lambo-design-bi 0.0.174 → 0.0.176

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,5 +1,6 @@
1
1
  <template>
2
- <LamboChartsFactory v-if="dataX" :height="height" :type="chartsType" :data-x="dataX" :data-y="dataY" :data-dim="dataDim">
2
+ <LamboChartsFactory v-if="dataX" :height="height" :type="chartsType" :data-x="dataX" :data-y="dataY"
3
+ :data-dim="dataDim" :charts-note="chartsNote">
3
4
  </LamboChartsFactory>
4
5
  </template>
5
6
  <script>
@@ -32,7 +33,9 @@ export default {
32
33
  xKey: null,
33
34
  yKey: null,
34
35
  dKey: null,
35
- dataCol: null
36
+ dataCol: null,
37
+ noteApiId: null,
38
+ chartsNote: null
36
39
  }
37
40
  },
38
41
  methods: {
@@ -58,6 +61,7 @@ export default {
58
61
  this.dataCol = this.columns["data_col"]
59
62
  }
60
63
  }
64
+ this.noteApiId = this.widget.options.noteApiId
61
65
  },
62
66
  doSearch() {
63
67
  if (!this.apiId) {
@@ -66,7 +70,7 @@ export default {
66
70
  }
67
71
  getListMapData(this.apiId, this.params).then(res => {
68
72
  if (res.data.code === 0) {
69
- console.error("charts组件调用服务[" + this.widget.options.apiId + "]失败:" + res.data.message)
73
+ console.error("charts数据服务[" + this.widget.options.apiId + "]请求失败:" + res.data.message)
70
74
  } else {
71
75
  if (res.data.data.rows.length > 0) {
72
76
  let rows = res.data.data.rows
@@ -78,21 +82,47 @@ export default {
78
82
  this.dataY = resObj.dataY
79
83
  this.dataDim = resObj.dataDim
80
84
  } else {
81
- console.error("charts组件[" + this.widget.name + "]数据转换失败:" + resObj)
82
- this.$Message.warning("charts组件[" + this.widget.name + "]数据转换失败")
85
+ console.error("charts数据服务[" + this.widget.name + "]数据转换失败:" + resObj)
86
+ this.$Message.warning("charts数据服务[" + this.widget.name + "]数据转换失败")
83
87
  }
84
88
  }
85
89
  } else {
86
- console.warn("charts组件调用服务[" + this.widget.options.apiId + "]数据为空:" + res.data.message)
90
+ console.warn("charts数据服务[" + this.widget.options.apiId + "]请求数据为空:" + res.data.message)
87
91
  this.dataX = []
88
92
  this.dataY = []
89
93
  this.dataDim = []
90
94
  }
91
95
  }
92
96
  }).catch(err => {
93
- console.error("charts的调用服务[" + this.widget.options.apiId + "]异常:", err)
97
+ console.error("charts数据服务[" + this.widget.options.apiId + "]请求异常:", err)
94
98
  })
95
99
 
100
+ if (this.noteApiId) {
101
+ getListMapData(this.noteApiId, this.params).then(res => {
102
+ if (res.data.code === 0) {
103
+ console.error("charts说明服务[" + this.widget.options.apiId + "]请求失败:" + res.data.message)
104
+ } else {
105
+ if (res.data.data.rows.length > 0) {
106
+ let rows = res.data.data.rows
107
+ if (rows && rows.length > 0) {
108
+ let rowData = rows[0]
109
+ if(rowData && Object.prototype.hasOwnProperty.call(rowData, "charts_note")){
110
+ this.chartsNote = rowData["charts_note"]
111
+ }
112
+ }
113
+ } else {
114
+ console.warn("charts说明服务[" + this.widget.options.apiId + "]请求数据为空:" + res.data.message)
115
+ this.noteApiId = null
116
+ this.chartsNote = null
117
+ }
118
+ }
119
+ }).catch(err => {
120
+ console.error("charts说明服务[" + this.widget.options.apiId + "]请求异常:", err)
121
+ this.noteApiId = null
122
+ this.chartsNote = null
123
+ })
124
+ }
125
+
96
126
  }
97
127
  },
