lw-cdp-ui 1.2.5 → 1.2.7
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/lwFormJson/JsonItem.vue +6 -3
- package/dist/components/lwFormJson/StatsConfig.vue +12 -17
- package/dist/components/lwFormJson/index.vue +7 -6
- package/dist/components/lwFormMini/FormItem.vue +2 -3
- package/dist/components/lwFormMini/index.vue +3 -2
- package/dist/components/lwTable/index.vue +8 -0
- package/dist/lw-cdp-ui.esm.js +1854 -1847
- package/dist/lw-cdp-ui.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -73,10 +73,12 @@
|
|
|
73
73
|
class="tool-list">
|
|
74
74
|
<el-icon class="btn"
|
|
75
75
|
size="14"
|
|
76
|
-
@click="copyItem(item, index)"
|
|
76
|
+
@click="copyItem(item, index)"
|
|
77
|
+
title="复制"><el-icon-copy-document /></el-icon>
|
|
77
78
|
<el-icon class="btn"
|
|
78
79
|
size="14"
|
|
79
|
-
@click="deleteItem(index)"
|
|
80
|
+
@click="deleteItem(index)"
|
|
81
|
+
title="删除"><el-icon-delete /></el-icon>
|
|
80
82
|
</div>
|
|
81
83
|
|
|
82
84
|
</el-col>
|
|
@@ -248,7 +250,8 @@ export default {
|
|
|
248
250
|
z-index: 9;
|
|
249
251
|
position: absolute;
|
|
250
252
|
}
|
|
251
|
-
:deep(.el-form-item--label-right)
|
|
253
|
+
:deep(.el-form-item--label-right),
|
|
254
|
+
:deep(.el-form-item--label-left) {
|
|
252
255
|
.el-form-item__label {
|
|
253
256
|
position: relative;
|
|
254
257
|
.add-btn {
|
|
@@ -307,27 +307,22 @@
|
|
|
307
307
|
|
|
308
308
|
<div class="form-title">表单校验</div>
|
|
309
309
|
<div class="form-body">
|
|
310
|
-
<el-form-item label="
|
|
311
|
-
<el-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
<el-form-item label="提交校验">
|
|
311
|
+
<el-select v-model="item.rules"
|
|
312
|
+
multiple
|
|
313
|
+
clearable
|
|
314
|
+
placeholder="请选择">
|
|
315
|
+
<el-option v-for="item in rules"
|
|
316
|
+
:label="item.label"
|
|
317
|
+
:value="item.value" />
|
|
318
|
+
</el-select>
|
|
314
319
|
</el-form-item>
|
|
315
320
|
<el-form-item label="隐藏校验">
|
|
316
321
|
<el-input v-model="item.hideHandle"
|
|
317
322
|
placeholder="请输入"
|
|
318
323
|
clearable />
|
|
319
324
|
</el-form-item>
|
|
320
|
-
|
|
321
|
-
<el-select v-model="item.labelPosition"
|
|
322
|
-
placeholder="请选择">
|
|
323
|
-
<el-option label="顶部"
|
|
324
|
-
value="top" />
|
|
325
|
-
<el-option label="左"
|
|
326
|
-
value="left" />
|
|
327
|
-
<el-option label="右"
|
|
328
|
-
value="right" />
|
|
329
|
-
</el-select>
|
|
330
|
-
</el-form-item>
|
|
325
|
+
|
|
331
326
|
</div>
|
|
332
327
|
</template>
|
|
333
328
|
<template v-else>
|
|
@@ -365,11 +360,11 @@ export default {
|
|
|
365
360
|
rules: [
|
|
366
361
|
{
|
|
367
362
|
label: '必填',
|
|
368
|
-
value: {
|
|
363
|
+
value: { required: true, message: '请输入', trigger: 'blur' }
|
|
369
364
|
},
|
|
370
365
|
{
|
|
371
366
|
label: '必选',
|
|
372
|
-
value: {
|
|
367
|
+
value: { required: true, message: '请选择', trigger: 'change' }
|
|
373
368
|
},
|
|
374
369
|
]
|
|
375
370
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-container>
|
|
2
|
+
<el-container :style="{ maxHeight }">
|
|
3
3
|
<el-aside v-if="hideTool"
|
|
4
4
|
width="200px"
|
|
5
5
|
class="form-json-body">
|
|
@@ -109,6 +109,8 @@ export default {
|
|
|
109
109
|
* }
|
|
110
110
|
* **/
|
|
111
111
|
config: { type: Object, default: () => { return {} } },
|
|
112
|
+
// 最大高度
|
|
113
|
+
maxHeight: { type: String, default: 'calc(100vh - 137px)' },
|
|
112
114
|
// 自定义组件
|
|
113
115
|
custom: { type: Array, default: () => [] },
|
|
114
116
|
// 是否显示加载中
|
|
@@ -141,9 +143,11 @@ export default {
|
|
|
141
143
|
deep: true
|
|
142
144
|
},
|
|
143
145
|
config: {
|
|
144
|
-
handler() {
|
|
146
|
+
handler(val) {
|
|
145
147
|
this.render()
|
|
148
|
+
this.localConfig = JSON.parse(JSON.stringify(val))
|
|
146
149
|
},
|
|
150
|
+
immediate: true,
|
|
147
151
|
deep: true
|
|
148
152
|
},
|
|
149
153
|
localConfig: {
|
|
@@ -240,9 +244,6 @@ export default {
|
|
|
240
244
|
}
|
|
241
245
|
this.form = this.parseNestedObject(form)
|
|
242
246
|
this.$emit("update:modelValue", this.form);
|
|
243
|
-
this.localConfig = config;
|
|
244
|
-
|
|
245
|
-
|
|
246
247
|
},
|
|
247
248
|
parseNestedObject(obj) {
|
|
248
249
|
const result = {};
|
|
@@ -305,7 +306,7 @@ export default {
|
|
|
305
306
|
|
|
306
307
|
<style lang="scss" scoped>
|
|
307
308
|
.menu-list {
|
|
308
|
-
:deep(.el-collapse){
|
|
309
|
+
:deep(.el-collapse) {
|
|
309
310
|
border-top: 0;
|
|
310
311
|
}
|
|
311
312
|
.menu-list-title {
|
|
@@ -292,17 +292,17 @@ export default {
|
|
|
292
292
|
// 否则,继续向下查找
|
|
293
293
|
current = current[keys[i]];
|
|
294
294
|
}
|
|
295
|
-
|
|
296
295
|
return current;
|
|
297
296
|
},
|
|
298
297
|
unflattenObject(obj, path, value) {
|
|
298
|
+
if (!path || !obj) { return false }
|
|
299
299
|
const keys = path.split('.'); // 按点分隔路径
|
|
300
300
|
let current = obj; // 指向传入的对象(如 this.form)
|
|
301
301
|
|
|
302
302
|
keys.forEach((key, index) => {
|
|
303
303
|
if (index === keys.length - 1) {
|
|
304
304
|
// 最后一级,直接赋值
|
|
305
|
-
current[key] = value;
|
|
305
|
+
current[key] = value || obj[path];
|
|
306
306
|
} else {
|
|
307
307
|
// 如果不存在该层级,创建空对象
|
|
308
308
|
if (!current[key] || typeof current[key] !== 'object') {
|
|
@@ -312,7 +312,6 @@ export default {
|
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
314
|
|
|
315
|
-
|
|
316
315
|
},
|
|
317
316
|
// 删除tag
|
|
318
317
|
tagClose(tag, item) {
|
|
@@ -127,14 +127,16 @@ export default {
|
|
|
127
127
|
deep: true
|
|
128
128
|
},
|
|
129
129
|
config: {
|
|
130
|
-
handler() {
|
|
130
|
+
handler(val) {
|
|
131
131
|
this.render()
|
|
132
132
|
if (this.showMenu) {
|
|
133
133
|
this.$nextTick(() => {
|
|
134
134
|
this.handleScroll()
|
|
135
135
|
})
|
|
136
136
|
}
|
|
137
|
+
this.localConfig = JSON.parse(JSON.stringify(val))
|
|
137
138
|
},
|
|
139
|
+
immediate: true,
|
|
138
140
|
deep: true
|
|
139
141
|
},
|
|
140
142
|
localConfig: {
|
|
@@ -213,7 +215,6 @@ export default {
|
|
|
213
215
|
}
|
|
214
216
|
this.form = this.parseNestedObject(form)
|
|
215
217
|
this.$emit("update:modelValue", this.form);
|
|
216
|
-
this.localConfig = config;
|
|
217
218
|
},
|
|
218
219
|
|
|
219
220
|
parseNestedObject(obj) {
|
|
@@ -34,6 +34,14 @@
|
|
|
34
34
|
<template #header="{ column, $index }">
|
|
35
35
|
<template v-if="!t?.header">
|
|
36
36
|
{{ t.title }}
|
|
37
|
+
<el-tooltip v-if="t.tips">
|
|
38
|
+
<template #content>
|
|
39
|
+
<span style="max-width: 300px; display: inline-block;">
|
|
40
|
+
{{ t.tips }}
|
|
41
|
+
</span>
|
|
42
|
+
</template>
|
|
43
|
+
<el-icon><component :is="t.icon || 'el-icon-question-filled'" /></el-icon>
|
|
44
|
+
</el-tooltip>
|
|
37
45
|
</template>
|
|
38
46
|
<slot v-else
|
|
39
47
|
:name="t.header"
|