From 208ddfa7f6caf39a4980b2d9f01ae1a35c4f49a7 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Wed, 15 Oct 2025 08:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=20=E6=97=B6=E9=97=B4=E6=AE=B5=E5=AD=90=E8=A1=A8=20bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 74 +++++++++++++++++-- .../DesignForm/public/form/childTable.vue | 48 ++++++++++++ .../DesignForm/tableListPage/formPageCont.vue | 30 ++++++++ 3 files changed, 145 insertions(+), 7 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index 3b80580..83402d9 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -358,6 +358,29 @@ let switchs: any[] = []; let selects: any[] = []; let tables: any[] = []; let dofs: any[] = []; //deptOrgAndOrgCententAndFounderArr +let rangedDatePickerInTables: any[] = []; + +function getAllRangedDatePickerInTables(){ + let dataList = ref({}); + dataList.value = props.fieldsDetailList; + if (dataList && Array.isArray(dataList.value) && dataList.value.length > 0) { + for (let i = 0; i < dataList.value.length; i++) { + if(dataList.value[i].type == "table"){ + dataList.value[i].list.forEach((element: any) => { + if(element.type=="datePicker"){ + //monthrange daterange datetimerange + if(element.control.type=="monthrange"||element.control.type=="daterange"||element.control.type=="datetimerange"){ + let str = ""+dataList.value[i].name+"^^^*^^^" + rangedDatePickerInTables.push(str+element.name) + } + } + + }); + } + } + } +} + function getAsfs() { //setTimeout(() => { let dataList = ref({}); @@ -822,7 +845,7 @@ const setUpClick = (val: string, id: string) => { id: idList.value, isTrue: 2, }; - softDeletion(sendData).then((data) => { + softDeletion(sendData).then((data: { mag: any; }) => { // console.log('cancel!',data) ElNotification({ title: "温馨提示!", @@ -1011,7 +1034,7 @@ const getPageData = () => { //表单导入 function doImportTableData() { dynamicVNode.value = h(importPanel, { - fields: props.fieldsDetailList.filter((val) => val.type !== "table"), + fields: props.fieldsDetailList.filter((val: { type: string; }) => val.type !== "table"), formId: props.versionid, commitFunc: () => { getPageData(); //刷新table页面 @@ -1049,7 +1072,7 @@ function doExportTableData() { array.push(title.join(",")); //写入数据行 - datas.list.forEach((item) => { + datas.list.forEach((item: { [x: string]: { [x: string]: any; }[]; }) => { const line = []; let maxline = 0; //写主表列 @@ -1138,10 +1161,43 @@ function doExportTableData() { }); } +function dateStringToTimestampLocal(dateStr: string) { + const isoStr = dateStr.replace(' ', 'T'); + const timestamp = new Date(isoStr).getTime(); + if (isNaN(timestamp)) { + throw new Error('Invalid date string'); + } + return String(timestamp); +} +const rangedDatePickerInTables1: any = [] async function doGainFormPageListCont(sendData: any) { const data = await gainFormPageListCont(sendData); - // console.log("获取列表详细信息----------------->",data) + console.log("获取列表详细信息----------------->",data) //console.log(dataList) + rangedDatePickerInTables.forEach(element => { + let x = element.split('^^^*^^^') + console.log(x) + rangedDatePickerInTables1.push(x) + data.data.list.forEach((item: any) => { + console.log(item) + console.log(item[x[0]]) + let tableValues = item[x[0]] + tableValues.forEach((element1: any) => { + let start = dateStringToTimestampLocal(element1[x[1]]) + let end = element1[x[1]+"_end"] + let arr = [start,end] + console.log(arr) + element1[x[1]] = arr + }); + /* let y = dateStringToTimestampLocal(item[x[0]][x[1]]) + console.log(y) */ + + }); + + + }); + + asfDetails = props.data.columns.filter((item: any) => { return item.fieldClass == "associatedForms"; }); @@ -1197,10 +1253,11 @@ async function doGainFormPageListCont(sendData: any) { } } } + return dataList.data; }); } - + return data.data; } @@ -1231,7 +1288,7 @@ async function doGainFormPageListCont(sendData: any) { } }); }); - +console.log(data.data) return data.data; //tableDataList.value = data.data.list @@ -1423,6 +1480,7 @@ onMounted(() => { drawerWith.value = container.value?.clientWidth; }); getAsfs(); + getAllRangedDatePickerInTables(); }); /** @ 作者: 秦东 @@ -1838,7 +1896,7 @@ jieguo = jieguo+"
+ + +