lambo-design-bi 0.0.185 → 0.0.187

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,7 +1,7 @@
1
1
  <template>
2
2
  <LamboNumberInfoBi :title="title" :sub-title="subTitle" :num="num" :sub-num1="subNum1" :trend1="trend1"
3
3
  :widget="widget" :is-drill="isDrill" @on-drill="onDrill" :sub-num2="subNum2" :trend2="trend2" :polar1="polar1"
4
- :polar2="polar2" :eva-level="evaLevel" :tab-clickable="tabClickable" @on-tab-click="onTabClick">
4
+ :polar2="polar2" :eva-level="evaLevel" :tab-clickable="tabClickable" :default-tab-active="defaultTabActive" @on-tab-click="onTabClick">
5
5
  </LamboNumberInfoBi>
6
6
  </template>
7
7
  <script>
@@ -62,6 +62,7 @@ export default {
62
62
  this.tabClickable = true
63
63
  }
64
64
  if (this.widget.options["defaultTabActive"] === '1') {
65
+ console.log("num-info initConfig 卡片初始设置为激活状态触发点击,START 当前实例:", this.widget.id + "_" + this.widget.name + ",defaultTabActive:" + this.widget.options["defaultTabActive"])
65
66
  this.defaultTabActive = true
66
67
  }
67
68
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.185",
3
+ "version": "0.0.187",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -363,7 +363,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
363
363
  },
364
364
  color: dynamicColors,
365
365
  grid: {
366
- top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
366
+ top: '40px', left: '0px', right: '50px', bottom: '0px', containLabel: true
367
367
  },
368
368
  calculable: true,
369
369
  xAxis: {
@@ -462,13 +462,44 @@ export function getECharts(type, dataX, dataY, dataDim) {
462
462
  },
463
463
  data: dataY[0],
464
464
  markPoint: {
465
+ symbol: 'pin',
466
+ symbolSize: 50,
467
+ itemStyle: {
468
+ color: colors[0],
469
+ borderWidth: 2,
470
+ shadowColor: 'rgba(0, 0, 0, 0.3)',
471
+ shadowBlur: 4
472
+ },
465
473
  data: [
466
- { type: 'max', name: 'Max' },
467
- { type: 'min', name: 'Min' }
474
+ {type: 'max', name: '最大值'},
475
+ {type: 'min', name: '最小值',}
468
476
  ]
469
477
  },
470
478
  markLine: {
471
- data: [{ type: 'average', name: 'Avg' }]
479
+ symbol: ['circle', 'arrow'],
480
+ symbolSize: [8, 16],
481
+ lineStyle: {
482
+ type: 'dashed',
483
+ width: 3,
484
+ color: colors[0]
485
+ },
486
+ label: {
487
+ show: true,
488
+ position: 'end',
489
+ color: '#fff',
490
+ backgroundColor: colors[0],
491
+ padding: [4, 6],
492
+ borderRadius: 4,
493
+ fontSize: 12,
494
+ fontWeight: 'bold',
495
+ formatter: '{c}'
496
+ },
497
+ data: [
498
+ {
499
+ type: 'average',
500
+ name: 'Avg',
501
+ }
502
+ ]
472
503
  }
473
504
  },
474
505
  ]
@@ -2325,51 +2356,53 @@ export function getECharts(type, dataX, dataY, dataDim) {
2325
2356
  }
