diff --git a/src/api/date/type.ts b/src/api/date/type.ts index f641eab..8d3737c 100644 --- a/src/api/date/type.ts +++ b/src/api/date/type.ts @@ -329,3 +329,7 @@ export interface fieldList{ classify: string; auxiliary: string; } +export interface changeDataInfo{ + key:string + value:any + } diff --git a/src/components/DesignForm/public/form/newForm.vue b/src/components/DesignForm/public/form/newForm.vue index 9faf71c..56789d0 100644 --- a/src/components/DesignForm/public/form/newForm.vue +++ b/src/components/DesignForm/public/form/newForm.vue @@ -27,6 +27,8 @@ import { jsonParseStringify } from "@/utils/DesignForm"; //通用提交 import { currencyFormApiSubmit,gainEditDataLog } from "@/api/taskapi/management"; +import { changeDataInfo } from "@/api/date/type"; + const props = withDefaults( defineProps<{ drawTitle: string; @@ -62,6 +64,7 @@ const props = withDefaults( isWeb: boolean; // nodeKey?: string; purview?: any[]; + updateAppTableForm?: Function; //关联表单 }>(), { drawTitle:"", @@ -877,7 +880,7 @@ function showOrHide(data: any,currentDataNameValue?:any) { const radioSelectZdtcszConfigArr: any[] = []; //20240815 关联选项设置的隐藏效果嵌套在内时不生效的问题修复 liwenxuan start - //console.log(props.formData.list) newModelKeyArr + console.log("关联选项设置的隐藏效果嵌套在内时不生效的问题修复--->",props.formData.list) //newModelKeyArr for (let i = 0; i < props.formData.list.length; i++) { if ( props.formData.list[i].type == "radio" || @@ -1245,7 +1248,9 @@ function showOrHide(data: any,currentDataNameValue?:any) { //console.log(radioSelectZdtcszConfigArr) nextTick(()=>{ - //console.log(model.value)// + console.log("radioSelectZdtcszConfigArr--------------------->",radioSelectZdtcszConfigArr)// + + const changeDataArr = ref([]) radioSelectZdtcszConfigArr.forEach(element => { let tbx=getLastColonAfterString(element.tbx) let tby=getLastColonAfterString(element.tby) @@ -1278,27 +1283,44 @@ nextTick(()=>{ let cellValue = getTableCellValue(element.tableData, rowValue, columnValue) model.value[element.name] = cellValue*1 + changeDataArr.value.push({ + key:element.name, + value:cellValue*1 + }) }else if(tbx!=""&&tby==""){ //console.log("仅设置了标题行") let cellValue = getTableCellValue(element.tableData, rowValue, 'default') //console.log(cellValue) model.value[element.name] = cellValue*1 + changeDataArr.value.push({ + key:element.name, + value:cellValue*1 + }) }else if(tbx==""&&tby!=""){ //console.log("仅设置了索引列") let cellValue = getTableCellValue(element.tableData, 'any', columnValue) //console.log(cellValue) model.value[element.name] = cellValue*1 + changeDataArr.value.push({ + key:element.name, + value:cellValue*1 + }) } //} - + console.log("model.value---------000------------>",model.value,element)// //console.log(getTableCellValueV2(element.tableData, 3, 2)); }); +console.log("model.value---------1111------------>",changeDataArr.value)// + + if (typeof props.updateAppTableForm === "function") { + props.updateAppTableForm(changeDataArr.value); + } }) diff --git a/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue b/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue index 5283f47..061eb50 100644 --- a/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue +++ b/src/views/sysworkflow/lowcodepage/pageFlow/newTableFlow.vue @@ -9,7 +9,7 @@ import { conditionInfo, nodeFlow } from "@/api/DesignForm/type"; import { echoTableFormPage,realTimeUpdateFlow } from "@/api/taskapi/management"; import { judgeSubmitCancel,startRunFlow,gainAppPageInfo,getFieldRecord } from "@/api/DesignForm/requestapi"; import { string2json, stringToObj } from "@/utils/DesignForm/form"; -import { appPageDataInit } from "@/api/date/type"; +import { appPageDataInit,changeDataInfo } from "@/api/date/type"; import { notAsA_BasisForJudgment, asAnApprovalActionControl, @@ -656,6 +656,67 @@ const changeKeyVal = (key: any, val: any, type: any, attribute: any) => { } + +//关联表单更新 +const updateAppTableForm = (data:changeDataInfo[])=>{ + console.log("关联表单更新--1111->",data) + console.log("关联表单更新--1112->",flowFactor) + console.log("关联表单更新--1113->",nodelUserList) + console.log("关联表单更新--1114->",flowMap.value) + if (data && Array.isArray(data)) { + if(flowFactor && Array.isArray(flowFactor)){ + if(data.length>0){ + data.forEach((item:changeDataInfo)=>{ + if(flowFactor.length>0){ + let isFind = false; + flowFactor.forEach((factor:any)=>{ + if(factor.factorid == item.key){ + factor.oneanswer = item.value.toString(); + isFind = true; + } + }) + if(!isFind){ + let condInfo = { + factorid: item.key, + type: 3, + isCheckbox: false, + oneanswer: item.value.toString(), + }; + flowFactor.push(condInfo); + } + + }else{ + let condInfo = { + factorid: item.key, + type: 3, + isCheckbox: false, + oneanswer: item.value.toString(), + }; + flowFactor.push(condInfo); + } + + }) + } + } + } + console.log("关联表单更新--555->",flowFactor) + flowLoading.value = true; + //获取工作流不进图 + gainFlowChart.conditionList = flowFactor; + gainFlowChart.nodelPeople = nodelUserList; + gainFlowChart.oldFlow = flowMap; + console.log("获取工作流不进图--gainFlowChart--->",gainFlowChart) + realTimeUpdateFlow(gainFlowChart).then((data: any) => { + // console.log("获取工作流不进图-new-->",data) + flowMap.value = data.data.flowList; + nextStep.value = data.data.nextStep; + currentProgress.value = data.data.Step; + nodeKey.value = data.data.nodeKey; + // // console.log("获取工作流不进图-1-->",flowMap.value) + flowLoading.value = false; + }); +} + const appTableForm = ref({ name:"" }) @@ -764,6 +825,7 @@ provide('currentNodeKey', nodeKey) :save-draft-page="saveDraftPage" :node-key="nodeKey" :purview="purviewAry" + :update-app-table-form="updateAppTableForm" />