@newview/ui 1.1.99 → 1.2.0

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/README.md CHANGED
@@ -1,6 +1,11 @@
1
+ ### 1.2.0
2
+ 1、表格组件工具栏、工具栏组件增加按钮权限控制
3
+
1
4
  ### 1.1.98
2
5
  1、表头筛选daterange增加默认传值功能
3
6
 
7
+ ### 1.1.97
8
+ 1、搜索日期时间选择组件赋值修改
4
9
 
5
10
  ### 1.1.96
6
11
  1、表单及表格日期时间选择组件赋值修改
@@ -32470,7 +32470,7 @@ let ToolbarInstance$1 = class ToolbarInstance2 extends BaseInstance {
32470
32470
  this.setShowOptions();
32471
32471
  }
32472
32472
  }
32473
- return isShow;
32473
+ return isShow && this.otherCommon.btnIsShowForOp(item2.name);
32474
32474
  });
32475
32475
  /**
32476
32476
  * 获取Icon
@@ -32739,13 +32739,23 @@ let GridColumnInstance$1 = class GridColumnInstance2 extends BaseInstance {
32739
32739
  return !this.utilities.isNull(column.rowButtons) && column.rowButtons.length > 0;
32740
32740
  });
32741
32741
  __publicField2(this, "getIsShowRowButton", (btn, row) => {
32742
+ let isshow = true;
32742
32743
  if (this.utilities.isNull(btn.isShow)) {
32743
- return true;
32744
+ isshow = true;
32745
+ } else {
32746
+ if (typeof btn.isShow == "boolean") {
32747
+ isshow = btn.isShow;
32748
+ } else {
32749
+ isshow = btn.isShow(row);
32750
+ }
32744
32751
  }
32745
- if (typeof btn.isShow == "boolean") {
32746
- return btn.isShow;
32752
+ let code = btn.name;
32753
+ if (btn.text == "编辑") {
32754
+ code = "edit";
32755
+ } else if (btn.text == "删除" || btn.text == "移除" || btn.text == "清除") {
32756
+ code = "delete";
32747
32757
  }
32748
- return btn.isShow(row);
32758
+ return isshow && this.otherCommon.btnIsShowForOp(code);
32749
32759
  });
32750
32760
  /**
32751
32761
  * 获取行按钮
@@ -57993,7 +58003,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
57993
58003
  super();
57994
58004
  __publicField2(this, "props");
57995
58005
  __publicField2(this, "ctx");
57996
- // API实例化
58006
+ // API实例化
57997
58007
  // 全局属性
57998
58008
  __publicField2(this, "xTable", ref());
57999
58009
  //#region 查询面板
@@ -58839,6 +58849,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
58839
58849
  return;
58840
58850
  }
58841
58851
  for (const item2 of toolbars) {
58852
+ item2.isShow = this.getIsShowButton(item2) && this.otherCommon.btnIsShowForOp(item2.name);
58842
58853
  switch (item2.name) {
58843
58854
  case "add":
58844
58855
  if (this.utilities.isNull(item2.onclick)) {
@@ -58886,6 +58897,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
58886
58897
  }
58887
58898
  break;
58888
58899
  case "exportexcel":
58900
+ item2.isShow = this.getIsShowButton(item2) && this.otherCommon.btnIsShowForOp("export");
58889
58901
  if (this.utilities.isNull(item2.onclick)) {
58890
58902
  item2.onclick = () => {
58891
58903
  this.doExportExcel();
@@ -58904,6 +58916,19 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
58904
58916
  }
58905
58917
  }
58906
58918
  });
58919
+ __publicField2(this, "getIsShowButton", (btn) => {
58920
+ let isshow = true;
58921
+ if (this.utilities.isNull(btn.isShow)) {
58922
+ isshow = true;
58923
+ } else {
58924
+ if (typeof btn.isShow == "boolean") {
58925
+ isshow = btn.isShow;
58926
+ } else {
58927
+ isshow = btn.isShow();
58928
+ }
58929
+ }
58930
+ return isshow;
58931
+ });
58907
58932
  /**
58908
58933
  * 获取添加的数据
58909
58934
  * @param row
@@ -240577,7 +240602,7 @@ class GridInstance extends BaseInstance {
240577
240602
  super();
240578
240603
  __publicField2(this, "props");
240579
240604
  __publicField2(this, "ctx");
240580
- // API实例化
240605
+ // API实例化
240581
240606
  // 全局属性
240582
240607
  __publicField2(this, "xTable", ref());
240583
240608
  //#region 查询面板
@@ -241423,6 +241448,7 @@ class GridInstance extends BaseInstance {
241423
241448
  return;
241424
241449
  }
241425
241450
  for (const item2 of toolbars) {
241451
+ item2.isShow = this.getIsShowButton(item2) && this.otherCommon.btnIsShowForOp(item2.name);
241426
241452
  switch (item2.name) {
241427
241453
  case "add":
241428
241454
  if (this.utilities.isNull(item2.onclick)) {
@@ -241470,6 +241496,7 @@ class GridInstance extends BaseInstance {
241470
241496
  }
241471
241497
  break;
241472
241498
  case "exportexcel":
241499
+ item2.isShow = this.getIsShowButton(item2) && this.otherCommon.btnIsShowForOp("export");
241473
241500
  if (this.utilities.isNull(item2.onclick)) {
241474
241501
  item2.onclick = () => {
241475
241502
  this.doExportExcel();
@@ -241488,6 +241515,19 @@ class GridInstance extends BaseInstance {
241488
241515
  }
241489
241516
  }
241490
241517
  });
241518
+ __publicField2(this, "getIsShowButton", (btn) => {
241519
+ let isshow = true;
241520
+ if (this.utilities.isNull(btn.isShow)) {
241521
+ isshow = true;
241522
+ } else {
241523
+ if (typeof btn.isShow == "boolean") {
241524
+ isshow = btn.isShow;
241525
+ } else {
241526
+ isshow = btn.isShow();
241527
+ }
241528
+ }
241529
+ return isshow;
241530
+ });
241491
241531
  /**
241492
241532
  * 获取添加的数据
241493
241533
  * @param row
@@ -243908,7 +243948,7 @@ class ToolbarInstance extends BaseInstance {
243908
243948
  this.setShowOptions();
243909
243949
  }
243910
243950
  }
243911
- return isShow;
243951
+ return isShow && this.otherCommon.btnIsShowForOp(item2.name);
243912
243952
  });
243913
243953
  /**
243914
243954
  * 获取Icon