2326
2357
  else if (type ==='2A'){
2327
2358
  let series = [];
2328
- if (dataY.length > 0) {
2329
- series.push({
2330
- name: dataDim[0],
2331
- type: 'bar',
2332
- barWidth: '30px',
2333
- itemStyle: {
2334
- normal: {
2335
- color: function (params) {
2336
- const baseColor = colors[0];
2337
- const lightColor = hexToRgba(baseColor, 0.6);
2338
- const colorArr = params.value > 0 ? [baseColor, lightColor] : [lightColor, baseColor];
2339
- return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
2340
- { offset: 0, color: colorArr[0] },
2341
- { offset: 1, color: colorArr[1] }
2342
- ]);
2343
- },
2344
- barBorderRadius: [1]
2345
- }
2346
- },
2347
- tooltip: { valueFormatter: value => value },
2348
- data: dataY.map(item => item[0])
2349
- });
2350
- }
2351
- for (let i = 1; i < 2; i++) {
2352
- series.push({
2353
- name: dataDim[i],
2354
- type: 'line',
2355
- smooth: true,
2356
- showAllSymbol: true,
2357
- symbol: 'circle',
2358
- showSymbol: true,
2359
- symbolSize: 5,
2360
- lineStyle: {
2361
- color: colors[i % colors.length],
2362
- width: 3
2363
- },
2364
- label: { show: false },
2365
- itemStyle: {
2366
- color: colors[i % colors.length],
2367
- borderColor: hexToRgba(colors[i % colors.length], 0.6),
2368
- borderWidth: 3
2369
- },
2370
- tooltip: { valueFormatter: value => value },
2371
- data: dataY.map(item => item[1])
2372
- });
2359
+ const transData = transpose(dataY)
2360
+ for (let i = 0; i < transData.length; i++) {
2361
+ if (i===0){
2362
+ series.push({
2363
+ name: dataDim[i],
2364
+ type: 'bar',
2365
+ barWidth: '30px',
2366
+ itemStyle: {
2367
+ normal: {
2368
+ color: function (params) {
2369
+ const baseColor = colors[0];
2370
+ const lightColor = hexToRgba(baseColor, 0.6);
2371
+ const colorArr = params.value > 0 ? [baseColor, lightColor] : [lightColor, baseColor];
2372
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
2373
+ { offset: 0, color: colorArr[0] },
2374
+ { offset: 1, color: colorArr[1] }
2375
+ ]);
2376
+ },
2377
+ barBorderRadius: [i]
2378
+ }
2379
+ },
2380
+ tooltip: { valueFormatter: value => value },
2381
+ data: transData[i]
2382
+ });
2383
+ }else {
2384
+ series.push({
2385
+ name: dataDim[i],
2386
+ type: 'line',
2387
+ smooth: true,
2388
+ showAllSymbol: true,
2389
+ symbol: 'circle',
2390
+ showSymbol: true,
2391
+ symbolSize: 5,
2392
+ lineStyle: {
2393
+ color: colors[i % colors.length],
2394
+ width: 3
2395
+ },
2396
+ label: { show: false },
2397
+ itemStyle: {
2398
+ color: colors[i % colors.length],
2399
+ borderColor: hexToRgba(colors[i % colors.length], 0.6),
2400
+ borderWidth: 3
2401
+ },
2402
+ tooltip: { valueFormatter: value => value },
2403
+ data: transData[i]
2404
+ });
2405
+ }
2373
2406
  }
2374
2407
  const dynamicColors = dataDim.map((_, index) => colors[index % colors.length]);
2375
2408
  opt = {
@@ -2395,7 +2428,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
2395
2428
  },
2396
2429
  color: dynamicColors,
2397
2430
  grid: {
2398
- top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
2431
+ top: '35px', left: '0px', right: '10px', bottom: '0px', containLabel: true
2399
2432
  },
