|
@@ -63,6 +63,21 @@
|
|
|
@blur="saveRouteTitle(route)"
|
|
|
@keyup.enter="saveRouteTitle(route)"
|
|
|
></el-input>
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 0"
|
|
|
+ class="ml-2"
|
|
|
+ :prop="`routeNodes.${index}.nodeKey`"
|
|
|
+ :rules="[{ required: true, message: '请选择流程节点' }]"
|
|
|
+ >
|
|
|
+ <el-select v-model="route.nodeKey" size="small" placeholder="请选择流程节点">
|
|
|
+ <el-option v-for="item in validNodeList" :key="item.nodeKey" :label="item.nodeName" :value="item.nodeKey">
|
|
|
+ <div class="w-[230px] flex justify-between -ml-[8px] -mr-[20px]">
|
|
|
+ <le-text :value="item.nodeName || '-'"></le-text>
|
|
|
+ <span class="text-gray-400">{{ item.nodeKey }}</span>
|
|
|
+ </div>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-button class="ml-auto" link type="danger" icon="Delete" @click="removeRouteNode(index)" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -165,7 +180,7 @@ export default {
|
|
|
components: {
|
|
|
addNode
|
|
|
},
|
|
|
- inject: ['rootConfig'],
|
|
|
+ inject: ['getRootConfig'],
|
|
|
props: {
|
|
|
modelValue: { type: Object, default: () => {} },
|
|
|
disabled: {
|
|
@@ -206,10 +221,34 @@ export default {
|
|
|
this.nodeConfig = this.modelValue
|
|
|
},
|
|
|
methods: {
|
|
|
+ queryValidNodeList() {
|
|
|
+ const validNodeList = []
|
|
|
+ const fn = data => {
|
|
|
+ if (!data) return
|
|
|
+ // validNodeList.push({ nodeKey: data.nodeKey, nodeName: data.nodeName, type: data.type })
|
|
|
+ validNodeList.push(data)
|
|
|
+ if (data.conditionNodes && Array.isArray(data.conditionNodes)) {
|
|
|
+ // 条件分支节点
|
|
|
+ data.conditionNodes.forEach(v => {
|
|
|
+ fn(v.childNode)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (data.childNode) {
|
|
|
+ // 正常子节点
|
|
|
+ fn(data.childNode)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const rootConfig = this.getRootConfig()
|
|
|
+ fn(rootConfig)
|
|
|
+ // 只允许选择审核人
|
|
|
+ this.validNodeList = validNodeList.filter(v => v.type === 1)
|
|
|
+ },
|
|
|
show() {
|
|
|
if (this.disabled) return
|
|
|
this.form = {}
|
|
|
this.form = JSON.parse(JSON.stringify(this.nodeConfig))
|
|
|
+ this.queryValidNodeList()
|
|
|
this.drawer = true
|
|
|
},
|
|
|
editTitle(refName) {
|
|
@@ -299,7 +338,8 @@ export default {
|
|
|
toText(nodeConfig) {
|
|
|
const routeNodes = nodeConfig.routeNodes || []
|
|
|
if (routeNodes.length > 0) {
|
|
|
- return routeNodes.map(v => `路由至(${v.nodeName})`).join(',')
|
|
|
+ return `${routeNodes.length}条动态路由`
|
|
|
+ // return routeNodes.map(v => `路由至(${v.nodeName})`).join(',')
|
|
|
}
|
|
|
return '<span class="placeholder">请设置路由节点</span>'
|
|
|
}
|