调用方法
this.$refs.dataField.getValue().then(obj => {
if (!obj) {
return
}
this.excelData = obj
this.show = false
})
方法
async getValue () {
return new Promise((resolve, reject) => {
if (!this.$refs.formRef.validate()) {
return
}
const filterObj = this.$refs.filterRef.filterObj
console.log(filterObj.orders)
const obj = {
metaDataCombinationEngName: this.metaDataCombinationEngName}
drillingData2(obj).then(({ data }) => {
if (data?.records?.length) {
this.excelData = [this.headerChNameArr, ...data.records.map(_e => {
return this.metaDataCombinationItemEngName.map(_i => {
return _e[_i]
})
})]
}
resolve(this.excelData)
}).catch(error => {
this.$snackbar.error(error)
})
})
},