leisure-core 0.6.7 → 0.6.9

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.
@@ -65,6 +65,14 @@ export default {
65
65
  type: String,
66
66
  default: "驳 回",
67
67
  },
68
+ uid: {
69
+ type: String,
70
+ default: "",
71
+ },
72
+ nick: {
73
+ type: String,
74
+ default: "",
75
+ },
68
76
  },
69
77
  data() {
70
78
  return {
@@ -87,6 +95,8 @@ export default {
87
95
  param.cid = this.cid;
88
96
  param.opinion = this.opinion;
89
97
  param.passed = passParam;
98
+ param.uid = this.uid;
99
+ param.nick = this.nick;
90
100
  this.$emit("audit", param);
91
101
  },
92
102
  onClick() {
@@ -406,23 +406,35 @@ export default {
406
406
  },
407
407
  clickMenuItem(item) {
408
408
  this.style.display = "none";
409
- if (item.name == this.tabNameCurrent) return;
410
- if (this.tabsAll && this.tabsAll.length > 0) {
411
- let routeE = this.tabsAll.filter((x) => {
412
- return x.name == item.name;
413
- });
414
- if (routeE && routeE.length > 0) {
415
- let currentTab = routeE[0];
416
- this.tabNameCurrent = currentTab.name;
417
- this.$router.push(currentTab); //
409
+
410
+ if (item.name === this.tabNameCurrent) {
411
+ this.$message.info("当前页面已经打开");
412
+ return;
413
+ }
414
+
415
+ // 查找是否已经存在相同name的标签页
416
+ const existingTabIndex = this.tabsAll.findIndex(
417
+ (tab) => tab.name === item.name
418
+ );
419
+
420
+ if (existingTabIndex > -1) {
421
+ // 已存在,用新的替换
422
+ const newTab = this._createTabItem(item);
423
+ this.tabsAll[existingTabIndex] = newTab;
424
+
425
+ // 如果替换的是当前激活的标签页,需要跳转
426
+ if (this.tabNameCurrent === item.name) {
427
+ this.$router.push(newTab);
418
428
  } else {
419
- this._navi2Page(item);
429
+ // 如果替换的不是当前激活的标签页,设置当前激活并跳转
430
+ this.tabNameCurrent = newTab.name;
431
+ this.$router.push(newTab);
420
432
  }
421
433
  } else {
422
434
  this._navi2Page(item);
423
435
  }
424
436
  },
425
- _navi2Page(item) {
437
+ _createTabItem(item) {
426
438
  let value;
427
439
  if (item.param) {
428
440
  value = {
@@ -444,11 +456,19 @@ export default {
444
456
  };
445
457
  }
446
458
  }
459
+ return value;
460
+ },
461
+ _navi2Page(item) {
462
+ const value = this._createTabItem(item);
463
+ if (!value) return; // 防止空值
464
+
447
465
  this.tabNameCurrent = value.name;
448
466
  if (this.tabsAll && this.tabsAll.length >= 8) {
449
467
  let elen = this.tabsAll.length;
450
468
  this.tabsAll[elen - 1] = value;
451
- } else this.tabsAll.push(value);
469
+ } else {
470
+ this.tabsAll.push(value);
471
+ }
452
472
  this.$router.push(value);
453
473
  },
454
474
  handleTabClick(clickTab, event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.6.07",
3
+ "version": "0.6.09",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",