lw-cdp-ui 1.4.23 → 1.4.24
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/dist/components/lwBiChart/page.vue +57 -14
- package/dist/lw-cdp-ui.esm.js +1747 -1738
- package/dist/lw-cdp-ui.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="lw-bi-chart-global-layout">
|
|
3
|
-
<lw-search
|
|
4
|
-
|
|
3
|
+
<lw-search
|
|
4
|
+
v-if="searchOptions.length > 0"
|
|
5
|
+
class="search-body"
|
|
6
|
+
:options="searchOptions"
|
|
7
|
+
v-model="searchParams"
|
|
8
|
+
:hideLabel="true"
|
|
9
|
+
@search="search"
|
|
10
|
+
@reset="reset" />
|
|
5
11
|
|
|
6
|
-
<GridLayout
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
<GridLayout
|
|
13
|
+
v-model:layout="chartList"
|
|
14
|
+
:col-num="12"
|
|
15
|
+
:row-height="30"
|
|
16
|
+
:is-draggable="designMode"
|
|
17
|
+
:is-resizable="designMode"
|
|
18
|
+
:use-css-transforms="false"
|
|
19
|
+
vertical-compact
|
|
20
|
+
use-css-transforms>
|
|
21
|
+
<GridItem
|
|
22
|
+
v-for="(item, index) in chartList"
|
|
23
|
+
:key="item.i"
|
|
24
|
+
:x="item.x"
|
|
25
|
+
:y="item.y"
|
|
26
|
+
:w="item.w"
|
|
27
|
+
:h="item.h"
|
|
9
28
|
:i="item.i">
|
|
10
29
|
<div class="lw-bi-chart-global-layout-item" :class="{ edit: designMode }">
|
|
11
30
|
<div v-if="item.data?.setting?.activeDateUnitFilter" class="filter-top">
|
|
12
31
|
<el-radio-group v-model="item.timeUnit" @change="changeTimeUnit(item, index)">
|
|
13
|
-
<el-radio-button
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
v-
|
|
32
|
+
<el-radio-button
|
|
33
|
+
:label="key"
|
|
34
|
+
:value="value"
|
|
35
|
+
v-for="(value, key) in item.data?.setting?.optionalDateUnitRanges"
|
|
36
|
+
:key="key" />
|
|
37
|
+
<el-radio-button disabled v-if="Object.keys(item.data?.setting?.optionalDateUnitRanges).length == 0"
|
|
38
|
+
>未选择周期列表</el-radio-button
|
|
39
|
+
>
|
|
17
40
|
</el-radio-group>
|
|
18
41
|
</div>
|
|
19
42
|
|
|
20
43
|
<div v-if="item?.type == 'Dashboard'" class="grid-item-dashboard">
|
|
21
44
|
<lwBiChartPage :chartId="item.id" />
|
|
22
45
|
</div>
|
|
23
|
-
<lwBiChartItem
|
|
46
|
+
<lwBiChartItem
|
|
47
|
+
:rawData="item.data"
|
|
24
48
|
:height="item.data?.setting?.activeDateUnitFilter ? 'calc(100% - 36px)' : '100%'" />
|
|
25
49
|
<div class="remove" v-if="designMode" @click="removeChart(index)">
|
|
26
50
|
<el-button type="primary" link icon="el-icon-delete"></el-button>
|
|
27
51
|
</div>
|
|
28
52
|
</div>
|
|
29
|
-
|
|
30
53
|
</GridItem>
|
|
31
54
|
</GridLayout>
|
|
32
55
|
<div class="no-record-panel e-unselect" v-if="chartList.length === 0">
|
|
33
|
-
<el-empty
|
|
56
|
+
<el-empty
|
|
57
|
+
:description="designMode ? '点击上方工具栏中的按钮,添加图表至当前仪表板' : '仪表板中还没有添加任何图表'" />
|
|
34
58
|
</div>
|
|
35
59
|
</div>
|
|
36
60
|
</template>
|
|
@@ -81,8 +105,8 @@ export default {
|
|
|
81
105
|
let visualize = await this.$http.get(
|
|
82
106
|
`${this.$config.API_URL}/bi-manage/{tenantId}/{buCode}/visualize/${chartData.id}`
|
|
83
107
|
)
|
|
84
|
-
visualize?.models.forEach(item => {
|
|
85
|
-
item?.dimensions.forEach(d => {
|
|
108
|
+
visualize?.models.forEach((item) => {
|
|
109
|
+
item?.dimensions.forEach((d) => {
|
|
86
110
|
d.timeSetting.timeUnit = chartItem.timeUnit
|
|
87
111
|
})
|
|
88
112
|
})
|
|
@@ -160,6 +184,25 @@ export default {
|
|
|
160
184
|
removeChart(index) {
|
|
161
185
|
this.modelValue.splice(index, 1)
|
|
162
186
|
},
|
|
187
|
+
listToTree(data) {
|
|
188
|
+
const result = []
|
|
189
|
+
const map = {}
|
|
190
|
+
|
|
191
|
+
data.forEach((item) => {
|
|
192
|
+
map[item.id] = { value: item.id, label: item.name, children: [] }
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
data.forEach((item) => {
|
|
196
|
+
const parent = map[item.parent]
|
|
197
|
+
if (parent) {
|
|
198
|
+
parent.children.push(map[item.id])
|
|
199
|
+
} else {
|
|
200
|
+
result.push(map[item.id])
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
return result
|
|
205
|
+
},
|
|
163
206
|
async getFilter(filterControls) {
|
|
164
207
|
for (const control of filterControls) {
|
|
165
208
|
const { type } = control
|