w-plot-vue 1.0.1 → 1.0.3

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.
Files changed (119) hide show
  1. package/README.md +1 -1
  2. package/dist/w-plot-vue.umd.js +1 -1
  3. package/docs/examples/app.html +1 -1
  4. package/docs/examples/app.umd.js +2 -2
  5. package/docs/examples/app.umd.js.map +1 -1
  6. package/docs/examples/w-bar_horizontal_multi-set(color).html +1 -1
  7. package/docs/examples/w-bar_horizontal_multi-set(color, gradient).html +1 -1
  8. package/docs/examples/w-bar_horizontal_multi-set(series color).html +1 -1
  9. package/docs/examples/w-bar_horizontal_multi-set(series color, gradient).html +1 -1
  10. package/docs/examples/w-bar_horizontal_multi-set.html +1 -1
  11. package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackNormal).html +1 -1
  12. package/docs/examples/w-bar_horizontal_multi-set__barDisplay(stackPercent).html +1 -1
  13. package/docs/examples/w-bar_horizontal_multi-set__hide legned.html +1 -1
  14. package/docs/examples/w-bar_horizontal_multi-set__show labels.html +1 -1
  15. package/docs/examples/w-bar_horizontal_multi-set_barKpColor(gradient).html +1 -1
  16. package/docs/examples/w-bar_horizontal_multi-set_barKpColor.html +1 -1
  17. package/docs/examples/w-bar_horizontal_multi-set_barUseInnerLabelsForHorizontal_barGroupWidthRatio.html +1 -1
  18. package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio.html +1 -1
  19. package/docs/examples/w-bar_horizontal_multi-set_barWidthRatio_barGroupWidthRatio.html +1 -1
  20. package/docs/examples/w-bar_horizontal_one-set(color).html +1 -1
  21. package/docs/examples/w-bar_horizontal_one-set(color, gradient).html +1 -1
  22. package/docs/examples/w-bar_horizontal_one-set.html +1 -1
  23. package/docs/examples/w-bar_horizontal_one-set_barColor(gradient).html +1 -1
  24. package/docs/examples/w-bar_horizontal_one-set_barColor.html +1 -1
  25. package/docs/examples/w-bar_horizontal_one-set_barKpColor(gradient).html +1 -1
  26. package/docs/examples/w-bar_horizontal_one-set_barKpColor.html +1 -1
  27. package/docs/examples/w-bar_horizontal_one-set_barUseInnerLabelsForHorizontal.html +1 -1
  28. package/docs/examples/w-bar_horizontal_one-set_barWidthRatio.html +1 -1
  29. package/docs/examples/w-bar_horizontal_one-set_barWidthRatio_barGroupWidthRatio.html +1 -1
  30. package/docs/examples/w-bar_horizontal_one-set_hide labels.html +1 -1
  31. package/docs/examples/w-bar_horizontal_one-set_marginLeft_marginRight.html +1 -1
  32. package/docs/examples/w-bar_horizontal_one-set_show legned.html +1 -1
  33. package/docs/examples/w-bar_multi-set(color).html +1 -1
  34. package/docs/examples/w-bar_multi-set(color, gradient).html +1 -1
  35. package/docs/examples/w-bar_multi-set(series color).html +1 -1
  36. package/docs/examples/w-bar_multi-set(series color, gradient).html +1 -1
  37. package/docs/examples/w-bar_multi-set.html +1 -1
  38. package/docs/examples/w-bar_multi-set__barDisplay(stackNormal).html +1 -1
  39. package/docs/examples/w-bar_multi-set__barDisplay(stackNormal)_.html +1 -1
  40. package/docs/examples/w-bar_multi-set__barDisplay(stackPercent).html +1 -1
  41. package/docs/examples/w-bar_multi-set__hide legned.html +1 -1
  42. package/docs/examples/w-bar_multi-set__show labels.html +1 -1
  43. package/docs/examples/w-bar_multi-set_barKpColor(gradient).html +1 -1
  44. package/docs/examples/w-bar_multi-set_barKpColor.html +1 -1
  45. package/docs/examples/w-bar_multi-set_barWidthRatio.html +1 -1
  46. package/docs/examples/w-bar_multi-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
  47. package/docs/examples/w-bar_one-set(color).html +1 -1
  48. package/docs/examples/w-bar_one-set(color, gradient).html +1 -1
  49. package/docs/examples/w-bar_one-set.html +1 -1
  50. package/docs/examples/w-bar_one-set_barColor(gradient).html +1 -1
  51. package/docs/examples/w-bar_one-set_barColor.html +1 -1
  52. package/docs/examples/w-bar_one-set_barKpColor(gradient).html +1 -1
  53. package/docs/examples/w-bar_one-set_barKpColor.html +1 -1
  54. package/docs/examples/w-bar_one-set_barWidthRatio.html +1 -1
  55. package/docs/examples/w-bar_one-set_barWidthRatio_barGroupWidthRatio_barBorderRadius.html +1 -1
  56. package/docs/examples/w-bar_one-set_hide labels.html +1 -1
  57. package/docs/examples/w-bar_one-set_marginLeft_marginRight_marginTop.html +1 -1
  58. package/docs/examples/w-bar_one-set_show legned.html +1 -1
  59. package/docs/examples/w-pie_one-set(color).html +1 -1
  60. package/docs/examples/w-pie_one-set(color, gradient).html +1 -1
  61. package/docs/examples/w-pie_one-set.html +1 -1
  62. package/docs/examples/w-pie_one-set_hide labels.html +1 -1
  63. package/docs/examples/w-pie_one-set_hide legned.html +1 -1
  64. package/docs/examples/w-pie_one-set_marginLeft_marginRight_marginTop.html +1 -1
  65. package/docs/examples/w-pie_one-set_pieBorderRadius.html +1 -1
  66. package/docs/examples/w-pie_one-set_pieBorderWidth_pieBorderRadius.html +1 -1
  67. package/docs/examples/w-pie_one-set_pieKpColor(gradient).html +1 -1
  68. package/docs/examples/w-pie_one-set_pieKpColor.html +1 -1
  69. package/docs/examples/w-pie_one-set_pieThicknessRatio.html +1 -1
  70. package/docs/examples/w-plot_default.html +1 -1
  71. package/docs/examples/w-rose_multi-set(color).html +1 -1
  72. package/docs/examples/w-rose_multi-set(color, gradient).html +1 -1
  73. package/docs/examples/w-rose_multi-set(series color).html +1 -1
  74. package/docs/examples/w-rose_multi-set(series color, gradient).html +1 -1
  75. package/docs/examples/w-rose_multi-set.html +1 -1
  76. package/docs/examples/w-rose_multi-set__hide legned.html +1 -1
  77. package/docs/examples/w-rose_multi-set__show labels.html +1 -1
  78. package/docs/examples/w-rose_multi-set_roseBorderWidth.html +1 -1
  79. package/docs/examples/w-rose_multi-set_roseKpColor(gradient).html +1 -1
  80. package/docs/examples/w-rose_multi-set_roseKpColor.html +1 -1
  81. package/docs/examples/w-rose_multi-set_roseWidthRatio.html +1 -1
  82. package/docs/examples/w-rose_one-set(color).html +1 -1
  83. package/docs/examples/w-rose_one-set(color, gradient).html +1 -1
  84. package/docs/examples/w-rose_one-set.html +1 -1
  85. package/docs/examples/w-rose_one-set_marginLeft_marginRight_marginTop.html +1 -1
  86. package/docs/examples/w-rose_one-set_roseBorderWidth.html +1 -1
  87. package/docs/examples/w-rose_one-set_roseKpColor(gradient).html +1 -1
  88. package/docs/examples/w-rose_one-set_roseKpColor.html +1 -1
  89. package/docs/examples/w-rose_one-set_roseShowLabels.html +1 -1
  90. package/docs/examples/w-rose_one-set_roseWidthRatio.html +1 -1
  91. package/docs/examples/w-rose_one-set_showLegend.html +1 -1
  92. package/docs/examples/w-rose_one-set_showLegend_legendPosition.html +1 -1
  93. package/docs/examples/w-set-multi_default.html +1 -1
  94. package/docs/examples/w-set-multi_hide labels.html +1 -1
  95. package/docs/examples/w-set-multi_hide legned.html +1 -1
  96. package/docs/examples/w-set-multi_keySelect.html +1 -1
  97. package/docs/examples/w-set-multi_slot head.html +1 -1
  98. package/docs/examples/w-set-multi_textPlotType_kpSelectText_widthSelect.html +1 -1
  99. package/docs/examples/w-set-one_default.html +1 -1
  100. package/docs/examples/w-set-one_hide labels.html +1 -1
  101. package/docs/examples/w-set-one_keySelect.html +1 -1
  102. package/docs/examples/w-set-one_show legned.html +1 -1
  103. package/docs/examples/w-set-one_slot head.html +1 -1
  104. package/docs/examples/w-set-one_textPlotType_kpSelectText_widthSelect.html +1 -1
  105. package/docs/getDefAxis.mjs.html +1 -1
  106. package/docs/getDefChart.mjs.html +1 -1
  107. package/docs/getDefLegend.mjs.html +1 -1
  108. package/docs/getDefOpt.mjs.html +1 -1
  109. package/docs/global.html +1 -1
  110. package/docs/index.html +1 -1
  111. package/docs/module-WBar.html +1 -1
  112. package/docs/module-WPie.html +1 -1
  113. package/docs/module-WPlot.html +1 -1
  114. package/docs/module-WRose.html +1 -1
  115. package/docs/module-WSetMulti.html +1 -1
  116. package/docs/module-WSetOne.html +1 -1
  117. package/docs/setLegendLoc.mjs.html +1 -1
  118. package/package.json +1 -1
  119. package/src/App.vue +227 -24
