Commit 2e5e05eb by caoyanzhi

接口联调

parent d89a531b
......@@ -285,6 +285,7 @@ export default {
this.editMenu.loading = true;
// 编辑节点
if (!isSubMenu && menuId) {
params.menuId = menuId;
editMenu(params).then(succ.bind(this, '保存成功!')).finally(() => this.editMenu.loading = false);
} else {
params.appType = this.appType;
......
......@@ -36,7 +36,13 @@
<el-dialog :visible.sync="editOperation.show" :title="editOperation.operationItemId ? '编辑操作项' : '新建操作项'" width="590px" @closed="onEditOperationClose">
<el-form :model="editOperation" :rules="editOperationRule" ref="editOperation" label-width="110px">
<el-form-item label="节点" prop="menuId">
<el-cascader v-model="editOperation.menuId" :options="menuList" :props="{ checkStrictly: true, label: 'menuName', value: 'menuId' }" style="width: 440px" clearable></el-cascader>
<el-cascader
v-model="editOperation.menuId"
:options="menuList"
:props="{ checkStrictly: true, label: 'menuName', value: 'menuId' }"
style="width: 440px"
clearable
@change="onMenuChange"></el-cascader>
</el-form-item>
<el-form-item label="节点code">
<el-input :value="editOperation.menuCode" style="width:440px" disabled></el-input>
......@@ -139,8 +145,7 @@ export default {
operationItemUrl: '',
authItemFlag: '', // 是否生产权限项1是0否
roleRange: '1', // 1使用管理员
version: '',
appType: ''
version: ''
},
editOperationRule: {
menuId: [{ required: true, message: '请选择节点', trigger: 'change' }],
......@@ -157,6 +162,7 @@ export default {
initData() {
this.getOperationList();
getMenuList({ appType: this.appType }).then(res => {
this.flatMenuList = res.result || [];
this.menuList = this.flatDataToTree(res.result || []);
})
haobanVersionList().then(res => {
......@@ -176,9 +182,9 @@ export default {
appType: this.appType
}
getOperationItemList(params).then(res => {
const { totalCount, list } = res.result || {};
const { totalCount, result } = res.result || {};
this.pager.total = totalCount || 0;
this.operationList = list || [];
this.operationList = result || [];
})
},
onSearch() {
......@@ -251,11 +257,20 @@ export default {
})
this.$nextTick(this.$refs.editOperation.clearValidate);
},
onMenuChange(menuIds) {
const menuId = menuIds[menuIds.length - 1];
this.flatMenuList.some(el => {
if (el.menuId == menuId) {
this.editOperation.menuCode = el.code;
}
return el.menuId == menuId
});
},
// 新建、编辑操作项 弹窗保存
onEditOperationSave() {
this.$refs.editOperation.validate(vali => {
if (!vali) return;
const { operationItemId, menuId, menuCode, operationItemName, operationItemCode, operationItemUrl, authItemFlag, roleRange, version, appType } = this.editOperation;
const { operationItemId, menuId, menuCode, operationItemName, operationItemCode, operationItemUrl, authItemFlag, roleRange, version } = this.editOperation;
const params = {
menuId: Array.isArray(menuId) && menuId.length > 0 ? menuId[menuId.length - 1] : '',
menuCode,
......@@ -272,11 +287,12 @@ export default {
params.operationItemId = operationItemId;
editOperationItem(params).then(succ.bind(this, '保存成功!')).finally(() => this.editOperation.loading = false);
} else {
params.appType = appType;
params.appType = this.appType;
addOperationItem(params).then(succ.bind(this, '新建成功!')).finally(() => this.editOperation.loading = false);
}
function succ(msg) {
this.$message.success(msg);
this.editOperation.show = false;
this.getOperationList();
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment