lw-cdp-ui 1.4.25 → 1.4.26

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.
@@ -16,8 +16,7 @@
16
16
  :is-draggable="designMode"
17
17
  :is-resizable="designMode"
18
18
  :use-css-transforms="false"
19
- vertical-compact
20
- use-css-transforms>
19
+ vertical-compact>
21
20
  <GridItem
22
21
  v-for="(item, index) in chartList"
23
22
  :key="item.i"
@@ -34,14 +33,20 @@
34
33
  :value="value"
35
34
  v-for="(value, key) in item.data?.setting?.optionalDateUnitRanges"
36
35
  :key="key" />
37
- <el-radio-button disabled v-if="Object.keys(item.data?.setting?.optionalDateUnitRanges).length == 0"
38
- >未选择周期列表</el-radio-button
39
- >
36
+ <el-radio-button disabled v-if="Object.keys(item.data?.setting?.optionalDateUnitRanges).length == 0">
37
+ 未选择周期列表 未选择周期列表
38
+ </el-radio-button>
40
39
  </el-radio-group>
41
40
  </div>
42
41
 
43
42
  <div v-if="item?.type == 'Dashboard'" class="grid-item-dashboard">
44
- <lwBiChartPage :chartId="item.id" />
43
+ <lwBiChartPage
44
+ :ref="
45
+ (el) => {
46
+ if (el) chartPageRefs[index] = el
47
+ }
48
+ "
49
+ :chartId="item.id" />
45
50
  </div>
46
51
  <lwBiChartItem
47
52
  :rawData="item.data"