98
128
  computed: {
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <LamboNumberInfoBi :title="title" :sub-title="subTitle" :num="num" :sub-num1="subNum1" :trend1="trend1"
3
- :sub-num2="subNum2" :trend2="trend2" :polar1="polar1" :polar2="polar2">
3
+ :is-drill="isDrill" @on-drill="onDrill" :sub-num2="subNum2" :trend2="trend2" :polar1="polar1" :polar2="polar2">
4
4
  </LamboNumberInfoBi>
5
5
  </template>
6
6
  <script>
7
7
  import { getListMapData } from "../api/data"
8
8
  import LamboNumberInfoBi from "../../../pub/number-info/index"
9
+ import { pageDrill } from '../util/router-util';
9
10
 
10
11
  export default {
11
12
  name: "BiNumIndex",
@@ -31,13 +32,27 @@ export default {
31
32
  polar1: null,
32
33
  subNum2: null,
33
34
  trend2: null,
34
- polar2: null
35
+ polar2: null,
36
+ isDrill: false,
37
+ toPageId: null,
38
+ toRouteName: null,
39
+ drillK1: null,
40
+ drillV1: null,
41
+ drillK2: null,
42
+ drillV2: null,
43
+ drillK3: null,
44
+ dirllV3: null
35
45
  }
36
46
  },
37
47
  methods: {
38
48
  initConfig() {
39
49
  this.title = this.widget.options.title || this.widget.name || ''
40
50
  this.apiId = this.widget.options.apiId
51
+ this.toPageId = this.widget.options.toPageId
52
+ this.toRouteName = this.widget.options.toRouteName
53
+ if (this.toPageId && this.toRouteName) {
54
+ this.isDrill = true
55
+ }
41
56
  },
42
57
  doSearch() {
43
58
  if (!this.apiId) {
@@ -61,7 +76,19 @@ export default {
61
76
  this.polar1 = row['polar1']
62
77
  }
63
78
  if (Object.prototype.hasOwnProperty.call(row, 'polar2')) {
64
- this.polar2 = row['polar2']
79
+ this.polar2 = row['polar2']
80
+ }
81
+ if (Object.prototype.hasOwnProperty.call(row, 'drill_k1') && Object.prototype.hasOwnProperty.call(row, 'drill_v1')) {
82
+ this.drillK1 = row['drill_k1'] || ''
83
+ this.drillV1 = row['drill_v1'] || ''
84
+ }
85
+ if (Object.prototype.hasOwnProperty.call(row, 'drill_k2') && Object.prototype.hasOwnProperty.call(row, 'drill_v2')) {
86
+ this.drillK2 = row['drill_k2'] || ''
87
+ this.drillV2 = row['drill_v2'] || ''
88
+ }
89
+ if (Object.prototype.hasOwnProperty.call(row, 'drill_k3') && Object.prototype.hasOwnProperty.call(row, 'drill_v3')) {
90
+ this.drillK3 = row['drill_k3'] || ''
91
+ this.drillV3 = row['drill_v3'] || ''
65
92
  }
66
93
  }
67
94
  }
@@ -69,6 +96,32 @@ export default {
69
96
  }).catch(err => {
70
97
  console.error("数据卡片的调用服务[" + this.widget.options.apiId + "]异常:", err)
71
98
  })
99
+ },
100
+ async onDrill(obj) {
101
+ let drillKV = {}
102
+ if (this.drillK1 && this.drillV1) {
103
+ drillKV[this.drillK1] = this.drillV1
104
+ }
105
+ if (this.drillK2 && this.drillV2) {
106
+ drillKV[this.drillK2] = this.drillV2
107
+ }
108
+ if (this.drillK3 && this.drillV3) {
109
+ drillKV[this.drillK3] = this.drillV3
110
+ }
111
+ let drillParams = Object.assign({}, this.params, obj, drillKV)
112
+ try {
113
+ await pageDrill(
114
+ this.$router,
115
+ this.widget.rootId,
116
+ this.toPageId,
117
+ this.toRouteName,
118
+ drillParams
119
+ )
120
+ console.log('number 跳转成功')
121
+ } catch (error) {
122
+ console.error('num 跳转失败:', error.msg)
123
+ this.$message.error(error.msg)
124
+ }
72
125
  }
73
126
  },
74
127
  created() {
@@ -153,5 +153,4 @@ export function getSearchFormRes(formParams, pageWidget) {
153
153
  }
154
154
  }
155
155
  return emptySearchArr
156
-
157
156
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div style="width: 100%">
3
3
  <LamboPagingTableBi ref="table" :auto-search="false" :columns="columns" :dataUrl="widget.options.url"
