lw-cdp-ui 1.4.9 → 1.4.11
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/index.vue +22 -39
- package/dist/components/lwLayout/components/tags.vue +57 -20
- package/dist/components/lwSearch/index.vue +28 -42
- 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 +2998 -2917
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -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,36 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="lw-search-card">
|
|
3
3
|
<div class="search-content">
|
|
4
|
-
<el-form ref="searchForm"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:label-align="labelAlign"
|
|
8
|
-
style="width: 100%">
|
|
9
|
-
<el-row :class="[isExpandRow ? 'expand-row' : '']"
|
|
10
|
-
:gutter="10">
|
|
11
|
-
<template v-for="(item, index) in defaultOptions"
|
|
12
|
-
:key="item.prop">
|
|
4
|
+
<el-form ref="searchForm" :model="form" @submit.prevent :label-align="labelAlign" style="width: 100%">
|
|
5
|
+
<el-row :class="[isExpandRow ? 'expand-row' : '']" :gutter="10">
|
|
6
|
+
<template v-for="(item, index) in defaultOptions" :key="item.prop">
|
|
13
7
|
<el-col :class="[isDefaultShow(index) ? '' : isExpandStatus ? '' : 'hide']"
|
|
14
|
-
|
|
15
|
-
<el-form-item :label-width="hideLabel ? 0 : labelWidth"
|
|
16
|
-
|
|
17
|
-
:label="hideLabel ? '' : $t(item.label)">
|
|
8
|
+
:span="item?.span ? item.span : 6">
|
|
9
|
+
<el-form-item :label-width="hideLabel ? 0 : labelWidth" :required="item.required"
|
|
10
|
+
:label="hideLabel ? '' : $t(item.label)">
|
|
18
11
|
|
|
19
12
|
<!-- cascader 组个组件有问题 动态加载下拉文字不会显示 -->
|
|
20
13
|
<template v-if="item.component == 'cascader'">
|
|
21
|
-
<el-cascader v-model="form[item.name]"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:separator="item?.options?.separator"
|
|
25
|
-
:disabled="item?.options?.disabled"
|
|
26
|
-
:options="item?.options.items"
|
|
27
|
-
clearable></el-cascader>
|
|
14
|
+
<el-cascader v-model="form[item.name]" style="width: 100%;" :props="item?.options?.props"
|
|
15
|
+
:separator="item?.options?.separator" :disabled="item?.options?.disabled"
|
|
16
|
+
:options="item?.options.items" clearable></el-cascader>
|
|
28
17
|
</template>
|
|
29
18
|
<!-- 动态组件 -->
|
|
30
19
|
<template v-else-if="componentType.includes(item.component)">
|
|
31
|
-
<FormComponent v-model="form[item.name]"
|
|
32
|
-
:item="item"
|
|
33
|
-
:disabled="item?.options?.disabled" />
|
|
20
|
+
<FormComponent v-model="form[item.name]" :item="item" :disabled="item?.options?.disabled" />
|
|
34
21
|
</template>
|
|
35
22
|
</el-form-item>
|
|
36
23
|
</el-col>
|
|
@@ -38,19 +25,14 @@
|
|
|
38
25
|
</el-row>
|
|
39
26
|
|
|
40
27
|
<div class="control">
|
|
41
|
-
<el-button text
|
|
42
|
-
|
|
43
|
-
type="primary"
|
|
44
|
-
@click="resetForm('searchForm')">
|
|
45
|
-
{{$t('btn.reset')}}
|
|
28
|
+
<el-button text bg type="primary" @click="resetForm('searchForm')">
|
|
29
|
+
{{ $t('btn.reset') }}
|
|
46
30
|
</el-button>
|
|
47
|
-
<el-button type="primary"
|
|
48
|
-
|
|
49
|
-
{{$t('btn.query')}}
|
|
31
|
+
<el-button type="primary" @click="submitForm('searchForm')">
|
|
32
|
+
{{ $t('btn.query') }}
|
|
50
33
|
</el-button>
|
|
51
34
|
|
|
52
|
-
<div :class="isExpandNumber ? 'expand-button' : 'hidden'"
|
|
53
|
-
@click="handleExpandStatus()">
|
|
35
|
+
<div :class="isExpandNumber ? 'expand-button' : 'hidden'" @click="handleExpandStatus()">
|
|
54
36
|
<span>{{ isExpandStatus ? "收起" : "展开" }}</span>
|
|
55
37
|
</div>
|
|
56
38
|
</div>
|
|
@@ -190,10 +172,10 @@ export default {
|
|
|
190
172
|
// 用来兼容旧配置
|
|
191
173
|
defaultOptions() {
|
|
192
174
|
return this.options.map(item => {
|
|
193
|
-
const {label, span, prop: name, renderType: component, placeholder = label, ...other} = item || {}
|
|
194
|
-
const componentObj = {label, name, component, span}
|
|
175
|
+
const { label, span, prop: name, renderType: component, placeholder = label, ...other } = item || {}
|
|
176
|
+
const componentObj = { label, name, component, span }
|
|
195
177
|
|
|
196
|
-
const baseOptions = {placeholder, ...other}
|
|
178
|
+
const baseOptions = { placeholder, ...other }
|
|
197
179
|
|
|
198
180
|
switch (component) {
|
|
199
181
|
case 'dateRange':
|
|
@@ -213,7 +195,7 @@ export default {
|
|
|
213
195
|
...componentObj,
|
|
214
196
|
options: {
|
|
215
197
|
...baseOptions,
|
|
216
|
-
items: item.options
|
|
198
|
+
items: item.options?.map(x => ({
|
|
217
199
|
label: x[item.labelKey || 'label'],
|
|
218
200
|
value: x[item.valueKey || 'value']
|
|
219
201
|
}))
|
|
@@ -308,6 +290,7 @@ export default {
|
|
|
308
290
|
width: 100%;
|
|
309
291
|
background: var(--color-bg-2);
|
|
310
292
|
overflow: hidden;
|
|
293
|
+
|
|
311
294
|
.arco-col {
|
|
312
295
|
margin: 5px 0;
|
|
313
296
|
padding: 0 !important;
|
|
@@ -377,7 +360,7 @@ export default {
|
|
|
377
360
|
padding-right: 5px;
|
|
378
361
|
cursor: pointer;
|
|
379
362
|
|
|
380
|
-
|
|
363
|
+
&>span {
|
|
381
364
|
color: #505050;
|
|
382
365
|
font-size: 12px;
|
|
383
366
|
}
|
|
@@ -403,13 +386,13 @@ export default {
|
|
|
403
386
|
width: 84px;
|
|
404
387
|
height: 30px;
|
|
405
388
|
|
|
406
|
-
|
|
389
|
+
&>span {
|
|
407
390
|
padding-right: 10px;
|
|
408
391
|
padding-left: 10px;
|
|
409
392
|
border-right: 1px solid #fff;
|
|
410
393
|
}
|
|
411
394
|
|
|
412
|
-
|
|
395
|
+
&>i {
|
|
413
396
|
padding-left: 10px;
|
|
414
397
|
}
|
|
415
398
|
}
|
|
@@ -428,6 +411,7 @@ export default {
|
|
|
428
411
|
font-size: 12px;
|
|
429
412
|
user-select: none;
|
|
430
413
|
}
|
|
414
|
+
|
|
431
415
|
// .arco-select__tags-text {
|
|
432
416
|
// max-width: 80px !important;
|
|
433
417
|
// }
|
|
@@ -435,8 +419,9 @@ export default {
|
|
|
435
419
|
width: 100%;
|
|
436
420
|
|
|
437
421
|
.el-select__tags {
|
|
422
|
+
|
|
438
423
|
// max-width: calc(100% - 0px) !important;
|
|
439
|
-
|
|
424
|
+
&>span {
|
|
440
425
|
max-width: 100%;
|
|
441
426
|
|
|
442
427
|
.el-tag--info {
|
|
@@ -449,6 +434,7 @@ export default {
|
|
|
449
434
|
}
|
|
450
435
|
|
|
451
436
|
&:nth-child(2) {
|
|
437
|
+
|
|
452
438
|
// display: none;
|
|
453
439
|
.arco-select__tags-text {
|
|
454
440
|
max-width: 100% !important;
|
|
@@ -468,7 +454,7 @@ export default {
|
|
|
468
454
|
display: flex;
|
|
469
455
|
flex-wrap: nowrap;
|
|
470
456
|
|
|
471
|
-
|
|
457
|
+
&>span {
|
|
472
458
|
display: flex;
|
|
473
459
|
flex-wrap: nowrap;
|
|
474
460
|
}
|