@@ -68,6 +73,7 @@ export default {
68
73
  return {
69
74
  id: '',
70
75
  searchOptions: [],
76
+ chartPageRefs: [],
71
77
  chartList: [],
72
78
  globalFilter: { values: {}, ranges: {} },
73
79
  searchParams: {}
@@ -157,20 +163,38 @@ export default {
157
163
  return result
158
164
  },
159
165
  search() {
166
+ let filter = JSON.parse(JSON.stringify(this.globalFilter))
160
167
  let params = this.unflattenObject(this.searchParams)
161
168
  if (params.ranges) {
162
169
  Object.entries(params.ranges).map(([key, value]) => {
163
- this.globalFilter.ranges[key].timeRange = {
170
+ filter.ranges[key].timeRange = {
164
171
  from: value[0],
165
172
  to: value[1]
166
173
  }
174
+ filter.ranges[key].type = 'ABSOLUTE'
175
+ })
176
+ }
177
+ filter.values = params.values
178
+ this.getChartList(filter)
179
+
180
+ // 如果有二级图表
181
+ if (this.chartPageRefs.length > 0) {
182
+ this.chartPageRefs.forEach((item) => {
183
+ item.searchParams = this.searchParams
184
+ item.globalFilter = filter
185
+ item.search()
167
186
  })
168
187
  }
169
- this.globalFilter.values = params.values
170
- this.getChartList(this.globalFilter)
171
188
  },
172
189
  reset() {
173
190
  this.getChartList({ values: {}, ranges: {} })
191
+
192
+ // 如果有二级图表
193
+ if (this.chartPageRefs.length > 0) {
194
+ this.chartPageRefs.forEach((item) => {
195
+ item.getChartList({ values: {}, ranges: {} })
196
+ })
197
+ }
174
198
  },
175
199
  async getChartList(globalFilter = {}) {
176
200
  let params = {
@@ -211,7 +235,10 @@ export default {
211
235
  const getOptions = async (setting) => {
212
236
  const { type, dict, dataInterfaceUri, dimensionTableId } = setting.options
213
237
  if (type === 'DICT') {
214
- return Object.entries(dict).map(([key, value]) => ({ value: key, label: value }))
238
+ return Object.entries(dict).map(([key, value]) => ({
239
+ value: key,
240
+ label: value
241
+ }))
215
242
  } else if (type === 'DATA_INTERFACE') {
216
243
  const res = await this.$http.get(dataInterfaceUri)
217
244
  return res.map((item) => ({ value: item.id, label: item.name }))
@@ -224,7 +251,10 @@ export default {
224
251
  const getTreeOptions = async (setting) => {
225
252
  const { type, dict, dataInterfaceUri, dimensionTableId } = setting.options
226
253
  if (type === 'DICT') {
227
- return Object.entries(dict).map(([key, value]) => ({ value: key, label: value }))
254
+ return Object.entries(dict).map(([key, value]) => ({
255
+ value: key,
256
+ label: value
257
+ }))
228
258
  } else if (type === 'DATA_INTERFACE') {
229
259
  const res = await this.$http.get(dataInterfaceUri)
230
260
  return this.listToTree(res)
@@ -24,7 +24,10 @@
24
24
  </div>
25
25
  <div class="adminui-side-scroll">
26
26
  <el-scrollbar>
27
- <el-menu :default-active="active" router :collapse="menuIsCollapse"
27
+ <el-menu
28
+ :default-active="active"
29
+ router
30
+ :collapse="menuIsCollapse"
28
31
  :unique-opened="$config.MENU_UNIQUE_OPENED">
29
32
  <NavMenu :navMenus="menu"></NavMenu>
30
33
  </el-menu>
@@ -41,7 +44,7 @@
41
44
  <div class="aminui-body el-container">
42
45
  <div class="aminui-body-menu-top">
43
46
  <div class="top-bar-title">
44
- <span class="title">{{ $t("lwLayout.layout.topbar") }}:</span>
47
+ <span class="title">{{ $t('lwLayout.layout.topbar') }}:</span>
45
48
  <Topbar v-if="!ismobile"></Topbar>
46
49
  </div>
47
50
  <userbar :isShowBu="isShowBu" :isShowTask="isShowTask" :isInitialized="isInitialized">
@@ -81,7 +84,6 @@
81
84
  </div>
82
85
  </section>
83
86
  </template>
84
-
85
87
  </template>
86
88
 
87
89
  <script>
@@ -165,7 +167,7 @@ export default {
165
167
  let { grantedApplications } = JSON.parse(userAuthInfo) || {}
166
168
 
167
169
  if (grantedApplications) {
168
- let item = grantedApplications.find(x => x.code === this.$config.APP_NAME.toLowerCase())
170
+ let item = grantedApplications.find((x) => x.code === this.$config.APP_NAME.toLowerCase())
169
171
  return item?.aliasName ? item : ''
170
172
  } else {
171
173
  return ''
@@ -174,7 +176,7 @@ export default {
174
176
  },
175
177
  beforeCreate() {
176
178
  // 挂载自定义菜单订阅
177
- this.$bus.$on('setMenu', menu => {
179
+ this.$bus.$on('setMenu', (menu) => {
178
180
  this.changeMenu = true
179
181
  this.menu = this.filterUrl(menu)
180
182
  })
@@ -225,14 +227,16 @@ export default {
225
227
  let user = await this.$api.auth.user()
226
228
 
227
229
  // 判断密码是否过期
228
- if (!user?.userAuthInfo && user?.loginPage?.includes("pwdChange")) {
230
+ if (!user?.userAuthInfo && user?.loginPage?.includes('pwdChange')) {
229
231
  this.$message.warning('您的密码已过期,请修改密码!')
230
232
  return false
231
233
  }
232
234
 
233
235
  // 处理应用显示逻辑
234
- let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
235
- user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x =>
236
+ let application = [
237
+ ...new Set(user.userAuthInfo.menus.map((permission) => permission.split('.')[0].split('_')[0]))
238
+ ]
239
+ user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter((x) =>
236
240
  application.includes(x.code)
237
241
  )
238
242
 
@@ -245,7 +249,10 @@ export default {
245
249
  }
246
250
  this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
247
251
  this.$tool.data.set('userAuthInfo', userAuthInfo)
248
- this.$store.state.user = userAuthInfo
252
+ this.$store.state.user = {
253
+ ...this.$store.state.user,
254
+ ...userAuthInfo
255
+ }
249
256
 
250
257
  // 动态菜单
251
258
  MENU_LIST['menuDynamic'] = !!user?.menuDynamic
@@ -276,7 +283,7 @@ export default {
276
283
 
277
284
  // 处理子节点
278
285
  if (node.children && node.children.length) {
279
- route.children = node.children.sort((a, b) => a.sort - b.sort).map(child => processNode(child, route))
286
+ route.children = node.children.sort((a, b) => a.sort - b.sort).map((child) => processNode(child, route))
280
287
  }
281
288
 
282
289
  return route
@@ -285,7 +292,7 @@ export default {
285
292
  // 按applications分组
286
293
  const groupedData = {}
287
294
 
288
- originData.forEach(item => {
295
+ originData.forEach((item) => {
289
296
  // 获取应用类型(如ec、cdp等)
290
297
  const appType = item.applications[0]
291
298
 
@@ -299,7 +306,7 @@ export default {
299
306
  })
300
307
 
301
308
  // 对每个应用类型的菜单进行排序
302
- Object.keys(groupedData).forEach(appType => {
309
+ Object.keys(groupedData).forEach((appType) => {
303
310
  groupedData[appType].sort((a, b) => a.sort - b.sort)
304
311
  })
305
312
 
@@ -328,7 +335,7 @@ export default {
328
335
  filterUrl(map) {
329
336
  var newMap = []
330
337
  map &&
331
- map.forEach(item => {
338
+ map.forEach((item) => {
332
339
  item.meta = item.meta ? item.meta : {}
333
340
  //处理隐藏
334
341
  if (item.meta.hidden || item.meta.type == 'button') {