仿钉钉设计流程:获取保存的模型

pull/452/head
jason 2024-04-05 22:54:40 +08:00
parent f79c29d168
commit 556cac8138
2 changed files with 51 additions and 49 deletions

View File

@ -86,9 +86,10 @@
@click="arrTransfer(index)" @click="arrTransfer(index)"
>&gt;</div >&gt;</div
> --> > -->
<div class="content" @click="setPerson(item.priorityLevel)">{{ <!-- <div class="content" @click="setPerson(item.priorityLevel)">{{
conditionStr(nodeConfig, index) conditionStr(nodeConfig, index)
}}</div> }}</div> -->
<div class="content">{{conditionStr(nodeConfig, index) }}</div>
<div class="error_tip" v-if="isTried && item.error"> <div class="error_tip" v-if="isTried && item.error">
<i class="anticon anticon-exclamation-circle"></i> <i class="anticon anticon-exclamation-circle"></i>
</div> </div>

View File

@ -101,8 +101,8 @@ export const copyerStr = ( candidateStrategy: number) => {
} }
} }
export const conditionStr = (nodeConfig, index) => { export const conditionStr = (nodeConfig, index) => {
const { conditionList, nodeUserList } = nodeConfig.conditionNodes[index] // const { conditionList, nodeUserList } = nodeConfig.conditionNodes[index]
if (conditionList.length == 0) { // if (conditionList.length == 0) {
// return index == nodeConfig.conditionNodes.length - 1 && // return index == nodeConfig.conditionNodes.length - 1 &&
// nodeConfig.conditionNodes[0].conditionList.length != 0 // nodeConfig.conditionNodes[0].conditionList.length != 0
// ? '其他条件进入此流程' // ? '其他条件进入此流程'
@ -111,56 +111,57 @@ export const conditionStr = (nodeConfig, index) => {
// nodeConfig.conditionNodes[0].conditionList.length != 0 // nodeConfig.conditionNodes[0].conditionList.length != 0
// ? '其他条件进入此流程' // ? '其他条件进入此流程'
// : '请设置条件' // : '请设置条件'
console.log('index===>', index); // console.log('index===>', index);
console.log('nodeConfig.conditionNodes.length===>', nodeConfig.conditionNodes.length); // console.log('nodeConfig.conditionNodes.length===>', nodeConfig.conditionNodes.length);
if( index === nodeConfig.conditionNodes.length - 1) { if( index === nodeConfig.conditionNodes.length - 1) {
return '其它情况将进入该分支' return '其它情况将进入该分支'
} else { } else {
return '请设置条件' return '请设置条件'
} }
} else { // } else {
let str = '' // let str = ''
for (let i = 0; i < conditionList.length; i++) { // for (let i = 0; i < conditionList.length; i++) {
const { // const {
columnId, // columnId,
columnType, // columnType,
showType, // showType,
showName, // showName,
optType, // optType,
zdy1, // zdy1,
opt1, // opt1,
zdy2, // zdy2,
opt2, // opt2,
fixedDownBoxValue // fixedDownBoxValue
} = conditionList[i] // } = conditionList[i]
if (columnId == 0) { // if (columnId == 0) {
if (nodeUserList.length != 0) { // if (nodeUserList.length != 0) {
str += '发起人属于:' // str += '发起人属于:'
str += // str +=
nodeUserList // nodeUserList
.map((item) => { // .map((item) => {
return item.name // return item.name
}) // })
.join('或') + ' 并且 ' // .join('或') + ' 并且 '
} // }
} // }
if (columnType == 'String' && showType == '3') { // if (columnType == 'String' && showType == '3') {
if (zdy1) { // if (zdy1) {
str += showName + '属于:' + dealStr(zdy1, JSON.parse(fixedDownBoxValue)) + ' 并且 ' // str += showName + '属于:' + dealStr(zdy1, JSON.parse(fixedDownBoxValue)) + ' 并且 '
} // }
} // }
if (columnType == 'Double') { // if (columnType == 'Double') {
if (optType != 6 && zdy1) { // if (optType != 6 && zdy1) {
const optTypeStr = ['', '<', '>', '≤', '=', '≥'][optType] // const optTypeStr = ['', '<', '>', '≤', '=', '≥'][optType]
str += `${showName} ${optTypeStr} ${zdy1} 并且 ` // str += `${showName} ${optTypeStr} ${zdy1} 并且 `
} else if (optType == 6 && zdy1 && zdy2) { // } else if (optType == 6 && zdy1 && zdy2) {
str += `${zdy1} ${opt1} ${showName} ${opt2} ${zdy2} 并且 ` // str += `${zdy1} ${opt1} ${showName} ${opt2} ${zdy2} 并且 `
} // }
} // }
} // }
return str ? str.substring(0, str.length - 4) : '请设置条件' // str ? str.substring(0, str.length - 4) :
} return '请设置条件'
// }
} }
export const dealStr = (str: string, obj) => { export const dealStr = (str: string, obj) => {