From fcac8dfb49248569351f170deed4606db7718b9c Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 08 九月 2023 15:55:41 +0800 Subject: [PATCH] 修改参照setValue --- Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue index 549156e..a549dd1 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue @@ -96,6 +96,7 @@ this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; } }, + computed:{ valueInfo:function (){ return this.text ? ("宸茶缃殑鍊间负[" + this.text + "]"): '鏈缃��' @@ -242,11 +243,15 @@ //璇存槑浼犻�掍簡鐨� this.option.column= this.options.tableConfig.cols.map(item => { if (item.field != 'LAY_TABLE_INDEX' && item.field != 'LAY_CHECKED') { + let formatter=item.template || item.templet; + if(typeof formatter == "string" && formatter !=''){ + formatter=eval("(" + formatter + ")") + } return { ...item, label: item.title, prop: item.field, - formatter:item.template, + formatter:formatter, search: this.options.tableConfig.queryColumns.some(qItem=>{ return qItem.field==item.field }) @@ -277,19 +282,19 @@ this.selectionList.forEach((item,_index) =>{ if(isMutiValue){ var valueFieldArray = _that.props.value.split(","); - valueFieldArray.forEach((_indexField,_itemField)=>{ - value.push( item[_itemField] + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); + valueFieldArray.forEach((_itemField,_indexFiel)=>{ + value.push( (item[_itemField] || item['data'][_itemField]) + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); }) }else { - value.push(item[_that.props.value]); + value.push(item[_that.props.value] || item['data'][_that.props.value]); } if(isMutiRaw) { var rawFieldArray = _that.props.label.split(","); - rawFieldArray.forEach((_indexField,_itemField)=>{ - text.push(item[_itemField] + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; + rawFieldArray.forEach((_itemField,_indexField)=>{ + text.push((item[_itemField] || item['data'][_itemField]) + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; }) }else{ - text.push(item[_that.props.label]); + text.push(item[_that.props.label] || item['data'][_that.props.label]); } }) @@ -343,8 +348,13 @@ } } getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url).then(res => { - this.data = res.data.records; - this.page.total=res.data.total + if(res.data.records){ + this.data = res.data.records + this.page.total=res.data.total ; + }else{ + this.data = res.data.data.records; + this.page.total=res.data.data.total; + } this.loading = false; this.selectionClear(); }).catch(error=>{ -- Gitblit v1.9.3