zydx-plus 1.35.597 → 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,389 +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
- beforeUnmount() {
231
- this.mindMap.destroy()
232
- this.mindMap = null
233
- },
234
- watch: {
235
- readOnly: {
236
- handler: function (val, oldVal) {
237
- this.mindMap?.setMode(val ? 'readonly' : 'edit')
238
- },
239
- deep: true,
240
- immediate: true
241
- },
242
- data: {
243
- handler: function (val) {
244
- if(this.updateInit) return
245
- if(this.updateStatus) this.updateInit = true
246
- if(Object.keys(val).length === 0) {
247
- this.mindMap?.setData(this.defaultData)
248
- }else {
249
- this.mindMap?.setData(this.msgFun(val))
250
- this.mindMap?.setLayout(val.layoutList || 'logicalStructure')
251
- }
252
- },
253
- immediate: true
254
- },
255
- sizeValue(e) { // 字号
256
- this.activeNodes.forEach(node => {
257
- node.setStyle('fontSize', e)
258
- })
259
- },
260
- rowValue(e) { // 行高
261
- this.activeNodes.forEach(node => {
262
- node.setStyle('lineHeight', e)
263
- })
264
- },
265
- styleValue(e) { // 粗斜体
266
- this.activeNodes.forEach(node => {
267
- node.setStyle('borderDasharray', e)
268
- })
269
- },
270
- widthValue(e) { // 线宽
271
- this.activeNodes.forEach(node => {
272
- node.setStyle('borderWidth', e)
273
- })
274
- },
275
- filletValue(e) { // 圆角
276
- this.activeNodes.forEach(node => {
277
- node.setStyle('borderRadius', e)
278
- })
279
- },
280
- shapeValue(e) { // 形状
281
- this.activeNodes.forEach(node => {
282
- node.setStyle('shape', e)
283
- })
284
- },
285
- lineValue(e) { // 线宽
286
- this.activeNodes.forEach(node => {
287
- node.setStyle('lineWidth', e)
288
- })
289
- },
290
- lineStyleValue(e) { // 线宽
291
- this.activeNodes.forEach(node => {
292
- node.setStyle('lineDasharray', e)
293
- })
294
- },
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
+ }
295
337
  },
296
- mounted() {
297
- this.id = this.randomId()
298
- setTimeout(() => {
299
- this.init()
300
- },0)
301
- window.onresize = () => {
302
- if (!document.fullscreenElement) {
303
- this.fullShow = true
304
- }
305
- 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
306
357
  }
358
+ })
359
+ this.cancelFullscreen()
307
360
  },
