Bladeren bron

禁止图表编辑调整

XuZinan 2 jaren geleden
bovenliggende
commit
d582660a13
1 gewijzigde bestanden met toevoegingen van 38 en 0 verwijderingen
  1. 38 0
      src/pages/Detail/LuckySheet.js

+ 38 - 0
src/pages/Detail/LuckySheet.js

@@ -159,21 +159,59 @@ class LuckySheet extends React.Component {
         // },
       };
       console.log(version);
+
+      const unableEdit = option => {
+        option.showtoolbar = false;
+        option.enableAddRow = false;
+        option.sheetFormulaBar = false;
+        option.enableAddBackTop = false;
+        option.showsheetbarConfig = {
+          add: false,
+          sheet: false,
+        };
+        option.cellRightClickConfig = {
+          copy: false, // 复制
+          copyAs: false, // 复制为
+          paste: false, // 粘贴
+          insertRow: false, // 插入行
+          insertColumn: false, // 插入列
+          deleteRow: false, // 删除选中行
+          deleteColumn: false, // 删除选中列
+          deleteCell: false, // 删除单元格
+          hideRow: false, // 隐藏选中行和显示选中行
+          hideColumn: false, // 隐藏选中列和显示选中列
+          rowHeight: false, // 行高
+          columnWidth: false, // 列宽
+          clear: false, // 清除内容
+          matrix: false, // 矩阵操作选区
+          sort: false, // 排序选区
+          filter: false, // 筛选选区
+          chart: false, // 图表生成
+          image: false, // 插入图片
+          link: false, // 插入链接
+          data: false, // 数据验证
+          cellFormat: false, // 设置单元格格式
+        };
+      };
+
       if (version.flow_id) {
         option.authority = {
           sheet: true,
           hintText: '当前处于审批节点,禁止编辑!',
         };
+        unableEdit(option);
       } else if (version.last_version) {
         option.authority = {
           sheet: true,
           hintText: '该清单已设置为最终版本,禁止编辑!',
         };
+        unableEdit(option);
       } else if (version.audit_status != 0 || version.status == 1) {
         option.authority = {
           sheet: true,
           hintText: '当前清单不可编辑!',
         };
+        unableEdit(option);
       }
     } else if (data && data.length > 0) {
       option.data = JSON.parse(JSON.stringify(data));