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;