w-plot-vue 1.0.1 → 1.0.2

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 +216 -22
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,61 @@
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">
18
+ <WListHorizontal
19
+ :items="cmpsL1"
20
+ :itemActive.sync="cmpP1"
21
+ :itemBackgroundColor="'transparent'"
22
+ :itemBackgroundColorHover="'transparent'"
23
+ :itemBackgroundColorActive="'transparent'"
24
+ :keyText="'name'"
25
+ @update:itemActive="(v)=>{indP2=0;indP1=getInd(v,cmpsL1)}"
26
+ >
27
+ <template v-slot:item="props">
28
+ <div style="">
29
+ {{kebabCase(props.item.name)}}
30
+ </div>
31
+ </template>
32
+ </WListHorizontal>
33
+ </div>
34
+
35
+ <div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL2">
36
+ <WListHorizontal
37
+ :items="cmpsL2"
38
+ :itemActive.sync="cmpP2"
39
+ :itemBackgroundColor="'transparent'"
40
+ :itemBackgroundColorHover="'transparent'"
41
+ :itemBackgroundColorActive="'transparent'"
42
+ :keyText="'name'"
43
+ @update:itemActive="(v)=>{indP2=getInd(v,cmpsL2)}"
44
+ >
45
+ <template v-slot:item="props">
46
+ <div style="">
47
+ {{kebabCase(props.item.name)}}
48
+ </div>
49
+ </template>
50
+ </WListHorizontal>
51
+ </div>
52
+
53
+ <div style="width:calc( 100vw - 20px ); overflow-x:auto;" v-if="cmpsL3">
14
54
  <WListHorizontal
15
- :items="cmps"
16
- :itemActive.sync="cmpPick"
55
+ :items="cmpsL3"
56
+ :itemActive.sync="cmpP3"
17
57
  :itemBackgroundColor="'transparent'"
18
58
  :itemBackgroundColorHover="'transparent'"
19
59
  :itemBackgroundColorActive="'transparent'"
60
+ :keyText="'name'"
61
+ @update:itemActive="(v)=>{indP3=getInd(v,cmpsL3)}"
20
62
  >
21
63
  <template v-slot:item="props">
22
- <div style="display:flex; align-items:center;">
23
- {{kebabCase(props.item)}}
64
+ <div style="">
65
+ {{kebabCase(props.item.name)}}
24
66
  </div>
25
67
  </template>
26
68
  </WListHorizontal>
27
69
  </div>
70
+
28
71
  </div>
29
72
 
30
73
 
@@ -49,11 +92,11 @@
49
92
  </template>
50
93
 
51
94
  <script>
52
- // import { mdiCheckCircle, mdiCheckboxBlankCircleOutline } from '@mdi/js'
53
- // import get from 'lodash-es/get'
95
+ import get from 'lodash-es/get'
54
96
  import kebabCase from 'lodash-es/kebabCase'
55
- // import each from 'lodash-es/each'
56
- // import urlParse from 'wsemi/src/urlParse.mjs'
97
+ import each from 'lodash-es/each'
98
+ // import cloneDeep from 'lodash-es/cloneDeep'
99
+ import urlParse from 'wsemi/src/urlParse.mjs'
57
100
  import WListHorizontal from 'w-component-vue/src/components/WListHorizontal.vue'
58
101
  import AppZoneWPlot from './AppZoneWPlot.vue'
59
102
  import AppZoneWBar from './AppZoneWBar.vue'
@@ -74,37 +117,188 @@ export default {
74
117
  AppZoneWSetMulti,
75
118
  },
76
119
  data: function() {
120
+ let cmps = [
121
+ {
122
+ name: 'basic',
123
+ cmps: [
124
+ { name: 'WPlot', },
125
+ { name: 'WBar', },
126
+ { name: 'WPie', },
127
+ { name: 'WRose', },
128
+ ],
129
+ },
130
+ {
131
+ name: 'set',
132
+ cmps: [
133
+ { name: 'WSetOne', },
134
+ { name: 'WSetMulti', },
135
+ // {
136
+ // name: 'VTest',
137
+ // cmps: [
138
+ // { name: 'VTest1', },
139
+ // { name: 'VTest2', },
140
+ // { name: 'VTest3', },
141
+ // ],
142
+ // },
143
+ ],
144
+ },
145
+ ]
77
146
  return {
78
- // get,
79
147
  kebabCase,
80
148
 
81
- // mdiCheckCircle,
82
- // mdiCheckboxBlankCircleOutline,
149
+ cmpsL1: cmps,
150
+ indP1: null,
151
+ cmpP1: null,
152
+
153
+ cmpsL2: null,
154
+ indP2: null,
155
+ cmpP2: null,
156
+
157
+ cmpsL3: null,
158
+ indP3: null,
159
+ cmpP3: null,
83
160
 
84
- cmps: [
85
- 'WPlot',
86
- 'WBar',
87
- 'WPie',
88
- 'WRose',
89
- 'WSetOne',
90
- 'WSetMulti',
91
- ],
161
+ cmpsL4: null,
92
162
 
93
- cmpPick: 'WPlot',
163
+ cmpPick: '',
94
164
 
95
165
  }
96
166
  },
