laiguoran 4 лет назад
Родитель
Сommit
22cd4e3332
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/public/js/material_exponent.js

+ 3 - 1
app/public/js/material_exponent.js

@@ -234,6 +234,8 @@ $(document).ready(() => {
             }
         },
         deletePress: function (sheet) {
+            if (!sheet.zh_setting || readOnly || sheet.zh_setting.readOnly) return;
+            // materialExponentBase.isUsed(select)
             if (sheet.zh_setting && sheet.zh_data) {
                 const sel = sheet.getSelections()[0];
                 if (!sel) return;
@@ -246,6 +248,7 @@ $(document).ready(() => {
                     for (let iCol = 0; iCol < sel.colCount; iCol++) {
                         const curCol = sel.col + iCol;
                         const colSetting = sheet.zh_setting.cols[curCol];
+                        if(colSetting.readOnly(exData)) continue;
                         if (!colSetting) continue;
                         const orgValue = sortData[iRow][colSetting.field];
                         if(orgValue === null) {
@@ -273,7 +276,6 @@ $(document).ready(() => {
                     SpreadJsObj.reLoadSheetData(sheet);
                     return;
                 }
-                // console.log(data);
                 // 更新至服务器
                 postData(window.location.pathname + '/save', { type:'paste', updateData: data }, function (result) {
                     materialExponentData = result.info;