zydx-plus 1.35.600 → 1.35.602

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.600",
3
+ "version": "1.35.602",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -55,7 +55,8 @@ export default {
55
55
  Rgb:{r:255,g:255,b:255},
56
56
  opacity: 1,
57
57
  s: 0,
58
- l: 0
58
+ l: 0,
59
+ maskRgb:{}
59
60
  }
60
61
  },
61
62
  props: {
@@ -64,8 +65,7 @@ export default {
64
65
  },
65
66
  created() {
66
67
  this.$nextTick(() => {
67
- console.log(this.color)
68
- if(this.color === undefined) return
68
+ if(!this.color) return
69
69
  this.alternativeColor(this.color)
70
70
  })
71
71
  },
@@ -126,8 +126,8 @@ export default {
126
126
  if(x >= w) this.colorX = w
127
127
  if(y <= 0) this.colorY = 0
128
128
  if(y >= h) this.colorY = h
129
- this.s = x / w
130
- this.l = (h - y) / h
129
+ this.s = w? x / w : 0
130
+ this.l = h? (h - y) / h : 0
131
131
  this.rgbaColor()
132
132
  },
133
133
  rgbaColor() {
@@ -17,7 +17,6 @@ function hsv2rgb(h, s, v) {
17
17
  case 4: r = t; g = p; b = v; break;
18
18
  case 5: r = v, g = p, b = q; break;
19
19
  }
20
-
21
20
  var round = (value) => Math.round(value * 255)
22
21
  return {
23
22
  r: round(r),
@@ -92,12 +91,12 @@ function rgbToHsb(rgb) {
92
91
  function rgb2Hex(r, g, b) {
93
92
  var o = (r << 16 | g << 8 | b).toString(16)
94
93
  return o.length < 6 ? ("#".concat("0".repeat(6 - o.length)).concat(o)):"#".concat(o);
95
- }
96
-
97
-
98
- module.exports = {
99
- hsv2rgb,
100
- rgb2hsv,
101
- rgbToHsb,
102
- rgb2Hex
94
+ }
95
+
96
+
97
+ module.exports = {
98
+ hsv2rgb,
99
+ rgb2hsv,
100
+ rgbToHsb,
101
+ rgb2Hex
103
102
  }
@@ -0,0 +1,177 @@
1
+ <template>
2
+ <div class="node-style node-style-line" :class="{'node-s': show, 'node-h': !show}">
3
+ <div class="style-li">
4
+ <img @click="nodeStyle"
5
+ src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADTFJREFUeF7t3VmspEUVB/A/r5oYH+TFBF/UFwcSjcsD4oOJaNQXjBERXMBdwRFhcEMdkUWRGVHGfQOVRVEU3AVBdBhGNlcWFRAFFBTcd0UxxVTP3NvTfbu66vxr/Xcy4WG+OlV16vzu+b6+Pc0e0EsZUAbmZmAP5UYZUAbmZ0BAVB3KwBoZEBCVhzIgIKoBZSAuA+ogcXnTqEEyICCDHLS2GZcBAYnLm0YNkgEBGeSgtc24DAhIXN40apAMCMggB61txmXAEshDAewL4B4AWwHcHrckjVIGgjMwqTk34HIANwePDLzQAshbATwTwN5Tc24HcBqATweuRZcpA6EZOBLAi2bU3LUAzgFwUmigRdelAHkMgAsAPHjBJA7I8QCuX7QY/b0ysCADjwBwIoADFlznoOxjkc0UIPcusYDrABwoJEtkTJdOZ8DhOBfAusDUXArgiYHXzr0sFsixAE5YcnIhWTJhunxnBpbFMRm4HsCWlDzGAHkQgLsiJxWSyMQNPCwWxyRlewK4OzZ/MUAeD+Cy2AkBCElC8gYbmorDpWs/ANti8xYD5IUAPhY7oR8nJIkJHGC4BQ6XJvdu18dj8xUD5GgAm2InXDFOSAyS2GkIKxwuPRsAbI7NUwyQ/QFcGDvh1DghMUpkR2Escbi0PBnARbH5iQGyF4BbYyecMU5IDJPZeChrHC4dDwFwW2xeYoC4udxvKw+KnVRIDDPXTygGDves/OKUFMUCeZR/J+t+KZPrdsswe22HYuBwdyZPAnBnSmpigbg53WewNqZMrk5inL02wzFwuEw8A8D5qSlJASIkqdnXeBaOZ/uPpSRnOBWIkCQfwbABqsfhTsYCiJAMW+PRG2fhcG8c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0RedgGYL+IcTuHxAI5GMBZS04sHEsmTJevykAMkn0BbE/JYywQN6f75runB04uHIGJ0mVrZmAZJEcBODU1nylA3NxPAbAZwLo5C3H/61/3jpf7r17KgEUGDvC3W4+cE+wKAIcDuMZislQgbg0PAHAQgCf4P+7z+BcDuATAORaLVAxlYCoDD/QfRpzUnPvrrf7PmQDMvhneAohOTxnoNgMC0u3RamMWGRAQiywqRrcZEJBuj1Ybs8iAgFhkUTG6zYCAdHu02phFBgTEIouK0W0GBKTbo9XGLDIgIBZZVIxuMyAg3R6tNmaRAQGxyKJidJsBAen2aLUxiwwIiEUWFaPbDAhIt0erjVlkQEAssqgY3WZAQLo9Wm3MIgP/B7mSJva6gFwqAAAAAElFTkSuQmCC"
6
+ alt=""/>
7
+ <div class="style-title">文字</div>
8
+ <div class="style-list">
9
+ <div class="node-left zIndex2">
10
+ <span>字号</span>
11
+ <Select :options="optionSize" v-model:value="sizeValue"></Select>
12
+ </div>
13
+ <div class="node-left padd zIndex2">
14
+ <span>行高</span>
15
+ <Select :options="optionRow" v-model:value="rowValue"></Select>
16
+ </div>
17
+ </div>
18
+ <div class="style-list">
19
+ <div class="node-left">
20
+ <span>颜色</span>
21
+ <div @click="colorTap($event,'associativeLineTextColor')" :style="{'background-color': associativeLineTextColor}" class="backColor"></div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div class="style-li">
26
+ <div class="style-title">边框</div>
27
+ <div class="style-list">
28
+ <div class="node-left">
29
+ <span>颜色</span>
30
+ <div @click="colorTap($event,'associativeLineColor')" :style="{'background-color': associativeLineColor}" class="backColor"></div>
31
+ </div>
32
+ <div class="node-left padd zIndex3">
33
+ <span>线宽</span>
34
+ <Select :options="optionLine" v-model:value="styleValue"></Select>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <div class="back-col" :style="{top: top + 'px'}" v-if="colorShow">
39
+ <Coloring @submit="submit" @empty="empty" @rgba="rgba" :color="colorRgba"></Coloring>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ import Select from '../../select/src/select.vue'
46
+ import Coloring from '../../coloring/src/coloring.vue'
47
+
48
+ export default {
49
+ components: {Select, Coloring},
50
+ data() {
51
+ return {
52
+ show: false,
53
+ top: 0,
54
+ colorRgba: '',
55
+ colorShow: false,
56
+ colorType: '',
57
+ optionSize: [
58
+ {label: "12", value: 12},
59
+ {label: "14", value: 14},
60
+ {label: "16", value: 16},
61
+ {label: "18", value: 18},
62
+ {label: "20", value: 20},
63
+ {label: "24", value: 24},
64
+ {label: "26", value: 26},
65
+ {label: "28", value: 28},
66
+ {label: "30", value: 30}
67
+ ],
68
+ sizeValue: 14,
69
+ optionRow: [
70
+ {label: "1.2", value: 1.2},
71
+ {label: "1.5", value: 1.5},
72
+ {label: "2", value: 2},
73
+ {label: "2.5", value: 2.5},
74
+ {label: "3", value: 3}
75
+ ],
76
+ rowValue: 1.2,
77
+ optionLine: [
78
+ {label: "0", value: 0},
79
+ {label: "1", value: 1},
80
+ {label: "2", value: 2},
81
+ {label: "3", value: 3},
82
+ {label: "4", value: 4},
83
+ {label: "5", value: 5},
84
+ {label: "6", value: 6},
85
+ {label: "7", value: 7}
86
+ ],
87
+ styleValue: 2,
88
+ associativeLineTextColor: '',
89
+ associativeLineColor: ''
90
+ }
91
+ },
92
+ emits: ['update:open', 'select'],
93
+ props: {
94
+ open: {
95
+ type: Boolean,
96
+ default: false
97
+ },
98
+ node: {
99
+ type: Object,
100
+ default: () => {}
101
+ }
102
+ },
103
+ watch: {
104
+ open: {
105
+ handler(val) {
106
+ this.show = val
107
+ },
108
+ deep: true
109
+ },
110
+ show: {
111
+ handler(val) {
112
+ this.$emit('update:open', val)
113
+ },
114
+ deep: true
115
+ },
116
+ node: {
117
+ handler(val) {
118
+ if (val) {
119
+ this.colorShow = false
120
+ this.sizeValue = val.associativeLineTextFontSize || 14
121
+ this.rowValue = val.associativeLineTextLineHeight || 1.2
122
+ this.styleValue = val.associativeLineWidth || 2
123
+ this.associativeLineTextColor = val.associativeLineTextColor || 'rgba(51, 51, 51, 1)'
124
+ this.associativeLineColor = val.associativeLineColor || 'rgba(51, 51, 51, 1)'
125
+ }
126
+ }
127
+ },
128
+ sizeValue: {
129
+ handler(val) {
130
+ this.$emit('select', {associativeLineTextFontSize: val})
131
+ },
132
+ deep: true
133
+ },
134
+ rowValue: {
135
+ handler(val) {
136
+ this.$emit('select', {associativeLineTextLineHeight: val})
137
+ },
138
+ deep: true
139
+ },
140
+ styleValue: {
141
+ handler(val) {
142
+ this.$emit('select', {associativeLineWidth: val})
143
+ },
144
+ deep: true
145
+ },
146
+ },
147
+ mounted() {
148
+
149
+ },
150
+ methods: {
151
+ nodeStyle() {
152
+ this.show = false
153
+ },
154
+ colorTap(e, i) {
155
+ this.colorType = i
156
+ if(this.colorType === 'associativeLineTextColor') this.colorRgba = this.associativeLineTextColor
157
+ if(this.colorType === 'associativeLineColor') this.colorRgba = this.associativeLineColor
158
+ this.colorShow = !this.colorShow
159
+ },
160
+ rgba(e) {
161
+ let color = {}
162
+ color[this.colorType] = e.rgba
163
+ if(this.colorType === 'associativeLineTextColor') this.associativeLineTextColor = e.rgba
164
+ if(this.colorType === 'associativeLineColor') this.associativeLineColor = e.rgba
165
+ this.$emit('select', color)
166
+ },
167
+ submit() {
168
+ this.colorShow = false
169
+ },
170
+ empty() {
171
+ this.colorShow = false
172
+ },
173
+ }
174
+ }
175
+ </script>
176
+
177
+ <style scoped src="./mind.css"></style>
@@ -119,6 +119,10 @@
119
119
  border-radius: 5px;
120
120
  box-shadow: rgba(0, 0, 0, 0.06) 0 2px 16px 0;
121
121
  z-index: 10;
122
+ position: absolute;
123
+ top: 0;
124
+ right: 0;
125
+ left: 0;
122
126
  }
123
127
 
124
128
  .style-li {
@@ -173,6 +177,11 @@
173
177
  display: none;
174
178
  }
175
179
 
180
+ .node-style-line {
181
+ height: 240px;
182
+ margin-top: -120px;
183
+ }
184
+
176
185
  .mind-table button {
177
186
  background-color: #fff;
178
187
  border: 1px solid #ccc;
@@ -182,7 +191,33 @@
182
191
  line-height: 30px;
183
192
  flex: 1;
184
193
  }
185
-
194
+ .mind-btn{
195
+ background-color: #fff;
196
+ border: 1px solid #ccc;
197
+ cursor: pointer;
198
+ font-size: 14px;
199
+ height: 28px;
200
+ line-height: 28px;
201
+ flex: 1;
202
+ position: relative;
203
+ text-align: center;
204
+ }
205
+ .mind-btn:hover .mind-btn-list{
206
+ display: block;
207
+ }
208
+ .mind-btn-list{
209
+ display: none;
210
+ }
211
+ .mind-btn-list button{
212
+ background-color: #fff;
213
+ border: 1px solid #ccc;
214
+ cursor: pointer;
215
+ font-size: 14px;
216
+ height: 30px;
217
+ line-height: 28px;
218
+ flex: 1;
219
+ width: 100%;
220
+ }
186
221
  .mind-table button:last-child {
187
222
  margin-right: 0;
188
223
  }
@@ -206,3 +241,6 @@
206
241
  left: 0;
207
242
  z-index: 100;
208
243
  }
244
+ .font-color-back{
245
+ color: #fff;
246
+ }
@@ -6,10 +6,19 @@
6
6
  <button :disabled="mindShow" @click="brotherNode">兄弟节点</button>
7
7
  <button :disabled="mindShow" @click="delNode">删除节点</button>
8
8
  <button :disabled="mindShow" @click="associativeLine">关联线</button>
9
+ <button :disabled="lineShow" @click="lineStyle">关联样式</button>
9
10
  <button :disabled="mindShow" @click="nodeStyle">节点样式</button>
10
- <button @click="structure">结构切换</button>
11
+ <div class="mind-btn">
12
+ <span>结构切换</span>
13
+ <div class="mind-btn-list">
14
+ <button @click="structure('logicalStructure')" :disabled="layoutList === 'logicalStructure' || layoutList === ''">向右结构</button>
15
+ <button @click="structure('organizationStructure')" :disabled="layoutList === 'organizationStructure'">向下结构</button>
16
+ <button @click="structure('mindMap')" :disabled="layoutList === 'mindMap'">左右结构</button>
17
+ </div>
18
+ </div>
11
19
  <button :disabled="retShow" @click="ret">上一步</button>
12
20
  <button :disabled="forwardShow" @click="forward">下一步</button>
21
+ <button @click="reset">重置位置</button>
13
22
  <button v-if="protectShow" @click="preservation">保存</button>
14
23
  <button @click="fullTap" v-if="fullShow">全屏</button>
15
24
  <button @click="fullDel" v-else>退出</button>
@@ -17,6 +26,7 @@
17
26
  </div>
18
27
  <div :id="id" class="mindMapContainer"></div>
19
28
  <Tool v-model:open="styleStatus" :node="nodeData" @select="toolSelect"></Tool>
29
+ <LineTool v-model:open="lineStyleStatus" :node="lineData" @select="lineToolSelect"></LineTool>
20
30
  </div>
21
31
  </template>
22
32
 
@@ -27,13 +37,14 @@ import TouchEvent from 'simple-mind-map/src/plugins/TouchEvent.js'
27
37
  import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
28
38
  import Export from 'simple-mind-map/src/plugins/Export.js'
29
39
  import Tool from "./tool.vue";
40
+ import LineTool from "./lineTool.vue";
30
41
 
31
42
  MindMap.usePlugin(AssociativeLine)
32
43
  MindMap.usePlugin(TouchEvent)
33
44
  MindMap.usePlugin(Export)
34
45
 
35
46
  export default {
36
- components: {Tool},
47
+ components: {LineTool, Tool},
37
48
  name: "zydx-mind",
38
49
  data() {
39
50
  return {
@@ -43,7 +54,10 @@ export default {
43
54
  retShow: false,
44
55
  forwardShow: false,
45
56
  nodeData: null,
57
+ lineData: null,
46
58
  colorShow: false,
59
+ lineStyleStatus: false,
60
+ lineShow: true,
47
61
  top: 0,
48
62
  activeNodes: null,
49
63
  defaultData: {
@@ -55,7 +69,9 @@ export default {
55
69
  fullShow: true,
56
70
  layoutList: '',
57
71
  updateInit: false,
58
- styleStatus: false
72
+ styleStatus: false,
73
+ activeLineNode: null,
74
+ activeLineToNode: null
59
75
  }
60
76
  },
61
77
  props: {
@@ -121,10 +137,25 @@ export default {
121
137
  if (!document.fullscreenElement) {
122
138
  this.fullShow = true
123
139
  }
124
- this.mindMap.resize()
140
+ this.mindMap?.resize()
125
141
  }
126
142
  },
127
143
  methods: {
144
+ lineToolSelect(v) {
145
+ const associativeLineStyle = this.activeLineNode.getData('associativeLineStyle') || {}
146
+ const toNodeUid = this.activeLineToNode.getData('uid')
147
+ const lineStyle = associativeLineStyle[toNodeUid] || {}
148
+ this.activeLineNode.setData({
149
+ associativeLineStyle: {
150
+ ...associativeLineStyle,
151
+ [toNodeUid]: {
152
+ ...lineStyle,
153
+ ...v
154
+ }
155
+ }
156
+ })
157
+ this.mindMap.associativeLine.updateActiveLineStyle()
158
+ },
128
159
  toolSelect(v) {
129
160
  this.activeNodes.forEach(node => {
130
161
  node.setStyle(v.type, v.value)
@@ -194,6 +225,7 @@ export default {
194
225
  const that = this
195
226
  this.mindMap = new MindMap({
196
227
  el: document.getElementById(that.id),
228
+ openPerformance: true,
197
229
  enableFreeDrag: false, // 是否开启自由拖拽
198
230
  enableNodeTransitionMove: false, // 是否开启节点过渡动画
199
231
  layout: that.data.layoutList || 'logicalStructure', // 节点布局方式
@@ -202,16 +234,39 @@ export default {
202
234
  data: that.msgFun(that.data)
203
235
  });
204
236
  this.mindMap.setMode(this.readOnly ? 'readonly' : 'edit')
237
+ // 节点点击
205
238
  this.mindMap.on('node_active', (node, activeNodeList) => {
206
239
  this.nodeData = node
207
- this.mindShow = node === null;
208
- if(node === null) this.styleStatus = false
209
240
  this.activeNodes = activeNodeList
241
+ this.mindShow = !node
242
+ if(node) {
243
+ this.lineData = null
244
+ this.lineShow = true
245
+ }
210
246
  })
247
+ // 后退前进
211
248
  this.mindMap.on('back_forward', (index, len) => {
212
249
  this.retShow = index <= 0;
213
250
  this.forwardShow = index >= len - 1
214
251
  })
252
+ // 关联线点击
253
+ this.mindMap.on('associative_line_click', (path, clickPath, node, toNode) => {
254
+ this.activeLineNode = node
255
+ this.activeLineToNode = toNode
256
+ this.lineData = this.mindMap.associativeLine.getStyleConfig(node, toNode)
257
+ this.lineShow = false
258
+ })
259
+ // 点击画布
260
+ this.mindMap.on('draw_click', () => {
261
+ this.lineStyleStatus = false
262
+ this.styleStatus = false
263
+ this.lineShow = true
264
+ this.mindShow = true
265
+ this.nodeData = null
266
+ this.activeNodes = []
267
+ this.lineData = null
268
+ })
269
+ // 数据改变
215
270
  this.mindMap.on('data_change', (data) => {
216
271
  this.$emit('dataChange', {
217
272
  data: data,
@@ -219,21 +274,15 @@ export default {
219
274
  })
220
275
  })
221
276
  },
222
- structure() {
223
- this.layoutList = 'logicalStructure'
224
- const layout = this.mindMap.getLayout()
225
- if (layout === 'mindMap') {
226
- this.layoutList = 'organizationStructure'
227
- } else if (layout === 'organizationStructure') {
228
- this.layoutList = 'logicalStructure'
229
- } else {
230
- this.layoutList = 'mindMap'
231
- }
277
+ structure(v) {
278
+ this.layoutList = v
232
279
  this.mindMap.setLayout(this.layoutList)
233
280
  },
234
281
  // 保存
235
282
  preservation() {
236
283
  let that = this
284
+ this.styleStatus = false
285
+ this.lineStyleStatus = false
237
286
  that.$emit('preservation', {
238
287
  data: {
239
288
  msg: that.mindMap.getData(),
@@ -255,8 +304,13 @@ export default {
255
304
  const name = v? v : 'mind'
256
305
  this.mindMap.export('png', true, name, true, false, null, true)
257
306
  },
307
+ lineStyle() {
308
+ this.lineStyleStatus = true
309
+ this.styleStatus = false
310
+ },
258
311
  nodeStyle() {
259
312
  this.styleStatus = true
313
+ this.lineStyleStatus = false
260
314
  },
261
315
  // 关联线
262
316
  associativeLine() {
@@ -281,6 +335,9 @@ export default {
281
335
  // 兄弟节点
282
336
  brotherNode() {
283
337
  this.mindMap.execCommand('INSERT_NODE')
338
+ },
339
+ reset() {
340
+ this.mindMap.renderer.setRootNodeCenter()
284
341
  }
285
342
  }
286
343
  }
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
  <div class="node-but">
19
- <button @click="colorTap($event,'color')">颜色</button>
19
+ <button @click="colorTap($event,'color')" class="font-color-back" :style="{'background-color': color}">颜色</button>
20
20
  <button :style="{'background-color': (boldAct)? '#549688': '#fff','color': (boldAct)? '#fff': '#333'}"
21
21
  @click="bolds">粗体
22
22
  </button>
@@ -33,7 +33,7 @@
33
33
  <div class="style-list">
34
34
  <div class="node-left">
35
35
  <span>颜色</span>
36
- <div @click="colorTap($event,'borderColor')" class="backColor"></div>
36
+ <div @click="colorTap($event,'borderColor')" :style="{'background-color': borderColor}" class="backColor"></div>
37
37
  </div>
38
38
  <div class="node-left padd zIndex3">
39
39
  <span>样式</span>
@@ -56,7 +56,7 @@
56
56
  <div class="style-list">
57
57
  <div class="node-left">
58
58
  <span>颜色</span>
59
- <div @click="colorTap($event,'fillColor')" class="backColor"></div>
59
+ <div @click="colorTap($event,'fillColor')" :style="{'background-color': fillColor}" class="backColor"></div>
60
60
  </div>
61
61
  </div>
62
62
  </div>
@@ -75,7 +75,7 @@
75
75
  <div class="style-list">
76
76
  <div class="node-left">
77
77
  <span>颜色</span>
78
- <div @click="colorTap($event,'lineColor')" class="backColor"></div>
78
+ <div @click="colorTap($event,'lineColor')" :style="{'background-color': lineColor}" class="backColor"></div>
79
79
  </div>
80
80
  </div>
81
81
  </div>
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  </div>
91
91
  <div class="back-col" :style="{top: top + 'px'}" v-if="colorShow">
92
- <Coloring @submit="submit" @empty="empty" @rgba="rgba" :color="color"></Coloring>
92
+ <Coloring @submit="submit" @empty="empty" @rgba="rgba" :color="colorRgba"></Coloring>
93
93
  </div>
94
94
  </div>
95
95
  </template>
@@ -123,7 +123,11 @@ export default {
123
123
  {label: "3", value: '3'}
124
124
  ],
125
125
  rowValue: '1.5',
126
- color: 'rgba(0,0,0,1)',
126
+ colorRgba: '',
127
+ color: '',
128
+ borderColor: '',
129
+ fillColor: '',
130
+ lineColor: '',
127
131
  boldAct: false,
128
132
  italicAct: false,
129
133
  scribeAct: false,
@@ -137,7 +141,7 @@ export default {
137
141
  ],
138
142
  lineStyleValue: 'none',
139
143
  styleValue: 'none',
140
- widthValue: 1,
144
+ widthValue: 0,
141
145
  optionWidth: [
142
146
  {label: "0", value: 0},
143
147
  {label: "1", value: 1},
@@ -182,27 +186,28 @@ export default {
182
186
  open: {
183
187
  handler(val) {
184
188
  this.show = val
189
+ this.colorShow = false
185
190
  },
186
191
  deep: true
187
192
  },
188
193
  node: {
189
194
  handler(val) {
190
195
  if (val) {
191
- console.log(val.nodeData.data)
196
+ this.colorShow = false
192
197
  this.sizeValue = val.nodeData.data.fontSize || '16'
193
198
  this.rowValue = val.nodeData.data.lineHeight || '1.5'
194
199
  this.boldAct = val.nodeData.data.fontWeight === 'bold'
195
200
  this.italicAct = val.nodeData.data.fontStyle === 'italic'
196
201
  this.scribeAct = val.nodeData.data.textDecoration === 'underline'
197
- if(this.colorType === 'color') this.color = val.nodeData.data.color || 'rgba(0,0,0,1)'
198
- if(this.colorType === 'borderColor') this.color = val.nodeData.data.borderColor || 'rgba(84, 150, 136,1)'
202
+ this.color = val.nodeData.data.color || 'rgba(0,0,0,1)'
203
+ this.borderColor = val.nodeData.data.borderColor || 'rgba(84, 150, 136,1)'
199
204
  this.styleValue = val.nodeData.data.borderDasharray || 'none'
200
- this.widthValue = val.nodeData.data.borderWidth || 1
205
+ this.widthValue = val.nodeData.data.borderWidth || 0
201
206
  this.filletValue = val.nodeData.data.borderRadius || 5
202
- if(this.colorType === 'fillColor') this.color = val.nodeData.data.fillColor || 'rgba(255,255,255,1)'
207
+ this.fillColor = val.nodeData.data.fillColor || 'rgba(255,255,255,1)'
203
208
  this.lineValue = val.nodeData.data.lineWidth || 1
204
209
  this.lineDasharray = val.nodeData.data.lineDasharray || 'none'
205
- if(this.colorType === 'lineColor') this.color = val.nodeData.data.lineColor || 'rgba(84, 150, 136,1)'
210
+ this.lineColor = val.nodeData.data.lineColor || 'rgba(84, 150, 136,1)'
206
211
  this.shapeValue = val.nodeData.data.shape || 'rectangle'
207
212
  }
208
213
  }
@@ -283,9 +288,17 @@ export default {
283
288
  },
284
289
  colorTap(e, i) {
285
290
  this.colorType = i
291
+ if(this.colorType === 'color') this.colorRgba = this.color
292
+ if(this.colorType === 'borderColor') this.colorRgba = this.borderColor
293
+ if(this.colorType === 'fillColor') this.colorRgba = this.fillColor
294
+ if(this.colorType === 'lineColor') this.colorRgba = this.lineColor
286
295
  this.colorShow = !this.colorShow
287
296
  },
288
297
  rgba(e) {
298
+ if(this.colorType === 'color') this.color = e.rgba
299
+ if(this.colorType === 'borderColor') this.borderColor = e.rgba
300
+ if(this.colorType === 'fillColor') this.fillColor = e.rgba
301
+ if(this.colorType === 'lineColor') this.lineColor = e.rgba
289
302
  this.$emit('select', {type: this.colorType, value: e.rgba})
290
303
  },
291
304
  submit() {
@@ -25,9 +25,9 @@
25
25
  <template v-if="!readonly">
26
26
  <template v-if="options.length">
27
27
  <ul v-if="isOpen"
28
+ class="custom-select-options scroll"
28
29
  ref="dropdown"
29
- :style="{position: 'fixed', 'z-index': '30000', left: x + 'px', top: y + 'px', width: width + 'px'}"
30
- :class="{ 'custom-select-options': true, 'scroll': maxHeight > 0 }">
30
+ :style="{position: 'fixed', 'z-index': '30000', left: x + 'px', top: y + 'px', width: width + 'px', maxHeight: height + 'px'}">
31
31
  <li v-for="(option, idx) in options"
32
32
  :key="idx"
33
33
  :class="option.disable ? 'disable': ''"
@@ -86,16 +86,19 @@ export default defineComponent({
86
86
  selected: null,
87
87
  x: 0,
88
88
  y: 0,
89
- width: 0
89
+ width: 0,
90
+ height: 300
90
91
  }
91
92
  },
92
93
  emits: ['update:value', 'select'],
93
94
  methods: {
94
95
  toggleDropDown: function () {
96
+ const winHeight = window.innerHeight
95
97
  const { x, y, width, height } = this.$refs.selectRef.getBoundingClientRect()
96
98
  this.x = x
97
99
  this.y = y + height
98
100
  this.width = width
101
+ this.height = (winHeight - this.y) - 50
99
102
  this.isOpen = !this.isOpen
100
103
  if(this.isOpen) {
101
104
  window.addEventListener('scroll', this.handler)
@@ -120,18 +123,11 @@ export default defineComponent({
120
123
  },
121
124
  computed: {
122
125
  transform: function () {
123
- return this.isOpen
124
- ? 'rotate(90 12 12)'
125
- : 'rotate(-90 12 12)'
126
+ return this.isOpen ? 'rotate(90 12 12)' : 'rotate(-90 12 12)'
126
127
  },
127
128
  style: function () {
128
129
  return 'transition: all 0.2s ease;'
129
130
  },
130
- _maxHeight: function () {
131
- return this.maxHeight > 0
132
- ? `${this.maxHeight}px`
133
- : ''
134
- }
135
131
  },
136
132
  watch: {
137
133
  value: {
@@ -247,14 +243,20 @@ export default defineComponent({
247
243
  }
248
244
 
249
245
  .custom-select-options.scroll {
250
- max-height: v-bind(_maxHeight);
251
246
  overflow-y: scroll;
252
247
  }
253
248
 
254
249
  .custom-select-options::-webkit-scrollbar {
255
250
  display: none;
256
251
  }
257
-
252
+ .custom-select-options {
253
+ scrollbar-width: none;
254
+ }
255
+ /** IE 与微软浏览器 **/
256
+ .custom-select-options {
257
+ -ms-overflow-style: none;
258
+ overflow: -moz-scrollbars-none;
259
+ }
258
260
  .custom-select-options li {
259
261
  padding: 0 10px;
260
262
  font-size: 14px;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.600',
90
+ version: '1.35.602',
91
91
  install,
92
92
  Calendar,
93
93
  Message,