From 25626dedaa65ab797ec88da6fc069433d76a2adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 14:23:35 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DallowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=EF=BC=8C=E9=BB=8F=E8=B4=B4=E4=BB=8D?= =?UTF-8?q?=E7=84=B6=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/keyboard.js b/src/controllers/keyboard.js index ce2ac9d..496761a 100644 --- a/src/controllers/keyboard.js +++ b/src/controllers/keyboard.js @@ -587,7 +587,7 @@ export function keyboardInitial(){ $("#luckysheet-icon-italic").click(); } else if (kcode == 86) {//Ctrl + V 粘贴 - if(isEditMode()){//此模式下禁用粘贴 + if (isEditMode() || Store.allowEdit === false){//此模式下禁用粘贴 return; } From 25f743f9702fa930be18815367f710a42eb4c1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 14:36:12 +0800 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DallowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=E8=BF=98=E5=85=81=E8=AE=B8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E7=BC=96=E8=BE=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index 06566f3..5aa8826 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -119,6 +119,11 @@ const menuButton = { //格式刷 $("#luckysheet-icon-paintformat").click(function(e){ + // *如果禁止前台编辑,则中止下一步操作 + if(Store.allowEdit === false){ + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } e.stopPropagation(); let _locale = locale(); let locale_paint = _locale.paint; @@ -174,6 +179,11 @@ const menuButton = { _this.luckysheetPaintSingle = true; }); $("#luckysheet-icon-paintformat").dblclick(function(){ + // *如果禁止前台编辑,则中止下一步操作 + if (Store.allowEdit === false) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } let _locale = locale(); let locale_paint = _locale.paint; if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){ From 723d6bfacc66f937c0c260acab137cf6e13b498f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 14:42:19 +0800 Subject: [PATCH 03/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DallowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=EF=BC=8C=E4=BA=A4=E6=9B=BF=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index 5aa8826..b78c1d7 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -789,6 +789,11 @@ const menuButton = { //交替颜色 $menuButton.find(".luckysheet-icon-alternateformat").click(function(){ + // *如果禁止前台编辑,则中止下一步操作 + if (Store.allowEdit === false) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } $menuButton.hide(); luckysheetContainerFocus(); From 7b91004a31ce561f1bfd6b2b8f1f58695d8bf241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 14:57:05 +0800 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=E5=B0=81=E8=A3=85checkIsAllowEdi?= =?UTF-8?q?t=E6=96=B9=E6=B3=95=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=89=8D=E5=8F=B0=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 12 +++++++----- src/global/validate.js | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index b78c1d7..18522a5 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -16,7 +16,7 @@ import {luckysheetupdateCell} from './updateCell'; import insertFormula from './insertFormula'; import sheetmanage from './sheetmanage'; import luckysheetPostil from './postil'; -import { isRealNum, isRealNull, isEditMode, hasPartMC } from '../global/validate'; +import { isRealNum, isRealNull, isEditMode, hasPartMC, checkIsAllowEdit } from '../global/validate'; import tooltip from '../global/tooltip'; import editor from '../global/editor'; import { genarate, update, is_date } from '../global/format'; @@ -120,7 +120,7 @@ const menuButton = { //格式刷 $("#luckysheet-icon-paintformat").click(function(e){ // *如果禁止前台编辑,则中止下一步操作 - if(Store.allowEdit === false){ + if (!checkIsAllowEdit()) { tooltip.info("", locale().pivotTable.errorNotAllowEdit); return } @@ -180,7 +180,7 @@ const menuButton = { }); $("#luckysheet-icon-paintformat").dblclick(function(){ // *如果禁止前台编辑,则中止下一步操作 - if (Store.allowEdit === false) { + if (!checkIsAllowEdit()) { tooltip.info("", locale().pivotTable.errorNotAllowEdit); return } @@ -790,7 +790,7 @@ const menuButton = { //交替颜色 $menuButton.find(".luckysheet-icon-alternateformat").click(function(){ // *如果禁止前台编辑,则中止下一步操作 - if (Store.allowEdit === false) { + if (!checkIsAllowEdit()) { tooltip.info("", locale().pivotTable.errorNotAllowEdit); return } @@ -3143,7 +3143,9 @@ const menuButton = { return; } - if(Store.allowEdit===false){ + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); return; } diff --git a/src/global/validate.js b/src/global/validate.js index ddcd559..adbb91f 100644 --- a/src/global/validate.js +++ b/src/global/validate.js @@ -76,6 +76,20 @@ function isEditMode() { } } +/** + * @description: 检查是否允许前台进行表格编辑 + * @param {*} + * @return {Boolean} true:允许编辑 fasle:不允许 + */ +function checkIsAllowEdit(){ + if (Store.allowEdit) { + return true; + } + else { + return false; + } +} + //范围是否只包含部分合并单元格 function hasPartMC(cfg, r1, r2, c1, c2) { let hasPartMC = false; @@ -200,6 +214,7 @@ export { valueIsError, hasChinaword, isEditMode, + checkIsAllowEdit, hasPartMC, checkWordByteLength } \ No newline at end of file From bf47a7f6201d2c483fd26b4bcb60163d686f17a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 15:03:28 +0800 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3allowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=E4=BB=8D=E7=84=B6=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=BE=B9=E6=A1=86=E7=BC=96=E8=BE=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index 18522a5..aabc918 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -942,7 +942,11 @@ const menuButton = { //边框设置 $("#luckysheet-icon-border-all").click(function(){ - + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } if(!checkProtectionFormatCells(Store.currentSheetIndex)){ return; } @@ -1100,6 +1104,11 @@ const menuButton = { // border choose menu $menuButton.find(".luckysheet-cols-menuitem").click(function(){ + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } $menuButton.hide(); luckysheetContainerFocus(); From a52626a7c56a05406ce88ef577d51f1b4dcba2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 15:06:04 +0800 Subject: [PATCH 06/10] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3allowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=E4=BB=8D=E7=84=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8D=95=E5=85=83=E6=A0=BC=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=8B=86=E5=88=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/menuButton.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index aabc918..018a71f 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -1250,7 +1250,6 @@ const menuButton = { //合并单元格 $("#luckysheet-icon-merge-button").click(function(){ - if(!checkProtectionNotEnable(Store.currentSheetIndex)){ return; } @@ -3201,6 +3200,11 @@ const menuButton = { jfrefreshgrid(d, Store.luckysheet_select_save, allParam, false); }, updateFormat_mc: function(d, foucsStatus){ + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } let cfg = $.extend(true, {}, Store.config); if(cfg["merge"] == null){ cfg["merge"] = {}; From 76194a38c040e8fe30343377dbaead97b5ef3114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 15:10:29 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3allowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=E5=85=81=E8=AE=B8=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/handler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/handler.js b/src/controllers/handler.js index 770df04..fadf2e7 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -45,7 +45,7 @@ import { mouseposition } from '../global/location'; import { rowlenByRange } from '../global/getRowlen'; -import { isRealNull, hasPartMC, isEditMode } from '../global/validate'; +import { isRealNull, hasPartMC, isEditMode, checkIsAllowEdit } from '../global/validate'; import { countfunc } from '../global/count'; import browser from '../global/browser'; import formula from '../global/formula'; @@ -4863,6 +4863,11 @@ export default function luckysheetHandler() { //菜单栏 插入图片按钮 $("#luckysheet-insertImg-btn-title").click(function () { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "editObjects")){ return; } From 4636926fd8f76d98fc0ba98fe16179f74b1e7343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 15:42:39 +0800 Subject: [PATCH 08/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DallowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=E4=BB=8D=E7=84=B6=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E8=B6=85=E9=93=BE=E6=8E=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/handler.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/handler.js b/src/controllers/handler.js index fadf2e7..c6bb6b6 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -4893,6 +4893,11 @@ export default function luckysheetHandler() { //菜单栏 插入链接按钮 $("#luckysheet-insertLink-btn-title").click(function () { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } if(!checkProtectionNotEnable(Store.currentSheetIndex)){ return; } From a4556f7e7b3f909cf0484b8138640974b5b87abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 16:00:39 +0800 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DallowEdit?= =?UTF-8?q?=E4=B8=BAfalse=E6=97=B6=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E8=A1=8C=E5=88=97=E7=9A=84=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=B9=B6=E4=B8=94=E8=BF=9B=E8=A1=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/rowColumnOperation.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/controllers/rowColumnOperation.js b/src/controllers/rowColumnOperation.js index d881ae4..c091f69 100644 --- a/src/controllers/rowColumnOperation.js +++ b/src/controllers/rowColumnOperation.js @@ -21,7 +21,7 @@ import { colLocationByIndex, mouseposition } from '../global/location'; -import { isRealNull, isRealNum, hasPartMC, isEditMode } from '../global/validate'; +import { isRealNull, isRealNum, hasPartMC, isEditMode, checkIsAllowEdit } from '../global/validate'; import { countfunc } from '../global/count'; import formula from '../global/formula'; import { luckysheetextendtable, luckysheetdeletetable, luckysheetDeleteCell } from '../global/extend'; @@ -381,6 +381,10 @@ export function rowColumnOperationInitial(){ $("#luckysheet-rows-change-size").css("opacity", 0); }).mouseup(function (event) { if (event.which == 3) { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + return + } if(isEditMode()){ //非编辑模式下禁止右键功能框 return; } @@ -815,6 +819,10 @@ export function rowColumnOperationInitial(){ $("#luckysheet-cols-change-size").css("opacity", 0); }).mouseup(function (event) { if (event.which == 3) { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + return + } if(isEditMode()){ //非编辑模式下禁止右键功能框 return; } @@ -996,6 +1004,11 @@ export function rowColumnOperationInitial(){ // 列标题的下拉箭头 $("#luckysheet-cols-menu-btn").click(function (event) { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + tooltip.info("", locale().pivotTable.errorNotAllowEdit); + return + } let $menu = $("#luckysheet-rightclick-menu"); let offset = $(this).offset(); $("#luckysheet-cols-rows-shift").show(); From 26bef655c0946bba44201e0ff0c9897c3de2ca73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8C=AB=E5=AD=90neko?= <815743831@qq.com> Date: Fri, 19 Nov 2021 16:02:29 +0800 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=BC=96=E8=BE=91=E4=B8=8B=EF=BC=8C=E4=BB=8D?= =?UTF-8?q?=E7=84=B6=E5=8F=AF=E4=BB=A5=E6=8B=96=E5=8A=A8=E8=A1=8C=E9=AB=98?= =?UTF-8?q?=E5=88=97=E5=AE=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/rowColumnOperation.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/controllers/rowColumnOperation.js b/src/controllers/rowColumnOperation.js index c091f69..59c4af5 100644 --- a/src/controllers/rowColumnOperation.js +++ b/src/controllers/rowColumnOperation.js @@ -912,6 +912,10 @@ export function rowColumnOperationInitial(){ //表格行标题 改变行高按钮 $("#luckysheet-rows-change-size").mousedown(function (event) { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + return + } //有批注在编辑时 luckysheetPostil.removeActivePs(); @@ -956,6 +960,10 @@ export function rowColumnOperationInitial(){ //表格列标题 改变列宽按钮 $("#luckysheet-cols-change-size").mousedown(function (event) { + // *如果禁止前台编辑,则中止下一步操作 + if (!checkIsAllowEdit()) { + return + } //有批注在编辑时 luckysheetPostil.removeActivePs();