package/src/App.vue CHANGED
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div style="">
2
+ <div
3
+ style=""
4
+ :changeMenus="changeMenus"
5
+ >
3
6
 
4
7
 
5
8
  <template v-if="!isNarrow">
@@ -10,21 +13,70 @@
10
13
 
11
14
 
12
15
  <div style="background:#f5f5f5;">
13
- <div style="width:calc( 100vw - 20px ); overflow-x:auto;">
16
+
17
+ <div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL1 && cmpsL1.length>0">
18
+ <WListHorizontal
19
+ :items="cmpsL1"
20
+ :itemActive.sync="cmpP1"
21
+ :itemBackgroundColor="'transparent'"
22
+ :itemBackgroundColorHover="'#eee'"
23
+ :itemBackgroundColorActive="'#eee'"
24
+ :keyText="'name'"
25
+ :paddingStyle="{v:12,h:20}"
26
+ @update:itemActive="(v)=>{indP3=0;indP2=0;indP1=getInd(v,cmpsL1)}"
27
+ >
28
+ <template v-slot:item="props">
29
+ <div style="">
30
+ {{kebabCase(props.item.name)}}
31
+ </div>
32
+ </template>
33
+ </WListHorizontal>
34
+ <div style="height:1px; background:#ddd;"></div>
35
+ </div>
36
+
37
+
38
+ <div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL2 && cmpsL2.length>0">
39
+ <div style="height:3px; background:#fff;"></div>
40
+ <WListHorizontal
41
+ :items="cmpsL2"
42
+ :itemActive.sync="cmpP2"
43
+ :itemBackgroundColor="'transparent'"
44
+ :itemBackgroundColorHover="'#eee'"
45
+ :itemBackgroundColorActive="'#eee'"
46
+ :keyText="'name'"
47
+ :paddingStyle="{v:12,h:20}"
48
+ @update:itemActive="(v)=>{indP3=0;indP2=getInd(v,cmpsL2)}"
49
+ >
50
+ <template v-slot:item="props">
51
+ <div style="">
52
+ {{kebabCase(props.item.name)}}
53
+ </div>
54
+ </template>
55
+ </WListHorizontal>
56
+ <div style="height:1px; background:#ddd;"></div>
57
+ </div>
58
+
59
+ <div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL3 && cmpsL3.length>0">
60
+ <div style="height:3px; background:#fff;"></div>
14
61
  <WListHorizontal