4
- :export-batch-size="20000" :show-table-option="true" :exportName="widget.name"
4
+ :export-batch-size="20000" :show-table-option="false" :exportName="widget.name"
5
5
  :page-disable="widget.options.isPaging === '0'" :page-size="widget.options.pageSize" :export-request-limit="200"
6
6
  :isSingleSelectModel="true" :showSummary="widget.options.isPageSum === '1'" :summary-method="handleSummary"
7
7
  @on-data-load="onDataLoad" :searchParams="tableSearchParams">
@@ -41,7 +41,7 @@ export default {
41
41
  },
42
42
  goDetail(routerName, pageId, row) {
43
43
  let parentPageId = this.widget.rootId || ''
44
- let newQuery = Object.assign({}, this.params, row);
44
+ let newQuery = Object.assign({}, this.params, row)
45
45
  newQuery['pageId'] = pageId
46
46
  newQuery['parentPageId'] = parentPageId
47
47
  console.log("goDetail newQuery:", newQuery)
@@ -0,0 +1,101 @@
1
+ /**
2
+ * 下钻页公共方法 (Promise)
3
+ *
4
+ * @param {*} router Vue Router 实例
5
+ * @param {*} fromPageId 源页面ID
6
+ * @param {*} toPageId 目标页面ID
7
+ * @param {*} toRouteName 目标路由名称
8
+ * @param {*} dataObj 传递的数据对象
9
+ * @returns {Promise} 返回Promise对象
10
+ */
11
+ export function pageDrill(router, fromPageId, toPageId, toRouteName, dataObj = {}) {
12
+ return new Promise((resolve, reject) => {
13
+ // 参数验证
14
+ if (!fromPageId) {
15
+ const error = {
16
+ code: RES_CODE.PARAM_ERROR,
17
+ msg: "页面跳转失败,跳转参数源页面编码为空",
18
+ data: fromPageId
19
+ }
20
+ console.error("drill 参数 fromPageId 无效:", fromPageId)
21
+ reject(error)
22
+ return
23
+ }
24
+ if (!toPageId) {
25
+ const error = {
26
+ code: RES_CODE.PARAM_ERROR,
27
+ msg: "页面跳转失败,跳转参数目标页面编码为空",
28
+ data: toPageId
29
+ }
30
+ console.error("drill 参数 toPageId 无效:", toPageId)
31
+ reject(error)
32
+ return
33
+ }
34
+ if (!toRouteName) {
35
+ const error = {
36
+ code: RES_CODE.PARAM_ERROR,
37
+ msg: "页面跳转失败,跳转参数目标路由名称为空",
38
+ data: toRouteName
39
+ }
40
+ console.error("drill 参数 toRouteName 无效:", toRouteName)
41
+ reject(error)
42
+ return
43
+ }
44
+
45
+ // 构造查询参数
46
+ const drillParams = {
47
+ ...dataObj,
48
+ pageId: toPageId,
49
+ parentPageId: fromPageId,
50
+ toRouteName: toRouteName
51
+ }
52
+ console.log("drill 下钻跳转参数 drillParams:", drillParams)
53
+
54
+ // 执行跳转
55
+ router.push({
56
+ name: toRouteName,
57
+ query: drillParams
58
+ })
59
+ .then(() => {
60
+ resolve({
61
+ code: RES_CODE.SUCCESS,
62
+ msg: "页面跳转成功",
63
+ data: null
64
+ })
65
+ })
66
+ .catch(error => {
67
+ console.error("drill 页面跳转失败:", error)
68
+
69
+ let errorMsg = "页面跳转失败,未知原因跳转失败"
70
+ let errorCode = RES_CODE.PAGE_ERROR
71
+
72
+ if (error.name === 'NavigationDuplicated') {
73
+ errorMsg = "页面跳转失败,跳转同一页面"
74
+ } else if (error.message && error.message.includes('not found')) {
75
+ errorMsg = "页面跳转失败,页面不存在"
76
+ }
77
+
78
+ reject({
79
+ code: errorCode,
80
+ msg: errorMsg,
81
+ data: error
82
+ })
83
+ })
84
+ })
85
+ }
86
+
87
+ /**
88
+ * 返回状态码
89
+ */
90
+ export const RES_CODE = {
91
+ // 成功
92
+ SUCCESS: 1,
93
+ // 未知原因失败
94
+ UNKNOWN_ERROR: 0,
95
+ // 参数异常
96
+ PARAM_ERROR: 1001,
97
+ // 页面异常
98
+ PAGE_ERROR: 3001,
99
+ // 系统异常
100
+ SYSTEM_ERROR: 5001
101
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.174",
3
+ "version": "0.0.176",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div ref="chartContainer" :style="{ width: '100%', height: height }"></div>
2
+ <div class="charts-with-note">
3
+ <div ref="chartContainer" :style="{ width: '100%', height: height }"></div>
4
+ <p v-if="chartsNote" v-html="chartsNote"></p>
5
+ </div>
3
6
  </template>
4
7
  <script>
5
8
  import * as echarts from 'echarts'
@@ -14,6 +17,10 @@ export default {
14
17
  height: {
15
18
  type: String,
16
19
  default: '300px'
20
+ },
21
+ chartsNote: {
22
+ type: String,
23
+ default: ''
17
24
  }
18
25
  },
19
26
  data() {
@@ -27,7 +34,7 @@ export default {
27
34
  watch: {
28
35
  options: {
29
36
  handler(newOptions) {
30
- console.log("watch options newOptions:", newOptions)
37
+ console.log("watch options newOptions:", newOptions)
31
38
  if (this.chart) {
32
39
  this.chart.setOption(newOptions, true)
33
40
  }
@@ -38,13 +45,21 @@ export default {
38
45
  },
39
46
  methods: {
40
47
  initChart() {
41
- if (!this.chart) {
48
+ this.$nextTick(() => {
42
49
  const container = this.$refs.chartContainer
43
50
  if (container) {
44
51
  this.chart = echarts.init(container)
45
52
  this.chart.setOption(this.options || {})
53
+
54
+ this.chart.resize()
55
+ const resizeChart = () => {
56
+ if (this.chart) {
57
+ this.chart.resize();
58
+ }
59
+ }
60
+ window.addEventListener('resize', resizeChart);
46
61
  }
47
- }
62
+ })
48
63
  }
49
64
  },
50
65
  beforeDestroy() {
@@ -55,4 +70,10 @@ export default {
55
70
  }
56
71
  }
57
72
  </script>
58
- <style scoped></style>
73
+ <style scoped>
74
+ .chart-with-note {
75
+ width: 100%;
76
+ display: flex;
77
+ flex-direction: column;
78
+ }
79
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <lambo-charts :options="getOptions" :height="height"></lambo-charts>
2
+ <lambo-charts :options="getOptions" :height="height" :charts-note="chartsNote"></lambo-charts>
3
3
  </template>
4
4
  <script>
5
5
  import LamboCharts from "../echarts.vue"
@@ -28,6 +28,10 @@ export default {
28
28
  height: {
29
29
  type: String,
30
30
  default: '300px'
31
+ },
32
+ chartsNote: {
33
+ type: String,
34
+ default: ''
31
35
  }
32
36
  },
33
37
  data() {
@@ -168,10 +168,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
168
168
  },
169
169
  },
170
170
  grid: {
171
- top: '10%',
172
- left: '2%',
173
- bottom: '1%',
174
- containLabel: true
171
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
175
172
  },
176
173
  xAxis: {
177
174
  type: 'category',
@@ -287,10 +284,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
287
284
  },
288
285
  },
289
286
  grid: {
290
- top: '10%',
291
- left: '2%',
292
- bottom: '1%',
293
- containLabel: true
287
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
294
288
  },
295
289
  xAxis: {
296
290
  type: 'category',
@@ -365,10 +359,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
365
359
  }
366
360
  },
367
361
  grid: {
368
- top: '10%',
369
- left: '2%',
370
- bottom: '1%',
371
- containLabel: true
362
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
372
363
  },
373
364
  calculable: true,
374
365
  xAxis: {
@@ -492,10 +483,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
492
483
  }
493
484
  },
494
485
  grid: {
495
- top: '10%',
496
- left: '2%',
497
- bottom: '1%',
498
- containLabel: true
486
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
499
487
  },
500
488
  legend: {
501
489
  icon: 'roundRect',
@@ -609,10 +597,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
609
597
  data: dataDim
610
598
  },
611
599
  grid: {
612
- top: '10%',
613
- left: '2%',
614
- bottom: '1%',
615
- containLabel: true
600
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
616
601
  },
617
602
  xAxis: {
618
603
  type: 'category',
@@ -722,10 +707,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
722
707
  data: dataDim
723
708
  },
724
709
  grid: {
725
- top: '10%',
726
- left: '2%',
727
- bottom: '1%',
728
- containLabel: true
710
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
729
711
  },
730
712
  xAxis: {
731
713
  type: 'value',
@@ -814,10 +796,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
814
796
  }
815
797
  },
816
798
  grid: {
817
- top: '10%',
818
- left: '2%',
819
- bottom: '1%',
820
- containLabel: true
799
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
821
800
  },
822
801
  legend: {
823
802
  icon: 'roundRect',
@@ -931,10 +910,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
931
910
  data: dataDim
932
911
  },
933
912
  grid: {
934
- top: '10%',
935
- left: '2%',
936
- bottom: '1%',
937
- containLabel: true
913
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
938
914
  },
939
915
  xAxis: {
940
916
  type: 'value',
@@ -1024,10 +1000,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
1024
1000
  data: dataDim
1025
1001
  },
1026
1002
  grid: {
1027
- top: '10%',
1028
- left: '2%',
1029
- bottom: '1%',
1030
- containLabel: true
1003
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
1031
1004
  },
1032
1005
  xAxis: {
1033
1006
  type: 'value',
@@ -1101,6 +1074,9 @@ export function getECharts(type, dataX, dataY, dataDim) {
1101
1074
  trigger: 'item',
1102
1075
  formatter: '{b}:<br/> {d}%<br/>{c}'
1103
1076
  },
1077
+ grid: {
1078
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
1079
+ },
1104
1080
  legend: {
1105
1081
  icon: 'circle',
1106
1082
  itemWidth: 8,
@@ -1399,7 +1375,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
1399
1375
  sum += dataY[0][i]
1400
1376
  }
1401
1377
  let title33 = ''
1402
- if(dataDim && dataDim.length > 0){
1378
+ if (dataDim && dataDim.length > 0) {
1403
1379
  title33 = formatTitle(dataDim[0])
1404
1380
  }
1405
1381
  opt = {
@@ -1523,7 +1499,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
1523
1499
  });
1524
1500
  }
1525
1501
  let title34 = ''
1526
- if(dataDim && dataDim.length > 0){
1502
+ if (dataDim && dataDim.length > 0) {
1527
1503
  title34 = formatTitle(dataDim[0])
1528
1504
  }
1529
1505
  opt = {
@@ -1835,10 +1811,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
1835
1811
  backgroundColor: '#fff',
1836
1812
  color: colors,
1837
1813
  grid: {
1838
- top: '15%',
1839
- bottom: '54%',
1840
- left: "30%",
1841
- containLabel: false
1814
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
1842
1815
  },
1843
1816
  legend: {
1844
1817
  icon: 'circle',
@@ -2016,10 +1989,7 @@ export function getECharts(type, dataX, dataY, dataDim) {
2016
1989
  backgroundColor: '#fff',
2017
1990
  color: colors,
2018
1991
  grid: {
2019
- top: '15%',
2020
- bottom: '54%',
2021
- left: "30%",
2022
- containLabel: false
1992
+ top: '5px', left: '0px', right: '10px', bottom: '0px', containLabel: true
2023
1993
  },
2024
1994
  legend: {
2025
1995
  icon: 'circle',
@@ -1,9 +1,11 @@
1
1
  <template>
2
2
  <div class="ivu-number-info">
3
- <div class="ivu-number-info-title-lambo" v-if="title || $slots.title">
3
+ <div class="ivu-number-info-title-lambo title-div"
4
+ :class="{ 'isDrill': isDrill }" v-if="title || $slots.title" @click="drill">
4
5
  <slot name="title">{{ title }}</slot>
6
+ <Icon v-if="isDrill" type="ios-redo-outline" />
5
7
  </div>
6
- <div class="ivu-number-info-subTitle" v-if="subTitle || $slots.subTitle">
8
+ <div v-if="subTitle" class="ivu-number-info-subTitle">
7
9
  <slot name="subTitle">{{ subTitle }}</slot>
8
10
  </div>
9
11
  <div class="ivu-number-info-value-lambo" :style="valueStyle">
@@ -56,7 +58,8 @@ export default {
56
58
  type: String
57
59
  },
58
60
  subTitle: {
59
- type: String
61
+ type: String,
62
+ default: ''
60
63
  },
61
64
  num: {
62
65
  type: [String, Number]
@@ -71,7 +74,7 @@ export default {
71
74
  },
72
75
  polar1: {
73
76
  type: String,
74
- required: false,
77
+ required: false,
75
78
  validator(value) {
76
79
  return !value || ['pos', 'neg'].includes(value);
77
80
  }
@@ -86,7 +89,7 @@ export default {
86
89
  },
87
90
  polar2: {
88
91
  type: String,
89
- required: false,
92
+ required: false,
90
93
  validator(value) {
91
94
  return !value || ['pos', 'neg'].includes(value);
92
95
  }
@@ -94,6 +97,10 @@ export default {
94
97
  gap: {
95
98
  type: [String, Number],
96
99
  default: 6
100
+ },
101
+ isDrill: {
102
+ type: Boolean,
103
+ default: false
97
104
  }
98
105
  },
99
106
  computed: {
@@ -102,6 +109,12 @@ export default {
102
109
  'margin-top': this.gap + 'px'
103
110
  };
104
111
  }
112
+ },
113
+ methods: {
114
+ drill() {
115
+ console.log("number-info 点击了下钻按钮")
116
+ this.$emit('on-drill', {})
117
+ }
105
118
  }
106
119
  };
107
120
  </script>
@@ -124,4 +137,20 @@ export default {
124
137
  -webkit-transition: all .2s;
125
138
  transition: all .2s
126
139
  }
140
+
141
+ .title-div {
142
+ display: flex;
143
+ justify-content: space-between;
144
+ align-items: center;
145
+ transition: all 0.2s ease;
146
+ border-radius: 5px;
147
+ }
148
+
149
+ .title-div.isDrill {
150
+ cursor: pointer;
151
+ }
152
+
153
+ .title-div.isDrill:hover {
154
+ transform: scale(1.02);
155
+ }
127
156
  </style>
@@ -218,7 +218,7 @@
218
218
  </div>
219
219
  </Col>
220
220
  </Row>
221
- <Row style="margin-top:10px;">
221
+ <Row>
222
222
  <Col span="24">
223
223
  <Table v-if="hackReset" ref="tableRef" :border="tableBorder" :columns="tableColumns" :data="tableData"
224
224
  :disabledHover="disabledHover" :draggable="draggable" :height="tableHeight" :max-height="tableMaxHeight"
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div>
3
+ <div class="words-item" v-for="(item, index) in suggestions" :key="index">
4
+ <div class="words-title" :style="{ background: item.titleBackgroundColor || '#21DA2E' }">
5
+ {{ item.title }}
6
+ </div>
7
+ <div class="words-content">{{ item.content }}</div>
8
+ </div>
9
+ </div>
10
+ </template>
11
+ <script>
12
+ export default {
13
+ name: 'LamboWordsInfoBi',
14
+ props: {
15
+ suggestions: {
16
+ type: Array,
17
+ default: () => [
18
+ {
19
+ title: '旺季建议',
20
+ titleBackgroundColor: '#1E58F8',
21
+ content: '成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。'
22
+ },
23
+ {
24
+ title: '淡季建议',
25
+ titleBackgroundColor: '#21DA2E',
26
+ content: '成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。成都市在旺季期间,例如11,12月份,装载率高于90%,建议增加配送车辆,优化路线规划,提高配送效率。'
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+ <style scoped>
34
+ .words-item {
35
+ display: flex;
36
+ flex-direction: column;
37
+ margin-bottom: 15px;
38
+ }
39
+
40
+ .words-item:last-child {
41
+ margin-bottom: 0;
42
+ }
43
+
44
+ .words-title {
45
+ width: 150px;
46
+ height: 30px;
47
+ line-height: 30px;
48
+ font-size: 14px;
49
+ font-weight: bold;
50
+ color: #FFFFFF;
51
+ text-align: center;
52
+ border-radius: 6px;
53
+ z-index: 1;
54
+ }
55
+
56
+ .words-content {
57
+ margin-top: -14px;
58
+ padding: 20px 5px 15px 5px;
59
+ background: #F3F8FE;
60
+ border-radius: 5px;
61
+ line-height: 1.6;
62
+ font-size: 14px;
63
+ }
64
+ </style>