Commit 9e3b25b8 by caoyanzhi

去掉开发数据

parent 9733d728
......@@ -15,7 +15,7 @@
<el-table-column label="页面code" prop="code" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="父级code" prop="parentCode" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="应用版本" prop="hbVersion" :formatter="(row, col, val) => val || '--'"></el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="320px">
<template slot-scope="{ row }">
<el-button type="text" @click="onEditMenu(row)">编辑</el-button>
<el-button type="text" @click="onEditMenu(row, true)">新建子节点</el-button>
......@@ -139,28 +139,7 @@ export default {
expand: false, // 是否展示子节点 true:展示 false:不展示
showTable: true,
// 节点列表数据
menuList: [
{
menuId: '1',
menuName: '通讯录',
parentId: null,
code: 'txl1',
parentCode: null,
hbVersion: '1',
operationItemFlag: 1,
children: [
{
menuId: '1-1',
menuName: '通讯录1-1',
parentId: '1',
code: 'txl1-1',
parentCode: 'txl1',
hbVersion: '1',
operationItemFlag: 0,
}
]
}
],
menuList: [],
// 新建节点、新建子节点、编辑节点弹窗相关的数据
editMenu: {
show: false, // 是否展示编辑节点的弹窗
......@@ -188,7 +167,7 @@ export default {
},
mounted() {
this.menuList = [];
this.getMenuList();
// this.getMenuList();
},
methods: {
// 获取节点列表数据
......@@ -198,9 +177,8 @@ export default {
appType: this.appType,
keyword: this.search
}
return console.log(params);
getMenuList(params).then(res => {
this.menuList = res.result || [];
this.menuList = this.flatDataToTree(res.result || []);
})
},
// 收起、展开子节点
......@@ -309,7 +287,17 @@ export default {
toPermissionList(menuData) {
const { menuId } = menuData;
this.$router.push(`/permission-list?menuId=${menuId}`)
},
flatDataToTree(data) {
return data.filter(el => {
// 返回当前节点下的子节点
const children = data.filter(item => item.parentId == el.menuId);
if (children.length > 0) {
el.children = children; // 如果存在子级,则给父级添加一个children属性,并赋值
}
return el.parentId == 0;
})
},
}
}
</script>
......@@ -105,7 +105,7 @@ export default {
search: '',
// 分页相关的数据
pager: {
total: 100,
total: 0,
pageSizes: [20, 40, 60, 80],
pageSize: 20,
currentPage: 1
......@@ -136,14 +136,13 @@ export default {
}
},
created() {
this.initData();
// this.initData();
},
methods: {
initData() {
this.getOperationList();
return;
getMenuList({ appType: this.appType }).then(res => {
this.menuList = res.result || [];
this.menuList = this.flatDataToTree(res.result || []);
})
},
// 获取操作项列表
......@@ -155,23 +154,6 @@ export default {
pageSize,
appType: this.appType
}
this.operationList = [
{
menuId: '1',
operationItemName: '操作项一',
operationItemCode: 'czx1',
operationItemId: 'czx1',
version: '1'
},
{
menuId: '1',
operationItemName: '操作项二',
operationItemCode: 'czx2',
operationItemId: 'czx2',
version: '1'
},
]
return console.log(params)
getOperationItemList(params).then(res => {
const { totalCount, list } = res.result || {};
this.pager.total = totalCount || 0;
......@@ -228,7 +210,6 @@ export default {
if (!vali) return;
const { operationItemId, menuId, menuCode, operationItemName, operationItemCode, operationItemUrl, authItemFlag, roleRange, version, appType } = this.editOperation;
const params = { menuId, menuCode, operationItemName, operationItemCode, operationItemUrl, authItemFlag, roleRange, version }
return console.log(params)
this.editOperation.loading = true;
if (operationItemId) {
......@@ -257,20 +238,15 @@ export default {
})
})
},
treeData(data) {
let tree = data.filter(father => {
let branchArr = data.filter(child => {
return father.departmentId == child.parentDepartmentId; //返回每一项的子级数组
});
if (branchArr.length > 0) {
father.hasSonNode = true;
father.children = branchArr; //如果存在子级,则给父级添加一个children属性,并赋值
} else {
father.hasSonNode = false;
flatDataToTree(data) {
return data.filter(el => {
// 返回当前节点下的子节点
const children = data.filter(item => item.parentId == el.menuId);
if (children.length > 0) {
el.children = children; // 如果存在子级,则给父级添加一个children属性,并赋值
}
return father.parentDepartmentId == 0; //返回第一层
});
return tree;
return el.parentId == 0;
})
},
}
}
......
......@@ -128,7 +128,6 @@ export default {
authItemName,
operationItemIds: operationItemIds.join(',')
}
return console.log(params)
this.editAuth.loading = true;
if (authItemId) {
params.authItemId = authItemId;
......
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