zydx-plus 1.35.596 → 1.35.598

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,113 +1,115 @@
1
1
  <template>
2
- <div class="mind" :class="{'full-screen':!fullShow}" :ref="id">
3
- <div class="table">
4
- <div class="table-left" v-if="!readOnly">
5
- <button :disabled="mindShow" @click="addNode">添加节点</button>
6
- <button :disabled="mindShow" @click="brotherNode">兄弟节点</button>
7
- <button :disabled="mindShow" @click="delNode">删除节点</button>
8
- <button :disabled="mindShow" @click="associativeLine">关联线</button>
9
- <button :disabled="mindShow" @click="nodeStyle">节点样式</button>
10
- <button @click="structure">结构切换</button>
11
- <button :disabled="retShow" @click="ret">上一步</button>
12
- <button :disabled="forwardShow" @click="forward">下一步</button>
13
- <button v-if="protectShow" @click="preservation">保存</button>
14
- <button @click="fullTap" v-if="fullShow">全屏</button>
15
- <button @click="fullDel" v-else>退出</button>
16
- </div>
2
+ <div class="mind" :class="{'full-screen':!fullShow}" :ref="id">
3
+ <div class="mind-table">
4
+ <div class="table-left" v-if="!readOnly">
5
+ <button :disabled="mindShow" @click="addNode">添加节点</button>
6
+ <button :disabled="mindShow" @click="brotherNode">兄弟节点</button>
7
+ <button :disabled="mindShow" @click="delNode">删除节点</button>
8
+ <button :disabled="mindShow" @click="associativeLine">关联线</button>
9
+ <button :disabled="mindShow" @click="nodeStyle">节点样式</button>
10
+ <button @click="structure">结构切换</button>
11
+ <button :disabled="retShow" @click="ret">上一步</button>
12
+ <button :disabled="forwardShow" @click="forward">下一步</button>
13
+ <button v-if="protectShow" @click="preservation">保存</button>
14
+ <button @click="fullTap" v-if="fullShow">全屏</button>
15
+ <button @click="fullDel" v-else>退出</button>
16
+ </div>
17
+ </div>
18
+ <div :id="id" class="mindMapContainer"></div>
19
+ <div class="node-style" :ref="id+'e'" :class="{'node-s': trans, 'node-h': !trans}">
20
+ <div class="style-li">
21
+ <img @click="nodeStyle"
22
+ src="data:image/png;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+BcDuATAORaLVAxlYCoDD/QfRpzUnPvrrf7PmQDMvhneAohOTxnoNgMC0u3RamMWGRAQiywqRrcZEJBuj1Ybs8iAgFhkUTG6zYCAdHu02phFBgTEIouK0W0GBKTbo9XGLDIgIBZZVIxuMyAg3R6tNmaRAQGxyKJidJsBAen2aLUxiwwIiEUWFaPbDAhIt0erjVlkQEAssqgY3WZAQLo9Wm3MIgP/B7mSJva6gFwqAAAAAElFTkSuQmCC"
23
+ alt=""/>
24
+ <div class="style-title">文字</div>
25
+ <div class="style-list">
26
+ <div class="node-left zIndex2">
27
+ <span>字号</span>
28
+ <Select :options="optionSize" v-model:value="sizeValue"></Select>
29
+ </div>
30
+ <div class="node-left padd zIndex2">
31
+ <span>行高</span>
32
+ <Select :options="optionRow" v-model:value="rowValue"></Select>
33
+ </div>
34
+ </div>
35
+ <div class="node-but">
36
+ <button @click="colorTap($event,'color')">颜色</button>
37
+ <button :style="{'background-color': (boldAct)? '#549688': '#fff','color': (boldAct)? '#fff': '#333'}"
38
+ @click="bolds">粗体
39
+ </button>
40
+ <button :style="{'background-color': (italicAct)? '#549688': '#fff','color': (italicAct)? '#fff': '#333'}"
41
+ @click="italics">斜体
42
+ </button>
43
+ <button :style="{'background-color': (scribeAct)? '#549688': '#fff','color': (scribeAct)? '#fff': '#333'}"
44
+ @click="scribes">划线
45
+ </button>
46
+ </div>
47
+ </div>
48
+ <div class="style-li">
49
+ <div class="style-title">边框</div>
50
+ <div class="style-list">
51
+ <div class="node-left">
52
+ <span>颜色</span>
53
+ <div @click="colorTap($event,'borderColor')" class="backColor"></div>
54
+ </div>
55
+ <div class="node-left padd zIndex3">
56
+ <span>样式</span>
57
+ <Select :options="optionLine" v-model:value="styleValue"></Select>
58
+ </div>
59
+ </div>
60
+ <div class="style-list">
61
+ <div class="node-left zIndex3">
62
+ <span>宽度</span>
63
+ <Select :options="optionWidth" v-model:value="widthValue"></Select>
64
+ </div>
65
+ <div class="node-left padd zIndex4">
66
+ <span>圆角</span>
67
+ <Select :options="optionWidth" v-model:value="filletValue"></Select>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div class="style-li">
72
+ <div class="style-title">背景</div>
73
+ <div class="style-list">
74
+ <div class="node-left">
75
+ <span>颜色</span>
76
+ <div @click="colorTap($event,'fillColor')" class="backColor"></div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ <div class="style-li">
81
+ <div class="style-title">线条</div>
82
+ <div class="style-list">
83
+ <div class="node-left zIndex">
84
+ <span>宽度</span>
85
+ <Select :options="optionWidth" v-model:value="lineValue"></Select>
86
+ </div>
87
+ <div class="node-left padd zIndex">
88
+ <span>样式</span>
89
+ <Select :options="optionLine" v-model:value="lineStyleValue"></Select>
90
+ </div>
91
+ </div>
92
+ <div class="style-list">
93
+ <div class="node-left">
94
+ <span>颜色</span>
95
+ <div @click="colorTap($event,'lineColor')" class="backColor"></div>
96
+ </div>
17
97
  </div>
