Commit 2980305e by liuyong

修改bug

1 parent 80bd9658
Showing with 256 additions and 16 deletions
...@@ -470,4 +470,20 @@ export function editCircleModelDicyTable(params) { ...@@ -470,4 +470,20 @@ export function editCircleModelDicyTable(params) {
// 元模型字典管理,发布,停用 // 元模型字典管理,发布,停用
export function releaseAndStopCircleModelDicyTable(params) { export function releaseAndStopCircleModelDicyTable(params) {
return post('/network/archi-model-dict/pModelDict', params); return post('/network/archi-model-dict/pModelDict', params);
}
// 元模型字典管理,字典维护列表
export function queryDicyUpdateTable(params) {
return post('/network/archi-model-dict/dModelDict', params);
}
// 元模型字典管理,字典维护列表的新增
export function dicyUpdateTableAdd(params) {
return post('/network/archi-model-dict-detail/cModelDict', params);
}
// 元模型字典管理,字典维护列表的编辑
export function dicyUpdateTableEdit(params) {
return post('/network/archi-model-dict-detail/uModelDict', params);
}
// 元模型字典管理,字典维护列表的删除
export function dicyUpdateTableDelete(params) {
return post('/network/archi-model-dict-detail/del', params);
} }
\ No newline at end of file
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<el-table-column label="操作" width="360" align="center"> <el-table-column label="操作" width="360" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;"> <div style="display: flex;align-items: center;justify-content: center;">
<el-button icon="el-icon-edit" type="primary" size="mini" @click="editItem(scope.row)" :disabled="scope.row.state == 1">维护</el-button> <el-button icon="el-icon-edit" type="primary" size="mini" @click="operation('update', scope.row)" :disabled="scope.row.state == 1">维护</el-button>
<el-button icon="el-icon-edit" type="primary" size="mini" @click="operation('edit', scope.row)" :disabled="scope.row.state == 1">编辑</el-button> <el-button icon="el-icon-edit" type="primary" size="mini" @click="operation('edit', scope.row)" :disabled="scope.row.state == 1">编辑</el-button>
<el-button icon="el-icon-upload2" type="primary" size="mini" @click="operation('release', scope.row)" :disabled="scope.row.state == 1 ">发布</el-button> <el-button icon="el-icon-upload2" type="primary" size="mini" @click="operation('release', scope.row)" :disabled="scope.row.state == 1 ">发布</el-button>
<el-button class="tingYong_btn" icon="el-icon-remove-outline" size="mini" @click="operation('stop', scope.row)" :disabled="scope.row.state != 1">停用</el-button> <el-button class="tingYong_btn" icon="el-icon-remove-outline" size="mini" @click="operation('stop', scope.row)" :disabled="scope.row.state == 0">停用</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<el-dialog <el-dialog
:title="is_add_edit == 'add' ? '新建字典' : '编辑字典'" :title="is_add_edit == 'add' ? '新建字典' : '编辑字典'"
:visible.sync="add_dialog" :visible.sync="dialog1"
:center="false" :center="false"
:close-on-click-modal="false" :close-on-click-modal="false"
width="60%"> width="60%">
...@@ -89,8 +89,64 @@ ...@@ -89,8 +89,64 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operation('save_dicy', null)">保存</el-button> <el-button class="greenButton" @click="operation_dialog('dialog1_save', null)">保存</el-button>
<el-button @click="add_dialog = false">取消</el-button> <el-button @click="dialog1 = false">取消</el-button>
</span>
</el-dialog>
<el-dialog
title="字典维护"
:visible.sync="dialog2"
:center="false"
:close-on-click-modal="false"
width="60%">
<div style="text-align: right;margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="operation_dialog('dialog2_add', null)">新增</el-button>
</div>
<el-table height="300" :data="tableData2" stripe border>
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
<el-table-column prop="value" label="字段值" align="center"></el-table-column>
<el-table-column prop="label" label="字段值中文名" align="center"></el-table-column>
<el-table-column prop="sort" label="排序" align="center"></el-table-column>
<el-table-column prop="remark" label="描述" align="center"></el-table-column>
<el-table-column label="操作" width="260" align="center">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<el-button icon="el-icon-edit" type="primary" size="mini" @click="operation_dialog('edit', scope.row)">编辑</el-button>
<el-button class="shanChu_btn" icon="el-icon-delete" size="mini" @click="operation_dialog('delete', scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operation_dialog('dialog2_save', null)">确定</el-button>
<el-button @click="dialog2 = false">取消</el-button>
</span>
</el-dialog>
<el-dialog
:title="is_add_edit2 == 'add' ? '字典维护新增' : '字典维护编辑'"
:visible.sync="dialog3"
:center="false"
:close-on-click-modal="false"
width="60%">
<el-form :model="ruleForm2" ref="form2" :rules="rules2" style="display: flex;flex-wrap: wrap;">
<el-form-item label="字段值:" prop="let1">
<el-input v-no-backslash v-model="ruleForm2.let1" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="字段值中文名:" prop="let2">
<el-input v-no-backslash v-model="ruleForm2.let2" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="排序:" prop="let3">
<el-input-number style="width: 200px;" v-model="ruleForm2.let3" :min="0"></el-input-number>
</el-form-item>
<el-form-item class="cross1" label="描述:" prop="let4">
<el-input v-no-backslash type="textarea" v-model="ruleForm2.let4" :rows="3" maxlength="200" show-word-limit placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button class="greenButton" @click="operation_dialog('dialog3_save', null)">保存</el-button>
<el-button @click="dialog3 = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -101,7 +157,11 @@ import { ...@@ -101,7 +157,11 @@ import {
queryCircleModelDicyTable, queryCircleModelDicyTable,
addCircleModelDicyTable, addCircleModelDicyTable,
editCircleModelDicyTable, editCircleModelDicyTable,
releaseAndStopCircleModelDicyTable releaseAndStopCircleModelDicyTable,
dicyUpdateTableAdd,
dicyUpdateTableEdit,
dicyUpdateTableDelete,
queryDicyUpdateTable
} from '@/api/index.js'; } from '@/api/index.js';
import { MessageBox, Message } from 'element-ui'; import { MessageBox, Message } from 'element-ui';
import $ from 'jquery'; import $ from 'jquery';
...@@ -113,6 +173,20 @@ export default { ...@@ -113,6 +173,20 @@ export default {
}, },
data() { data() {
return { return {
ruleForm2: {
let1: null,
let2: null,
let3: 1,
let4: null,
},
rules2: {
let1: [
{ required: true, message: '请输入字段值', trigger: 'blur' },
],
let2: [
{ required: true, message: '请输入字段值中文名', trigger: 'blur' },
],
},
ruleForm: { ruleForm: {
let1: null, let1: null,
let2: null, let2: null,
...@@ -126,7 +200,7 @@ export default { ...@@ -126,7 +200,7 @@ export default {
{ required: true, message: '请输入字典标识', trigger: 'blur' }, { required: true, message: '请输入字典标识', trigger: 'blur' },
], ],
}, },
add_dialog: false, dialog1: false,
tableData: [], tableData: [],
loading: false, loading: false,
pager: { pager: {
...@@ -141,7 +215,13 @@ export default { ...@@ -141,7 +215,13 @@ export default {
state: null, state: null,
}, },
is_add_edit: 'add', is_add_edit: 'add',
is_add_edit2: 'add',
id: null, id: null,
dialog2: false,
tableData2: [],
dialog3: false,
dictId: null,
dialog2_id: null,
}; };
}, },
mounted(){ mounted(){
...@@ -157,12 +237,12 @@ export default { ...@@ -157,12 +237,12 @@ export default {
case 'add': case 'add':
this.addItem(); this.addItem();
break; break;
case 'save_dicy':
this.save_dicy();
break;
case 'edit': case 'edit':
this.editItem(data); this.editItem(data);
break; break;
case 'update':
this.open_dicy_dialog(data);
break;
case 'release': case 'release':
this.releaseItem(data); this.releaseItem(data);
break; break;
...@@ -171,6 +251,145 @@ export default { ...@@ -171,6 +251,145 @@ export default {
break; break;
} }
}, },
operation_dialog(state, data) {
switch(state){
case 'dialog1_save':
this.dialog1_save();
break;
case 'dialog2_save':
this.dialog2_save();
break;
case 'dialog2_add':
this.dialog2_add();
break;
case 'dialog3_save':
this.dialog3_save();
break;
case 'edit':
this.dialog2_edit(data);
break;
case 'delete':
this.dialog2_delete(data);
break;
}
},
open_dicy_dialog(row) {//打开维护字典窗口
this.dialog2 = true;
this.dictId = row.id;
this.getDicyUpdateTable();
},
getDicyUpdateTable() {//维护字典窗口的表格
const params = {
id: this.dictId
};
queryDicyUpdateTable(params).then(res => {
this.tableData2 = res.data.detailList;
});
},
dialog2_save() {//维护字典窗口的保存
this.dialog2 = false;
},
dialog2_add() {//维护字典的新增
this.dialog3 = true;
this.is_add_edit2 = 'add';
this.$nextTick(() => {
this.$refs.form2.resetFields();
this.ruleForm2.let1 = null;
this.ruleForm2.let2 = null;
this.ruleForm2.let3 = 1;
this.ruleForm2.let4 = null;
});
},
dialog3_save() {//维护字典的编辑窗口的保存
this.$refs.form2.validate(valid => {
if(valid) {
const params = {
"value": this.ruleForm2.let1,
"label": this.ruleForm2.let2,
"sort": this.ruleForm2.let3,
"remark": this.ruleForm2.let4,
};
const requestParams = this.is_add_edit2 == 'add' ? [{ ...params, dictId: this.dictId }] : { ...params, id: this.dialog2_id };
if(this.is_add_edit2 == 'add') {
dicyUpdateTableAdd(requestParams).then(res => {
if(res.code == 200) {
this.dialog3 = false;
this.getDicyUpdateTable();
Message({
type: 'success',
message: '保存成功!'
});
}else {
Message({
type: 'error',
message: res.msg
});
}
});
}else {
dicyUpdateTableEdit(requestParams).then(res => {
if(res.code == 200) {
this.dialog3 = false;
this.getDicyUpdateTable();
Message({
type: 'success',
message: '保存成功!'
});
}else {
Message({
type: 'error',
message: res.msg
});
}
});
}
}else {
return false;
}
});
},
dialog2_edit(row) {//维护字典的编辑
this.dialog3 = true;
this.dialog2_id = row.id;
this.is_add_edit2 = 'edit';
this.ruleForm2.let1 = row.value;
this.ruleForm2.let2 = row.label;
this.ruleForm2.let3 = row.sort;
this.ruleForm2.let4 = row.remark;
},
dialog2_delete(row) {//维护字典的删除
MessageBox.confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning'
}).then(() => {
const params = {
ids: [row.id],
}
dicyUpdateTableDelete(params).then(res => {
if(res.code == 200) {
this.getDicyUpdateTable();
Message({
type: 'success',
message: '删除成功!'
});
}else {
Message({
type: 'error',
message: res.msg
});
}
});
}).catch(() => {
Message({
type: 'info',
message: '已取消'
});
});
},
stopItem(row){ stopItem(row){
MessageBox.confirm('确定停用?', '提示', { MessageBox.confirm('确定停用?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -193,7 +412,7 @@ export default { ...@@ -193,7 +412,7 @@ export default {
}else { }else {
Message({ Message({
type: 'error', type: 'error',
message: '停用失败!' message: res.msg
}); });
} }
}); });
...@@ -238,7 +457,7 @@ export default { ...@@ -238,7 +457,7 @@ export default {
}); });
}, },
addItem() {//新增 addItem() {//新增
this.add_dialog = true; this.dialog1 = true;
this.is_add_edit = 'add'; this.is_add_edit = 'add';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
...@@ -249,7 +468,7 @@ export default { ...@@ -249,7 +468,7 @@ export default {
}, },
editItem(row) {//编辑 editItem(row) {//编辑
this.is_add_edit = 'edit'; this.is_add_edit = 'edit';
this.add_dialog = true; this.dialog1 = true;
this.id = row.id; this.id = row.id;
this.ruleForm.let1 = row.name; this.ruleForm.let1 = row.name;
this.ruleForm.let2 = row.typeValue; this.ruleForm.let2 = row.typeValue;
...@@ -258,7 +477,7 @@ export default { ...@@ -258,7 +477,7 @@ export default {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}); });
}, },
save_dicy() {//保存字典 dialog1_save() {//保存字典
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if(valid) { if(valid) {
const params = { const params = {
...@@ -270,7 +489,7 @@ export default { ...@@ -270,7 +489,7 @@ export default {
if(this.is_add_edit == 'add') { if(this.is_add_edit == 'add') {
addCircleModelDicyTable(requestParams).then(res => { addCircleModelDicyTable(requestParams).then(res => {
if(res.code == 200) { if(res.code == 200) {
this.add_dialog = false; this.dialog1 = false;
this.get_table(); this.get_table();
Message({ Message({
type: 'success', type: 'success',
...@@ -286,7 +505,7 @@ export default { ...@@ -286,7 +505,7 @@ export default {
}else { }else {
editCircleModelDicyTable(requestParams).then(res => { editCircleModelDicyTable(requestParams).then(res => {
if(res.code == 200) { if(res.code == 200) {
this.add_dialog = false; this.dialog1 = false;
this.get_table(); this.get_table();
Message({ Message({
type: 'success', type: 'success',
...@@ -415,6 +634,10 @@ export default { ...@@ -415,6 +634,10 @@ export default {
color: #0D867F; color: #0D867F;
border: 0; border: 0;
} }
.shanChu_btn{
color: #DD6A15;
background-color: #F8EBE2;
}
/deep/ .el-input-group__append{ /deep/ .el-input-group__append{
background-color: #0D867F; background-color: #0D867F;
color: #fff; color: #fff;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!