lw-cdp-ui 1.4.38 → 1.4.40

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.
@@ -183,6 +183,8 @@ export default {
183
183
  ? index == 0
184
184
  ? setting?.title?.text || `${header}-${metricName}`
185
185
  : `${header}-${metricName}`
186
+ : index == 0
187
+ ? setting?.title?.text || metricName
186
188
  : metricName,
187
189
  unit: table.unit,
188
190
  unitName: table.unitName,
@@ -285,7 +285,6 @@ export default {
285
285
  }
286
286
  :deep(.el-form-item__label) {
287
287
  position: relative;
288
- display: inline-block;
289
288
  > .el-tooltip__trigger {
290
289
  position: absolute;
291
290
  right: 0;
@@ -1,28 +1,50 @@
1
1
  <template>
2
2
  <!-- 递归渲染子列 -->
3
- <el-table-column v-if="col.children && col.children.length" :prop="col.dataIndex" :label="col.title"
4
- :width="col.width" :min-width="col.minWidth" :align="col.align ?? 'center'" :fixed="col.fixed"
5
- :sortable="col.sortable" :show-overflow-tooltip="col.tooltip">
3
+ <el-table-column
4
+ v-if="col.children && col.children.length"
5
+ :prop="col.dataIndex"
6
+ :label="col.title"
7
+ :width="col.width"
8
+ :min-width="col.minWidth"
9
+ :align="col.align ?? 'center'"
10
+ :fixed="col.fixed"
11
+ :sortable="col.sortable"
12
+ :show-overflow-tooltip="col.tooltip">
6
13
  <TableColumn v-for="item in col.children" :col="item" />
7
14
  </el-table-column>
8
15
 
9
16
  <!-- 子级展开 -->
10
- <el-table-column v-else-if="col.expand" :prop="col.dataIndex" :label="col.title" type="expand" :width="col.width"
11
- :min-width="col.minWidth" :align="col.align ?? 'center'" :fixed="col.fixed" :sortable="col.sortable"
17
+ <el-table-column
18
+ v-else-if="col.expand"
19
+ :prop="col.dataIndex"
20
+ :label="col.title"
21
+ type="expand"
22
+ :width="col.width"
23
+ :min-width="col.minWidth"
24
+ :align="col.align ?? 'center'"
25
+ :fixed="col.fixed"
26
+ :sortable="col.sortable"
12
27
  :show-overflow-tooltip="col.tooltip">
13
28
  <template #default="scope">
14
29
  <!-- 自定义组件 -->
15
30
  <template v-if="col.component">
16
31
  <slot :name="col.component" :scope="scope.row" :col="col">
17
- <el-tag type="danger">[{{ col.component }}]
18
- 没有这个默认组件也未自定义插槽内容</el-tag>
32
+ <el-tag type="danger">[{{ col.component }}] 没有这个默认组件也未自定义插槽内容</el-tag>
19
33
  </slot>
20
34
  </template>
21
35
  </template>
22
36
  </el-table-column>
23
37
 
24
- <el-table-column v-else :prop="col.dataIndex" :label="col.title" :width="col.width" :min-width="col.minWidth"
25
- :align="col.align ?? 'center'" :fixed="col.fixed" :sortable="col.sortable" :show-overflow-tooltip="col.tooltip">
38
+ <el-table-column
39
+ v-else
40
+ :prop="col.dataIndex"
41
+ :label="col.title"
42
+ :width="col.width"
43
+ :min-width="col.minWidth"
44
+ :align="col.align ?? 'center'"
45
+ :fixed="col.fixed"
46
+ :sortable="col.sortable"
47
+ :show-overflow-tooltip="col.tooltip">
26
48
  <!-- 表头插槽 -->
27
49
  <template #header="{ column, $index }">
28
50
  <slot v-if="col?.header" :name="col.header" :scope="{ column, $index, col }">
@@ -32,7 +54,7 @@
32
54
  {{ col.title }}
33
55
  <el-tooltip v-if="col.tips">
34
56
  <template #content>
35
- <span style="max-width: 300px; display: inline-block;">{{ col.tips }}</span>
57
+ <span style="max-width: 300px; display: inline-block">{{ col.tips }}</span>
36
58
  </template>
37
59
  <el-icon>
38
60
  <component :is="col.icon || 'el-icon-question-filled'" />
@@ -49,12 +71,22 @@
49
71
  <template v-for="op in filterOperations(col.operation, scope.row)" :key="op">
50
72
  <!-- 图标按钮 -->
51
73
  <el-tooltip v-if="op.icon" :content="op.label" placement="top">
52
- <el-button type="primary" size="small" :icon="op.icon" :disabled="op.disabled?.(scope.row)" circle
74
+ <el-button
75
+ type="primary"
76
+ size="small"
77
+ :icon="op.icon"
78
+ :disabled="op.disabled?.(scope.row)"
79
+ circle
53
80
  @click="op.clickFun(scope.row, scope.$index, tableData)" />
54
81
  </el-tooltip>
55
82
 
56
83
  <!-- 文字按钮 -->
57
- <el-button v-else type="primary" text size="small" :disabled="op.disabled?.(scope.row)"
84
+ <el-button
85
+ v-else
86
+ type="primary"
87
+ text
88
+ size="small"
89
+ :disabled="op.disabled?.(scope.row)"
58
90
  @click="op.clickFun(scope.row, scope.$index, tableData)">
59
91
  {{ op.label }}
60
92
  </el-button>
@@ -66,11 +98,21 @@
66
98
  <!-- 显示前2个按钮 -->
67
99
  <template v-for="op in filterOperations(col.operation, scope.row).slice(0, 2)" :key="op">
68
100
  <el-tooltip v-if="op.icon" :content="op.label" placement="top">
69
- <el-button type="primary" size="small" :icon="op.icon" :disabled="op.disabled?.(scope.row)" circle
101
+ <el-button
102
+ type="primary"
103
+ size="small"
104
+ :icon="op.icon"
105
+ :disabled="op.disabled?.(scope.row)"
106
+ circle
70
107
  @click="op.clickFun(scope.row, scope.$index, tableData)" />
71
108
  </el-tooltip>
72
109
 
73
- <el-button v-else type="primary" text size="small" :disabled="op.disabled?.(scope.row)"
110
+ <el-button
111
+ v-else
112
+ type="primary"
113
+ text
114
+ size="small"
115
+ :disabled="op.disabled?.(scope.row)"
74
116
  @click="op.clickFun(scope.row, scope.$index, tableData)">
75
117
  {{ op.label }}
76
118
  </el-button>
@@ -80,7 +122,9 @@
80
122
  <el-button size="small" type="primary" icon="el-icon-more-filled" class="el-dropdown-link" text></el-button>
81
123
  <template #dropdown>
82
124
  <el-dropdown-menu>
83
- <el-dropdown-item v-for="op in filterOperations(col.operation, scope.row).slice(2)" :key="op"
125
+ <el-dropdown-item
126
+ v-for="op in filterOperations(col.operation, scope.row).slice(2)"
127
+ :key="op"
84
128
  @click="op.clickFun(scope.row, scope.$index, tableData)">
85
129
  {{ op.label }}
86
130
  </el-dropdown-item>
@@ -94,14 +138,20 @@
94
138
  <template v-else>
95
139
  <!-- 自定义渲染 -->
96
140
  <template v-if="col.eleRender">
97
- <span v-html="col.eleRender(scope.row, scope.$index)"
141
+ <span
142
+ v-html="col.eleRender(scope.row, scope.$index)"
98
143
  @click="col.clickFun?.(scope.row, scope.$index, tableData)" />
99
144
  </template>
100
145
 
101
146
  <!-- 图片列 -->
102
147
  <template v-else-if="col.type === 'img'">
103
- <el-image style="height: 28px;" :src="scope.row[col.dataIndex] || empty"
104
- :preview-src-list="[scope.row[col.dataIndex]]" fit="cover" :z-index="99" :preview-teleported="true">
148
+ <el-image
149
+ style="height: 28px"
150
+ :src="scope.row[col.dataIndex] || empty"
151
+ :preview-src-list="[scope.row[col.dataIndex]]"
152
+ fit="cover"
153
+ :z-index="99"
154
+ :preview-teleported="true">
105
155
  <template #error>
106
156
  <div class="image-slot">
107
157
  <el-icon><el-icon-picture /></el-icon>
@@ -120,16 +170,24 @@
120
170
  <template v-else>
121
171
  {{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
122
172
  </template>
123
-
124
173
  </template>
125
174
 
126
175
  <!-- 开关 -->
127
176
  <template v-else-if="col.switch">
128
- <el-switch :inline-prompt="true" :active-text="col.activeText || '是'" :inactive-text="col.inactiveText || '否'"
177
+ <el-switch
178
+ :inline-prompt="true"
179
+ :active-text="col.activeText || '是'"
180
+ :inactive-text="col.inactiveText || '否'"
129
181
  style="--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #c6c6c6"
130
- v-model="scope.row[col.dataIndex]" :active-value="col.activeValue ?? true"
131
- :inactive-value="col.inactiveValue ?? false" :disabled="col.disabled ? col.disabled(scope.row) : false"
132
- @change="(v) => { col.clickFun(v, scope.row) }" />
182
+ v-model="scope.row[col.dataIndex]"
183
+ :active-value="col.activeValue ?? true"
184
+ :inactive-value="col.inactiveValue ?? false"
185
+ :disabled="col.disabled ? col.disabled(scope.row) : false"
186
+ @change="
187
+ (v) => {
188
+ col.clickFun(v, scope.row)
189
+ }
190
+ " />
133
191
  </template>
134
192
 
135
193
  <!-- 视频 -->
@@ -145,18 +203,25 @@
145
203
  <!-- 自定义组件 -->
146
204
  <template v-else-if="col.component">
147
205
  <slot :name="col.component" :scope="scope.row" :col="col">
148
- <el-tag type="danger">[{{ col.component }}]
149
- 没有这个默认组件也未自定义插槽内容</el-tag>
206
+ <el-tag type="danger">[{{ col.component }}] 没有这个默认组件也未自定义插槽内容</el-tag>
150
207
  </slot>
151
208
  </template>
152
209
 
153
210
  <!-- 枚举 options -->
154
211
  <template v-else-if="col.options?.length">
155
212
  <template v-if="col?.isEdit">
156
- <el-select class="select-select number" v-model="scope.row[col.dataIndex]" placeholder="请选择" clearable
157
- filterable @change="(val) => col.callback?.(val, scope.row)">
158
- <el-option v-for="item in col.options" :key="item[col.optionsValue || 'value']"
159
- :label="item[col.optionsLabel || 'label']" :value="item[col.optionsValue || 'value']" />
213
+ <el-select
214
+ class="select-select number"
215
+ v-model="scope.row[col.dataIndex]"
216
+ placeholder="请选择"
217
+ clearable
218
+ filterable
219
+ @change="(val) => col.callback?.(val, scope.row)">
220
+ <el-option
221
+ v-for="item in col.options"
222
+ :key="item[col.optionsValue || 'value']"
223
+ :label="item[col.optionsLabel || 'label']"
224
+ :value="item[col.optionsValue || 'value']" />
160
225
  </el-select>
161
226
  </template>
162
227
  <template v-else>
@@ -166,8 +231,11 @@
166
231
 
167
232
  <!-- 链接跳转 -->
168
233
  <template v-else-if="col.link">
169
- <span class="el-button el-button--primary el-button--small is-text"
170
- @click="col.clickFun?.(scope.row, scope.$index, tableData)"> {{ scope.row[col.dataIndex] || '' }}</span>
234
+ <span
235
+ class="el-button el-button--primary el-button--small is-text"
236
+ @click="col.clickFun?.(scope.row, scope.$index, tableData)">
237
+ {{ scope.row[col.dataIndex] || '' }}</span
238
+ >
171
239
  </template>
172
240
 
173
241
  <!-- 其他简单渲染 -->
@@ -182,7 +250,6 @@
182
250
  </template>
183
251
  </template>
184
252
  </el-table-column>
185
-
186
253
  </template>
187
254
 
188
255
  <script>
@@ -208,7 +275,7 @@ export default {
208
275
  */
209
276
  filterOperations(operations, row) {
210
277
  return (
211
- operations?.filter(o => {
278
+ operations?.filter((o) => {
212
279
  const hasAuth = !o.auth || this.checkAuth(o.auth)
213
280
  const isVisible = !o.isShow || o.isShow(row)
214
281
  return hasAuth && isVisible
@@ -224,7 +291,7 @@ export default {
224
291
 
225
292
  if (!auth) return true
226
293
  if (Array.isArray(auth)) {
227
- return auth.some(permission => allPermissions.includes(permission))
294
+ return auth.some((permission) => allPermissions.includes(permission))
228
295
  }
229
296
  return allPermissions.includes(auth)
230
297
  },
@@ -251,11 +318,11 @@ export default {
251
318
  let values = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [value]
252
319
  // 获取匹配的 labels
253
320
  let labels = values
254
- .map(val => {
255
- const option = options.find(opt => opt[optionsValue] == val)
321
+ .map((val) => {
322
+ const option = options.find((opt) => opt[optionsValue] == val)
256
323
  return option ? option[optionsLabel] : ''
257
324
  })
258
- .filter(label => label !== '')
325
+ .filter((label) => label !== '')
259
326
  return labels.join(', ') || '--'
260
327
  }
261
328
  }
@@ -273,7 +340,6 @@ export default {
273
340
  }
274
341
 
275
342
  .btn-list {
276
-
277
343
  :deep(.el-button + .el-button),
278
344
  :deep(.el-button + .el-dropdown) {
279
345
  margin-left: 0px;
@@ -1193,7 +1193,7 @@ function o5(e, t, n, r, a, o) {
1193
1193
  _: 3
1194
1194
  }, 8, ["prop", "label", "width", "min-width", "align", "fixed", "sortable", "show-overflow-tooltip"]));
1195
1195
  }
1196
- const i5 = /* @__PURE__ */ ae(Ju, [["render", o5], ["__scopeId", "data-v-13993311"]]);
1196
+ const i5 = /* @__PURE__ */ ae(Ju, [["render", o5], ["__scopeId", "data-v-23665983"]]);
1197
1197
  function l5() {
1198
1198
  const e = Ft(!1), t = (o) => {
1199
1199
  o.requestFullscreen ? o.requestFullscreen() : o.mozRequestFullScreen ? o.mozRequestFullScreen() : o.webkitRequestFullscreen ? o.webkitRequestFullscreen() : o.msRequestFullscreen && o.msRequestFullscreen();
@@ -6791,7 +6791,7 @@ function y8(e, t, n, r, a, o) {
6791
6791
  _: 3
6792
6792
  }, 8, ["class", "prop", "rules"]));
6793
6793
  }
6794
- const B4 = /* @__PURE__ */ ae(h8, [["render", y8], ["__scopeId", "data-v-5f42e108"]]), b8 = {
6794
+ const B4 = /* @__PURE__ */ ae(h8, [["render", y8], ["__scopeId", "data-v-d2367b25"]]), b8 = {
6795
6795
  props: {
6796
6796
  modelValue: { type: String, default: "" },
6797
6797
  // 传入的字符串
@@ -20893,16 +20893,16 @@ const Zc = /* @__PURE__ */ ae(bA, [["render", CA], ["__scopeId", "data-v-c34118b
20893
20893
  for (let a = 0; a < r; a++) {
20894
20894
  const o = [];
20895
20895
  e.forEach((i, l) => {
20896
- var s;
20896
+ var s, u;
20897
20897
  if (a < i.headers.length) {
20898
- const u = i.headers[a], d = i.metricName, f = i.rows[0].values[a];
20898
+ const d = i.headers[a], f = i.metricName, A = i.rows[0].values[a];
20899
20899
  o.push({
20900
- name: u != d ? l == 0 ? ((s = t == null ? void 0 : t.title) == null ? void 0 : s.text) || `${u}-${d}` : `${u}-${d}` : d,
20900
+ name: d != f ? l == 0 ? ((s = t == null ? void 0 : t.title) == null ? void 0 : s.text) || `${d}-${f}` : `${d}-${f}` : l == 0 && ((u = t == null ? void 0 : t.title) == null ? void 0 : u.text) || f,
20901
20901
  unit: i.unit,
20902
20902
  unitName: i.unitName,
20903
20903
  unit: i.unit,
20904
20904
  setting: t,
20905
- value: f
20905
+ value: A
20906
20906
  });
20907
20907
  }
20908
20908
  }), o.length > 0 && n.push(o);
@@ -21014,7 +21014,7 @@ function IA(e, t, n, r, a, o) {
21014
21014
  ], 4))), 128))
21015
21015
  ], 4);
21016
21016
  }
21017
- const Yc = /* @__PURE__ */ ae(vA, [["render", IA], ["__scopeId", "data-v-281ea2fd"]]), xA = {
21017
+ const Yc = /* @__PURE__ */ ae(vA, [["render", IA], ["__scopeId", "data-v-13aefa1d"]]), xA = {
21018
21018
  name: "GaugeChart",
21019
21019
  props: {
21020
21020
  rawData: {