lw-cdp-ui 1.0.56 → 1.0.58
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/lwForm/index.vue +8 -2
- package/dist/components/lwTable/index.js +11 -51
- package/dist/components/lwTable/index.vue +11 -8
- package/dist/lw-cdp-ui.esm.js +1357 -1355
- package/dist/lw-cdp-ui.esm.js.map +1 -1
- package/dist/lw-cdp-ui.umd.js +7 -7
- package/dist/lw-cdp-ui.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
:type="item.options.type"
|
|
40
40
|
:disabled="item.options.disabled"
|
|
41
41
|
:maxlength="item.options.maxlength"
|
|
42
|
-
show-word-limit
|
|
42
|
+
show-word-limit>
|
|
43
|
+
<template v-if="item.options.append"
|
|
44
|
+
#append>{{item.options.append}}</template>
|
|
45
|
+
</el-input>
|
|
43
46
|
</template>
|
|
44
47
|
<template v-else>
|
|
45
48
|
<el-input v-model="form[item.name]"
|
|
@@ -48,7 +51,10 @@
|
|
|
48
51
|
:type="item.options.type"
|
|
49
52
|
:disabled="item.options.disabled"
|
|
50
53
|
:maxlength="item.options.maxlength"
|
|
51
|
-
show-word-limit
|
|
54
|
+
show-word-limit>
|
|
55
|
+
<template v-if="item.options.append"
|
|
56
|
+
#append>{{item.options.append}}</template>
|
|
57
|
+
</el-input>
|
|
52
58
|
</template>
|
|
53
59
|
</template>
|
|
54
60
|
<!-- upload -->
|
|
@@ -64,21 +64,26 @@ export default {
|
|
|
64
64
|
fixNum: 0
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
// 处理数据
|
|
68
|
+
const filterData = () => {
|
|
68
69
|
let list = props.tableColumns
|
|
69
70
|
|
|
70
71
|
state.checkedKeys = []
|
|
71
|
-
|
|
72
|
+
let arr = []
|
|
72
73
|
list.forEach((item, index) => {
|
|
73
74
|
if (!item.key) {
|
|
74
75
|
item.key = $tool.getUUID()
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
if (!!item.checked || item.checked == undefined) {
|
|
78
|
+
state.checkedKeys.push(item.key)
|
|
79
|
+
arr.push(item)
|
|
80
|
+
}
|
|
78
81
|
})
|
|
79
82
|
state.treeData = list
|
|
80
|
-
state.tableHeaders =
|
|
83
|
+
state.tableHeaders = arr
|
|
84
|
+
}
|
|
81
85
|
|
|
86
|
+
onBeforeMount(async () => {
|
|
82
87
|
window.addEventListener('resize', () => {
|
|
83
88
|
let isFull =
|
|
84
89
|
document.mozFullScreen || document.fullScreen || document.webkitIsFullScreen || document.webkitRequestFullScreen || document.mozRequestFullScreen || document.msFullscreenEnabled
|
|
@@ -94,21 +99,7 @@ export default {
|
|
|
94
99
|
watch(
|
|
95
100
|
() => props.tableColumns,
|
|
96
101
|
(newVal) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
state.checkedKeys = []
|
|
100
|
-
let arr = []
|
|
101
|
-
list.forEach((item, index) => {
|
|
102
|
-
if (!item.key) {
|
|
103
|
-
item.key = $tool.getUUID()
|
|
104
|
-
}
|
|
105
|
-
if (!!item.checked || item.checked == undefined) {
|
|
106
|
-
state.checkedKeys.push(item.key)
|
|
107
|
-
arr.push(item)
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
state.treeData = list
|
|
111
|
-
state.tableHeaders = arr
|
|
102
|
+
filterData()
|
|
112
103
|
},
|
|
113
104
|
{ deep: true, immediate: true }
|
|
114
105
|
)
|
|
@@ -283,36 +274,6 @@ export default {
|
|
|
283
274
|
state.tableSize = v
|
|
284
275
|
}
|
|
285
276
|
|
|
286
|
-
const onDrop = (info) => {
|
|
287
|
-
let dropPosition = info.dropPosition
|
|
288
|
-
let dragNode = info.dragNode
|
|
289
|
-
let dropNode = info.dropNode
|
|
290
|
-
const data = state.treeData
|
|
291
|
-
const loop = (data, key, callback) => {
|
|
292
|
-
data.some((item, index, arr) => {
|
|
293
|
-
if (item.title === key) {
|
|
294
|
-
callback(item, index, arr)
|
|
295
|
-
return true
|
|
296
|
-
}
|
|
297
|
-
if (item.children) {
|
|
298
|
-
return loop(item.children, key, callback)
|
|
299
|
-
}
|
|
300
|
-
return false
|
|
301
|
-
})
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (dropPosition === 0) {
|
|
305
|
-
} else {
|
|
306
|
-
loop(data, dragNode.title, (_, index, arr) => {
|
|
307
|
-
arr.splice(index, 1)
|
|
308
|
-
})
|
|
309
|
-
loop(data, dropNode.title, (_, index, arr) => {
|
|
310
|
-
arr.splice(dropPosition < 0 ? index : index + 1, 0, dragNode)
|
|
311
|
-
})
|
|
312
|
-
}
|
|
313
|
-
state.tableHeaders = state.treeData
|
|
314
|
-
}
|
|
315
|
-
|
|
316
277
|
const checkAll = (selected) => {
|
|
317
278
|
if (selected) {
|
|
318
279
|
state.tableHeaders = JSON.parse(JSON.stringify(props.tableColumns))
|
|
@@ -403,7 +364,6 @@ export default {
|
|
|
403
364
|
sortChange,
|
|
404
365
|
getHeader,
|
|
405
366
|
handleSelect,
|
|
406
|
-
onDrop,
|
|
407
367
|
checkAll,
|
|
408
368
|
tableToggleFullScreen,
|
|
409
369
|
isFullscreen,
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
:key="t">
|
|
34
34
|
<template #default="scope">
|
|
35
35
|
<!-- 操作 -->
|
|
36
|
-
<
|
|
36
|
+
<template v-if="t?.operation">
|
|
37
37
|
<!-- 操作按钮少于3个或不需要省略号 -->
|
|
38
|
+
|
|
38
39
|
<div
|
|
39
|
-
v-if="
|
|
40
|
-
<span v-for="o in t.operation"
|
|
41
|
-
:key="o"
|
|
42
|
-
v-show="o.isShow ? o.isShow(row) : true">
|
|
40
|
+
v-if="t.operation.filter(o => !o?.isShow || o.isShow(scope.row)).length <= 3">
|
|
41
|
+
<span v-for="o in t.operation.filter(o => !o?.isShow || o.isShow(scope.row))"
|
|
42
|
+
:key="o">
|
|
43
43
|
<el-tooltip v-if="o.icon"
|
|
44
44
|
:content="o.label"
|
|
45
45
|
placement="top">
|
|
@@ -104,12 +104,15 @@
|
|
|
104
104
|
|
|
105
105
|
</el-dropdown>
|
|
106
106
|
</div>
|
|
107
|
-
</
|
|
107
|
+
</template>
|
|
108
108
|
|
|
109
109
|
<!-- render -->
|
|
110
110
|
<div v-else-if="t.eleRender">
|
|
111
|
-
<span v-if="t?.clickFun"
|
|
112
|
-
|
|
111
|
+
<span v-if="t?.clickFun"
|
|
112
|
+
v-html="t.eleRender(scope.row, scope.$index)"
|
|
113
|
+
@click="t.clickFun(scope.row, scope.$index, tableData)"></span>
|
|
114
|
+
<span v-else
|
|
115
|
+
v-html="t.eleRender(scope.row, scope.$index)"></span>
|
|
113
116
|
</div>
|
|
114
117
|
|
|
115
118
|
<div v-else-if="t.type === 'img'">
|