18
- <div :id="id" class="mindMapContainer"></div>
19
- <div class="node-style" :ref="id+'e'" :class="{'node-s': trans, 'node-h': !trans}">
20
- <div class="style-li">
21
- <img @click="nodeStyle" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADTFJREFUeF7t3VmspEUVB/A/r5oYH+TFBF/UFwcSjcsD4oOJaNQXjBERXMBdwRFhcEMdkUWRGVHGfQOVRVEU3AVBdBhGNlcWFRAFFBTcd0UxxVTP3NvTfbu66vxr/Xcy4WG+OlV16vzu+b6+Pc0e0EsZUAbmZmAP5UYZUAbmZ0BAVB3KwBoZEBCVhzIgIKoBZSAuA+ogcXnTqEEyICCDHLS2GZcBAYnLm0YNkgEBGeSgtc24DAhIXN40apAMCMggB61txmXAEshDAewL4B4AWwHcHrckjVIGgjMwqTk34HIANwePDLzQAshbATwTwN5Tc24HcBqATweuRZcpA6EZOBLAi2bU3LUAzgFwUmigRdelAHkMgAsAPHjBJA7I8QCuX7QY/b0ysCADjwBwIoADFlznoOxj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SFhDhqL9wc66QgeQLHsk9zI0wgAgH88Tajd0kEmsgwtFuAedYOQPJ530n+S9jA5ZAhINxQv3FZCFxD+7/s06XFRDhsD6ZvuMxkJznO4kpEgsgwtF3MbN2x0DyOY/kXqtFpwIRDquTGDNO9UhSgAjHmEVtvWsGks/6TpK81hQg7msk909eweoAxwFwCdNrrAwwkGwBsD41jbFAjgDgFmD5Eg7LbLYXi4HkEABnp6QiBsj9AdwAYK+UiafGCodhMhsOZY3kFgD7AIj+ppQYII8FcKXhIQiHYTI7CGWN5HEArorNSwyQQwGcHjuhOodR5voOY4nkMABnxKYrBsgGAKfETrhinDqHQRI7DmGF5BgAm2LzFAPkqQDct+ClvIQjJXvjjLVA8jQA7qtNo14xQB4G4Mao2XYMEo6E5A04NBXJwwHcFJu3GCBurqsBPDpiUuGISJqG3Pe7sY0RedgGYL+IcTuHxAI5GMBZS04sHEsmTJevykAMkn0BbE/JYywQN6f75runB04uHIGJ0mVrZmAZJEcBODU1nylA3NxPAbAZwLo5C3H/61/3jpf7r17KgEUGDvC3W4+cE+wKAIcDuMZislQgbg0PAHAQgCf4P+7z+BcDuATAORaLVAxlYCoDD/QfRpzUnPvrrf7PmQDMvhneAohOTxnoNgMC0u3RamMWGRAQiywqRrcZEJBuj1Ybs8iAgFhkUTG6zYCAdHu02phFBgTEIouK0W0GBKTbo9XGLDIgIBZZVIxuMyAg3R6tNmaRAQGxyKJidJsBAen2aLUxiwwIiEUWFaPbDAhIt0erjVlkQEAssqgY3WZAQLo9Wm3MIgP/B7mSJva6gFwqAAAAAElFTkSuQmCC" alt="" />
22
- <div class="style-title">文字</div>
23
- <div class="style-list">
24
- <div class="node-left zIndex2">
25
- <span>字号</span>
26
- <Select :options="optionSize" v-model:value="sizeValue"></Select>
27
- </div>
28
- <div class="node-left padd zIndex2">
29
- <span>行高</span>
30
- <Select :options="optionRow" v-model:value="rowValue"></Select>
31
- </div>
32
- </div>
33
- <div class="node-but">
34
- <button @click="colorTap($event,'color')">颜色</button>
35
- <button :style="{'background-color': (boldAct)? '#549688': '#fff','color': (boldAct)? '#fff': '#333'}"
36
- @click="bolds">粗体
37
- </button>
38
- <button :style="{'background-color': (italicAct)? '#549688': '#fff','color': (italicAct)? '#fff': '#333'}"
39
- @click="italics">斜体
40
- </button>
41
- <button :style="{'background-color': (scribeAct)? '#549688': '#fff','color': (scribeAct)? '#fff': '#333'}"
42
- @click="scribes">划线
43
- </button>
44
- </div>
45
- </div>
46
- <div class="style-li">
47
- <div class="style-title">边框</div>
48
- <div class="style-list">
49
- <div class="node-left">
50
- <span>颜色</span>
51
- <div @click="colorTap($event,'borderColor')" class="backColor"></div>
52
- </div>
53
- <div class="node-left padd zIndex3">
54
- <span>样式</span>
55
- <Select :options="optionLine" v-model:value="styleValue"></Select>
56
- </div>
57
- </div>
58
- <div class="style-list">
59
- <div class="node-left zIndex3">
60
- <span>宽度</span>
61
- <Select :options="optionWidth" v-model:value="widthValue"></Select>
62
- </div>
63
- <div class="node-left padd zIndex4">
64
- <span>圆角</span>
65
- <Select :options="optionWidth" v-model:value="filletValue"></Select>
66
- </div>
67
- </div>
68
- </div>
69
- <div class="style-li">
70
- <div class="style-title">背景</div>
71
- <div class="style-list">
72
- <div class="node-left">
73
- <span>颜色</span>
74
- <div @click="colorTap($event,'fillColor')" class="backColor"></div>
75
- </div>
76
- </div>
77
- </div>
78
- <div class="style-li">
79
- <div class="style-title">线条</div>
80
- <div class="style-list">
81
- <div class="node-left zIndex">
82
- <span>宽度</span>
83
- <Select :options="optionWidth" v-model:value="lineValue"></Select>
84
- </div>
85
- <div class="node-left padd zIndex">
86
- <span>样式</span>
87
- <Select :options="optionLine" v-model:value="lineStyleValue"></Select>
88
- </div>
89
- </div>
90
- <div class="style-list">
91
- <div class="node-left">
92
- <span>颜色</span>
93
- <div @click="colorTap($event,'lineColor')" class="backColor"></div>
94
- </div>
95
- </div>
96
- </div>
97
- <div class="style-li">
98
- <div class="style-title">形状</div>
99
- <div class="style-list">
100
- <div class="node-left">
101
- <span>形状</span>
102
- <Select :options="optionShape" v-model:value="shapeValue"></Select>
103
- </div>
104
- </div>
105
- </div>
106
- <div class="back-col" :style="{top: top + 'px'}" v-if="colorShow">
107
- <Coloring @submit="submit" @empty="empty" @rgba="rgba" :color="color"></Coloring>
108
- </div>
98
+ </div>
99
+ <div class="style-li">
100
+ <div class="style-title">形状</div>
101
+ <div class="style-list">
102
+ <div class="node-left">
103
+ <span>形状</span>
104
+ <Select :options="optionShape" v-model:value="shapeValue"></Select>
105
+ </div>
109
106
  </div>