15
- :items="cmps"
16
- :itemActive.sync="cmpPick"
62
+ :items="cmpsL3"
63
+ :itemActive.sync="cmpP3"
17
64
  :itemBackgroundColor="'transparent'"
18
- :itemBackgroundColorHover="'transparent'"
19
- :itemBackgroundColorActive="'transparent'"
65
+ :itemBackgroundColorHover="'#eee'"
66
+ :itemBackgroundColorActive="'#eee'"
67
+ :keyText="'name'"
68
+ :paddingStyle="{v:12,h:20}"
69
+ @update:itemActive="(v)=>{indP3=getInd(v,cmpsL3)}"
20
70
  >
21
71
  <template v-slot:item="props">
22
- <div style="display:flex; align-items:center;">
23
- {{kebabCase(props.item)}}
72
+ <div style="">
73
+ {{kebabCase(props.item.name)}}
24
74
  </div>
25
75
  </template>
26
76
  </WListHorizontal>
77
+ <div style="height:1px; background:#ddd;"></div>
27
78
  </div>
79
+
28
80
  </div>
29
81
 
30
82
 
@@ -49,11 +101,11 @@
49
101
  </template>
50
102
 
51
103
  <script>
52
- // import { mdiCheckCircle, mdiCheckboxBlankCircleOutline } from '@mdi/js'
53
- // import get from 'lodash-es/get'
104
+ import get from 'lodash-es/get'
54
105
  import kebabCase from 'lodash-es/kebabCase'