308
- methods: {
309
- randomId() {
310
- const id = Math.random().toString(36).substr(2)
311
- return id.replace(/[0-9]/g, '')
312
- },
313
- fullScreen(element) {
314
- if (element.requestFullScreen) {
315
- element.requestFullScreen()
316
- } else if (element.webkitRequestFullScreen) {
317
- element.webkitRequestFullScreen()
318
- } else if (element.mozRequestFullScreen) {
319
- element.mozRequestFullScreen()
320
- }
321
- },
322
- cancelFullscreen() {
323
- if (document.exitFullscreen) {
324
- document.exitFullscreen();
325
- } else if (document.msExitFullscreen) {
326
- document.msExitFullscreen();
327
- } else if (document.mozCancelFullScreen) {
328
- document.mozCancelFullScreen();
329
- } else if (document.webkitExitFullscreen) {
330
- document.webkitExitFullscreen();
331
- }
332
- },
333
- fullDel() {
334
- this.fullShow = true
335
- this.mindMap.view.setTransformData({
336
- state : {scale: 1, x: 0, y: 0, sx: 0, sy: 0},
337
- 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}
338
- })
339
- this.cancelFullscreen()
340
- },
341
- // 全屏
342
- fullTap() {
343
- this.fullShow = false
344
- this.fullScreen(document.body)
345
- },
346
- msgFun(e) {
347
- if(e.msg) {
348
- return Object.keys(e.msg).length === 0 ? this.defaultData : e.msg
349
- }else {
350
- return Object.keys(e).length === 0 ? this.defaultData : e
351
- }
352
- },
353
- // 初始化
354
- init() {
355
- const that = this
356
- this.mindMap = new MindMap({
357
- el: document.getElementById(that.id),
358
- enableFreeDrag: false, // 是否开启自由拖拽
359
- enableNodeTransitionMove: false, // 是否开启节点过渡动画
360
- layout: that.data.layoutList || 'logicalStructure', // 节点布局方式
361
- maxHistoryCount: 100, // 最大历史记录数
362
- maxNodeCacheCount: 100, // 最大节点缓存数
363
- data: that.msgFun(that.data)
364
- });
365
- this.mindMap.setMode(this.readOnly ? 'readonly' : 'edit')
366
- this.mindMap.on('node_active', (node) => {
367
- this.mindShow = node === null;
368
- })
369
- this.mindMap.on('back_forward', (index, len) => {
370
- this.retShow = index <= 0;
371
- this.forwardShow = index >= len - 1
372
- })
373
- this.mindMap.on('node_active', (node, activeNodeList) => {
374
- console.log('activeNodeList',activeNodeList)
375
- this.activeNodes = activeNodeList
376
- })
377
- this.mindMap.on('data_change', (data) => {
378
- this.$emit('dataChange', {
379
- data: data,
380
- url: ''
381
- })
382
- })
383
- },
384
- scribes() {
385
- this.scribeAct = !this.scribeAct
386
- this.activeNodes.forEach(node => {
387
- node.setStyle('textDecoration', (!this.scribeAct) ? 'none' : 'underline')
388
- })
389
- },
390
- italics() {
391
- this.italicAct = !this.italicAct
392
- this.activeNodes.forEach(node => {
393
- node.setStyle('fontStyle', (!this.italicAct) ? 'normal' : 'italic')
394
- })
395
- },
396
- bolds() {
397
- this.boldAct = !this.boldAct
398
- this.activeNodes.forEach(node => {
399
- node.setStyle('fontWeight', (!this.boldAct) ? 'normal' : 'bold')
400
- })
401
- },
402
- rgba(e) {
403
- this.colorData.data.target.style.backgroundColor = e.rgba
404
- },
405
- submit(e) {
406
- this.activeNodes.forEach(node => {
407
- node.setStyle(this.colorData.index, e.rgba)
408
- })
409
- this.colorData.data.target.style.backgroundColor = e.rgba
410
- this.colorShow = false
411
- },
412
- empty() {
413
- this.colorShow = false
414
- },
415
- colorTap(e, i) {
416
- this.colorData = {index: i, data: e}
417
- let parent = this.colorData.data.target.parentNode.offsetTop + 32
418
- if (parent > 330) parent = 300
419
- this.colorShow = !this.colorShow
420
- this.top = parent
421
- },
422
- structure() {
423
- this.layoutList = 'logicalStructure'
424
- const layout = this.mindMap.getLayout()
425
- if (layout === 'mindMap') {
426
- this.layoutList = 'organizationStructure'
427
- } else if (layout === 'organizationStructure') {
428
- this.layoutList = 'logicalStructure'
429
- } else {
430
- this.layoutList = 'mindMap'
431
- }
432
- this.mindMap.setLayout(this.layoutList)
433
- },
434
- // 保存
435
- preservation() {
436
- let that = this
437
- that.$emit('preservation', {
438
- data: {
439
- msg: that.mindMap.getData(),
440
- layoutList: this.layoutList
441
- },
442
- url: ''
443
- })
444
- // that.mindMap.doExport.png().then((data) => {
445
- // that.$emit('preservation', {
446
- // data: that.mindMap.getData(),
447
- // url: data
448
- // })
449
- // })
450
- },
451
- getContent() {
452
- let that = this
453
- return new Promise((rl,rs) => {
454
- rl({
455
- data: that.mindMap.getData(),
456
- url: ''
457
- })
458
- // that.mindMap.export('png', false, '123213', true).then(r => {
459
- // rl({
460
- // data: that.mindMap.getData(),
461
- // url: r
462
- // })
463
- // })
464
- })
465
- },
466
- nodeStyle() {
467
- this.$refs[`${this.id}e`].style.display = 'block'
468
- this.$refs[this.id].style.overflow = 'hidden'
469
- this.trans = !this.trans
470
- setTimeout(() => {
471
- this.$refs[this.id].style.overflow = 'visible'
472
- if (!this.trans) {
473
- this.$refs[`${this.id}e`].style.display = 'none'
474
- }
475
- }, 250)
476
- },
477
- // 关联线
478
- associativeLine() {
479
- this.mindMap.associativeLine.createLineFromActiveNode()
480
- },
481
- // 前进
482
- forward() {
483
- this.mindMap.execCommand('FORWARD')
484
- },
485
- // 返回
486
- ret() {
487
- this.mindMap.execCommand('BACK')
488
- },
489
- // 添加节点
490
- addNode() {
491
- this.mindMap.execCommand('INSERT_CHILD_NODE')
492
- },
493
- // 删除节点
494
- delNode() {
495
- this.mindMap.execCommand('REMOVE_NODE')
496
- },
497
- // 兄弟节点
498
- brotherNode() {
499
- 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'
500
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')
501
518
  }