107
+ </div>
108
+ <div class="back-col" :style="{top: top + 'px'}" v-if="colorShow">
109
+ <Coloring @submit="submit" @empty="empty" @rgba="rgba" :color="color"></Coloring>
110
+ </div>
110
111
  </div>
112
+ </div>
111
113
  </template>
112
114
 
113
115
  <script>
@@ -116,385 +118,405 @@ import Coloring from '../../coloring/src/coloring.vue'
116
118
  import MindMap from "simple-mind-map";
117
119
  import TouchEvent from 'simple-mind-map/src/plugins/TouchEvent.js'
118
120
  import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
121
+ import Export from 'simple-mind-map/src/plugins/Export.js'
122
+
119
123
  MindMap.usePlugin(AssociativeLine)
120
124
  MindMap.usePlugin(TouchEvent)
125
+ MindMap.usePlugin(Export)
121
126
 
122
127
  export default {
123
- components: {Select, Coloring},
124
- name: "zydx-mind",
125
- data() {
126
- return {
127
- id: null,
128
- mindMap: null,
129
- mindShow: false,
130
- retShow: false,
131
- forwardShow: false,
132
- optionSize: [
133
- {label: "12", value: '12'},
134
- {label: "14", value: '14'},
135
- {label: "16", value: '16'},
136
- {label: "18", value: '18'},
137
- {label: "20", value: '20'},
138
- {label: "24", value: '24'},
139
- {label: "26", value: '26'},
140
- {label: "28", value: '28'},
141
- {label: "30", value: '30'}
142
- ],
143
- sizeValue: '18',
144
- optionRow: [
145
- {label: "1", value: '1'},
146
- {label: "1.5", value: '1.5'},
147
- {label: "2", value: '2'},
148
- {label: "2.5", value: '2.5'},
149
- {label: "3", value: '3'}
150
- ],
151
- rowValue: '1.5',
152
- optionWidth: [
153
- {label: "0", value: 0},
154
- {label: "1", value: 1},
155
- {label: "2", value: 2},
156
- {label: "3", value: 3},
157
- {label: "4", value: 4},
158
- {label: "5", value: 5},
159
- {label: "6", value: 6},
160
- {label: "7", value: 7},
161
- {label: "8", value: 8},
162
- {label: "9", value: 9},
163
- {label: "10", value: 10},
164
- ],
165
- widthValue: 1,
166
- filletValue: '5',
167
- lineValue: '1',
168
- optionLine: [
169
- {label: "实线", value: 'none'},
170
- {label: "虚线", value: '5,5'},
171
- {label: "点线", value: '1,5'}
172
- ],
173
- lineStyleValue: 'none',
174
- styleValue: 'none',
175
- optionShape: [
176
- {label: "矩形", value: 'rectangle'},
177
- {label: "菱形", value: 'diamond'},
178
- {label: "平行四边形", value: 'parallelogram'},
179
- {label: "圆角矩形", value: 'roundedRectangle'},
180
- {label: "八角形", value: 'octagonalRectangle'},
181
- {label: "外三角矩形", value: 'outerTriangularRectangle'},
182
- {label: "内三角矩形", value: 'innerTriangularRectangle'},
183
- {label: "椭圆", value: 'ellipse'},
184
- {label: "圆", value: 'circle'},
185
- ],
186
- shapeValue: 'rectangle',
187
- trans: false,
188
- colorShow: false,
189
- top: 0,
190
- colorData: {},
191
- activeNodes: null,
192
- color: 'rgba(84,150,136,1)',
193
- boldAct: false,
194
- italicAct: false,
195
- scribeAct: false,
196
- defaultData: {
197
- "data": {
198
- "text": "根节点"
199
- },
200
- "children": []
201
- },
202
- fullShow: true,
203
- layoutList: '',
204
- updateInit: false,
128
+ components: {Select, Coloring},
129
+ name: "zydx-mind",
130
+ data() {
131
+ return {
132
+ id: null,
133
+ mindMap: null,
134
+ mindShow: false,
135
+ retShow: false,
136
+ forwardShow: false,
137
+ optionSize: [
138
+ {label: "12", value: '12'},
139
+ {label: "14", value: '14'},
140
+ {label: "16", value: '16'},
141
+ {label: "18", value: '18'},
142
+ {label: "20", value: '20'},
143
+ {label: "24", value: '24'},
144
+ {label: "26", value: '26'},
145
+ {label: "28", value: '28'},
146
+ {label: "30", value: '30'}
147
+ ],
148
+ sizeValue: '18',
149
+ optionRow: [
150
+ {label: "1", value: '1'},
151
+ {label: "1.5", value: '1.5'},
152
+ {label: "2", value: '2'},
153
+ {label: "2.5", value: '2.5'},
154
+ {label: "3", value: '3'}
155
+ ],
156
+ rowValue: '1.5',
157
+ optionWidth: [
158
+ {label: "0", value: 0},
159
+ {label: "1", value: 1},
160
+ {label: "2", value: 2},
161
+ {label: "3", value: 3},
162
+ {label: "4", value: 4},
163
+ {label: "5", value: 5},
164
+ {label: "6", value: 6},
165
+ {label: "7", value: 7},
166
+ {label: "8", value: 8},
167
+ {label: "9", value: 9},
168
+ {label: "10", value: 10},
169
+ ],
170
+ widthValue: 1,
171
+ filletValue: '5',
172
+ lineValue: '1',
173
+ optionLine: [
174
+ {label: "实线", value: 'none'},
175
+ {label: "虚线", value: '5,5'},
176
+ {label: "点线", value: '1,5'}
177
+ ],
178
+ lineStyleValue: 'none',
179
+ styleValue: 'none',
180
+ optionShape: [
181
+ {label: "矩形", value: 'rectangle'},
182
+ {label: "菱形", value: 'diamond'},
183
+ {label: "平行四边形", value: 'parallelogram'},
184
+ {label: "圆角矩形", value: 'roundedRectangle'},
185
+ {label: "八角形", value: 'octagonalRectangle'},
186
+ {label: "外三角矩形", value: 'outerTriangularRectangle'},
187
+ {label: "内三角矩形", value: 'innerTriangularRectangle'},
188
+ {label: "椭圆", value: 'ellipse'},
189
+ {label: "圆", value: 'circle'},
190
+ ],
191
+ shapeValue: 'rectangle',
192
+ trans: false,
193
+ colorShow: false,
194
+ top: 0,
195
+ colorData: {},
196
+ activeNodes: null,
197
+ color: 'rgba(84,150,136,1)',
198
+ boldAct: false,
199
+ italicAct: false,
200
+ scribeAct: false,
201
+ defaultData: {
202
+ "data": {
203
+ "text": "根节点"
204
+ },
205
+ "children": []
206
+ },
207
+ fullShow: true,
208
+ layoutList: '',
209
+ updateInit: false,
210
+ }
211
+ },
212
+ props: {
213
+ data: { // 数据
214
+ type: Object,
215
+ default: {
216
+ "data": {
217
+ "text": "根节点"
218
+ },
219
+ "children": []
220
+ }
221
+ },
222
+ readOnly: { // 只读
223
+ type: Boolean,
224
+ default: false
225
+ },
226
+ protectShow: {
227
+ type: Boolean,
228
+ default: true
229
+ },
230
+ updateStatus: {
231
+ type: Boolean,
232
+ default: false
233
+ }
234
+ },
235
+ beforeUnmount() {
236
+ this.mindMap.destroy()
237
+ this.mindMap = null
238
+ },
239
+ watch: {
240
+ readOnly: {
241
+ handler: function (val, oldVal) {
242
+ this.mindMap?.setMode(val ? 'readonly' : 'edit')
243
+ },
244
+ deep: true,
245
+ immediate: true
246
+ },
247
+ data: {
248
+ handler: function (val) {
249
+ if (this.updateInit) return
250
+ if (this.updateStatus) this.updateInit = true
251
+ if (Object.keys(val).length === 0) {
252
+ this.mindMap?.setData(this.defaultData)
253
+ } else {
254
+ this.mindMap?.setData(this.msgFun(val))
255
+ this.mindMap?.setLayout(val.layoutList || 'logicalStructure')
205
256
  }
257
+ },
258
+ immediate: true
206
259
  },
207
- props: {
208
- data: { // 数据
209
- type: Object,
210
- default: {
211
- "data": {
212
- "text": "根节点"
213
- },
214
- "children": []
215
- }
216
- },
217
- readOnly: { // 只读
218
- type: Boolean,
219
- default: false
220
- },
221
- protectShow: {
222
- type: Boolean,
223
- default: true
224
- },
225
- updateStatus: {
226
- type: Boolean,
227
- default: false
260
+ sizeValue(e) { // 字号
261
+ this.activeNodes.forEach(node => {
262
+ node.setStyle('fontSize', e)
263
+ })
264
+ },
265
+ rowValue(e) { // 行高
266
+ this.activeNodes.forEach(node => {
267
+ node.setStyle('lineHeight', e)
268
+ })
269
+ },
270
+ styleValue(e) { // 粗斜体
271
+ this.activeNodes.forEach(node => {
272
+ node.setStyle('borderDasharray', e)
273
+ })
274
+ },
275
+ widthValue(e) { // 线宽
276
+ this.activeNodes.forEach(node => {
277
+ node.setStyle('borderWidth', e)
278
+ })
279
+ },
280
+ filletValue(e) { // 圆角
281
+ this.activeNodes.forEach(node => {
282
+ node.setStyle('borderRadius', e)
283
+ })
284
+ },
285
+ shapeValue(e) { // 形状
286
+ this.activeNodes.forEach(node => {
287
+ node.setStyle('shape', e)
288
+ })
289
+ },
290
+ lineValue(e) { // 线宽
291
+ this.activeNodes.forEach(node => {
292
+ node.setStyle('lineWidth', e)
293
+ })
294
+ },
295
+ lineStyleValue(e) { // 线宽
296
+ this.activeNodes.forEach(node => {
297
+ node.setStyle('lineDasharray', e)
298
+ })
299
+ },
300
+ },
301
+ mounted() {
302
+ this.id = this.randomId()
303
+ setTimeout(() => {
304
+ this.init()
305
+ }, 0)
306
+ window.onresize = () => {
307
+ if (!document.fullscreenElement) {
308
+ this.fullShow = true
228
309
  }
310
+ this.mindMap.resize()
311
+ }
312
+ },
313
+ methods: {
314
+ randomId() {
315
+ const id = Math.random().toString(36).substr(2)
316
+ return id.replace(/[0-9]/g, '')
229
317
  },
230
- watch: {
231
- readOnly: {
232
- handler: function (val, oldVal) {
233
- this.mindMap?.setMode(val ? 'readonly' : 'edit')
234
- },
235
- deep: true,
236
- immediate: true
237
- },
238
- data: {
239
- handler: function (val) {
240
- if(this.updateInit) return
241
- if(this.updateStatus) this.updateInit = true
242
- if(Object.keys(val).length === 0) {
243
- this.mindMap?.setData(this.defaultData)
244
- }else {
245
- this.mindMap?.setData(this.msgFun(val))
246
- this.mindMap?.setLayout(val.layoutList || 'logicalStructure')
247
- }
248
- },
249
- immediate: true
250
- },
251
- sizeValue(e) { // 字号
252
- this.activeNodes.forEach(node => {
253
- node.setStyle('fontSize', e)
254
- })
255
- },
256
- rowValue(e) { // 行高
257
- this.activeNodes.forEach(node => {
258
- node.setStyle('lineHeight', e)
259
- })
260
- },
261
- styleValue(e) { // 粗斜体
262
- this.activeNodes.forEach(node => {
263
- node.setStyle('borderDasharray', e)
264
- })
265
- },
266
- widthValue(e) { // 线宽
267
- this.activeNodes.forEach(node => {
268
- node.setStyle('borderWidth', e)
269
- })
270
- },
271
- filletValue(e) { // 圆角
272
- this.activeNodes.forEach(node => {
273
- node.setStyle('borderRadius', e)
274
- })
275
- },
276
- shapeValue(e) { // 形状
277
- this.activeNodes.forEach(node => {
278
- node.setStyle('shape', e)
279
- })
280
- },
281
- lineValue(e) { // 线宽
282
- this.activeNodes.forEach(node => {
283
- node.setStyle('lineWidth', e)
284
- })
285
- },
286
- lineStyleValue(e) { // 线宽
287
- this.activeNodes.forEach(node => {
288
- node.setStyle('lineDasharray', e)
289
- })
290
- },
318
+ fullScreen(element) {
319
+ if (element.requestFullScreen) {
320
+ element.requestFullScreen()
321
+ } else if (element.webkitRequestFullScreen) {
322
+ element.webkitRequestFullScreen()
323
+ } else if (element.mozRequestFullScreen) {
324
+ element.mozRequestFullScreen()
325
+ }
326
+ },
327
+ cancelFullscreen() {
328
+ if (document.exitFullscreen) {
329
+ document.exitFullscreen();
330
+ } else if (document.msExitFullscreen) {
331
+ document.msExitFullscreen();
332
+ } else if (document.mozCancelFullScreen) {
333
+ document.mozCancelFullScreen();
334
+ } else if (document.webkitExitFullscreen) {
335
+ document.webkitExitFullscreen();
336
+ }
291
337
  },
292
- mounted() {
293
- this.id = this.randomId()
294
- setTimeout(() => {
295
- this.init()
296
- },0)
297
- window.onresize = () => {
298
- if (!document.fullscreenElement) {
299
- this.fullShow = true
300
- }
301
- this.mindMap.resize()
338
+ fullDel() {
339
+ this.fullShow = true
340
+ this.mindMap.view.setTransformData({
341
+ state: {scale: 1, x: 0, y: 0, sx: 0, sy: 0},
342
+ transform: {
343
+ a: 1,
344
+ b: 0,
345
+ c: 0,
346
+ d: 1,
347
+ e: 0,
348
+ f: 0,
349
+ originX: 0,
350
+ originY: 0,
351
+ rotate: 0,
352
+ scaleX: 1,
353
+ scaleY: 1,
354
+ shear: 0,
355
+ translateX: 0,
356
+ translateY: 0
302
357
  }
358
+ })
359
+ this.cancelFullscreen()
303
360
  },
304
- methods: {
305
- randomId() {
306
- const id = Math.random().toString(36).substr(2)
307
- return id.replace(/[0-9]/g, '')
308
- },
309
- fullScreen(element) {
310
- if (element.requestFullScreen) {
311
- element.requestFullScreen()
312
- } else if (element.webkitRequestFullScreen) {
313
- element.webkitRequestFullScreen()
314
- } else if (element.mozRequestFullScreen) {
315
- element.mozRequestFullScreen()
316
- }
317
- },
318
- cancelFullscreen() {
319
- if (document.exitFullscreen) {
320
- document.exitFullscreen();
321
- } else if (document.msExitFullscreen) {
322
- document.msExitFullscreen();
323
- } else if (document.mozCancelFullScreen) {
324
- document.mozCancelFullScreen();
325
- } else if (document.webkitExitFullscreen) {
326
- document.webkitExitFullscreen();
327
- }
328
- },
329
- fullDel() {
330
- this.fullShow = true
331
- this.mindMap.view.setTransformData({
332
- state : {scale: 1, x: 0, y: 0, sx: 0, sy: 0},
333
- transform : {a:1,b:0,c:0,d:1,e:0,f:0,originX:0,originY:0,rotate:0,scaleX:1,scaleY:1,shear:0,translateX:0,translateY:0}
334
- })
335
- this.cancelFullscreen()
336
- },
337
- // 全屏
338
- fullTap() {
339
- this.fullShow = false
340
- this.fullScreen(document.body)
341
- },
342
- msgFun(e) {
343
- if(e.msg) {
344
- return Object.keys(e.msg).length === 0 ? this.defaultData : e.msg
345
- }else {
346
- return Object.keys(e).length === 0 ? this.defaultData : e
347
- }
348
- },
349
- // 初始化
350
- init() {
351
- const that = this
352
- this.mindMap = new MindMap({
353
- el: document.getElementById(that.id),
354
- enableFreeDrag: false, // 是否开启自由拖拽
355
- enableNodeTransitionMove: false, // 是否开启节点过渡动画
356
- layout: that.data.layoutList || 'logicalStructure', // 节点布局方式
357
- maxHistoryCount: 100, // 最大历史记录数
358
- maxNodeCacheCount: 100, // 最大节点缓存数
359
- data: that.msgFun(that.data)
360
- });
361
- this.mindMap.setMode(this.readOnly ? 'readonly' : 'edit')
362
- this.mindMap.on('node_active', (node) => {
363
- this.mindShow = node === null;
364
- })
365
- this.mindMap.on('back_forward', (index, len) => {
366
- this.retShow = index <= 0;
367
- this.forwardShow = index >= len - 1
368
- })
369
- this.mindMap.on('node_active', (node, activeNodeList) => {
370
- console.log('activeNodeList',activeNodeList)
371
- this.activeNodes = activeNodeList
372
- })
373
- this.mindMap.on('data_change', (data) => {
374
- this.$emit('dataChange', {
375
- data: data,
376
- url: ''
377
- })
378
- })
379
- },
380
- scribes() {
381
- this.scribeAct = !this.scribeAct
382
- this.activeNodes.forEach(node => {
383
- node.setStyle('textDecoration', (!this.scribeAct) ? 'none' : 'underline')
384
- })
385
- },
386
- italics() {
387
- this.italicAct = !this.italicAct
388
- this.activeNodes.forEach(node => {
389
- node.setStyle('fontStyle', (!this.italicAct) ? 'normal' : 'italic')
390
- })
391
- },
392
- bolds() {
393
- this.boldAct = !this.boldAct
394
- this.activeNodes.forEach(node => {
395
- node.setStyle('fontWeight', (!this.boldAct) ? 'normal' : 'bold')
396
- })
397
- },
398
- rgba(e) {
399
- this.colorData.data.target.style.backgroundColor = e.rgba
400
- },
401
- submit(e) {
402
- this.activeNodes.forEach(node => {
403
- node.setStyle(this.colorData.index, e.rgba)
404
- })
405
- this.colorData.data.target.style.backgroundColor = e.rgba
406
- this.colorShow = false
407
- },
408
- empty() {
409
- this.colorShow = false
410
- },
411
- colorTap(e, i) {
412
- this.colorData = {index: i, data: e}
413
- let parent = this.colorData.data.target.parentNode.offsetTop + 32
414
- if (parent > 330) parent = 300
415
- this.colorShow = !this.colorShow
416
- this.top = parent
417
- },
418
- structure() {
419
- this.layoutList = 'logicalStructure'
420
- const layout = this.mindMap.getLayout()
421
- if (layout === 'mindMap') {
422
- this.layoutList = 'organizationStructure'
423
- } else if (layout === 'organizationStructure') {
424
- this.layoutList = 'logicalStructure'
425
- } else {
426
- this.layoutList = 'mindMap'
427
- }
428
- this.mindMap.setLayout(this.layoutList)
429
- },
430
- // 保存
431
- preservation() {
432
- let that = this
433
- that.$emit('preservation', {
434
- data: {
435
- msg: that.mindMap.getData(),
436
- layoutList: this.layoutList
437
- },
438
- url: ''
439
- })
440
- // that.mindMap.doExport.png().then((data) => {
441
- // that.$emit('preservation', {
442
- // data: that.mindMap.getData(),
443
- // url: data
444
- // })
445
- // })
446
- },
447
- getContent() {
448
- let that = this
449
- return new Promise((rl,rs) => {
450
- rl({
451
- data: that.mindMap.getData(),
452
- url: ''
453
- })
454
- // that.mindMap.export('png', false, '123213', true).then(r => {
455
- // rl({
456
- // data: that.mindMap.getData(),
457
- // url: r
458
- // })
459
- // })
460
- })
461
- },
462
- nodeStyle() {
463
- this.$refs[`${this.id}e`].style.display = 'block'
464
- this.$refs[this.id].style.overflow = 'hidden'
465
- this.trans = !this.trans
466
- setTimeout(() => {
467
- this.$refs[this.id].style.overflow = 'visible'
468
- if (!this.trans) {
469
- this.$refs[`${this.id}e`].style.display = 'none'
470
- }
471
- }, 250)
472
- },
473
- // 关联线
474
- associativeLine() {
475
- this.mindMap.associativeLine.createLineFromActiveNode()
476
- },
477
- // 前进
478
- forward() {
479
- this.mindMap.execCommand('FORWARD')
480
- },
481
- // 返回
482
- ret() {
483
- this.mindMap.execCommand('BACK')
484
- },
485
- // 添加节点
486
- addNode() {
487
- this.mindMap.execCommand('INSERT_CHILD_NODE')
488
- },
489
- // 删除节点
490
- delNode() {
491
- this.mindMap.execCommand('REMOVE_NODE')
492
- },
493
- // 兄弟节点
494
- brotherNode() {
495
- this.mindMap.execCommand('INSERT_NODE')
361
+ // 全屏
362
+ fullTap() {
363
+ this.fullShow = false
364
+ this.fullScreen(document.body)
365
+ },
366
+ msgFun(e) {
367
+ if (e.msg) {
368
+ return Object.keys(e.msg).length === 0 ? this.defaultData : e.msg
369
+ } else {
370
+ return Object.keys(e).length === 0 ? this.defaultData : e
371
+ }
372
+ },
373
+ // 初始化
374
+ init() {
375
+ const that = this
376
+ this.mindMap = new MindMap({
377
+ el: document.getElementById(that.id),
378
+ enableFreeDrag: false, // 是否开启自由拖拽
379
+ enableNodeTransitionMove: false, // 是否开启节点过渡动画
380
+ layout: that.data.layoutList || 'logicalStructure', // 节点布局方式
381
+ maxHistoryCount: 100, // 最大历史记录数
382
+ maxNodeCacheCount: 100, // 最大节点缓存数
383
+ data: that.msgFun(that.data)
384
+ });
385
+ this.mindMap.setMode(this.readOnly ? 'readonly' : 'edit')
386
+ this.mindMap.on('node_active', (node) => {
387
+ this.mindShow = node === null;
388
+ })
389
+ this.mindMap.on('back_forward', (index, len) => {
390
+ this.retShow = index <= 0;
391
+ this.forwardShow = index >= len - 1
392
+ })
393
+ this.mindMap.on('node_active', (node, activeNodeList) => {
394
+ console.log('activeNodeList', activeNodeList)
395
+ this.activeNodes = activeNodeList
396
+ })
397
+ this.mindMap.on('data_change', (data) => {
398
+ this.$emit('dataChange', {
399
+ data: data,
400
+ url: ''
401
+ })
402
+ })
403
+ },
404
+ scribes() {
405
+ this.scribeAct = !this.scribeAct
406
+ this.activeNodes.forEach(node => {
407
+ node.setStyle('textDecoration', (!this.scribeAct) ? 'none' : 'underline')
408
+ })
409
+ },
410
+ italics() {
411
+ this.italicAct = !this.italicAct
412
+ this.activeNodes.forEach(node => {
413
+ node.setStyle('fontStyle', (!this.italicAct) ? 'normal' : 'italic')
414
+ })
415
+ },
416
+ bolds() {
417
+ this.boldAct = !this.boldAct
418
+ this.activeNodes.forEach(node => {
419
+ node.setStyle('fontWeight', (!this.boldAct) ? 'normal' : 'bold')
420
+ })
421
+ },
422
+ rgba(e) {
423
+ this.colorData.data.target.style.backgroundColor = e.rgba
424
+ },
425
+ submit(e) {
426
+ this.activeNodes.forEach(node => {
427
+ node.setStyle(this.colorData.index, e.rgba)
428
+ })
429
+ this.colorData.data.target.style.backgroundColor = e.rgba
430
+ this.colorShow = false
431
+ },
432
+ empty() {
433
+ this.colorShow = false
434
+ },
435
+ colorTap(e, i) {
436
+ this.colorData = {index: i, data: e}
437
+ let parent = this.colorData.data.target.parentNode.offsetTop + 32
438
+ if (parent > 330) parent = 300
439
+ this.colorShow = !this.colorShow
440
+ this.top = parent
441
+ },
442
+ structure() {
443
+ this.layoutList = 'logicalStructure'
444
+ const layout = this.mindMap.getLayout()
445
+ if (layout === 'mindMap') {
446
+ this.layoutList = 'organizationStructure'
447
+ } else if (layout === 'organizationStructure') {
448
+ this.layoutList = 'logicalStructure'
449
+ } else {
450
+ this.layoutList = 'mindMap'
451
+ }
452
+ this.mindMap.setLayout(this.layoutList)
453
+ },
454
+ // 保存
455
+ preservation() {
456
+ let that = this
457
+ that.$emit('preservation', {
458
+ data: {
459
+ msg: that.mindMap.getData(),
460
+ layoutList: this.layoutList
461
+ },
462
+ url: ''
463
+ })
464
+ // that.mindMap.doExport.png().then((data) => {
465
+ // that.$emit('preservation', {
466
+ // data: that.mindMap.getData(),
467
+ // url: data
468
+ // })
469
+ // })
470
+ },
471
+ getContent() {
472
+ let that = this
473
+ return new Promise((rl, rs) => {
474
+ rl({
475
+ data: that.mindMap.getData(),
476
+ url: ''
477
+ })
478
+ })
479
+ },
480
+ getImage(v) {
481
+ const name = v? v : 'mind'
482
+ this.mindMap.export('png', true, name, true, false, null, true)
483
+ },
484
+ nodeStyle() {
485
+ this.$refs[`${this.id}e`].style.display = 'block'
486
+ this.$refs[this.id].style.overflow = 'hidden'
487
+ this.trans = !this.trans
488
+ setTimeout(() => {
489
+ this.$refs[this.id].style.overflow = 'visible'
490
+ if (!this.trans) {
491
+ this.$refs[`${this.id}e`].style.display = 'none'
496
492
  }
493
+ }, 250)
494
+ },
495
+ // 关联线
496
+ associativeLine() {
497
+ this.mindMap.associativeLine.createLineFromActiveNode()
498
+ },
499
+ // 前进
500
+ forward() {
501
+ this.mindMap.execCommand('FORWARD')
502
+ },
503
+ // 返回
504
+ ret() {
505
+ this.mindMap.execCommand('BACK')
506
+ },
507
+ // 添加节点
508
+ addNode() {
509
+ this.mindMap.execCommand('INSERT_CHILD_NODE')
510
+ },
511
+ // 删除节点
512
+ delNode() {
513
+ this.mindMap.execCommand('REMOVE_NODE')
514
+ },
515
+ // 兄弟节点
516
+ brotherNode() {
517
+ this.mindMap.execCommand('INSERT_NODE')
497
518
  }
519
+ }
498
520
  }
499
521
  </script>
500
522
 
@@ -502,197 +524,202 @@ export default {
502
524
  :deep(.custom-select-options li) {
503
525
  padding: 0 10px !important;
504
526
  }
527
+
505
528
  .table-left {
506
- margin-right: 5px;
507
- display: flex;
508
- width: 100%;
529
+ margin-right: 5px;
530
+ display: flex;
531
+ width: 100%;
509
532
  }
510
533
 
511
534
  .node-s {
512
- animation: nodeShow 0.3s;
513
- display: block;
535
+ animation: nodeShow 0.3s;
536
+ display: block;
514
537
  }
515
538
 
516
539
  .node-h {
517
- animation: nodeHide 0.3s;
540
+ animation: nodeHide 0.3s;
518
541
  }
519
542
 
520
543
  @keyframes nodeHide {
521
- 0% {
522
- opacity: 1;
523
- transform: translateX(0);
524
- }
525
- 100% {
526
- opacity: 0;
527
- transform: translateX(110%);
528
- }
544
+ 0% {
545
+ opacity: 1;
546
+ transform: translateX(0);
547
+ }
548
+ 100% {
549
+ opacity: 0;
550
+ transform: translateX(110%);
551
+ }
529
552
  }
530
553
 
531
554
  @keyframes nodeShow {
532
- 0% {
533
- opacity: 0;
534
- transform: translateX(110%);
535
- }
536
- 10% {
537
- opacity: 1;
538
- transform: translateX(100%);
539
- }
540
- 100% {
541
- opacity: 1;
542
- transform: translateX(0);
543
- }
555
+ 0% {
556
+ opacity: 0;
557
+ transform: translateX(110%);
558
+ }
559
+ 10% {
560
+ opacity: 1;
561
+ transform: translateX(100%);
562
+ }
563
+ 100% {
564
+ opacity: 1;
565
+ transform: translateX(0);
566
+ }
544
567
  }
545
568
 
546
569
  .zIndex {
547
- position: relative;
548
- z-index: 30;
570
+ position: relative;
571
+ z-index: 30;
549
572
  }
550
573
 
551
574
  .zIndex2 {
552
- position: relative;
553
- z-index: 33;
575
+ position: relative;
576
+ z-index: 33;
554
577
  }
555
578
 
556
579
  .zIndex3 {
557
- position: relative;
558
- z-index: 32;
580
+ position: relative;
581
+ z-index: 32;
559
582
  }
560
583
 
561
584
  .zIndex4 {
562
- position: relative;
563
- z-index: 31;
585
+ position: relative;
586
+ z-index: 31;
564
587
  }
565
588
 
566
589
  .backColor {
567
- width: 93px;
568
- height: 30px;
569
- border: 1px solid #ccc;
570
- border-radius: 3px;
571
- margin-left: -40px;
572
- box-shadow: 0 1px 0 1px rgb(0 0 0 / 4%);
573
- cursor: pointer;
574
- background-color: #549688;
590
+ width: 93px;
591
+ height: 30px;
592
+ border: 1px solid #ccc;
593
+ border-radius: 3px;
594
+ margin-left: -40px;
595
+ box-shadow: 0 1px 0 1px rgb(0 0 0 / 4%);
596
+ cursor: pointer;
597
+ background-color: #549688;
575
598
  }
576
599
 
577
600
  .back-col {
578
- position: absolute;
579
- top: 0;
580
- left: 60px;
581
- z-index: 40;
601
+ position: absolute;
602
+ top: 0;
603
+ left: 60px;
604
+ z-index: 40;
582
605
  }
583
606
 
584
607
  .node-but {
585
- display: flex;
586
- padding: 5px 0;
608
+ display: flex;
609
+ padding: 5px 0;
587
610
  }
588
611
 
589
612
  .node-but button {
590
- flex: 1;
591
- margin-right: 5px;
592
- background-color: #fff;
593
- border: 1px solid #ccc;
594
- border-radius: 3px;
595
- padding: 5px 10px;
596
- cursor: pointer;
597
- font-size: 12px;
613
+ flex: 1;
614
+ margin-right: 5px;
615
+ background-color: #fff;
616
+ border: 1px solid #ccc;
617
+ border-radius: 3px;
618
+ padding: 5px 10px;
619
+ cursor: pointer;
620
+ font-size: 12px;
598
621
  }
599
622
 
600
623
  .node-but button:last-child {
601
- margin: 0;
624
+ margin: 0;
602
625
  }
603
626
 
604
627
  .style-title {
605
- font-size: 16px;
606
- font-weight: bold;
607
- padding: 5px 0 10px 0;
628
+ font-size: 16px;
629
+ font-weight: bold;
630
+ padding: 5px 0 10px 0;
608
631
  }
609
632
 
610
633
  .mind {
611
- width: 100%;
612
- height: 100%;
613
- position: relative;
634
+ width: 100%;
635
+ height: 100%;
636
+ position: relative;
614
637
  }
615
638
 
616
- .table {
617
- background-color: #fff;
618
- border-radius: 5px;
619
- box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
620
- z-index: 10;
639
+ .mind-table {
640
+ background-color: #fff;
641
+ border-radius: 5px;
642
+ box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
643
+ z-index: 10;
621
644
  }
622
- .style-li{
623
- position: relative;
645
+
646
+ .style-li {
647
+ position: relative;
624
648
  }
625
- .style-li img{
626
- position: absolute;
627
- top: 0;
628
- right: 0;
629
- z-index: 1;
630
- width: 15px;
631
- height: 15px;
632
- cursor: pointer;
649
+
650
+ .style-li img {
651
+ position: absolute;
652
+ top: 0;
653
+ right: 0;
654
+ z-index: 1;
655
+ width: 15px;
656
+ height: 15px;
657
+ cursor: pointer;
633
658
  }
659
+
634
660
  .style-list {
635
- display: flex;
636
- padding: 5px 0;
661
+ display: flex;
662
+ padding: 5px 0;
637
663
  }
638
664
 
639
665
  .node-left {
640
- display: flex;
641
- padding-right: 10px;
666
+ display: flex;
667
+ padding-right: 10px;
642
668
  }
643
669
 
644
670
  .node-left > span {
645
- display: inline-block;
646
- width: 80px;
647
- line-height: 32px;
648
- padding-right: 10px;
649
- box-sizing: border-box;
671
+ display: inline-block;
672
+ width: 80px;
673
+ line-height: 32px;
674
+ padding-right: 10px;
675
+ box-sizing: border-box;
650
676
  }
651
677
 
652
678
  .padd {
653
- padding-right: 0;
679
+ padding-right: 0;
654
680
  }
655
681
 
656
682
  .node-style {
657
- position: absolute;
658
- right: 0;
659
- top: 50%;
660
- background-color: #fff;
661
- border-bottom-left-radius: 5px;
662
- border-top-left-radius: 5px;
663
- padding: 20px;
664
- box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
665
- z-index: 11;
666
- width: 320px;
667
- height: 550px;
668
- margin-top: -270px;
669
- display: none;
683
+ position: absolute;
684
+ right: 0;
685
+ top: 50%;
686
+ background-color: #fff;
687
+ border-bottom-left-radius: 5px;
688
+ border-top-left-radius: 5px;
689
+ padding: 20px;
690
+ box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
691
+ z-index: 11;
692
+ width: 320px;
693
+ height: 550px;
694
+ margin-top: -270px;
695
+ display: none;
670
696
  }
671
697
 
672
- .table button {
673
- background-color: #fff;
674
- border: 1px solid #ccc;
675
- cursor: pointer;
676
- font-size: 14px;
677
- height: 30px;
678
- line-height: 30px;
679
- flex: 1;
698
+ .mind-table button {
699
+ background-color: #fff;
700
+ border: 1px solid #ccc;
701
+ cursor: pointer;
702
+ font-size: 14px;
703
+ height: 30px;
704
+ line-height: 30px;
705
+ flex: 1;
680
706
  }
681
707
 
682
- .table button:last-child {
683
- margin-right: 0;
708
+ .mind-table button:last-child {
709
+ margin-right: 0;
684
710
  }
685
711
 
686
712
  .mindMapContainer {
687
- width: 100%;
688
- height: 100%;
713
+ width: 100%;
714
+ height: 100%;
689
715
  }
690
- :deep(.custom-select){
716
+
717
+ :deep(.custom-select) {
691
718
  width: 94px;
692
719
  margin-left: -40px;
693
720
  }
694
721
 
695
- .full-screen{
722
+ .full-screen {
696
723
  background: #fff;
697
724
  width: 100vw;
698
725
  height: 100vh;