From a3a2b238a2626ef8744e7a135f9ca2e2fbb5184c Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 21 5月 2025 10:17:36 +0800 Subject: [PATCH] 优化 --- PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx | 123 +++++++++++++++++++--------------------- 1 files changed, 59 insertions(+), 64 deletions(-) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx index 6f745cc..5c9b177 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx @@ -23,6 +23,12 @@ ElFormItem, } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' +// 寮曞叆鍏叡閫夐」閰嶇疆 +import { + FILTER_MODE_OPTIONS_STRING +} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 寮曞叆鍏叡楂樼骇鏌ヨ宸ュ叿鏂囦欢 +import { commonSaveCurHighQueryData,setValueForCurHighQueryData,commonGetHighQueryForm,initQueryForm,GetFilteredData } from '@/utils/myHighQueryUtils'; interface RenderTableType { url?: string @@ -65,16 +71,12 @@ //瀹氫箟楂樼骇鏌ヨ寮曠敤 const workPlanQueryDrawerRef=ref(null); - // 鏂板鐨勬煡璇㈡潯浠� - const queryForm = ref({ - searchVal: '', - str_searchFormInputAttrs:[] - }) + //瀹氫箟鏁翠綋妯$硦鏌ヨ鐨勫垪鏁扮粍(娉ㄦ剰锛氬繀椤诲ぇ灏忓啓璺熷悗绔殑瀹炰綋绫诲睘鎬у悕涓�鑷达紝鍚﹀垯浼氬鑷村尮閰嶄笉瀵圭殑闂) const _searchFormInputAttrs = ref([ - 'TaskCode','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','WorkpieceName','ProcessName','PipeFittingCode','PreSerialNumber','PipeSpecCode','PipeSectionName','Material','ProcessRouteNumber','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' + 'TaskCode','PipeSpecCode','PipeSectionName','PipeSpecMode','ProcessName','ShipNumber','ProjectNumber','ProcessRouteNumber','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','PipeFittingCode','PreSerialNumber','Material','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' ]); - const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ヤ换鍔$紪鐮�/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/宸ヤ欢鍚嶇О/宸ュ簭鍚嶇О/绠′欢缂栫爜/椤哄簭鍙�/绠℃缂栫爜/绠℃鍚嶇О/鏉愯川/宸ヨ壓娴佸悜缂栧彿/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); + const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ヤ换鍔$紪鐮�/绠℃缂栫爜/绠℃鍚嶇О/绠℃鍨嬪彿/宸ュ簭鍚嶇О/鑸瑰彿/椤圭洰鍙�/宸ヨ壓娴佸悜缂栧彿/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/浜х嚎缂栫爜/绠′欢缂栫爜/椤哄簭鍙�/鏉愯川/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); // 鍔ㄦ�佹灇涓鹃�夐」 @@ -106,62 +108,40 @@ } } - // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� - onMounted(() => { - fetchEnumData() - }) - - // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� - const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[] }); - // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 - const handleQueryForMain = async () => { - _curHighQueryData.value.searchVal = queryForm.value.searchVal; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; - tableRef.value.getList(_curHighQueryData.value) - } - // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 - const handleQuery = async (extraParams = {}) => { - let filteredData = commonGetHighQueryForm(extraParams); - commonSaveCurHighQueryData(filteredData); - tableRef.value.getList(filteredData) - } - // 鏂扮増鐨勬煡璇㈤噸缃� - const resetQuery = () => { - queryForm.value.searchVal = '' - queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; - } - //鏂扮増鐨勫鍑烘柟娉� - const handleExport=()=>{ - onExport(_curHighQueryData.value); - } - // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 - const closeQuery = (extraParams={}) => { - let filteredData = commonGetHighQueryForm(extraParams); - console.log("closeQuery鏂规硶"); - console.log(filteredData); - commonSaveCurHighQueryData(filteredData); - } - //淇濆瓨鏌ヨ鍊� - const commonSaveCurHighQueryData=(filteredData={})=>{ - _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; - _curHighQueryData.value.searchVal = queryForm.value.searchVal - _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; - } - //鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊� - const commonGetHighQueryForm=(extraParams={})=>{ - // 杩囨护鎺� undefined 鐨勫�� - let filteredData = Object.assign( - {}, - ...Object.entries(extraParams).map(([key, value]) => - value !== undefined ? { [key]: value } : {} - ) - ) - //缁勫悎妯$硦鏌ヨ - filteredData.searchVal = queryForm.value.searchVal - filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; - return filteredData; - } - + /*******************************************************[楂樼骇鏌ヨ]寮�濮�********************************************************************************* */ + // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� + onMounted(() => { + fetchEnumData() + resetQuery(); + }) + // 鏂板鐨勬煡璇㈡潯浠� + const queryForm = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� + const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 + const handleQueryForMain = async () => { + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + tableRef.value.getList(_curHighQueryData.value) + } + // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 + const handleQuery = async (extraParams = {}) => { + let filteredData = GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + tableRef.value.getList(filteredData) + } + // 鏂扮増鐨勬煡璇㈤噸缃� + const resetQuery = () => { + initQueryForm(queryForm,_searchFormInputAttrs,FILTER_MODE_OPTIONS_STRING); + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + } + //鏂扮増鐨勫鍑烘柟娉� + const handleExport=()=>{ + onExport(_curHighQueryData.value); + } + // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 + const closeQuery = (extraParams={}) => { + GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + } + /*******************************************************[楂樼骇鏌ヨ]缁撴潫********************************************************************************* */ /** * @returns 琛ㄦ牸 @@ -312,8 +292,8 @@ > 娣诲姞 </IconButton> - <el-divider direction="vertical" /> + <el-upload v-permission="workPlan-import" name="file" @@ -352,6 +332,21 @@ /> </el-tooltip> </ElFormItem> + <ElFormItem label="" style="width:100px;"> + <ElSelect + v-model={queryForm.value.searchVal_FilterMode} + placeholder="璇烽�夋嫨" + class={styles.formItem} + > + {FILTER_MODE_OPTIONS_STRING.map((option) => ( + <ElOption + key={option.value} + label={option.label} + value={option.value} + /> + ))} + </ElSelect> + </ElFormItem> <IconButton type="primary" icon="search" onClick={handleQueryForMain}> 鏌ヨ </IconButton> -- Gitblit v1.9.3