55
- // import each from 'lodash-es/each'
56
- // import urlParse from 'wsemi/src/urlParse.mjs'
106
+ import each from 'lodash-es/each'
107
+ // import cloneDeep from 'lodash-es/cloneDeep'
108
+ import urlParse from 'wsemi/src/urlParse.mjs'
57
109
  import WListHorizontal from 'w-component-vue/src/components/WListHorizontal.vue'
58
110
  import AppZoneWPlot from './AppZoneWPlot.vue'
59
111
  import AppZoneWBar from './AppZoneWBar.vue'
@@ -74,37 +126,188 @@ export default {
74
126
  AppZoneWSetMulti,
75
127
  },
76
128
  data: function() {
129
+ let cmps = [
130
+ {
131
+ name: 'basic',
132
+ cmps: [
133
+ { name: 'WPlot', },
134
+ { name: 'WBar', },
135
+ { name: 'WPie', },
136
+ { name: 'WRose', },
137
+ ],
138
+ },
139
+ {
140
+ name: 'set',
141
+ cmps: [
142
+ { name: 'WSetOne', },
143
+ { name: 'WSetMulti', },
144
+ // {
145
+ // name: 'VTest',
146
+ // cmps: [
147
+ // { name: 'VTest1', },
148
+ // { name: 'VTest2', },
149
+ // { name: 'VTest3', },
150
+ // ],
151
+ // },
152
+ ],
153
+ },
154
+ ]
77
155
  return {
78
- // get,
79
156
  kebabCase,
80
157
 
81
- // mdiCheckCircle,
82
- // mdiCheckboxBlankCircleOutline,
158
+ cmpsL1: cmps,
159
+ indP1: null,
160
+ cmpP1: null,
83
161
 
84
- cmps: [
85
- 'WPlot',
86
- 'WBar',
87
- 'WPie',
88
- 'WRose',
89
- 'WSetOne',
90
- 'WSetMulti',
91
- ],
162
+ cmpsL2: null,
163
+ indP2: null,
164
+ cmpP2: null,
92
165
 
93
- cmpPick: 'WPlot',
166
+ cmpsL3: null,
167
+ indP3: null,
168
+ cmpP3: null,
169
+
170
+ cmpsL4: null,
171
+
172
+ cmpPick: '',
94
173
 
95
174
  }
96
175
  },
97
176
  mounted: function() {
98
177
  let vo = this
178
+
179
+ //default
180
+ vo.indP1 = 0
181
+ vo.indP2 = 0
182
+ vo.indP3 = 0
183
+
184
+ //urlParse, http://localhost:8080/?cmp=w-pie
185
+ let p = urlParse(location.href)
186
+ // console.log('p', p)
187
+
188
+ //viewPick
189
+ vo.viewPick(get(p, 'cmp', ''))
190
+
99
191
  },
