clay : 任意节点退回完成(可以退回到并行网关或者条件网关) #35

Merged
clay merged 1 commits from master into pro 2023-03-21 09:35:52 +00:00
1 changed files with 16 additions and 15 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content" :error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser" <node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content"
:error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser"
@selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)" @selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)"
placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/> placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/>
</template> </template>
@ -9,8 +10,8 @@ import Node from './Node'
export default { export default {
name: "CcNode", name: "CcNode",
props:{ props: {
config:{ config: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {}
@ -24,30 +25,30 @@ export default {
errorInfo: '', errorInfo: '',
} }
}, },
computed:{ computed: {
selectUser(){ selectUser() {
return { return {
show: this.config.props.assignedType !== 'ASSIGN_USER', show: this.config.props.assignedType !== 'ASSIGN_USER',
multiple: true multiple: true
}; };
}, },
viewer(){ viewer() {
return this.$store.state.diagramMode === 'viewer' return this.$store.state.diagramMode === 'viewer'
}, },
preview(){ preview() {
return this.$store.state.preview; return this.$store.state.preview;
}, },
headerBgc() { headerBgc() {
if (this.preview || !this.viewer){ if (this.preview || !this.viewer) {
return '#3296fa' return '#3296fa'
}else { } else {
return this.config.props.headerBgc return this.config.props.headerBgc
} }
}, },
content() { content() {
if (this.config.props.shouldAdd){ if (this.config.props.shouldAdd) {
return '由发起人指定' return '由发起人指定'
}else if (this.config.props.assignedUser.length > 0) { } else if (this.config.props.assignedUser.length > 0) {
let texts = [] let texts = []
this.config.props.assignedUser.forEach(org => texts.push(org.name)) this.config.props.assignedUser.forEach(org => texts.push(org.name))
return String(texts).replaceAll(',', '、') return String(texts).replaceAll(',', '、')
@ -58,15 +59,15 @@ export default {
}, },
methods: { methods: {
// //
validate(err){ validate(err) {
this.showError = false this.showError = false
if(this.config.props.shouldAdd){ if (this.config.props.shouldAdd) {
this.showError = false this.showError = false
}else if(this.config.props.assignedUser.length === 0){ } else if (this.config.props.assignedUser.length === 0) {
this.showError = true this.showError = true
this.errorInfo = '请选择需要抄送的人员' this.errorInfo = '请选择需要抄送的人员'
} }
if (this.showError){ if (this.showError) {
err.push(`抄送节点 ${this.config.name} 未设置抄送人`) err.push(`抄送节点 ${this.config.name} 未设置抄送人`)
} }
return !this.showError return !this.showError