From ad738073a572c975463f0d5b24e4ea893adf4adc Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Fri, 18 Feb 2022 17:48:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20There=20is=20no=20way=20the,=20?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=A0=87=E5=87=86=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=BD=93=E7=B3=BB=E4=BC=98=E5=8C=96=20=20=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E6=A0=87=E5=87=86=E5=B7=A6=E4=BE=A7=E6=A0=91=20?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=8A=80=E6=9C=AF=E4=BD=93=E7=B3=BB=20?= =?UTF-8?q?=E5=BE=85=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/config/pages/roleManage/index.vue | 63 +++++++++++++++++-- .../domesticStandardsAndRegulations/index.vue | 55 +++++++++++++++- 2 files changed, 111 insertions(+), 7 deletions(-) diff --git a/src/pages/config/pages/roleManage/index.vue b/src/pages/config/pages/roleManage/index.vue index 9d5cde35c..f742ddb6f 100644 --- a/src/pages/config/pages/roleManage/index.vue +++ b/src/pages/config/pages/roleManage/index.vue @@ -450,11 +450,62 @@ export default { } this.addModel = true }, - getTree3() { - this.$http.get('sarResource/ts-resource', {}, {}, res => { - if (res.ok) { - this.treeData3 = res.data - } + // getTree3() { + // this.$http.get('sarResource/ts-resource', {}, {}, res => { + // if (res.ok) { + // this.treeData3 = res.data + // } + // }) + // }, + async getTreeAsync(){ + let tsResource = await this.getTree3() + let sarMenuStandard = await this.getTree4() + + let list1 = [] + let list2 = [] + if(tsResource && tsResource.ok && tsResource.data){ + list1 = tsResource.data + } + + if(sarMenuStandard && sarMenuStandard.ok && sarMenuStandard.data){ + list2 = sarMenuStandard.data + } + + if(list2.length > 0){ + list1 = list1.concat(list2) + } + + if(list1.length > 0){ + this.treeData3 = this.sortByKey(list1,"displaySeq") + } + + + }, + sortByKey(ary, key) { + return ary.sort(function (a, b) { + let x = a[key] + let y = b[key] + return ((x < y) ? -1 : (x > y) ? 1 : 0) + }) + }, + getTree3(res,json) { + return new Promise((resolve, reject) => { + this.$http.get('sarResource/ts-resource/getListStand', {}, { + _this: this + }, res => { + const history = res; + resolve(history) + }) + }) + }, + getTree4(res,json) { + return new Promise((resolve, reject) => { + this.$http.get('lawss/sarMenuStandard/getListStand', {dicId:'9m4qqqaansxmox5e82zm'}, { + _this: this + }, res => { + const history = res; + resolve(history) + }) }) }, confirmDialogData() { @@ -627,7 +678,7 @@ export default { }, mounted() { this.getTree() - this.getTree3() + this.getTreeAsync() } } diff --git a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue index 775c6512a..2804dfc07 100644 --- a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue +++ b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue @@ -3783,6 +3783,59 @@ export default { } }) }, + async getTreeAsync(){ + + let tsResource = await this.selectMenu1() + let sarMenuStandard = await this.selectMenu2() + + let list1 = [] + let list2 = [] + if(tsResource && tsResource.ok && tsResource.data){ + list1 = tsResource.data + } + + if(sarMenuStandard && sarMenuStandard.ok && sarMenuStandard.data){ + list2 = sarMenuStandard.data + } + + if(list2.length > 0){ + list1 = list1.concat(list2) + } + + if(list1.length > 0){ + this.treeList = this.sortByKey(list1,"displaySeq") + } + }, + sortByKey(ary, key) { + return ary.sort(function (a, b) { + let x = a[key] + let y = b[key] + return ((x < y) ? -1 : (x > y) ? 1 : 0) + }) + }, + selectMenu1() { + return new Promise((resolve, reject) => { + this.$http.get('sarResource/ts-resource/getListStand', { + sorDivide: 'INLAND_STAND', + userId: this.$store.getters.userInfo.userId + }, { + _this: this + }, res => { + const history = res; + resolve(history) + }) + }) + }, + selectMenu2(res,json) { + return new Promise((resolve, reject) => { + this.$http.get('lawss/sarMenuStandard/getListStand', {dicId:'9m4qqqaansxmox5e82zm'}, { + _this: this + }, res => { + const history = res; + resolve(history) + }) + }) + }, // 查询二级菜单 selectMenu() { this.$http.get('sarResource/ts-resource/getListStand', { @@ -5792,7 +5845,7 @@ export default { }, async mounted() { // 进入页面后查询树形结构目录 - await this.selectMenu() + await this.getTreeAsync() this.dragControllerLR() // 进入页面后查询标准体系树形结构目录 引用 数据字典配置 // await this.selectStandardMenu()