From 47acf70c81d86e429af75b18e8bfc5cb8065c448 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Wed, 5 Mar 2025 11:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/modules/sys/dept-add-or-update.vue | 2 +- base-vue/src/views/modules/sys/dept.vue | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/base-vue/src/views/modules/sys/dept-add-or-update.vue b/base-vue/src/views/modules/sys/dept-add-or-update.vue index 0fafacb..23f07d9 100644 --- a/base-vue/src/views/modules/sys/dept-add-or-update.vue +++ b/base-vue/src/views/modules/sys/dept-add-or-update.vue @@ -110,7 +110,7 @@ this.$http({ url: this.$http.adornUrl('/api/dept/superior'), method: 'post', - params: this.$http.adornParams(data) + params: this.$http.adornData(data) }).then(({res}) => { const date = res.content this.buildDepts(date) diff --git a/base-vue/src/views/modules/sys/dept.vue b/base-vue/src/views/modules/sys/dept.vue index 5b12a1c..eec1e8f 100644 --- a/base-vue/src/views/modules/sys/dept.vue +++ b/base-vue/src/views/modules/sys/dept.vue @@ -151,6 +151,20 @@ export default { this.dataListLoading = false }) }, + // 表格渲染 :load="getDeptDatas" 点击事件 row-key需要指定唯一的数据id + getDeptDatas (tree, treeNode, resolve) { + setTimeout(() => { + this.$http({ + url: this.$http.adornUrl('/api/dept/vo'), + method: 'get', + params: this.$http.adornParams({ + 'pid': tree.deptId + }) + }).then(({data}) => { + resolve(data.content) + }) + }, 100) + }, // 每页数 sizeChangeHandle (val) { this.pageSize = val @@ -202,19 +216,6 @@ export default { } }) }).catch(() => {}) - }, - // 表格渲染 :load="getDeptDatas" 点击事件 row-key需要指定唯一的数据id - getDeptDatas(tree, treeNode, resolve) { - const params = { pid: tree.deptId } - setTimeout(() => { - this.$http({ - url: this.$http.adornUrl('/api/dept/vo'), - method: 'get', - data: this.$http.adornData(params) - }).then(({res}) => { - resolve(res.content) - }) - }, 100) } } }