1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| <template>
| <div :class="{ 'node':true, 'root': isRoot || !show, 'node-error-state': showError}">
| <div v-if="show" @click="$emit('selected')" :class="{'node-body': true, 'error': showError}" >
| <div>
|
| <div class="node-body-header" :style="{'background-color': headerBgc}">
| <i :class="headerIcon" style="margin-right: 5px" v-if="(headerIcon || '') !== ''"></i>
| <ellipsis class="name" hover-tip :content="title"/>
| <i class="el-icon-close" v-if="!isRoot && $store.state.diagramMode !== 'viewer'" style="float:right;" @click="$emit('delNode')"></i>
| </div>
| <div class="node-body-content">
| <i :class="leftIcon" v-if="leftIcon"></i>
| <span class="placeholder" v-if="(content || '').trim() === ''">{{placeholder}}</span>
| <ellipsis :row="3" :content="content" v-else/>
|
| <!-- <p v-show="$store.state.diagramMode === 'viewer'" >发起人:{{ content }}</p>-->
| <i class="el-icon-arrow-right" v-if="$store.state.diagramMode !== 'viewer'" ></i>
| </div>
| <div class="node-error" v-if="showError">
|
| <el-tooltip effect="dark" :content="errorInfo" placement="top-start">
| <i class="el-icon-warning-outline"></i>
| </el-tooltip>
| </div>
| </div>
| </div>
| <div class="node-footer">
| <!-- <div v-if="flowText!=='发起时间:'">-->
| <!-- <ellipsis style="font-size: 14px;" :row="2" :content="flowText" />-->
| <!-- </div>-->
| <div class="btn">
| <insert-button v-show="$store.state.diagramMode !== 'viewer'" @insertNode="type => $emit('insertNode', type)"></insert-button>
|
| </div>
|
| </div>
| </div>
| </template>
| <script>
| import InsertButton from '@/views/common/InsertButton.vue'
|
|
| export default {
| name: "Node",
| components: {InsertButton},
| props:{
| //是否为根节点
| isRoot: {
| type: Boolean,
| default: false
| },
| //是否显示节点体
| show: {
| type: Boolean,
| default: true
| },
| //节点内容区域文字
| content: {
| type: String,
| default: ""
| },
| title:{
| type: String,
| default: "标题"
| },
| placeholder:{
| type: String,
| default: "请设置"
| },
| flowText:{
| type: String,
| default: ""
| },
| //节点体左侧图标
| leftIcon: {
| type: String,
| default: undefined
| },
| //头部图标
| headerIcon:{
| type: String,
| default: ''
| },
| //头部背景色
| headerBgc:{
| type: String,
| default: '#576a95'
| },
| //是否显示错误状态
| showError:{
| type: Boolean,
| default: false
| },
| errorInfo:{
| type: String,
| default: '无信息'
| },
| },
| data() {
| return {
| isV:this.$isVertical
| }
| },
|
|
| created() {
| console.log("this.isV",this.flowText)
| },
| methods: {}
| }
| </script>
|
| <style lang="scss" :src="$cssSrc" scoped >
|
| </style>
|
|