|
@@ -4,7 +4,7 @@
|
|
|
<add-node v-model:childNodeP="nodeConfig.childNode" :operateShow="operateShow" />
|
|
|
</div>
|
|
|
<div class="node-wrap" v-if="(nodeConfig.nodeType == 1 || nodeConfig.nodeType == 4) && nodeConfig.nodeType != 0">
|
|
|
- <div class="node-wrap-box" :class="isTried && nodeConfig.error ? 'active error' : ''">
|
|
|
+ <div class="node-wrap-box" :class="nodeConfig.error ? 'active error' : ''">
|
|
|
<div class="title" :style="`background: rgb(${bgColors[nodeConfig.nodeType]});`">
|
|
|
<template v-if="nodeConfig.nodeType != 0">
|
|
|
<span class="iconfont">{{ nodeConfig.nodeType == 1 ? '' : '' }}</span>
|
|
@@ -13,15 +13,15 @@
|
|
|
type="text"
|
|
|
class="ant-input editable-title-input"
|
|
|
:disabled="props.operateShow"
|
|
|
- @blur="blurEvent()"
|
|
|
+ @blur="blurEvent(-1)"
|
|
|
v-model="nodeConfig.nodeName"
|
|
|
:placeholder="defaultText"
|
|
|
/>
|
|
|
- <span v-else class="editable-title" @click="clickEvent()">{{ nodeConfig.nodeName }}</span>
|
|
|
+ <span v-else class="editable-title" @click="clickEvent(false)">{{ nodeConfig.nodeName }}</span>
|
|
|
<span
|
|
|
v-if="nodeConfig.nodeName == '' && nodeConfig.nodeType == 1"
|
|
|
class="editable-title"
|
|
|
- @click="clickEvent()"
|
|
|
+ @click="clickEvent(false)"
|
|
|
>请输入节点名称</span
|
|
|
>
|
|
|
|
|
@@ -35,7 +35,7 @@
|
|
|
</div>
|
|
|
<i class="anticon anticon-right arrow"></i>
|
|
|
</div>
|
|
|
- <div class="error_tip" v-if="isTried && nodeConfig.error">
|
|
|
+ <div class="error_tip" v-if="nodeConfig.error">
|
|
|
<i class="anticon anticon-exclamation-circle"></i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,7 +48,7 @@
|
|
|
<div class="col-box" v-for="(item, index) in nodeConfig.conditionNodes" :key="index">
|
|
|
<div class="condition-node">
|
|
|
<div class="condition-node-box">
|
|
|
- <div class="auto-judge" :class="isTried && item.error ? 'error active' : ''">
|
|
|
+ <div class="auto-judge" :class="item.error ? 'error active' : ''">
|
|
|
<div class="sort-left" v-if="index != 0 && !props.operateShow" @click="arrTransfer(index, -1)">
|
|
|
<
|
|
|
</div>
|
|
@@ -77,7 +77,7 @@
|
|
|
<div class="content" @click="setPerson(item.priorityLevel)">
|
|
|
{{ $func.conditionStr(nodeConfig, index) }}
|
|
|
</div>
|
|
|
- <div class="error_tip" v-if="isTried && item.error">
|
|
|
+ <div class="error_tip" v-if="item.error">
|
|
|
<i class="anticon anticon-exclamation-circle"></i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -102,9 +102,10 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import $func from '@/utils/preload'
|
|
|
+import { getCurrentInstance } from 'vue'
|
|
|
import { useWorkflow } from '@/stores/workflow'
|
|
|
const workFlow = useWorkflow()
|
|
|
-const _uid = getCurrentInstance().uid
|
|
|
+const _uid = getCurrentInstance()?.uid
|
|
|
const bgColors = ['87, 106, 149', '255, 148, 62', '50, 150, 250']
|
|
|
const placeholderList = ['发起人', '', '抄送人']
|
|
|
const props = defineProps({
|
|
@@ -126,7 +127,7 @@ const showText = computed(() => {
|
|
|
return $func.copyerStr(props.nodeConfig)
|
|
|
})
|
|
|
|
|
|
-const isInputList = ref([])
|
|
|
+const isInputList = ref<any>([])
|
|
|
const isInput = ref(false)
|
|
|
const resetConditionNodesErr = () => {
|
|
|
for (let i = 0; i < props.nodeConfig.conditionNodes.length; i++) {
|
|
@@ -145,7 +146,7 @@ onMounted(() => {
|
|
|
})
|
|
|
const emits = defineEmits(['update:nodeConfig'])
|
|
|
|
|
|
-watch(workFlow, val => {
|
|
|
+watch(workFlow, (val: any) => {
|
|
|
if (val.approverConfig1.flag && val.approverConfig1.id === _uid) {
|
|
|
emits('update:nodeConfig', val.approverConfig1.value)
|
|
|
}
|
|
@@ -157,14 +158,14 @@ watch(workFlow, val => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const clickEvent = index => {
|
|
|
+const clickEvent = (index: any) => {
|
|
|
if (index || index === 0) {
|
|
|
isInputList.value[index] = true
|
|
|
} else {
|
|
|
isInput.value = true
|
|
|
}
|
|
|
}
|
|
|
-const blurEvent = index => {
|
|
|
+const blurEvent = (index: any) => {
|
|
|
if (index || index === 0) {
|
|
|
isInputList.value[index] = false
|
|
|
props.nodeConfig.conditionNodes[index].nodeName = props.nodeConfig.conditionNodes[index].nodeName || '条件'
|
|
@@ -192,9 +193,9 @@ const addTerm = () => {
|
|
|
resetConditionNodesErr()
|
|
|
emits('update:nodeConfig', props.nodeConfig)
|
|
|
}
|
|
|
-const delTerm = index => {
|
|
|
+const delTerm = (index: any) => {
|
|
|
props.nodeConfig.conditionNodes.splice(index, 1)
|
|
|
- props.nodeConfig.conditionNodes.map((item, index) => {
|
|
|
+ props.nodeConfig.conditionNodes.map((item: any, index: any) => {
|
|
|
item.priorityLevel = index + 1
|
|
|
item.nodeName = `条件${index + 1}`
|
|
|
})
|
|
@@ -211,14 +212,14 @@ const delTerm = index => {
|
|
|
emits('update:nodeConfig', props.nodeConfig.conditionNodes[0].childNode)
|
|
|
}
|
|
|
}
|
|
|
-const reData = (data, addData) => {
|
|
|
+const reData = (data: any, addData: any) => {
|
|
|
if (!data.childNode) {
|
|
|
data.childNode = addData
|
|
|
} else {
|
|
|
reData(data.childNode, addData)
|
|
|
}
|
|
|
}
|
|
|
-const setPerson = priorityLevel => {
|
|
|
+const setPerson = (priorityLevel: any) => {
|
|
|
const { nodeType } = props.nodeConfig
|
|
|
if (nodeType == 1) {
|
|
|
workFlow.approverDrawer = true
|
|
@@ -247,14 +248,14 @@ const setPerson = priorityLevel => {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-const arrTransfer = (index, type = 1) => {
|
|
|
+const arrTransfer = (index: any, type = 1) => {
|
|
|
//向左-1,向右1
|
|
|
props.nodeConfig.conditionNodes[index] = props.nodeConfig.conditionNodes.splice(
|
|
|
index + type,
|
|
|
1,
|
|
|
props.nodeConfig.conditionNodes[index]
|
|
|
)[0]
|
|
|
- props.nodeConfig.conditionNodes.map((item, index) => {
|
|
|
+ props.nodeConfig.conditionNodes.map(({ item, index }: any) => {
|
|
|
item.priorityLevel = index + 1
|
|
|
})
|
|
|
resetConditionNodesErr()
|