From 06446a6f6c806f8f89d1418da42c8152737c9bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 9 Nov 2023 11:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E9=A1=B5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/board/board2.js | 5 ++-- .../src/main/resources/static/board/doc.js | 27 ++++++++++++------- .../resources/templates/board/board2.html | 6 ++--- .../main/resources/templates/board/doc.html | 2 +- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/haiwei-admin/src/main/resources/static/board/board2.js b/haiwei-admin/src/main/resources/static/board/board2.js index ce118f0..162fc9e 100644 --- a/haiwei-admin/src/main/resources/static/board/board2.js +++ b/haiwei-admin/src/main/resources/static/board/board2.js @@ -26,12 +26,13 @@ $(() => { let data = e?.data?.map(val => { return { name: val.customerName, - img: val.customerLogo + img: val.customerLogo, + objid:val.objid } }) data.forEach(e => { let html = ` -
+
${e.name}
diff --git a/haiwei-admin/src/main/resources/static/board/doc.js b/haiwei-admin/src/main/resources/static/board/doc.js index de42e4b..70cc723 100644 --- a/haiwei-admin/src/main/resources/static/board/doc.js +++ b/haiwei-admin/src/main/resources/static/board/doc.js @@ -9,14 +9,23 @@ new Vue({ }, treeId: null, tableData: [], - tableIds:[], + tableIds: [], + defaultCheckedKeys:[] }; }, - mounted() { - this.getTree() + async mounted() { + await this.getTree() + let thisId = location.href?.split('?')?.[1]?.split('=')?.[1] + if(thisId){ + let thisTreeItem = this.treeData.find(e=>e.id.toString() === thisId) + this.handleNodeClick(thisTreeItem) + this.defaultCheckedKeys = [+thisId] + console.log(this.defaultCheckedKeys) + } }, methods: { handleNodeClick(data) { + console.log(data) $.post(ctx + 'manage/base_file/fileList', {name: data.value}, (e) => { this.tableData = e.data.map((e, i) => { return { @@ -25,7 +34,7 @@ new Vue({ name: e.fileName, date: e.createTime, people: e.customName, - objid:e.objid + objid: e.objid } }) }) @@ -53,7 +62,7 @@ new Vue({ type: 'success', message: '删除成功!', }); - this.handleNodeClick({value:this.treeName}) + this.handleNodeClick({value: this.treeName}) }) }).catch(() => { this.$message({ @@ -63,7 +72,7 @@ new Vue({ }); }, handleSelectionChange(val) { - this.tableIds = val.map(e=>e.objid).toString() + this.tableIds = val.map(e => e.objid).toString() console.log(this.tableIds); }, addTree() { @@ -103,7 +112,7 @@ new Vue({ type: 'success', message: '删除成功!', }); - this.handleNodeClick({value:this.treeName}) + this.handleNodeClick({value: this.treeName}) }) }).catch(() => { this.$message({ @@ -113,8 +122,8 @@ new Vue({ }); }, - getTree() { - $.get(ctx + 'broad/home/queryCustomer', {}, (e) => { + async getTree() { + await $.get(ctx + 'broad/home/queryCustomer', {}, (e) => { console.log(e) this.treeData = e.data.map(e => { return { diff --git a/haiwei-admin/src/main/resources/templates/board/board2.html b/haiwei-admin/src/main/resources/templates/board/board2.html index 38b5c4c..fc4ea48 100644 --- a/haiwei-admin/src/main/resources/templates/board/board2.html +++ b/haiwei-admin/src/main/resources/templates/board/board2.html @@ -6,11 +6,11 @@