100
192
  computed: {
101
193
 
194
+ changeMenus: function() {
195
+ let vo = this
196
+ vo.modifyMenus(vo.indP1, vo.indP2, vo.indP3)
197
+ return ''
198
+ },
199
+
102
200
  isNarrow: function() {
103
201
  return window.innerWidth < 1000
104
202
  },
105
203
 
106
204
  },
107
205
  methods: {
206
+
207
+ modifyMenus: function() {
208
+ let vo = this
209
+
210
+ let cmpPick = ''
211
+
212
+ setTimeout(() => {
213
+
214
+ // console.log('call P1')
215
+ vo.cmpP1 = get(vo.cmpsL1, vo.indP1, {})
216
+ vo.cmpsL2 = get(vo.cmpP1, `cmps`, [])
217
+ let _cmpPick = get(vo.cmpP1, `name`, '')
218
+ if (_cmpPick) {
219
+ cmpPick = _cmpPick
220
+ }
221
+ // console.log('vo.cmpP1', cloneDeep(vo.cmpP1))
222
+ // console.log('vo.cmpsL2', cloneDeep(vo.cmpsL2))
223
+
224
+ }, 50)
225
+
226
+ setTimeout(() => {
227
+
228
+ // console.log('call P2')
229
+ let cmps = get(vo.cmpP1, `cmps`, [])
230
+ vo.cmpP2 = get(cmps, vo.indP2, {})
231
+ vo.cmpsL3 = get(vo.cmpP2, `cmps`, [])
232
+ let _cmpPick = get(vo.cmpP2, `name`, '')
233
+ if (_cmpPick) {
234
+ cmpPick = _cmpPick
235
+ }
236
+ // console.log('vo.cmpP2', cloneDeep(vo.cmpP2))
237
+ // console.log('vo.cmpsL3', cloneDeep(vo.cmpsL3))
238
+
239
+ }, 100)
240
+
241
+ setTimeout(() => {
242
+
243
+ // console.log('call P3')
244
+ let cmps = get(vo.cmpP2, `cmps`, [])
245
+ vo.cmpP3 = get(cmps, vo.indP3, {})
246
+ vo.cmpsL4 = get(vo.cmpP3, `cmps`, [])
247
+ let _cmpPick = get(vo.cmpP3, `name`, '')
248
+ if (_cmpPick) {
249
+ cmpPick = _cmpPick
250
+ }
251
+ // console.log('vo.cmpP3', cloneDeep(vo.cmpP3))
252
+ // console.log('vo.cmpsL4', cloneDeep(vo.cmpsL4))
253
+
254
+ //update
255
+ vo.cmpPick = cmpPick
256
+ // console.log('cmpPick', cmpPick)
257
+
258
+ }, 150)
259
+
260
+ },
261
+
262
+ getInd: function(item, items) {
263
+ // let vo = this
264
+ let ind = -1
265
+ each(items, (v, k) => {
266
+ if (item.name === v.name) {
267
+ ind = k
268
+ return false //跳出
269
+ }
270
+ })
271
+ return ind
272
+ },
273
+
274
+ viewPick: function(cmpPick) {
275
+ let vo = this
276
+ let _cmpPick = kebabCase(cmpPick)
277
+ let r = ''
278
+ let rs = []
279
+ let ls = []
280
+ let l = 0
281
+ let pv = (ts) => {
282
+ each(ts, (v, k) => {
283
+ let name = get(v, `name`, '')
284
+ let _name = kebabCase(name)
285
+ let cmps = get(v, `cmps`, [])
286
+ if (cmps.length > 0) {
287
+ ls.push(l)
288
+ l++
289
+ pv(cmps)
290
+ l--
291
+ ls.pop()
292
+ }
293
+ let lst = [...ls, k]
294
+ rs.push({
295
+ clst: lst.join('.'),
296
+ name,
297
+ })
298
+ if (_name === _cmpPick) {
299
+ r = lst
300
+ }
301
+ })
302
+ }
303
+ pv(vo.cmpsL1)
304
+ // console.log('rs', rs)
305
+ // console.log('r', r)
306
+ vo.indP1 = get(r, 0, 0)
307
+ vo.indP2 = get(r, 1, 0)
308
+ vo.indP3 = get(r, 2, 0)
309
+ },
310
+
108
311
  },
109
312
  }
110
313
  </script>