From 794116acdb93235a4df8184f7873ebac36d627db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 30 Apr 2021 16:06:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update=20=E7=94=A8=E6=88=B7=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/pages/system/role/dataForm.vue | 11 ------ .../system/user/{orgForm.vue => dataForm.vue} | 35 ++++++++++++++++--- Web/src/pages/system/user/index.vue | 8 ++--- 3 files changed, 34 insertions(+), 20 deletions(-) rename Web/src/pages/system/user/{orgForm.vue => dataForm.vue} (71%) diff --git a/Web/src/pages/system/role/dataForm.vue b/Web/src/pages/system/role/dataForm.vue index 4d26a6e..e24cca7 100644 --- a/Web/src/pages/system/role/dataForm.vue +++ b/Web/src/pages/system/role/dataForm.vue @@ -138,17 +138,6 @@ export default { onLoadAreaTreeData() { return this.$api.getAreaTree().then(({ data }) => { - // 为了防止出现空的层级选择,删除所有空children节点 - const clearChiildren = (data) => { - data.forEach((item) => { - if (item.children && item.children.length) { - clearChiildren(item.children); - } else { - delete item.children; - } - }); - }; - clearChiildren(data); return data; }); }, diff --git a/Web/src/pages/system/user/orgForm.vue b/Web/src/pages/system/user/dataForm.vue similarity index 71% rename from Web/src/pages/system/user/orgForm.vue rename to Web/src/pages/system/user/dataForm.vue index 9a037f2..8407c31 100644 --- a/Web/src/pages/system/user/orgForm.vue +++ b/Web/src/pages/system/user/dataForm.vue @@ -11,16 +11,27 @@
- + + + +
@@ -40,7 +51,11 @@ export default { id: '', orgs: [], - orgList: [], + orgTreeData: [], + + areas: [], + arerTreeData: [], + SHOW_PARENT, }; }, @@ -69,6 +84,7 @@ export default { .sysUserGrantData({ id: this.id, grantOrgIdList: this.orgs, + grantAreaCodeList: this.areas, }) .then(({ success }) => { if (success) { @@ -90,22 +106,31 @@ export default { this.visible = false; setTimeout(() => { this.orgs = []; + this.areas = []; }, 300); }, async onInit() { this.loading = true; - this.orgList = await this.onLoadOrgList(); + this.orgTreeData = await this.onLoadOrgTreeData(); this.orgs = await this.onLoadOrg(); + + this.arerTreeData = await this.onLoadAreaTreeData(); this.loading = false; }, - onLoadOrgList() { + onLoadOrgTreeData() { return this.$api.getOrgTree().then(({ data }) => { return data; }); }, + onLoadAreaTreeData() { + return this.$api.getAreaTree().then(({ data }) => { + return data; + }); + }, + onLoadOrg() { return this.$api.sysUserOwnData({ id: this.id }).then(({ data }) => { return data; diff --git a/Web/src/pages/system/user/index.vue b/Web/src/pages/system/user/index.vue index fa6519d..644d66f 100644 --- a/Web/src/pages/system/user/index.vue +++ b/Web/src/pages/system/user/index.vue @@ -66,7 +66,7 @@ - 授权额外数据 + 授权额外数据 @@ -112,7 +112,7 @@ - + \ No newline at end of file diff --git a/Web/public/doc-code/seed/editForm.vue b/Web/public/doc-code/seed/editForm.vue deleted file mode 100644 index 6f96748..0000000 --- a/Web/public/doc-code/seed/editForm.vue +++ /dev/null @@ -1,79 +0,0 @@ - - \ No newline at end of file diff --git a/Web/public/doc-code/seed/form.vue b/Web/public/doc-code/seed/form.vue index ab74d56..fb4579d 100644 --- a/Web/public/doc-code/seed/form.vue +++ b/Web/public/doc-code/seed/form.vue @@ -1,27 +1,41 @@ \ No newline at end of file diff --git a/Web/public/doc-code/seed/query.vue b/Web/public/doc-code/seed/query.vue index a98cd27..842a52d 100644 --- a/Web/public/doc-code/seed/query.vue +++ b/Web/public/doc-code/seed/query.vue @@ -1,4 +1,10 @@ \ No newline at end of file diff --git a/Web/src/pages/system/_seed/editForm.vue b/Web/src/pages/system/_seed/editForm.vue deleted file mode 100644 index 9e4dde4..0000000 --- a/Web/src/pages/system/_seed/editForm.vue +++ /dev/null @@ -1,79 +0,0 @@ - - \ No newline at end of file diff --git a/Web/src/pages/system/_seed/form.vue b/Web/src/pages/system/_seed/form.vue index 873e6f2..941cf9b 100644 --- a/Web/src/pages/system/_seed/form.vue +++ b/Web/src/pages/system/_seed/form.vue @@ -1,27 +1,41 @@ \ No newline at end of file diff --git a/Web/src/pages/system/_seed/index.vue b/Web/src/pages/system/_seed/index.vue index 07a3d7e..157a2c1 100644 --- a/Web/src/pages/system/_seed/index.vue +++ b/Web/src/pages/system/_seed/index.vue @@ -1,4 +1,10 @@ \ No newline at end of file diff --git a/Web/src/pages/system/dict/dictdata/addForm.vue b/Web/src/pages/system/dict/dictdata/addForm.vue deleted file mode 100644 index bc1067f..0000000 --- a/Web/src/pages/system/dict/dictdata/addForm.vue +++ /dev/null @@ -1,79 +0,0 @@ - - \ No newline at end of file diff --git a/Web/src/pages/system/dict/dictdata/editForm.vue b/Web/src/pages/system/dict/dictdata/editForm.vue deleted file mode 100644 index 8d40561..0000000 --- a/Web/src/pages/system/dict/dictdata/editForm.vue +++ /dev/null @@ -1,79 +0,0 @@ - - \ No newline at end of file diff --git a/Web/src/pages/system/dict/dictdata/form.vue b/Web/src/pages/system/dict/dictdata/form.vue index 930abc9..273cf2b 100644 --- a/Web/src/pages/system/dict/dictdata/form.vue +++ b/Web/src/pages/system/dict/dictdata/form.vue @@ -21,14 +21,16 @@ \ No newline at end of file diff --git a/Web/src/pages/system/dict/form.vue b/Web/src/pages/system/dict/form.vue index 6528541..a56ed6c 100644 --- a/Web/src/pages/system/dict/form.vue +++ b/Web/src/pages/system/dict/form.vue @@ -47,10 +47,10 @@ export default { * 必要的方法 * 在打开编辑页时允许填充数据 */ - onFillData(record) { + onFillData(params) { /** 将默认数据覆盖到form */ this.form = this.$_.cloneDeep({ - ...record, + ...params.record, /** 在此处添加默认数据转换 */ /** ... */ }); diff --git a/Web/src/pages/system/dict/index.vue b/Web/src/pages/system/dict/index.vue index fb4f814..b77c892 100644 --- a/Web/src/pages/system/dict/index.vue +++ b/Web/src/pages/system/dict/index.vue @@ -42,21 +42,25 @@
- - + + + + + + + + \ No newline at end of file + diff --git a/Web/src/pages/system/doc/seed/query.vue b/Web/src/pages/system/doc/seed/query.vue index f3be95c..e9cebd3 100644 --- a/Web/src/pages/system/doc/seed/query.vue +++ b/Web/src/pages/system/doc/seed/query.vue @@ -4,7 +4,7 @@ 当前版本 1.2

- + \ No newline at end of file diff --git a/Web/src/views/main/_layout/header/index.vue b/Web/src/views/main/_layout/header/index.vue index 79aae2f..50f3fa5 100644 --- a/Web/src/views/main/_layout/header/index.vue +++ b/Web/src/views/main/_layout/header/index.vue @@ -10,7 +10,7 @@ > - +
@@ -29,9 +29,11 @@
+ + + - - +
@@ -47,12 +49,26 @@
+ +
+
+
\ No newline at end of file diff --git a/Web/src/views/main/_layout/header/search.js b/Web/src/views/main/_layout/header/search.js index 1e8fb2f..cae9bd6 100644 --- a/Web/src/views/main/_layout/header/search.js +++ b/Web/src/views/main/_layout/header/search.js @@ -46,7 +46,7 @@ export default { onSearch(value) { this.searchText = value - const menus = this.$_.cloneDeep(this.menus) + const menus = this.$_.concat.apply(this, this.$_.cloneDeep(this.menus.map(p => p.menu))) const search = (m) => { if (!value) return [] @@ -83,12 +83,14 @@ export default { return result } - this.searchResult = unzip(search(menus)).map(p => { + const result = unzip(search(menus)).filter(p => p.parents.length).map(p => { return { parents: p.parents.join('-'), children: p.children } }) + + this.searchResult = result }, onSearchSelect(value, node) { diff --git a/Web/src/views/main/_layout/nav/index.js b/Web/src/views/main/_layout/nav/index.js new file mode 100644 index 0000000..cdea4d7 --- /dev/null +++ b/Web/src/views/main/_layout/nav/index.js @@ -0,0 +1,78 @@ +export default { + props: { + nav: { + type: Object, + default() { + return { + content: [] + } + } + } + }, + + methods: { + onOpenContentWindow(menu) { + this.$emit('open') + setTimeout(() => { + this.openContentWindow({ + key: menu.id, + title: menu.meta.title, + icon: menu.meta.icon, + path: menu.component, + }) + }, 300) + }, + }, + + render() { + return ( + + {this.nav.content.map((item, i) => { + return ( +
+
{item.app.name}
+
+ { + item.menu.map(sub => { + return ( +
+
+ { + sub.children ? +
+ { + sub.meta.icon && + } + {sub.meta.title} +
+ : +
this.onOpenContentWindow(sub)}> + { + sub.meta.icon && + } + {sub.meta.title} +
+ } + { + sub.children && sub.children.map(menu => { + return
this.onOpenContentWindow(menu)}> + { + menu.meta.icon && + } + {menu.meta.title} +
+ }) + } +
+
+ ) + }) + } +
+
+ ) + })} +
+ ) + } +} \ No newline at end of file diff --git a/Web/src/views/main/_layout/sider/app.vue b/Web/src/views/main/_layout/sider/app.vue deleted file mode 100644 index f97d621..0000000 --- a/Web/src/views/main/_layout/sider/app.vue +++ /dev/null @@ -1,46 +0,0 @@ - - \ No newline at end of file diff --git a/Web/src/views/main/_layout/sider/index copy.vue b/Web/src/views/main/_layout/sider/index copy.vue deleted file mode 100644 index 004b462..0000000 --- a/Web/src/views/main/_layout/sider/index copy.vue +++ /dev/null @@ -1,138 +0,0 @@ - - \ No newline at end of file diff --git a/Web/src/views/main/_layout/sider/index.vue b/Web/src/views/main/_layout/sider/index.vue index 0acaa6c..190312e 100644 --- a/Web/src/views/main/_layout/sider/index.vue +++ b/Web/src/views/main/_layout/sider/index.vue @@ -8,7 +8,6 @@ >
-
@@ -27,19 +26,10 @@
- \ No newline at end of file diff --git a/Web/src/pages/system/doc/index.vue b/Web/src/pages/system/doc/index.vue index 9b5949b..ccce3fd 100644 --- a/Web/src/pages/system/doc/index.vue +++ b/Web/src/pages/system/doc/index.vue @@ -3,12 +3,7 @@ - +

{{ doc.title }}