n20-project-component 1.0.9 → 1.0.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/n20-project-component.common.js +98 -84
- package/dist/n20-project-component.css +1 -1
- package/dist/n20-project-component.umd.js +98 -84
- package/dist/n20-project-component.umd.min.js +4 -4
- package/package.json +1 -1
- package/src/components/ProFilterView/AdvancedFilter/index.vue +1 -0
- package/src/components/ProFilterView/index.vue +35 -19
- package/src/components/ProFilterView/style/iconfont.css +17 -6
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<slot name="leftContent"></slot>
|
|
5
5
|
<div class="flex-box flex-v">
|
|
6
6
|
<el-popover
|
|
7
|
-
v-if="
|
|
7
|
+
v-if="_bussId"
|
|
8
8
|
ref="viewPopover"
|
|
9
9
|
v-model="viewPopoverVisible"
|
|
10
10
|
popper-class="pro-filter-view-popover"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
trigger="click"
|
|
13
13
|
class="m-r-s"
|
|
14
14
|
>
|
|
15
|
-
<el-button slot="reference" class="botton" :class="{ activiti:
|
|
15
|
+
<el-button slot="reference" class="botton" :class="{ activiti: !!selectItem.viewId }">
|
|
16
16
|
<div class="flex-box flex-v m-r">
|
|
17
17
|
<i class="v3-icon-inbox"></i>
|
|
18
18
|
<div class="popover-title" style="margin: 0 8px" :title="selectedItem">{{ selectedItem }}</div>
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
<div class="filter-view-wrapper">
|
|
26
26
|
<cl-drag-list class="flex-item" :list="filteredList" :hide-delete="true" @change="handleDragSort">
|
|
27
27
|
<template v-slot="{ item }">
|
|
28
|
-
<div class="proFilterView-list-item" :class="{ 'is-selected':
|
|
28
|
+
<div class="proFilterView-list-item" :class="{ 'is-selected': selectItem.viewId === item.viewId }">
|
|
29
29
|
<span class="proFilterView-list-item__name" :title="item.viewName" @click="handleSelect(item)">{{
|
|
30
30
|
item.viewName
|
|
31
31
|
}}</span>
|
|
32
|
-
<i v-if="
|
|
32
|
+
<i v-if="selectItem.viewId === item.viewId" class="el-icon-check selected-icon"></i>
|
|
33
33
|
<el-dropdown
|
|
34
|
-
v-if="
|
|
34
|
+
v-if="item.viewId && selectItem.viewId !== item.viewId"
|
|
35
35
|
trigger="click"
|
|
36
36
|
class="proFilterView-list-item__more"
|
|
37
37
|
@command="command => handleCommand(command, item)"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
</el-popover>
|
|
56
|
-
<el-button v-if="
|
|
56
|
+
<el-button v-if="_bussId && selectItem" class="activiti m-l-s" @click="edit(selectItem, true)">
|
|
57
57
|
<div class="flex-box flex-v">
|
|
58
58
|
<i class="v3-icon-find"></i>
|
|
59
59
|
<div style="margin-left: 8px">
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
:class="{ 'is-hidden': !filterExpanded }"
|
|
75
75
|
:visible.sync="filterExpanded"
|
|
76
76
|
:filter-id="filterId"
|
|
77
|
-
:buss-id="
|
|
77
|
+
:buss-id="_bussId"
|
|
78
78
|
:model="searchValue"
|
|
79
79
|
:filter-list="filterList"
|
|
80
80
|
:filter-readonly="!!selectItem"
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
</cl-advanced-filter>
|
|
115
115
|
<cl-dialog
|
|
116
116
|
v-drag
|
|
117
|
+
v-if="visible"
|
|
117
118
|
width="85%"
|
|
118
119
|
:visible.sync="visible"
|
|
119
120
|
:title="isAdd ? $lc('新建视图') : $lc('编辑视图')"
|
|
@@ -184,6 +185,10 @@ export default {
|
|
|
184
185
|
type: String,
|
|
185
186
|
default: '',
|
|
186
187
|
},
|
|
188
|
+
isDiffByUser: {
|
|
189
|
+
type: Boolean,
|
|
190
|
+
default: true,
|
|
191
|
+
},
|
|
187
192
|
filterId: {
|
|
188
193
|
type: String,
|
|
189
194
|
default: '',
|
|
@@ -222,9 +227,14 @@ export default {
|
|
|
222
227
|
searchValue: {},
|
|
223
228
|
viewId: undefined,
|
|
224
229
|
isRefresh: false,
|
|
230
|
+
noneViewSearchValue: {}, // 无视图时的筛选值
|
|
225
231
|
};
|
|
226
232
|
},
|
|
227
233
|
computed: {
|
|
234
|
+
_bussId() {
|
|
235
|
+
const userNo = sessionStorage.getItem('userNo');
|
|
236
|
+
return this.bussId ? (this.isDiffByUser ? this.bussId + '_' + userNo : this.bussId) : '';
|
|
237
|
+
},
|
|
228
238
|
/**
|
|
229
239
|
* 本地搜索过滤视图列表
|
|
230
240
|
* @returns {Array} 根据 searchKeyword 过滤后的视图列表;searchKeyword 为空时返回完整列表
|
|
@@ -304,8 +314,8 @@ export default {
|
|
|
304
314
|
},
|
|
305
315
|
},
|
|
306
316
|
mounted() {
|
|
307
|
-
// 只有在有
|
|
308
|
-
if (this.
|
|
317
|
+
// 只有在有 _bussId 时才获取视图列表
|
|
318
|
+
if (this._bussId) {
|
|
309
319
|
this.getFilterList();
|
|
310
320
|
}
|
|
311
321
|
// 合并初始筛选值:slot 字段使用默认值,其他字段使用 initialValue 传入的值
|
|
@@ -408,15 +418,15 @@ export default {
|
|
|
408
418
|
'clear',
|
|
409
419
|
);
|
|
410
420
|
},
|
|
411
|
-
// 通过
|
|
421
|
+
// 通过_bussId拿取视图列表
|
|
412
422
|
getFilterList(viewId) {
|
|
413
|
-
// 如果没有
|
|
414
|
-
if (!this.
|
|
423
|
+
// 如果没有 _bussId,不获取视图列表
|
|
424
|
+
if (!this._bussId) {
|
|
415
425
|
return;
|
|
416
426
|
}
|
|
417
427
|
|
|
418
428
|
axios
|
|
419
|
-
.get(`/bems/query/viewColumn/getViewInfo`, { bussId: this.
|
|
429
|
+
.get(`/bems/query/viewColumn/getViewInfo`, { bussId: this._bussId })
|
|
420
430
|
.then(res => {
|
|
421
431
|
const list = (res.data || []).map(item => {
|
|
422
432
|
item.keyIds = this.safeParse(item.keyIds, []);
|
|
@@ -446,12 +456,12 @@ export default {
|
|
|
446
456
|
},
|
|
447
457
|
// 新增
|
|
448
458
|
add() {
|
|
449
|
-
let keyIds = this.filterList.filter(v => v.required).map(v => v.id);
|
|
450
|
-
|
|
451
459
|
this.isRefresh = false;
|
|
452
460
|
this.viewPopoverVisible = false;
|
|
453
461
|
this.visible = true;
|
|
454
462
|
this.isAdd = true;
|
|
463
|
+
|
|
464
|
+
let keyIds = this.filterList.filter(v => v.required || v.static).map(v => v.id);
|
|
455
465
|
this.form = {
|
|
456
466
|
userNo: sessionStorage.getItem('userNo'),
|
|
457
467
|
pageNo: this.filterId,
|
|
@@ -469,6 +479,7 @@ export default {
|
|
|
469
479
|
this.visible = true;
|
|
470
480
|
this.isAdd = false;
|
|
471
481
|
this.dialogFilterKey++;
|
|
482
|
+
|
|
472
483
|
// 浅拷贝,避免修改 form 时污染原始 item
|
|
473
484
|
this.form = { ...item };
|
|
474
485
|
this.viewId = item.viewId;
|
|
@@ -490,7 +501,7 @@ export default {
|
|
|
490
501
|
},
|
|
491
502
|
// 保存视图
|
|
492
503
|
saveSt() {
|
|
493
|
-
if (!this.
|
|
504
|
+
if (!this._bussId) {
|
|
494
505
|
this.$message.warning('缺少业务ID,无法保存视图');
|
|
495
506
|
return;
|
|
496
507
|
}
|
|
@@ -514,7 +525,7 @@ export default {
|
|
|
514
525
|
const obj = {
|
|
515
526
|
viewName: this.form.viewName,
|
|
516
527
|
viewType: '0',
|
|
517
|
-
bussId: this.
|
|
528
|
+
bussId: this._bussId,
|
|
518
529
|
viewConfig: this.form.viewConfig,
|
|
519
530
|
keyIds: JSON.stringify(keyIds),
|
|
520
531
|
viewId: this.viewId,
|
|
@@ -547,12 +558,17 @@ export default {
|
|
|
547
558
|
},
|
|
548
559
|
// 选中视图
|
|
549
560
|
handleSelect(item) {
|
|
561
|
+
// 上一个选中的是“无视图”
|
|
562
|
+
if (!this.selectItem.viewId) {
|
|
563
|
+
this.noneViewSearchValue = JSON.parse(JSON.stringify(this.searchValue || {}));
|
|
564
|
+
}
|
|
565
|
+
|
|
550
566
|
this.viewPopoverVisible = false;
|
|
551
567
|
this.selectItem = item;
|
|
552
568
|
this.selectedItem = item.viewName;
|
|
553
|
-
if (item.
|
|
569
|
+
if (!item.viewId) {
|
|
554
570
|
this.selectItem = '';
|
|
555
|
-
this.searchValue = { ...this.
|
|
571
|
+
this.searchValue = { ...this.noneViewSearchValue };
|
|
556
572
|
// 无视图时恢复原来的筛选逻辑
|
|
557
573
|
this.$nextTick(() => {
|
|
558
574
|
const filterRef = this.$refs.filter;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
url('./v3-iconfont.ttf') format('truetype');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* n20
|
|
11
|
+
/* n20 系列图标字体(独立字体文件,与 n20-common-lib 的 core-lib-iconfont 不同,不冲突) */
|
|
12
12
|
@font-face {
|
|
13
13
|
font-family: "n20-iconfont";
|
|
14
14
|
src: url('./n20-iconfont.woff2') format('woff2'),
|
|
@@ -50,12 +50,23 @@
|
|
|
50
50
|
content: "\e6f4";
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.v3-icon-plus:before {
|
|
54
|
+
content: "\e6eb";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.v3-icon-delete:before {
|
|
58
|
+
content: "\e6ec";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.v3-icon-search:before {
|
|
62
|
+
content: "\e6de";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.v3-icon-folder-add:before {
|
|
66
|
+
content: "\e775";
|
|
67
|
+
}
|
|
68
|
+
|
|
53
69
|
/* ProFilterView 使用的 n20 系列图标 */
|
|
54
70
|
.n20-icon-xiala-moren:before {
|
|
55
71
|
content: "\e66c";
|
|
56
72
|
}
|
|
57
|
-
|
|
58
|
-
/* Element UI 图标 (el-icon-check) */
|
|
59
|
-
/* .el-icon-check:before {
|
|
60
|
-
content: "\e611";
|
|
61
|
-
} */
|