n20-project-component 1.0.10 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-project-component",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "PC 端 Vue 2 + Element UI 组件库",
5
5
  "main": "dist/n20-project-component.umd.min.js",
6
6
  "module": "dist/n20-project-component.common.js",
@@ -555,8 +555,6 @@ export default {
555
555
  */
556
556
  getFilterList() {
557
557
  if (!this.filterId) {
558
- console.log(this.checkIds, 1122);
559
-
560
558
  if (this.checkIds.length === 0) {
561
559
  this.GroupData = []
562
560
  } else {
@@ -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="bussId"
7
+ v-if="_bussId"
8
8
  ref="viewPopover"
9
9
  v-model="viewPopoverVisible"
10
10
  popper-class="pro-filter-view-popover"
@@ -53,7 +53,7 @@
53
53
  </div>
54
54
  </div>
55
55
  </el-popover>
56
- <el-button v-if="bussId && selectItem" class="activiti m-l-s" @click="edit(selectItem, true)">
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="bussId"
77
+ :buss-id="_bussId"
78
78
  :model="searchValue"
79
79
  :filter-list="filterList"
80
80
  :filter-readonly="!!selectItem"
@@ -185,6 +185,10 @@ export default {
185
185
  type: String,
186
186
  default: '',
187
187
  },
188
+ isDiffByUser: {
189
+ type: Boolean,
190
+ default: true,
191
+ },
188
192
  filterId: {
189
193
  type: String,
190
194
  default: '',
@@ -223,9 +227,14 @@ export default {
223
227
  searchValue: {},
224
228
  viewId: undefined,
225
229
  isRefresh: false,
230
+ noneViewSearchValue: {}, // 无视图时的筛选值
226
231
  };
227
232
  },
228
233
  computed: {
234
+ _bussId() {
235
+ const userNo = sessionStorage.getItem('userNo');
236
+ return this.bussId ? (this.isDiffByUser ? this.bussId + '_' + userNo : this.bussId) : '';
237
+ },
229
238
  /**
230
239
  * 本地搜索过滤视图列表
231
240
  * @returns {Array} 根据 searchKeyword 过滤后的视图列表;searchKeyword 为空时返回完整列表
@@ -305,8 +314,8 @@ export default {
305
314
  },
306
315
  },
307
316
  mounted() {
308
- // 只有在有 bussId 时才获取视图列表
309
- if (this.bussId) {
317
+ // 只有在有 _bussId 时才获取视图列表
318
+ if (this._bussId) {
310
319
  this.getFilterList();
311
320
  }
312
321
  // 合并初始筛选值:slot 字段使用默认值,其他字段使用 initialValue 传入的值
@@ -409,15 +418,15 @@ export default {
409
418
  'clear',
410
419
  );
411
420
  },
412
- // 通过bussId拿取视图列表
421
+ // 通过_bussId拿取视图列表
413
422
  getFilterList(viewId) {
414
- // 如果没有 bussId,不获取视图列表
415
- if (!this.bussId) {
423
+ // 如果没有 _bussId,不获取视图列表
424
+ if (!this._bussId) {
416
425
  return;
417
426
  }
418
427
 
419
428
  axios
420
- .get(`/bems/query/viewColumn/getViewInfo`, { bussId: this.bussId })
429
+ .get(`/bems/query/viewColumn/getViewInfo`, { bussId: this._bussId })
421
430
  .then(res => {
422
431
  const list = (res.data || []).map(item => {
423
432
  item.keyIds = this.safeParse(item.keyIds, []);
@@ -470,8 +479,7 @@ export default {
470
479
  this.visible = true;
471
480
  this.isAdd = false;
472
481
  this.dialogFilterKey++;
473
- console.log(this.form, 123);
474
-
482
+
475
483
  // 浅拷贝,避免修改 form 时污染原始 item
476
484
  this.form = { ...item };
477
485
  this.viewId = item.viewId;
@@ -493,7 +501,7 @@ export default {
493
501
  },
494
502
  // 保存视图
495
503
  saveSt() {
496
- if (!this.bussId) {
504
+ if (!this._bussId) {
497
505
  this.$message.warning('缺少业务ID,无法保存视图');
498
506
  return;
499
507
  }
@@ -517,7 +525,7 @@ export default {
517
525
  const obj = {
518
526
  viewName: this.form.viewName,
519
527
  viewType: '0',
520
- bussId: this.bussId,
528
+ bussId: this._bussId,
521
529
  viewConfig: this.form.viewConfig,
522
530
  keyIds: JSON.stringify(keyIds),
523
531
  viewId: this.viewId,
@@ -550,14 +558,17 @@ export default {
550
558
  },
551
559
  // 选中视图
552
560
  handleSelect(item) {
553
- console.log(item, 111);
554
-
561
+ // 上一个选中的是“无视图”
562
+ if (!this.selectItem.viewId) {
563
+ this.noneViewSearchValue = JSON.parse(JSON.stringify(this.searchValue || {}));
564
+ }
565
+
555
566
  this.viewPopoverVisible = false;
556
567
  this.selectItem = item;
557
568
  this.selectedItem = item.viewName;
558
569
  if (!item.viewId) {
559
570
  this.selectItem = '';
560
- this.searchValue = { ...this.getInitialSearchValue, ...JSON.parse(JSON.stringify(this.initialValue || {})) };
571
+ this.searchValue = { ...this.noneViewSearchValue };
561
572
  // 无视图时恢复原来的筛选逻辑
562
573
  this.$nextTick(() => {
563
574
  const filterRef = this.$refs.filter;
@@ -8,7 +8,7 @@
8
8
  url('./v3-iconfont.ttf') format('truetype');
9
9
  }
10
10
 
11
- /* n20 系列图标字体 (来自 iconFont) */
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
- } */