|
|
@ -271,6 +271,11 @@ const props = defineProps({ |
|
|
|
type: Number, |
|
|
|
required: false, |
|
|
|
default: 0 |
|
|
|
}, |
|
|
|
sumFormData:{ |
|
|
|
type: Array, |
|
|
|
required: false, |
|
|
|
default: null |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
@ -383,6 +388,25 @@ const opensearchTable = ( |
|
|
|
_searchCondition |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const changeSumFormData = () => { |
|
|
|
if(props.sumFormData){ |
|
|
|
const sumObject = {} |
|
|
|
props.sumFormData.forEach(sumItem=>{ |
|
|
|
sumObject[sumItem?.formField]= props.tableData.reduce((prev, item) => prev + item[sumItem?.valueField],0) |
|
|
|
}) |
|
|
|
nextTick(()=>{ |
|
|
|
formRef.value.setValues(sumObject) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
watch(()=>props.tableData,() => { |
|
|
|
changeSumFormData() |
|
|
|
},{ |
|
|
|
deep:true |
|
|
|
}) |
|
|
|
|
|
|
|
// 弹层确定返回所选数据 |
|
|
|
// val : 弹层列表row 数据 |
|
|
|
const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|