|
|
@ -12,6 +12,8 @@ import tooltip from '../global/tooltip'; |
|
|
|
import func_methods from '../global/func_methods'; |
|
|
|
import Store from '../store'; |
|
|
|
import locale from '../locale/locale'; |
|
|
|
import {checkProtectionLockedRangeList,checkProtectionAllSelected,checkProtectionSelectLockedOrUnLockedCells,checkProtectionNotEnable,checkProtectionLocked} from './protection'; |
|
|
|
|
|
|
|
|
|
|
|
//查找替换
|
|
|
|
const luckysheetSearchReplace = { |
|
|
@ -575,6 +577,10 @@ const luckysheetSearchReplace = { |
|
|
|
|
|
|
|
let v = replaceText; |
|
|
|
|
|
|
|
if(!checkProtectionLocked(r, c, Store.currentSheetIndex)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
setcellvalue(r, c, d, v); |
|
|
|
} |
|
|
|
else{ |
|
|
@ -589,6 +595,10 @@ const luckysheetSearchReplace = { |
|
|
|
r = searchIndexArr[count].r; |
|
|
|
c = searchIndexArr[count].c; |
|
|
|
|
|
|
|
if(!checkProtectionLocked(r, c, Store.currentSheetIndex)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let v = valueShowEs(r, c, d).toString().replace(reg, replaceText); |
|
|
|
|
|
|
|
setcellvalue(r, c, d, v); |
|
|
@ -695,17 +705,22 @@ const luckysheetSearchReplace = { |
|
|
|
let replaceText = $("#luckysheet-search-replace #replaceInput input").val(); |
|
|
|
|
|
|
|
let d = editor.deepCopyFlowData(Store.flowdata); |
|
|
|
|
|
|
|
let replaceCount = 0; |
|
|
|
if(wordCheck){ |
|
|
|
for(let i = 0; i < searchIndexArr.length; i++){ |
|
|
|
let r = searchIndexArr[i].r; |
|
|
|
let c = searchIndexArr[i].c; |
|
|
|
|
|
|
|
if(!checkProtectionLocked(r, c, Store.currentSheetIndex, false)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
let v = replaceText; |
|
|
|
|
|
|
|
setcellvalue(r, c, d, v); |
|
|
|
|
|
|
|
range.push({ "row": [r, r], "column": [c, c] }); |
|
|
|
replaceCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
@ -721,11 +736,16 @@ const luckysheetSearchReplace = { |
|
|
|
let r = searchIndexArr[i].r; |
|
|
|
let c = searchIndexArr[i].c; |
|
|
|
|
|
|
|
if(!checkProtectionLocked(r, c, Store.currentSheetIndex, false)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
let v = valueShowEs(r, c, d).toString().replace(reg, replaceText); |
|
|
|
|
|
|
|
setcellvalue(r, c, d, v); |
|
|
|
|
|
|
|
range.push({ "row": [r, r], "column": [c, c] }); |
|
|
|
replaceCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -739,7 +759,7 @@ const luckysheetSearchReplace = { |
|
|
|
selectHightlightShow(); |
|
|
|
|
|
|
|
let succeedInfo = replaceHtml(locale_findAndReplace.successTip, { |
|
|
|
"xlength": searchIndexArr.length |
|
|
|
"xlength": replaceCount |
|
|
|
}); |
|
|
|
if(isEditMode()){ |
|
|
|
alert(succeedInfo); |
|
|
|