Browse Source

sheet名称支持和excel一样

master
kdevilpf 5 years ago
parent
commit
364314aac3
  1. 7
      src/controllers/sheetBar.js
  2. 2
      src/locale/zh.js

7
src/controllers/sheetBar.js

@ -281,9 +281,12 @@ export function initialSheetBar(){
let $t = $(this);
let txt = $t.text(), oldtxt = $t.data("oldtxt");
var reg1 = new RegExp("[\\[\\]:\\?*\/'\"]");
if(reg1.test(txt)){
if(txt.length>31 || txt.charAt(0)=="'" || txt.charAt(txt.length-1)=="'" || /[:\:\\\/?\?\*\[\]]+/.test(txt)){
alert(locale_sheetconfig.sheetNameSpecCharError);
setTimeout(()=>{
luckysheetsheetnameeditor($(this));
$(this).focus();
}, 1);
return;
}

2
src/locale/zh.js

@ -9769,7 +9769,7 @@ export default {
redoDelete:"可以通过Ctrl+Z撤销删除",
noHide:"不能隐藏, 至少保留一个sheet标签",
chartEditNoOpt:"图表编辑模式下不允许该操作!",
sheetNameSpecCharError:"名称不能包含:[ ] : \ ? * / ' \"",
sheetNameSpecCharError:"名称不能超过31个字符,首尾不能是' 且名称不能包含:\r\n[ ] : \\ ? * /",
sheetNamecannotIsEmptyError:"名称不能为空"
},
conditionformat: {

Loading…
Cancel
Save