2400
2433
  xAxis: [
2401
2434
  {
@@ -2435,71 +2468,49 @@ export function getECharts(type, dataX, dataY, dataDim) {
2435
2468
  }
2436
2469
  else if (type ==='2B'){
2437
2470
  let series = [];
2438
- if (dataY.length > 0) {
2439
- series.push({
2440
- name: dataDim[0],
2441
- type: 'pictorialBar',
2442
- barWidth: '30px',
2443
- symbol: 'rect',
2444
- symbolSize: ['100%', 4],
2445
- symbolRepeat: true,
2446
- symbolMargin: 0.3,
2447
- symbolBoundingData: Math.max(...dataY.map(item => item[0])),
2448
- itemStyle: {
2449
- color: colors[0]
2450
- },
2451
- tooltip: { valueFormatter: value => value },
2452
- data: dataY.map(item => item[0])
2453
- });
2454
- }
2455
- if (dataY.length > 1) {
2456
- series.push({
2457
- name: dataDim[1],
2458
- type: 'line',
2459
- yAxisIndex: 1,
2460
- smooth: true,
2461
- showAllSymbol: true,
2462
- symbol: 'circle',
2463
- showSymbol: true,
2464
- symbolSize: 5,
2465
- lineStyle: {
2466
- color: colors[1],
2467
- width: 3
2468
- },
2469
- label: { show: false },
2470
- itemStyle: {
2471
- color: colors[1],
2472
- borderColor: hexToRgba(colors[1], 0.6),
2473
- borderWidth: 3
2474
- },
2475
- tooltip: { valueFormatter: value => value },
2476
- data: dataY.map(item => item[1])
2477
- });
2478
- }
2471
+ const transData = transpose(dataY);
2472
+ for (let i = 0; i < transData.length; i++) {
2473
+ if (i === 0) {
2474
+ series.push({
2475
+ name: dataDim[i],
2476
+ type: 'pictorialBar',
2477
+ barWidth: '30px',
2478
+ symbol: 'rect',
2479
+ symbolSize: ['100%', 4],
2480
+ symbolRepeat: true,
2481
+ symbolMargin: 2,
2482
+ symbolBoundingData: Math.max(...transData[i]),
2483
+ itemStyle: {
2484
+ color: colors[i]
2485
+ },
2486
+ tooltip: {valueFormatter: value => value},
2487
+ data: transData[i]
2488
+ });
2489
+ } else {
2490
+ series.push({
2491
+ name: dataDim[i],
2492
+ type: 'line',
2493
+ yAxisIndex: 1,
2494
+ smooth: true,
2495
+ showAllSymbol: true,
2496
+ symbol: 'circle',
2497
+ showSymbol: true,
2498
+ symbolSize: 5,
2499
+ lineStyle: {
2500
+ color: colors[i % colors.length],
2501
+ width: 3
2502
+ },
2503
+ label: {show: false},
2504
+ itemStyle: {
2505
+ color: colors[i % colors.length],
2506
+ borderColor: hexToRgba(colors[i % colors.length], 0.6),
2507
+ borderWidth: 3
2508
+ },
2509
+ tooltip: {valueFormatter: value => value},
2510
+ data: transData[i]
2511
+ });
2479
2512
 
2480
- for (let i = 2; i < 3; i++) {
2481
- series.push({
2482
- name: dataDim[i],
2483
- type: 'line',
2484
- yAxisIndex: 0,
2485
- smooth: true,
2486
- showAllSymbol: true,
2487
- symbol: 'circle',
2488
- showSymbol: true,
2489
- symbolSize: 5,
2490
- lineStyle: {
2491
- color: colors[i % colors.length],
2492
- width: 3
2493
- },
2494
- label: { show: false },
2495
- itemStyle: {
2496
- color: colors[i % colors.length],
2497
- borderColor: hexToRgba(colors[i % colors.length], 0.6),
2498
- borderWidth: 3
2499
- },
2500
- tooltip: { valueFormatter: value => value },
2501
- data: dataY.map(item => item[2])
2502
- });
2513
+ }
2503
2514
  }
2504
2515
  const dynamicColors = dataDim.map((_, index) => colors[index % colors.length]);
2505
2516
 
@@ -2526,7 +2537,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
2526
2537
  },
2527
2538
  color: dynamicColors,
2528
2539
  grid: {
2529
- top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
2540
+ top: '35px', left: '0px', right: '10px', bottom: '0px', containLabel: true
2530
2541
  },
2531
2542
  xAxis: [
2532
2543
  {
@@ -181,17 +181,20 @@ export default {
181
181
  }
182
182
  },
183
183
  initDefTabClickActiveStatus() {
184
- if(this.tabClickable === true && this.defaultTabActive === true ){
184
+ console.log("num-info handleCardClick 卡片初始设置为激活状态触发点击,START 当前实例:", this.widget.id + "_" + this.widget.name + ",this.defaultTabActive:" + this.defaultTabActive)
185
+ if (this.tabClickable === true && this.defaultTabActive === true) {
185
186
  if (!this.isActive) {
186
187
  this.isActive = true
187
188
  this.$emit('on-tab-click', {})
188
189
  }
189
- console.log("num-info handleCardClick 卡片初始设置为激活状态触发点击,当前实例:", this.widget.id + "_" + this.widget.name)
190
+ console.log("num-info handleCardClick 卡片初始设置为激活状态触发点击,END 当前实例:", this.widget.id + "_" + this.widget.name)
190
191
  }
191
192
  }
192
193
  },
193
194
  created() {
194
195
  this.eventBusOn()
196
+ },
197
+ mounted() {
195
198
  this.initDefTabClickActiveStatus()
196
199
  },
197
200
  beforeDestroy() {