97
167
  mounted: function() {
98
168
  let vo = this
169
+
170
+ //default
171
+ vo.indP1 = 0
172
+ vo.indP2 = 0
173
+ vo.indP3 = 0
174
+
175
+ //urlParse, http://localhost:8080/?cmp=w-pie
176
+ let p = urlParse(location.href)
177
+ // console.log('p', p)
178
+
179
+ //viewPick
180
+ vo.viewPick(get(p, 'cmp', ''))
181
+
99
182
  },
100
183
  computed: {
101
184
 
185
+ changeMenus: function() {
186
+ let vo = this
187
+ vo.modifyMenus(vo.indP1, vo.indP2, vo.indP3)
188
+ return ''
189
+ },
190
+
102
191
  isNarrow: function() {
103
192
  return window.innerWidth < 1000
104
193
  },
105
194
 
106
195
  },
107
196
  methods: {
197
+
198
+ modifyMenus: function() {
199
+ let vo = this
200
+
201
+ let cmpPick = ''
202
+
203
+ setTimeout(() => {
204
+
205
+ // console.log('call P1')
206
+ vo.cmpP1 = get(vo.cmpsL1, vo.indP1, {})
207
+ vo.cmpsL2 = get(vo.cmpP1, `cmps`, [])
208
+ let _cmpPick = get(vo.cmpP1, `name`, '')
209
+ if (_cmpPick) {
210
+ cmpPick = _cmpPick
211
+ }
212
+ // console.log('vo.cmpP1', cloneDeep(vo.cmpP1))
213
+ // console.log('vo.cmpsL2', cloneDeep(vo.cmpsL2))
214
+
215
+ }, 50)
216
+
217
+ setTimeout(() => {
218
+
219
+ // console.log('call P2')
220
+ let cmps = get(vo.cmpP1, `cmps`, [])
221
+ vo.cmpP2 = get(cmps, vo.indP2, {})
222
+ vo.cmpsL3 = get(vo.cmpP2, `cmps`, [])
223
+ let _cmpPick = get(vo.cmpP2, `name`, '')
224
+ if (_cmpPick) {
225
+ cmpPick = _cmpPick
226
+ }
227
+ // console.log('vo.cmpP2', cloneDeep(vo.cmpP2))
228
+ // console.log('vo.cmpsL3', cloneDeep(vo.cmpsL3))
229
+
230
+ }, 100)
231
+
232
+ setTimeout(() => {
233
+
234
+ // console.log('call P3')
235
+ let cmps = get(vo.cmpP2, `cmps`, [])
236
+ vo.cmpP3 = get(cmps, vo.indP3, {})
237
+ vo.cmpsL4 = get(vo.cmpP3, `cmps`, [])
238
+ let _cmpPick = get(vo.cmpP3, `name`, '')
239
+ if (_cmpPick) {
240
+ cmpPick = _cmpPick
241
+ }
242
+ // console.log('vo.cmpP3', cloneDeep(vo.cmpP3))
243
+ // console.log('vo.cmpsL4', cloneDeep(vo.cmpsL4))
244
+
245
+ //update
246
+ vo.cmpPick = cmpPick
247
+ // console.log('cmpPick', cmpPick)
248
+
249
+ }, 150)
250
+
251
+ },
252
+
253
+ getInd: function(item, items) {
254
+ // let vo = this
255
+ let ind = -1
256
+ each(items, (v, k) => {
257
+ if (item.name === v.name) {
258
+ ind = k
259
+ return false //跳出
260
+ }
261
+ })
262
+ return ind
263
+ },
264
+
265
+ viewPick: function(cmpPick) {
266
+ let vo = this
267
+ let _cmpPick = kebabCase(cmpPick)
268
+ let r = ''
269
+ let rs = []
270
+ let ls = []
271
+ let l = 0
272
+ let pv = (ts) => {
273
+ each(ts, (v, k) => {
274
+ let name = get(v, `name`, '')
275
+ let _name = kebabCase(name)
276
+ let cmps = get(v, `cmps`, [])
277
+ if (cmps.length > 0) {
278
+ ls.push(l)
279
+ l++
280
+ pv(cmps)
281
+ l--
282
+ ls.pop()
283
+ }
284
+ let lst = [...ls, k]
285
+ rs.push({
286
+ clst: lst.join('.'),
287
+ name,
288
+ })
289
+ if (_name === _cmpPick) {
290
+ r = lst
291
+ }
292
+ })
293
+ }
294
+ pv(vo.cmpsL1)
295
+ // console.log('rs', rs)
296
+ // console.log('r', r)
297
+ vo.indP1 = get(r, 0, 0)
298
+ vo.indP2 = get(r, 1, 0)
299
+ vo.indP3 = get(r, 2, 0)
300
+ },
301
+
108
302
  },
109
303
  }
110
304
  </script>