|
|
@ -8,7 +8,9 @@ import { gainTaskFormInfo,gainEditDataLog,afreshRunWorkflow } from '@/api/lowCod |
|
|
import{ json2string,string2json,stringToObj } from '@/utils/lowCode/form' |
|
|
import{ json2string,string2json,stringToObj } from '@/utils/lowCode/form' |
|
|
import { judgeSubmitCancel } from '@/api/lowCode/form/index' |
|
|
import { judgeSubmitCancel } from '@/api/lowCode/form/index' |
|
|
|
|
|
|
|
|
import { afreshSubmitButton,editFormCont,draftSubmitButton,submitButtonEs,submitButton } from '@/utils/lowCode/const' |
|
|
import { afreshSubmitButton,editFormCont,draftSubmitButton,submitButtonEs,submitButton,notAsA_BasisForJudgment, fixedValueControl,timeControl,timeEquation,asAnApprovalActionControl } from '@/utils/lowCode/const' |
|
|
|
|
|
|
|
|
|
|
|
import { conditionInfo,nodelPeoples } from "@/api/lowCode/taskapi/types" |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
isShow:{ |
|
|
isShow:{ |
|
|
@ -44,6 +46,7 @@ const props = defineProps({ |
|
|
default:"", |
|
|
default:"", |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
const nodelUserList = reactive<nodelPeoples[]>([]); |
|
|
const emits = defineEmits(["update:isShow","searchData"]) |
|
|
const emits = defineEmits(["update:isShow","searchData"]) |
|
|
const openPage =computed({ |
|
|
const openPage =computed({ |
|
|
get() { |
|
|
get() { |
|
|
@ -57,7 +60,9 @@ const formDesign = ref<any>(); |
|
|
const flowLogPage = ref<any>(); //流程与历史记录 |
|
|
const flowLogPage = ref<any>(); //流程与历史记录 |
|
|
const pageLog = ref<any[]>([]); //历史记录 |
|
|
const pageLog = ref<any[]>([]); //历史记录 |
|
|
const loadPage = ref(false) |
|
|
const loadPage = ref(false) |
|
|
|
|
|
const gainFlowChart = reactive<nodeFlow>({ |
|
|
|
|
|
id: "0", |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -187,6 +192,195 @@ onMounted(()=>{ |
|
|
console.log("挺挺挺挺下") |
|
|
console.log("挺挺挺挺下") |
|
|
console.log(props) |
|
|
console.log(props) |
|
|
}) |
|
|
}) |
|
|
|
|
|
const flowFactor = reactive<conditionInfo[]>([]); //表单组件 |
|
|
|
|
|
//组件解析 |
|
|
|
|
|
const changeKeyVal = (key: any, val: any, type: any, attribute: any) => { |
|
|
|
|
|
console.log("改变表单值--key--->",key) |
|
|
|
|
|
console.log("改变表单值--val--->",val,Array.isArray(val)) |
|
|
|
|
|
console.log("改变表单值--type--->",type) |
|
|
|
|
|
console.log("改变表单值--attribute--->",attribute) |
|
|
|
|
|
|
|
|
|
|
|
let unitsVal = val; |
|
|
|
|
|
let isUpdateFlowChart = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//单选,多选,下拉菜单 |
|
|
|
|
|
if (notAsA_BasisForJudgment.indexOf(type) === -1) { |
|
|
|
|
|
let isWrite = true; |
|
|
|
|
|
flowFactor.forEach((item: any) => { |
|
|
|
|
|
if (item.factorid == key) { |
|
|
|
|
|
isWrite = false; |
|
|
|
|
|
|
|
|
|
|
|
item.type = 3; |
|
|
|
|
|
if (type == "checkbox") { |
|
|
|
|
|
item.isCheckbox = true; |
|
|
|
|
|
item.answers = val.map(String); |
|
|
|
|
|
} else { |
|
|
|
|
|
item.isCheckbox = false; |
|
|
|
|
|
item.oneanswer = val.toString(); |
|
|
|
|
|
} |
|
|
|
|
|
if (notAsA_BasisForJudgment.indexOf(type) === -1) { |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (isWrite) { |
|
|
|
|
|
if (type == "checkbox") { |
|
|
|
|
|
flowFactor.push({ |
|
|
|
|
|
factorid: key, |
|
|
|
|
|
type: 3, |
|
|
|
|
|
isCheckbox: true, |
|
|
|
|
|
answers: val.map(String), |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
flowFactor.push({ |
|
|
|
|
|
factorid: key, |
|
|
|
|
|
type: 3, |
|
|
|
|
|
isCheckbox: false, |
|
|
|
|
|
oneanswer: val.toString(), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
} |
|
|
|
|
|
// console.log("改变表单值--flowFactor--->",flowFactor) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
//时间类空间附加判断条件 |
|
|
|
|
|
if ( |
|
|
|
|
|
timeControl.indexOf(type) > -1 || |
|
|
|
|
|
fixedValueControl.indexOf(type) > -1 || |
|
|
|
|
|
type == "input" |
|
|
|
|
|
) { |
|
|
|
|
|
// console.log("改变表单值--flowFactor--3->",unitsVal) |
|
|
|
|
|
let addNewTime = true; //判断是否新增 |
|
|
|
|
|
flowFactor.forEach((item: any) => { |
|
|
|
|
|
// console.log("改变表单值--flowFactor--5->",item.type) |
|
|
|
|
|
if (item.type == 2) { |
|
|
|
|
|
addNewTime = false; |
|
|
|
|
|
// console.log("改变表单值--flowFactor--5====1->",item.type) |
|
|
|
|
|
// console.log("改变表单值--flowFactor--5====3->",item.customFields,item.customFields.length) |
|
|
|
|
|
if (item.customFields && item.customFields.length > 0) { |
|
|
|
|
|
// console.log("改变表单值--flowFactor--5====2->",item.customFields) |
|
|
|
|
|
let sunNewAdd = true; |
|
|
|
|
|
item.customFields.forEach((sunItem: any) => { |
|
|
|
|
|
// console.log("改变表单值--flowFactor-4->",sunItem.wordfield , key,sunItem.wordfield == key) |
|
|
|
|
|
if (sunItem.wordfield == key) { |
|
|
|
|
|
sunNewAdd = false; |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
if (timeEquation.indexOf(attribute) === -1) { |
|
|
|
|
|
//非区间性时间 |
|
|
|
|
|
sunItem.leftval = val.toString(); |
|
|
|
|
|
} else { |
|
|
|
|
|
//区间性时间 |
|
|
|
|
|
if (Array.isArray(val)) { |
|
|
|
|
|
if (val.length >= 2) { |
|
|
|
|
|
sunItem.leftval = val[0].toString(); |
|
|
|
|
|
sunItem.rightval = val[val.length - 1].toString(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (sunNewAdd) { |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
if (timeEquation.indexOf(attribute) === -1) { |
|
|
|
|
|
//非区间性时间 |
|
|
|
|
|
let customFieldInfo = { |
|
|
|
|
|
wordfield: key, |
|
|
|
|
|
optType: "1", |
|
|
|
|
|
leftval: val.toString(), |
|
|
|
|
|
}; |
|
|
|
|
|
item.customFields.push(customFieldInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
//区间性时间 |
|
|
|
|
|
if (Array.isArray(val)) { |
|
|
|
|
|
if (val.length >= 2) { |
|
|
|
|
|
let customFieldInfo = { |
|
|
|
|
|
wordfield: key, |
|
|
|
|
|
optType: "6", |
|
|
|
|
|
leftval: val[0].toString(), |
|
|
|
|
|
leftoptType: "3", |
|
|
|
|
|
rightoptType: "3", |
|
|
|
|
|
rightval: val[val.length - 1].toString(), |
|
|
|
|
|
}; |
|
|
|
|
|
item.customFields.push(customFieldInfo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (addNewTime) { |
|
|
|
|
|
//新增自定义类数据判断 |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
if (timeEquation.indexOf(attribute) === -1) { |
|
|
|
|
|
//非区间性时间 |
|
|
|
|
|
let customFieldInfo = { |
|
|
|
|
|
wordfield: key, |
|
|
|
|
|
optType: "1", |
|
|
|
|
|
leftval: val.toString(), |
|
|
|
|
|
}; |
|
|
|
|
|
let condInfo = { |
|
|
|
|
|
factorid: "customFields", |
|
|
|
|
|
type: 2, |
|
|
|
|
|
isCheckbox: false, |
|
|
|
|
|
customFields: [customFieldInfo], |
|
|
|
|
|
}; |
|
|
|
|
|
flowFactor.push(condInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
//区间性时间 |
|
|
|
|
|
if (Array.isArray(val)) { |
|
|
|
|
|
if (val.length >= 2) { |
|
|
|
|
|
let customFieldInfo = { |
|
|
|
|
|
wordfield: key, |
|
|
|
|
|
optType: "6", |
|
|
|
|
|
leftval: val[0].toString(), |
|
|
|
|
|
leftoptType: "3", |
|
|
|
|
|
rightoptType: "3", |
|
|
|
|
|
rightval: val[val.length - 1].toString(), |
|
|
|
|
|
}; |
|
|
|
|
|
let condInfo = { |
|
|
|
|
|
factorid: "customFields", |
|
|
|
|
|
type: 2, |
|
|
|
|
|
isCheckbox: false, |
|
|
|
|
|
customFields: [customFieldInfo], |
|
|
|
|
|
}; |
|
|
|
|
|
flowFactor.push(condInfo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//操作人 |
|
|
|
|
|
if (asAnApprovalActionControl.indexOf(type) > -1) { |
|
|
|
|
|
isUpdateFlowChart = true; |
|
|
|
|
|
let isWriteUs = true; |
|
|
|
|
|
nodelUserList.forEach((item: any) => { |
|
|
|
|
|
if (item.factorid == key) { |
|
|
|
|
|
isWriteUs = false; |
|
|
|
|
|
item.userList = val; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (isWriteUs) { |
|
|
|
|
|
nodelUserList.push({ |
|
|
|
|
|
factorid: key, |
|
|
|
|
|
userList: val, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("改变表单值--flowFactor--->", isUpdateFlowChart); |
|
|
|
|
|
//更新工作流图 |
|
|
|
|
|
if (isUpdateFlowChart&&props.stateForm.taskKey&&props.stateForm.taskKey!="") { |
|
|
|
|
|
// gainFlowChart.conditionList = flowFactor; |
|
|
|
|
|
// gainFlowChart.nodelPeople = nodelUserList; |
|
|
|
|
|
// gainFlowChart.id = flowMap; |
|
|
|
|
|
console.log("获取工作流不进图--gainFlowChart--->",props.stateForm) |
|
|
|
|
|
flowLogPage.value.refreshWorkFlow(props.stateForm.taskKey,flowFactor,nodelUserList) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
<div class="newDrawerCont"> |
|
|
<div class="newDrawerCont"> |
|
|
@ -205,6 +399,7 @@ onMounted(()=>{ |
|
|
:is-work-flow="stateForm.flowIsTrue" |
|
|
:is-work-flow="stateForm.flowIsTrue" |
|
|
:app-info="props.appInfo" |
|
|
:app-info="props.appInfo" |
|
|
:after-submit="afterSubmit" |
|
|
:after-submit="afterSubmit" |
|
|
|
|
|
:change-key-val="changeKeyVal" |
|
|
/> |
|
|
/> |
|
|
<FlowAndLog ref="flowLogPage" v-if="openPage" :types="props.stateForm.type" :app-flow-info="props.appFlowInfo" :app-info="props.appInfo" :log-list="pageLog" :app-page-info="props.appPageInfo" :state-form="props.stateForm" /> |
|
|
<FlowAndLog ref="flowLogPage" v-if="openPage" :types="props.stateForm.type" :app-flow-info="props.appFlowInfo" :app-info="props.appInfo" :log-list="pageLog" :app-page-info="props.appPageInfo" :state-form="props.stateForm" /> |
|
|
<!-- {{stateForm.flowIsTrue}}<br> |
|
|
<!-- {{stateForm.flowIsTrue}}<br> |
|
|
|