From 78f836dd9233b9aedc8cf38ab533ce7166042050 Mon Sep 17 00:00:00 2001 From: guoyue Date: Thu, 28 Jul 2022 10:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=8B=E8=83=BD=E5=9C=BA=E6=99=AF=EF=BC=9A?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=B5=84=E6=BA=90=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ability/components/combine-ability.vue | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/back/src/views/modules/ability/components/combine-ability.vue b/back/src/views/modules/ability/components/combine-ability.vue index 05b719de..5da84a14 100644 --- a/back/src/views/modules/ability/components/combine-ability.vue +++ b/back/src/views/modules/ability/components/combine-ability.vue @@ -223,17 +223,39 @@ export default { }, // 获取列表 getData() { - this.allData = []; - this.transferData = []; - let arr = JSON.parse(JSON.stringify(sjzyArray)); - arr.map(v => { - this.transferData.push({ - type: this.type, - id: v[keyObj[this.type].idKey], - name: v[keyObj[this.type].nameKey] || "--" + // this.allData = []; + // this.transferData = []; + // let arr = JSON.parse(JSON.stringify(sjzyArray)); + // arr.map(v => { + // this.transferData.push({ + // type: this.type, + // id: v[keyObj[this.type].idKey], + // name: v[keyObj[this.type].nameKey] || "--" + // }); + // }); + // this.allData = JSON.parse(JSON.stringify(this.transferData)); + // return; + if (this.getDataParams.url === '') { + return; + } + this.$http[this.getDataParams.methods](this.getDataParams.url, this.getDataParams.postData).then(res => { + console.log('res.data----获取列表-------->', res.data); + if (res.data.code !== 0) { + return this.$message.error(res.msg); + } + this.transferData = []; // allData + this.allData = []; + (res.data.data || []).map(v => { + this.transferData.push({ + type: this.type, + id: v[keyObj[this.type].idKey], + name: v[keyObj[this.type].nameKey] || "--" + }); }); - }); - this.allData = JSON.parse(JSON.stringify(this.transferData)); + this.allData = JSON.parse(JSON.stringify(this.transferData)); + }).catch(err => { + this.$message.error(err); + }) }, filterMethod(query, item) { return item.name && item.name.indexOf(query) > -1;