519
+ }
502
520
  }
503
521
  </script>
504
522
 
@@ -506,197 +524,202 @@ export default {
506
524
  :deep(.custom-select-options li) {
507
525
  padding: 0 10px !important;
508
526
  }
527
+
509
528
  .table-left {
510
- margin-right: 5px;
511
- display: flex;
512
- width: 100%;
529
+ margin-right: 5px;
530
+ display: flex;
531
+ width: 100%;
513
532
  }
514
533
 
515
534
  .node-s {
516
- animation: nodeShow 0.3s;
517
- display: block;
535
+ animation: nodeShow 0.3s;
536
+ display: block;
518
537
  }
519
538
 
520
539
  .node-h {
521
- animation: nodeHide 0.3s;
540
+ animation: nodeHide 0.3s;
522
541
  }
523
542
 
524
543
  @keyframes nodeHide {
525
- 0% {
526
- opacity: 1;
527
- transform: translateX(0);
528
- }
529
- 100% {
530
- opacity: 0;
531
- transform: translateX(110%);
532
- }
544
+ 0% {
545
+ opacity: 1;
546
+ transform: translateX(0);
547
+ }
548
+ 100% {
549
+ opacity: 0;
550
+ transform: translateX(110%);
551
+ }
533
552
  }
534
553
 
535
554
  @keyframes nodeShow {
536
- 0% {
537
- opacity: 0;
538
- transform: translateX(110%);
539
- }
540
- 10% {
541
- opacity: 1;
542
- transform: translateX(100%);
543
- }
544
- 100% {
545
- opacity: 1;
546
- transform: translateX(0);
547
- }
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
+ }
548
567
  }
549
568
 
550
569
  .zIndex {
551
- position: relative;
552
- z-index: 30;
570
+ position: relative;
571
+ z-index: 30;
553
572
  }
554
573
 
555
574
  .zIndex2 {
556
- position: relative;
557
- z-index: 33;
575
+ position: relative;
576
+ z-index: 33;
558
577
  }
559
578
 
560
579
  .zIndex3 {
561
- position: relative;
562
- z-index: 32;
580
+ position: relative;
581
+ z-index: 32;
563
582
  }
564
583
 
565
584
  .zIndex4 {
566
- position: relative;
567
- z-index: 31;
585
+ position: relative;
586
+ z-index: 31;
568
587
  }
569
588
 
570
589
  .backColor {
571
- width: 93px;
572
- height: 30px;
573
- border: 1px solid #ccc;
574
- border-radius: 3px;
575
- margin-left: -40px;
576
- box-shadow: 0 1px 0 1px rgb(0 0 0 / 4%);
577
- cursor: pointer;
578
- 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;
579
598
  }
580
599
 
