Compare commits
2 Commits
9fb0524c6b
...
76726e75ba
| Author | SHA1 | Date |
|---|---|---|
|
|
76726e75ba | |
|
|
a84bbbeedb |
|
|
@ -1,5 +1,6 @@
|
|||
<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)"
|
||||
placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/>
|
||||
</template>
|
||||
|
|
@ -9,8 +10,8 @@ import Node from './Node'
|
|||
|
||||
export default {
|
||||
name: "CcNode",
|
||||
props:{
|
||||
config:{
|
||||
props: {
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
|
|
@ -24,30 +25,30 @@ export default {
|
|||
errorInfo: '',
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
selectUser(){
|
||||
computed: {
|
||||
selectUser() {
|
||||
return {
|
||||
show: this.config.props.assignedType !== 'ASSIGN_USER',
|
||||
multiple: true
|
||||
};
|
||||
},
|
||||
viewer(){
|
||||
viewer() {
|
||||
return this.$store.state.diagramMode === 'viewer'
|
||||
},
|
||||
preview(){
|
||||
preview() {
|
||||
return this.$store.state.preview;
|
||||
},
|
||||
headerBgc() {
|
||||
if (this.preview || !this.viewer){
|
||||
if (this.preview || !this.viewer) {
|
||||
return '#3296fa'
|
||||
}else {
|
||||
} else {
|
||||
return this.config.props.headerBgc
|
||||
}
|
||||
},
|
||||
content() {
|
||||
if (this.config.props.shouldAdd){
|
||||
if (this.config.props.shouldAdd) {
|
||||
return '由发起人指定'
|
||||
}else if (this.config.props.assignedUser.length > 0) {
|
||||
} else if (this.config.props.assignedUser.length > 0) {
|
||||
let texts = []
|
||||
this.config.props.assignedUser.forEach(org => texts.push(org.name))
|
||||
return String(texts).replaceAll(',', '、')
|
||||
|
|
@ -58,15 +59,15 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
//校验数据配置的合法性
|
||||
validate(err){
|
||||
validate(err) {
|
||||
this.showError = false
|
||||
if(this.config.props.shouldAdd){
|
||||
if (this.config.props.shouldAdd) {
|
||||
this.showError = false
|
||||
}else if(this.config.props.assignedUser.length === 0){
|
||||
} else if (this.config.props.assignedUser.length === 0) {
|
||||
this.showError = true
|
||||
this.errorInfo = '请选择需要抄送的人员'
|
||||
}
|
||||
if (this.showError){
|
||||
if (this.showError) {
|
||||
err.push(`抄送节点 ${this.config.name} 未设置抄送人`)
|
||||
}
|
||||
return !this.showError
|
||||
|
|
|
|||
Loading…
Reference in New Issue