lw-cdp-ui 1.4.8 → 1.4.10
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/charts/MapChart.vue +1 -1
- package/dist/components/lwFormJson/index.vue +22 -39
- package/dist/components/lwLayout/components/tags.vue +57 -20
- package/dist/components/lwTable/components/TableColumn.vue +58 -123
- package/dist/components/lwTable/index.js +305 -292
- package/dist/components/lwTable/index.scss +183 -173
- package/dist/components/lwTable/index.vue +50 -96
- package/dist/lw-cdp-ui.esm.js +3882 -3793
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
this.option = option
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const mapJson = await this.$http.get(
|
|
82
|
+
const mapJson = await this.$http.get(`/${this.$config.APP_NAME.toLowerCase()}/map/${this.rawData?.setting?.mapName || 'china'}.json`)
|
|
83
83
|
this.echarts.registerMap(this.rawData?.setting?.mapName || 'china', mapJson)
|
|
84
84
|
|
|
85
85
|
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-container :style="{ maxHeight }">
|
|
3
|
-
<el-aside v-if="!hideModule"
|
|
4
|
-
width="200px"
|
|
5
|
-
class="form-json-body">
|
|
3
|
+
<el-aside v-if="!hideModule" width="200px" class="form-json-body">
|
|
6
4
|
<div class="menu-list">
|
|
7
5
|
<el-collapse v-model="activeNames">
|
|
8
|
-
<el-collapse-item v-for="item in menuList"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<draggable class="menu-list-group"
|
|
13
|
-
:list="item.list"
|
|
14
|
-
:group="{ name: 'people', pull: 'clone', put: false }"
|
|
15
|
-
:clone="cloneItem"
|
|
16
|
-
item-key="name">
|
|
6
|
+
<el-collapse-item v-for="item in menuList" :title="item.title" :name="item.title" :key="item.title"
|
|
7
|
+
class="menu-list-title">
|
|
8
|
+
<draggable class="menu-list-group" :list="item.list" :group="{ name: 'people', pull: 'clone', put: false }"
|
|
9
|
+
:clone="cloneItem" item-key="name">
|
|
17
10
|
<template #item="{ element }">
|
|
18
|
-
<div v-if="!element?.hide"
|
|
19
|
-
class="list-group-item">
|
|
11
|
+
<div v-if="!element?.hide" class="list-group-item">
|
|
20
12
|
{{ element.label }}
|
|
21
13
|
</div>
|
|
22
14
|
</template>
|
|
@@ -29,25 +21,14 @@
|
|
|
29
21
|
<el-container>
|
|
30
22
|
<!-- <el-header v-if="hideTool">暂未开发工具栏</el-header> -->
|
|
31
23
|
<el-main class="form-json-body">
|
|
32
|
-
<el-form ref="form"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
:label-width="config.labelWidth"
|
|
36
|
-
:label-position="$i18n.locale == 'en-us' ? 'top' : config.labelPosition"
|
|
37
|
-
v-loading="loading"
|
|
38
|
-
:disabled="isView"
|
|
39
|
-
element-loading-text="Loading...">
|
|
24
|
+
<el-form ref="form" @click.capture="back(config)" :model="form" :label-width="config.labelWidth"
|
|
25
|
+
:label-position="$i18n.locale == 'en-us' ? 'top' : config.labelPosition" v-loading="loading"
|
|
26
|
+
:disabled="isView" element-loading-text="Loading...">
|
|
40
27
|
<el-row :gutter="10">
|
|
41
|
-
<JsonItem :formItems="config.formItems"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@curClick="selectItem">
|
|
46
|
-
<template v-for="item in custom"
|
|
47
|
-
v-slot:[item.component]="{ itemCur, formCur }">
|
|
48
|
-
<slot :name="item.component"
|
|
49
|
-
:itemCur="itemCur"
|
|
50
|
-
:formCur="formCur"></slot>
|
|
28
|
+
<JsonItem :formItems="config.formItems" :hideBorder="hideBorder" :form="form" :custom="custom"
|
|
29
|
+
@curClick="selectItem">
|
|
30
|
+
<template v-for="item in custom" v-slot:[item.component]="{ itemCur, formCur }">
|
|
31
|
+
<slot :name="item.component" :itemCur="itemCur" :formCur="formCur"></slot>
|
|
51
32
|
</template>
|
|
52
33
|
</JsonItem>
|
|
53
34
|
</el-row>
|
|
@@ -56,11 +37,8 @@
|
|
|
56
37
|
</el-main>
|
|
57
38
|
</el-container>
|
|
58
39
|
|
|
59
|
-
<el-aside v-if="!hideConfig"
|
|
60
|
-
|
|
61
|
-
class="aside-right">
|
|
62
|
-
<StatsConfig :item="curItem"
|
|
63
|
-
:config="config" />
|
|
40
|
+
<el-aside v-if="!hideConfig" width="300px" class="aside-right">
|
|
41
|
+
<StatsConfig :item="curItem" :config="config" />
|
|
64
42
|
</el-aside>
|
|
65
43
|
</el-container>
|
|
66
44
|
</template>
|
|
@@ -103,7 +81,7 @@ export default {
|
|
|
103
81
|
* label: '选项2'
|
|
104
82
|
* }]
|
|
105
83
|
* }
|
|
106
|
-
* ...
|
|
84
|
+
* ...
|
|
107
85
|
* }]
|
|
108
86
|
* labelWidth: '100px', // 表单域标签的宽度
|
|
109
87
|
* labelPosition: 'top', // 表单域标签的位置,如果值为 left 或者 right 时,则需要设置 label-width
|
|
@@ -326,6 +304,7 @@ export default {
|
|
|
326
304
|
border-top: 0;
|
|
327
305
|
background-color: var(--color-white);
|
|
328
306
|
}
|
|
307
|
+
|
|
329
308
|
.menu-list-title {
|
|
330
309
|
:deep(.el-collapse-item__header) {
|
|
331
310
|
font-weight: bold;
|
|
@@ -333,14 +312,17 @@ export default {
|
|
|
333
312
|
background-color: var(--el-menu-bg-color);
|
|
334
313
|
}
|
|
335
314
|
}
|
|
315
|
+
|
|
336
316
|
:deep(.el-collapse-item__content) {
|
|
337
317
|
padding-bottom: 10px;
|
|
338
318
|
}
|
|
319
|
+
|
|
339
320
|
.menu-list-group {
|
|
340
321
|
display: flex;
|
|
341
322
|
flex-wrap: wrap;
|
|
342
323
|
gap: 10px;
|
|
343
324
|
padding: 10px;
|
|
325
|
+
|
|
344
326
|
.list-group-item {
|
|
345
327
|
width: calc(50% - 5px);
|
|
346
328
|
background-color: var(--el-fill-color-light);
|
|
@@ -358,8 +340,9 @@ export default {
|
|
|
358
340
|
border-left: 1px solid var(--el-border-color-light);
|
|
359
341
|
background-color: var(--color-white);
|
|
360
342
|
}
|
|
343
|
+
|
|
361
344
|
.form-json-body {
|
|
362
345
|
max-height: calc(100vh - 137px);
|
|
363
346
|
background-color: var(--color-white);
|
|
364
347
|
}
|
|
365
|
-
</style>
|
|
348
|
+
</style>
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="adminui-tags">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<li v-bind:key="tag"
|
|
11
|
-
|
|
12
|
-
@contextmenu.prevent="openContextMenu($event, tag)">
|
|
3
|
+
<!-- 左滚动箭头 -->
|
|
4
|
+
<div v-if="iconVisible" class="scroll-arrow left" @click="scrollLeft">
|
|
5
|
+
<el-icon><el-icon-arrow-left /></el-icon>
|
|
6
|
+
</div>
|
|
7
|
+
<draggable v-model="$store.state.viewTags.viewTags" @change="changeTages" class="context-menu-list" ref="tags"
|
|
8
|
+
itemKey="name">
|
|
9
|
+
<template #item="{ element: tag, index }" keyName="tag">
|
|
10
|
+
<li v-bind:key="tag" :class="[isActive(tag) ? 'active' : '', tag.meta.affix ? 'affix' : '']"
|
|
11
|
+
@contextmenu.prevent="openContextMenu($event, tag)">
|
|
13
12
|
<router-link :to="tag">
|
|
14
13
|
<span>{{ getIdName(tag) }}</span>
|
|
15
|
-
<el-icon v-if="!tag.meta.affix"
|
|
16
|
-
@click.prevent.stop='closeSelectedTag(tag)'><el-icon-close /></el-icon>
|
|
14
|
+
<el-icon v-if="!tag.meta.affix" @click.prevent.stop='closeSelectedTag(tag)'><el-icon-close /></el-icon>
|
|
17
15
|
</router-link>
|
|
18
16
|
</li>
|
|
19
17
|
</template>
|
|
20
18
|
</draggable>
|
|
19
|
+
<!-- 右滚动箭头 -->
|
|
20
|
+
<div v-if="iconVisible" class="scroll-arrow right" @click="scrollRight">
|
|
21
|
+
<el-icon><el-icon-arrow-right /></el-icon>
|
|
22
|
+
</div>
|
|
21
23
|
</div>
|
|
22
24
|
|
|
23
25
|
<transition name="el-zoom-in-top">
|
|
24
|
-
<ul v-if="contextMenuVisible"
|
|
25
|
-
:style="{left:left+'px',top:top+'px'}"
|
|
26
|
-
class="contextmenu"
|
|
27
|
-
id="contextmenu">
|
|
26
|
+
<ul v-if="contextMenuVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu" id="contextmenu">
|
|
28
27
|
<li @click="refreshTab()"><el-icon><el-icon-refresh /></el-icon>刷新</li>
|
|
29
28
|
<hr>
|
|
30
|
-
<li @click="closeTabs()"
|
|
31
|
-
:class="contextMenuItem.meta.affix?'disabled':''">
|
|
29
|
+
<li @click="closeTabs()" :class="contextMenuItem.meta.affix ? 'disabled' : ''">
|
|
32
30
|
<el-icon><el-icon-close /></el-icon>关闭标签
|
|
33
31
|
</li>
|
|
34
32
|
<li @click="closeOtherTabs()">
|
|
@@ -57,6 +55,7 @@ export default {
|
|
|
57
55
|
contextMenuItem: null,
|
|
58
56
|
left: 0,
|
|
59
57
|
top: 0,
|
|
58
|
+
iconVisible: false,
|
|
60
59
|
tipVisible: false,
|
|
61
60
|
tipDisplayed: false,
|
|
62
61
|
menu: this.$router.sc_getMenu()
|
|
@@ -112,6 +111,10 @@ export default {
|
|
|
112
111
|
|
|
113
112
|
// 将方法挂载到全局
|
|
114
113
|
this.$store.state.viewTags.closeTagAndJump = this.closeTagAndJump
|
|
114
|
+
|
|
115
|
+
window.addEventListener('resize', () => {
|
|
116
|
+
this.changeLeftRight()
|
|
117
|
+
})
|
|
115
118
|
},
|
|
116
119
|
mounted() {
|
|
117
120
|
this.scrollInit()
|
|
@@ -157,6 +160,9 @@ export default {
|
|
|
157
160
|
this.$tool.data.set('RouteTags', this.$store.state.viewTags.viewTags)
|
|
158
161
|
}
|
|
159
162
|
|
|
163
|
+
this.changeLeftRight()
|
|
164
|
+
},
|
|
165
|
+
changeLeftRight() {
|
|
160
166
|
//判断标签容器是否出现滚动条
|
|
161
167
|
this.$nextTick(() => {
|
|
162
168
|
const tags = document.querySelector(".context-menu-list")
|
|
@@ -168,6 +174,9 @@ export default {
|
|
|
168
174
|
if (!this.tipDisplayed) {
|
|
169
175
|
this.tipVisible = true
|
|
170
176
|
}
|
|
177
|
+
this.iconVisible = true
|
|
178
|
+
} else {
|
|
179
|
+
this.iconVisible = false
|
|
171
180
|
}
|
|
172
181
|
})
|
|
173
182
|
},
|
|
@@ -181,7 +190,7 @@ export default {
|
|
|
181
190
|
if (item.children) {
|
|
182
191
|
item = item.children[0]
|
|
183
192
|
}
|
|
184
|
-
|
|
193
|
+
|
|
185
194
|
// 兼容合并菜单
|
|
186
195
|
if (item.meta?.code && item.meta?.code != this.$config.APP_NAME.toLowerCase()) {
|
|
187
196
|
item.path = `/i/${item.name}`
|
|
@@ -203,6 +212,8 @@ export default {
|
|
|
203
212
|
this.$router.push({ path: item.path })
|
|
204
213
|
}
|
|
205
214
|
}
|
|
215
|
+
|
|
216
|
+
this.changeLeftRight()
|
|
206
217
|
},
|
|
207
218
|
//tag右键
|
|
208
219
|
openContextMenu(e, tag) {
|
|
@@ -338,7 +349,27 @@ export default {
|
|
|
338
349
|
return tag.meta.title
|
|
339
350
|
}
|
|
340
351
|
|
|
341
|
-
}
|
|
352
|
+
},
|
|
353
|
+
// 左滚动
|
|
354
|
+
scrollLeft() {
|
|
355
|
+
this.scroll(-200);
|
|
356
|
+
},
|
|
357
|
+
|
|
358
|
+
// 右滚动
|
|
359
|
+
scrollRight() {
|
|
360
|
+
this.scroll(200);
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
// 执行滚动
|
|
364
|
+
scroll(offset) {
|
|
365
|
+
const container = document.querySelector('.context-menu-list');
|
|
366
|
+
if (container) {
|
|
367
|
+
container.scrollBy({
|
|
368
|
+
left: offset,
|
|
369
|
+
behavior: 'smooth'
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
},
|
|
342
373
|
}
|
|
343
374
|
}
|
|
344
375
|
</script>
|
|
@@ -356,6 +387,7 @@ export default {
|
|
|
356
387
|
list-style-type: none;
|
|
357
388
|
padding: 10px 0;
|
|
358
389
|
}
|
|
390
|
+
|
|
359
391
|
.contextmenu hr {
|
|
360
392
|
margin: 5px 0;
|
|
361
393
|
border: none;
|
|
@@ -363,6 +395,7 @@ export default {
|
|
|
363
395
|
font-size: 0px;
|
|
364
396
|
background-color: var(--el-border-color-light);
|
|
365
397
|
}
|
|
398
|
+
|
|
366
399
|
.contextmenu li {
|
|
367
400
|
display: flex;
|
|
368
401
|
align-items: center;
|
|
@@ -372,14 +405,17 @@ export default {
|
|
|
372
405
|
padding: 0 17px;
|
|
373
406
|
color: #606266;
|
|
374
407
|
}
|
|
408
|
+
|
|
375
409
|
.contextmenu li i {
|
|
376
410
|
font-size: 14px;
|
|
377
411
|
margin-right: 10px;
|
|
378
412
|
}
|
|
413
|
+
|
|
379
414
|
.contextmenu li:hover {
|
|
380
415
|
background-color: var(--el-color-primary-light-9);
|
|
381
416
|
color: var(--el-color-primary);
|
|
382
417
|
}
|
|
418
|
+
|
|
383
419
|
.contextmenu li.disabled {
|
|
384
420
|
cursor: not-allowed;
|
|
385
421
|
color: #bbb;
|
|
@@ -389,6 +425,7 @@ export default {
|
|
|
389
425
|
.tags-tip {
|
|
390
426
|
padding: 5px;
|
|
391
427
|
}
|
|
428
|
+
|
|
392
429
|
.tags-tip p {
|
|
393
430
|
margin-bottom: 10px;
|
|
394
431
|
}
|
|
@@ -1,35 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- 递归渲染子列 -->
|
|
3
|
-
<el-table-column v-if="col.children && col.children.length"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:min-width="col.minWidth"
|
|
8
|
-
:align="col.align ?? 'center'"
|
|
9
|
-
:fixed="col.fixed"
|
|
10
|
-
:sortable="col.sortable"
|
|
11
|
-
:show-overflow-tooltip="col.tooltip">
|
|
12
|
-
<TableColumn v-for="item in col.children"
|
|
13
|
-
:col="item" />
|
|
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">
|
|
6
|
+
<TableColumn v-for="item in col.children" :col="item" />
|
|
14
7
|
</el-table-column>
|
|
15
8
|
|
|
16
9
|
<!-- 子级展开 -->
|
|
17
|
-
<el-table-column v-else-if="col.expand"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type="expand"
|
|
21
|
-
:width="col.width"
|
|
22
|
-
:min-width="col.minWidth"
|
|
23
|
-
:align="col.align ?? 'center'"
|
|
24
|
-
:fixed="col.fixed"
|
|
25
|
-
:sortable="col.sortable"
|
|
26
|
-
:show-overflow-tooltip="col.tooltip">
|
|
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"
|
|
12
|
+
:show-overflow-tooltip="col.tooltip">
|
|
27
13
|
<template #default="scope">
|
|
28
14
|
<!-- 自定义组件 -->
|
|
29
15
|
<template v-if="col.component">
|
|
30
|
-
<slot :name="col.component"
|
|
31
|
-
:scope="scope.row"
|
|
32
|
-
:col="col">
|
|
16
|
+
<slot :name="col.component" :scope="scope.row" :col="col">
|
|
33
17
|
<el-tag type="danger">[{{ col.component }}]
|
|
34
18
|
没有这个默认组件也未自定义插槽内容</el-tag>
|
|
35
19
|
</slot>
|
|
@@ -37,20 +21,11 @@
|
|
|
37
21
|
</template>
|
|
38
22
|
</el-table-column>
|
|
39
23
|
|
|
40
|
-
<el-table-column v-else
|
|
41
|
-
|
|
42
|
-
:label="col.title"
|
|
43
|
-
:width="col.width"
|
|
44
|
-
:min-width="col.minWidth"
|
|
45
|
-
:align="col.align ?? 'center'"
|
|
46
|
-
:fixed="col.fixed"
|
|
47
|
-
:sortable="col.sortable"
|
|
48
|
-
:show-overflow-tooltip="col.tooltip">
|
|
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">
|
|
49
26
|
<!-- 表头插槽 -->
|
|
50
27
|
<template #header="{ column, $index }">
|
|
51
|
-
<slot v-if="col?.header"
|
|
52
|
-
:name="col.header"
|
|
53
|
-
:scope="{ column, $index, col }">
|
|
28
|
+
<slot v-if="col?.header" :name="col.header" :scope="{ column, $index, col }">
|
|
54
29
|
<el-tag type="danger">[{{ col.header }}]没有这个自定义表头</el-tag>
|
|
55
30
|
</slot>
|
|
56
31
|
<template v-else>
|
|
@@ -69,30 +44,18 @@
|
|
|
69
44
|
<!-- 单元格内容 -->
|
|
70
45
|
<template #default="scope">
|
|
71
46
|
<!-- 操作列 -->
|
|
72
|
-
<div class="btn-list"
|
|
73
|
-
v-if="col?.operation">
|
|
47
|
+
<div class="btn-list" v-if="col?.operation">
|
|
74
48
|
<template v-if="filterOperations(col.operation, scope.row).length <= 3">
|
|
75
|
-
<template v-for="op in filterOperations(col.operation, scope.row)"
|
|
76
|
-
:key="op">
|
|
49
|
+
<template v-for="op in filterOperations(col.operation, scope.row)" :key="op">
|
|
77
50
|
<!-- 图标按钮 -->
|
|
78
|
-
<el-tooltip v-if="op.icon"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<el-button type="primary"
|
|
82
|
-
size="small"
|
|
83
|
-
:icon="op.icon"
|
|
84
|
-
:disabled="op.disabled?.(scope.row)"
|
|
85
|
-
circle
|
|
86
|
-
@click="op.clickFun(scope.row, scope.$index, tableData)" />
|
|
51
|
+
<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
|
|
53
|
+
@click="op.clickFun(scope.row, scope.$index, tableData)" />
|
|
87
54
|
</el-tooltip>
|
|
88
55
|
|
|
89
56
|
<!-- 文字按钮 -->
|
|
90
|
-
<el-button v-else
|
|
91
|
-
|
|
92
|
-
text
|
|
93
|
-
size="small"
|
|
94
|
-
:disabled="op.disabled?.(scope.row)"
|
|
95
|
-
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
57
|
+
<el-button v-else type="primary" text size="small" :disabled="op.disabled?.(scope.row)"
|
|
58
|
+
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
96
59
|
{{ op.label }}
|
|
97
60
|
</el-button>
|
|
98
61
|
</template>
|
|
@@ -101,40 +64,24 @@
|
|
|
101
64
|
<!-- 更多操作下拉菜单 -->
|
|
102
65
|
<template v-else>
|
|
103
66
|
<!-- 显示前2个按钮 -->
|
|
104
|
-
<template v-for="op in filterOperations(col.operation, scope.row).slice(0, 2)"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
placement="top">
|
|
109
|
-
<el-button type="primary"
|
|
110
|
-
size="small"
|
|
111
|
-
:icon="op.icon"
|
|
112
|
-
:disabled="op.disabled?.(scope.row)"
|
|
113
|
-
circle
|
|
114
|
-
@click="op.clickFun(scope.row, scope.$index, tableData)" />
|
|
67
|
+
<template v-for="op in filterOperations(col.operation, scope.row).slice(0, 2)" :key="op">
|
|
68
|
+
<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
|
|
70
|
+
@click="op.clickFun(scope.row, scope.$index, tableData)" />
|
|
115
71
|
</el-tooltip>
|
|
116
72
|
|
|
117
|
-
<el-button v-else
|
|
118
|
-
|
|
119
|
-
text
|
|
120
|
-
size="small"
|
|
121
|
-
:disabled="op.disabled?.(scope.row)"
|
|
122
|
-
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
73
|
+
<el-button v-else type="primary" text size="small" :disabled="op.disabled?.(scope.row)"
|
|
74
|
+
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
123
75
|
{{ op.label }}
|
|
124
76
|
</el-button>
|
|
125
77
|
</template>
|
|
126
78
|
|
|
127
79
|
<el-dropdown>
|
|
128
|
-
<el-button size="small"
|
|
129
|
-
type="primary"
|
|
130
|
-
icon="el-icon-more-filled"
|
|
131
|
-
class="el-dropdown-link"
|
|
132
|
-
text></el-button>
|
|
80
|
+
<el-button size="small" type="primary" icon="el-icon-more-filled" class="el-dropdown-link" text></el-button>
|
|
133
81
|
<template #dropdown>
|
|
134
82
|
<el-dropdown-menu>
|
|
135
|
-
<el-dropdown-item v-for="op in filterOperations(col.operation, scope.row).slice(2)"
|
|
136
|
-
|
|
137
|
-
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
83
|
+
<el-dropdown-item v-for="op in filterOperations(col.operation, scope.row).slice(2)" :key="op"
|
|
84
|
+
@click="op.clickFun(scope.row, scope.$index, tableData)">
|
|
138
85
|
{{ op.label }}
|
|
139
86
|
</el-dropdown-item>
|
|
140
87
|
</el-dropdown-menu>
|
|
@@ -148,17 +95,13 @@
|
|
|
148
95
|
<!-- 自定义渲染 -->
|
|
149
96
|
<template v-if="col.eleRender">
|
|
150
97
|
<span v-html="col.eleRender(scope.row, scope.$index)"
|
|
151
|
-
|
|
98
|
+
@click="col.clickFun?.(scope.row, scope.$index, tableData)" />
|
|
152
99
|
</template>
|
|
153
100
|
|
|
154
101
|
<!-- 图片列 -->
|
|
155
102
|
<template v-else-if="col.type === 'img'">
|
|
156
|
-
<el-image style="height: 28px;"
|
|
157
|
-
|
|
158
|
-
:preview-src-list="[scope.row[col.dataIndex]]"
|
|
159
|
-
fit="cover"
|
|
160
|
-
:z-index="99"
|
|
161
|
-
:preview-teleported="true">
|
|
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">
|
|
162
105
|
<template #error>
|
|
163
106
|
<div class="image-slot">
|
|
164
107
|
<el-icon><el-icon-picture /></el-icon>
|
|
@@ -170,46 +113,38 @@
|
|
|
170
113
|
<!-- 日期转换 -->
|
|
171
114
|
<template v-else-if="col.date">
|
|
172
115
|
<template v-if="Array.isArray(scope.row[col.dataIndex])">
|
|
173
|
-
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss') : '--'}}
|
|
116
|
+
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
174
117
|
到
|
|
175
|
-
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex][1]).format('YYYY-MM-DD HH:mm:ss') : '--'}}
|
|
118
|
+
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex][1]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
176
119
|
</template>
|
|
177
120
|
<template v-else>
|
|
178
|
-
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss') : '--'}}
|
|
121
|
+
{{ scope.row[col.dataIndex] ? dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
179
122
|
</template>
|
|
180
123
|
|
|
181
124
|
</template>
|
|
182
125
|
|
|
183
126
|
<!-- 开关 -->
|
|
184
127
|
<template v-else-if="col.switch">
|
|
185
|
-
<el-switch :inline-prompt="true"
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
:active-value="col.activeValue ?? true"
|
|
191
|
-
:inactive-value="col.inactiveValue ?? false"
|
|
192
|
-
:disabled="col.disabled ? col.disabled(scope.row) : false"
|
|
193
|
-
@change="(v) => {col.clickFun(v, scope.row)}" />
|
|
128
|
+
<el-switch :inline-prompt="true" :active-text="col.activeText || '是'" :inactive-text="col.inactiveText || '否'"
|
|
129
|
+
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) }" />
|
|
194
133
|
</template>
|
|
195
134
|
|
|
196
135
|
<!-- 视频 -->
|
|
197
136
|
<template v-else-if="col.video">
|
|
198
|
-
<video width="40"
|
|
199
|
-
:src="scope.row[col.dataIndex]"
|
|
200
|
-
style="margin: 5px 0" />
|
|
137
|
+
<video width="40" :src="scope.row[col.dataIndex]" style="margin: 5px 0" />
|
|
201
138
|
</template>
|
|
202
139
|
|
|
203
140
|
<!-- 数组转string -->
|
|
204
141
|
<template v-else-if="col.array">
|
|
205
|
-
<span>{{ scope.row[col.dataIndex]
|
|
142
|
+
<span>{{ scope.row[col.dataIndex] ? scope.row[col.dataIndex].toString() : '' }}</span>
|
|
206
143
|
</template>
|
|
207
144
|
|
|
208
145
|
<!-- 自定义组件 -->
|
|
209
146
|
<template v-else-if="col.component">
|
|
210
|
-
<slot :name="col.component"
|
|
211
|
-
:scope="scope.row"
|
|
212
|
-
:col="col">
|
|
147
|
+
<slot :name="col.component" :scope="scope.row" :col="col">
|
|
213
148
|
<el-tag type="danger">[{{ col.component }}]
|
|
214
149
|
没有这个默认组件也未自定义插槽内容</el-tag>
|
|
215
150
|
</slot>
|
|
@@ -218,16 +153,10 @@
|
|
|
218
153
|
<!-- 枚举 options -->
|
|
219
154
|
<template v-else-if="col.options?.length">
|
|
220
155
|
<template v-if="col?.isEdit">
|
|
221
|
-
<el-select class="select-select number"
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
filterable
|
|
226
|
-
@change="(val) => col.callback?.(val, scope.row)">
|
|
227
|
-
<el-option v-for="item in col.options"
|
|
228
|
-
:key="item[col.optionsValue || 'value']"
|
|
229
|
-
:label="item[col.optionsLabel || 'label']"
|
|
230
|
-
:value="item[col.optionsValue || 'value']" />
|
|
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']" />
|
|
231
160
|
</el-select>
|
|
232
161
|
</template>
|
|
233
162
|
<template v-else>
|
|
@@ -238,7 +167,7 @@
|
|
|
238
167
|
<!-- 链接跳转 -->
|
|
239
168
|
<template v-else-if="col.link">
|
|
240
169
|
<span class="el-button el-button--primary el-button--small is-text"
|
|
241
|
-
|
|
170
|
+
@click="col.clickFun?.(scope.row, scope.$index, tableData)"> {{ scope.row[col.dataIndex] || '' }}</span>
|
|
242
171
|
</template>
|
|
243
172
|
|
|
244
173
|
<!-- 其他简单渲染 -->
|
|
@@ -248,8 +177,7 @@
|
|
|
248
177
|
|
|
249
178
|
<!-- 复制 -->
|
|
250
179
|
<template v-if="col.copy">
|
|
251
|
-
<el-icon class="copy-btn"
|
|
252
|
-
v-copy="scope.row[col.dataIndex]"><el-icon-copy-document /></el-icon>
|
|
180
|
+
<el-icon class="copy-btn" v-copy="scope.row[col.dataIndex]"><el-icon-copy-document /></el-icon>
|
|
253
181
|
</template>
|
|
254
182
|
</template>
|
|
255
183
|
</template>
|
|
@@ -257,7 +185,7 @@
|
|
|
257
185
|
|
|
258
186
|
</template>
|
|
259
187
|
|
|
260
|
-
<script
|
|
188
|
+
<script>
|
|
261
189
|
import dayjs from 'dayjs'
|
|
262
190
|
import empty from '@/assets/images/empty.jpg'
|
|
263
191
|
export default {
|
|
@@ -291,7 +219,7 @@ export default {
|
|
|
291
219
|
* 检查权限
|
|
292
220
|
*/
|
|
293
221
|
checkAuth(auth) {
|
|
294
|
-
const {menus = [], authorities = []} = JSON.parse(localStorage.getItem('userAuthInfo') || '{}')
|
|
222
|
+
const { menus = [], authorities = [] } = JSON.parse(localStorage.getItem('userAuthInfo') || '{}')
|
|
295
223
|
const allPermissions = [...menus]
|
|
296
224
|
|
|
297
225
|
if (!auth) return true
|
|
@@ -318,7 +246,7 @@ export default {
|
|
|
318
246
|
if (!col || !Array.isArray(col.options) || col.options.length === 0) {
|
|
319
247
|
return ''
|
|
320
248
|
}
|
|
321
|
-
const {options, optionsLabel = 'label', optionsValue = 'value'} = col
|
|
249
|
+
const { options, optionsLabel = 'label', optionsValue = 'value' } = col
|
|
322
250
|
// 统一处理为数组
|
|
323
251
|
let values = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [value]
|
|
324
252
|
// 获取匹配的 labels
|
|
@@ -339,27 +267,34 @@ export default {
|
|
|
339
267
|
cursor: pointer;
|
|
340
268
|
margin-left: 5px;
|
|
341
269
|
}
|
|
270
|
+
|
|
342
271
|
.el-dropdown-link {
|
|
343
272
|
font-size: 16px;
|
|
344
273
|
}
|
|
274
|
+
|
|
345
275
|
.btn-list {
|
|
276
|
+
|
|
346
277
|
:deep(.el-button + .el-button),
|
|
347
278
|
:deep(.el-button + .el-dropdown) {
|
|
348
279
|
margin-left: 0px;
|
|
349
280
|
}
|
|
350
281
|
}
|
|
282
|
+
|
|
351
283
|
:deep(.cell) {
|
|
352
284
|
position: relative;
|
|
353
285
|
}
|
|
286
|
+
|
|
354
287
|
.el-tooltip {
|
|
355
288
|
position: relative;
|
|
356
289
|
}
|
|
290
|
+
|
|
357
291
|
.copy-btn {
|
|
358
292
|
position: absolute;
|
|
359
293
|
right: 0;
|
|
360
294
|
top: 50%;
|
|
361
295
|
transform: translateY(-50%);
|
|
362
296
|
}
|
|
297
|
+
|
|
363
298
|
.image-slot {
|
|
364
299
|
display: flex;
|
|
365
300
|
align-items: center;
|
|
@@ -372,4 +307,4 @@ export default {
|
|
|
372
307
|
min-width: 35px;
|
|
373
308
|
cursor: pointer;
|
|
374
309
|
}
|
|
375
|
-
</style>
|
|
310
|
+
</style>
|