581
600
  .back-col {
582
- position: absolute;
583
- top: 0;
584
- left: 60px;
585
- z-index: 40;
601
+ position: absolute;
602
+ top: 0;
603
+ left: 60px;
604
+ z-index: 40;
586
605
  }
587
606
 
588
607
  .node-but {
589
- display: flex;
590
- padding: 5px 0;
608
+ display: flex;
609
+ padding: 5px 0;
591
610
  }
592
611
 
593
612
  .node-but button {
594
- flex: 1;
595
- margin-right: 5px;
596
- background-color: #fff;
597
- border: 1px solid #ccc;
598
- border-radius: 3px;
599
- padding: 5px 10px;
600
- cursor: pointer;
601
- 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;
602
621
  }
603
622
 
604
623
  .node-but button:last-child {
605
- margin: 0;
624
+ margin: 0;
606
625
  }
607
626
 
608
627
  .style-title {
609
- font-size: 16px;
610
- font-weight: bold;
611
- padding: 5px 0 10px 0;
628
+ font-size: 16px;
629
+ font-weight: bold;
630
+ padding: 5px 0 10px 0;
612
631
  }
613
632
 
614
633
  .mind {
615
- width: 100%;
616
- height: 100%;
617
- position: relative;
634
+ width: 100%;
635
+ height: 100%;
636
+ position: relative;
618
637
  }
619
638
 
620
- .table {
621
- background-color: #fff;
622
- border-radius: 5px;
623
- box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
624
- 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;
625
644
  }
626
- .style-li{
627
- position: relative;
645
+
646
+ .style-li {
647
+ position: relative;
628
648
  }
629
- .style-li img{
630
- position: absolute;
631
- top: 0;
632
- right: 0;
633
- z-index: 1;
634
- width: 15px;
635
- height: 15px;
636
- 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;
637
658
  }
659
+
638
660
  .style-list {
639
- display: flex;
640
- padding: 5px 0;
661
+ display: flex;
662
+ padding: 5px 0;
641
663
  }
642
664
 
643
665
  .node-left {
644
- display: flex;
645
- padding-right: 10px;
666
+ display: flex;
667
+ padding-right: 10px;
646
668
  }
647
669
 
648
670
  .node-left > span {
649
- display: inline-block;
650
- width: 80px;
651
- line-height: 32px;
652
- padding-right: 10px;
653
- box-sizing: border-box;
671
+ display: inline-block;
672
+ width: 80px;
673
+ line-height: 32px;
674
+ padding-right: 10px;
675
+ box-sizing: border-box;
654
676
  }
655
677
 
656
678
  .padd {
657
- padding-right: 0;
679
+ padding-right: 0;
658
680
  }
659
681
 
660
682
  .node-style {
661
- position: absolute;
662
- right: 0;
663
- top: 50%;
664
- background-color: #fff;
665
- border-bottom-left-radius: 5px;
666
- border-top-left-radius: 5px;
667
- padding: 20px;
668
- box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
669
- z-index: 11;
670
- width: 320px;
671
- height: 550px;
672
- margin-top: -270px;
673
- 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;
674
696
  }
675
697
 
676
- .table button {
677
- background-color: #fff;
678
- border: 1px solid #ccc;
679
- cursor: pointer;
680
- font-size: 14px;
681
- height: 30px;
682
- line-height: 30px;
683
- 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;
684
706
  }
685
707
 
686
- .table button:last-child {
687
- margin-right: 0;
708
+ .mind-table button:last-child {
709
+ margin-right: 0;
688
710
  }
689
711
 
690
712
  .mindMapContainer {
691
- width: 100%;
692
- height: 100%;
713
+ width: 100%;
714
+ height: 100%;
693
715
  }
694
- :deep(.custom-select){
716
+
717
+ :deep(.custom-select) {
695
718
  width: 94px;
696
719
  margin-left: -40px;
697
720
  }
698
721
 
699
- .full-screen{
722
+ .full-screen {
700
723
  background: #fff;
701
724
  width: 100vw;
702
725
  height: 100vh;