Compare commits

..

No commits in common. "76726e75bad75c06a46c608c5954730dd10e4b2e" and "9fb0524c6b197215cdec70b6987ebdaa3e705341" have entirely different histories.

1 changed files with 15 additions and 16 deletions

View File

@ -1,6 +1,5 @@
<template> <template>
<node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content" <node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content" :error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser"
: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>
@ -10,8 +9,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 {}
@ -25,30 +24,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(',', '、')
@ -59,15 +58,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