From 815e9320bf805423dc8504a109a865c2c7578cad Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期二, 12 十一月 2024 14:27:33 +0800 Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test --- src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue | 90 ++++++++++++++++++++++++--------------------- 1 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue index 0adb614..34dcd70 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue @@ -3,7 +3,7 @@ <div class="w-full flex-column"> <div class="flex mb-4 flex-wrap flex-0"> <!-- TimeRange v-model 璺� @change 涓殑鍊间細涓嶄竴鏍凤紝浠change 涓负鍑� --> - <template v-if="visibleParams && visibleParams.length > 0 && showFilter "> + <template v-if="visibleParams && visibleParams.length > 0 && showFilter"> <component class="flex-0 m-2" v-model="visibleParams[index].value" @@ -14,7 +14,7 @@ :data="item" :originData="originData" @change="(val) => handleQueryChange(val, item)" - :disabled="chartLoading ||disabled" + :disabled="chartLoading || disabled" ></component> </template> <slot> </slot> @@ -104,10 +104,10 @@ type: Boolean, default: true, }, - disabled:{ - type:Boolean, - default:false, - } + disabled: { + type: Boolean, + default: false, + }, }) as { data: any; summaryIndex: number; @@ -448,10 +448,49 @@ } }; +const getFilterList = () => { + const curAgentKey = props.data.agent_key; + + // 鐩稿悓 agent_key 涓嬫墍鏈� filter 璇锋眰鍙傛暟 + const filterList = ((props as any).originData?.content?.origin?.summary ?? []).reduce((preVal, curVal) => { + if (curVal.agent_key !== curAgentKey) return preVal; + + const filter = (curVal.filter ?? []).reduce((subPreVal, subCurVal) => { + if (subCurVal.type === RecordSetParamsType.TimeRange) { + subPreVal.push( + ...[ + { + update: subCurVal.update, + value: subCurVal.start_value, + path: subCurVal.start_path, + }, + { + update: subCurVal.update, + value: subCurVal.end_value, + path: subCurVal.end_path, + }, + ] + ); + } else { + subPreVal.push({ + update: subCurVal.update, + value: subCurVal.step_value, + path: subCurVal.step_path, + }); + } + + return subPreVal; + }, []); + + preVal = preVal.concat(filter); + + return preVal; + }, []); + return filterList; +}; const handleQueryChange = async (val: any, item: RecordSetParamsItem) => { if (!val) return; const historyId = (props as any).originData.historyId; - const curAgentKey = props.data.agent_key; let res = null; // 鏀瑰彉鍘熷鍊� @@ -461,42 +500,9 @@ } else { item.origin.step_value = val; } + + const filterList = getFilterList(); try { - // 鐩稿悓 agent_key 涓嬫墍鏈� filter 璇锋眰鍙傛暟 - const filterList = ((props as any).originData?.content?.origin?.summary ?? []).reduce((preVal, curVal) => { - if (curVal.agent_key !== curAgentKey) return preVal; - - const filter = (curVal.filter ?? []).reduce((subPreVal, subCurVal) => { - if (subCurVal.type === RecordSetParamsType.TimeRange) { - subPreVal.push( - ...[ - { - update: subCurVal.update, - value: subCurVal.start_value, - path: subCurVal.start_path, - }, - { - update: subCurVal.update, - value: subCurVal.end_value, - path: subCurVal.end_path, - }, - ] - ); - } else { - subPreVal.push({ - update: subCurVal.update, - value: subCurVal.step_value, - path: subCurVal.step_path, - }); - } - - return subPreVal; - }, []); - - preVal = preVal.concat(filter); - - return preVal; - }, []); const params = { history_id: historyId, // 鏌ヨ鍓嶅悗 agent_key 涓嶄細鍙� -- Gitblit v1.9.3