diff --git a/src/controllers/conditionformat.js b/src/controllers/conditionformat.js
index 29ae399..c9d3c6e 100644
--- a/src/controllers/conditionformat.js
+++ b/src/controllers/conditionformat.js
@@ -10,14 +10,55 @@ import { modelHTML, luckysheet_CFiconsImg } from './constant';
import server from './server';
import { selectionCopyShow } from './select';
import sheetmanage from './sheetmanage';
+import locale from '../locale/locale';
import Store from '../store';
//条件格式
const conditionformat = {
fileClone: [],
editorRule: null, //{"sheetIndex": sheetIndex,"itemIndex": itemIndex,"data": luckysheetfile[sheetIndex].luckysheet_conditionformat_save[itemIndex]}
- ruleTypeHtml: '
+
+ ►
+ ${conditionformat_Text.ruleTypeItem1}
+
+
+ ►
+ ${conditionformat_Text.ruleTypeItem2}
+
+
+ ►
+ ${conditionformat_Text.ruleTypeItem3}
+
+
+ ►
+ ${conditionformat_Text.ruleTypeItem4}
+
+
+ ►
+ ${conditionformat_Text.ruleTypeItem5}
+
+
`;
+ },
+ textCellColorHtml: function(){
+ const conditionformat_Text = locale().conditionformat;
+
+ return ``;
+ },
selectRange: [],
selectStatus: false,
dataBarList: [
@@ -1545,44 +1586,51 @@ const conditionformat = {
administerRuleDialog: function(){
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-administerRule-dialog").remove();
+
+ const conditionformat_Text = locale().conditionformat;
//工作表
let opHtml = '';
for(let j = 0; j < Store.luckysheetfile.length; j++){
if(Store.luckysheetfile[j].status == "1"){
- opHtml += '' +
- '
选择规则类型:
' +
- _this.ruleTypeHtml +
- '
编辑规则说明:
' +
+ '
' + conditionformat_Text.chooseRuleType + ':
' +
+ _this.ruleTypeHtml() +
+ '
' + conditionformat_Text.editRuleDescription + ':
' +
'
' +
ruleExplainHtml +
'
' +
@@ -1834,9 +1885,10 @@ const conditionformat = {
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-newConditionRule-dialog",
"addclass": "luckysheet-newEditorRule-dialog",
- "title": "新建格式规则",
+ "title": conditionformat_Text.newFormatRule,
"content": content,
- "botton": '
',
+ "botton": `
+
`,
"style": "z-index:100003"
}));
let $t = $("#luckysheet-newConditionRule-dialog")
@@ -1914,7 +1966,7 @@ const conditionformat = {
let content = '
' +
'
选择规则类型:
' +
- _this.ruleTypeHtml +
+ _this.ruleTypeHtml() +
'
编辑规则说明:
' +
'
' +
ruleExplainHtml +
@@ -2094,85 +2146,87 @@ const conditionformat = {
}).show();
},
getRuleExplain: function(index){
- let textCellColorHtml = this.textCellColorHtml;
+ const conditionformat_Text = locale().conditionformat;
+
+ let textCellColorHtml = this.textCellColorHtml();
let ruleExplainHtml;
switch(index){
case 0: //基于各自值设置所有单元格的格式
- ruleExplainHtml = '
基于各自值设置所有单元格的格式:
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '' +
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- '
' +
- '
' +
- '
';
+ ruleExplainHtml = `
${conditionformat_Text.ruleTypeItem1}:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
break;
case 1: //只为包含以下内容的单元格设置格式
ruleExplainHtml = '
只为满足以下条件的单元格:
' +
diff --git a/src/controllers/constant.js b/src/controllers/constant.js
index 1cf06b5..fda50ca 100644
--- a/src/controllers/constant.js
+++ b/src/controllers/constant.js
@@ -424,7 +424,7 @@ function rightclickHTML(){
-
`
+
`;
}
const pivottableconfigHTML = '',
@@ -438,9 +438,53 @@ const pivottableconfigHTML = '',
filtermenuHTML = '',
- filtersubmenuHTML = '',
- sheetconfigHTML = ' ';
+ filtersubmenuHTML = '';
+//底部 表格标签操作dom
+function sheetconfigHTML(){
+ const sheetconfig = locale().sheetconfig;
+
+ return `
+ `;
+}
const luckysheetPivotTableHTML = '
';
diff --git a/src/controllers/handler.js b/src/controllers/handler.js
index 184e323..8649030 100644
--- a/src/controllers/handler.js
+++ b/src/controllers/handler.js
@@ -6468,8 +6468,8 @@ export default function luckysheetHandler() {
hideAfterPaletteSelect: false,
showSelectionPalette: true,
maxPaletteSize: 10,
- cancelText: "取消",
- chooseText: "确定颜色",
+ cancelText: locale().sheetconfig.cancelText,
+ chooseText: locale().sheetconfig.chooseText,
togglePaletteMoreText: "更多",
togglePaletteLessText: "少于",
clearText: "清除颜色选择",
@@ -9656,9 +9656,11 @@ export default function luckysheetHandler() {
let reg2Arr = regArr[i].match(reg2);
- for(let j = 0; j < reg2Arr.length; j++){
- let cpValue = reg2Arr[j].replace(/
/g, "").replace(/<\/td>/g, "");
- cpRowArr.push(cpValue);
+ if(reg2Arr != null){
+ for(let j = 0; j < reg2Arr.length; j++){
+ let cpValue = reg2Arr[j].replace(//g, "").replace(/<\/td>/g, "");
+ cpRowArr.push(cpValue);
+ }
}
cpDataArr.push(cpRowArr);
diff --git a/src/global/createdom.js b/src/global/createdom.js
index 976c6a0..34f7f1a 100644
--- a/src/global/createdom.js
+++ b/src/global/createdom.js
@@ -101,7 +101,7 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit
$("body").append(inputHTML);
$("body").append(replaceHtml(filtermenuHTML, { "menuid": "filter" }));
$("body").append(replaceHtml(filtersubmenuHTML, { "menuid": "filter" }));
- $("body").append(sheetconfigHTML);
+ $("body").append(sheetconfigHTML());
//批注
luckysheetPostil.buildAllPs(Store.flowdata);
diff --git a/src/locale/en.js b/src/locale/en.js
index 8f097a9..a193e0d 100644
--- a/src/locale/en.js
+++ b/src/locale/en.js
@@ -371,6 +371,81 @@ export default {
byRow: 'By row',
byCol: 'By column',
generateNewMatrix: 'Generate new matrix',
- }
+ },
+ sheetconfig: {
+ delete: 'Delete',
+ copy: 'Copy',
+ rename: 'Rename',
+ changeColor: 'Change color',
+ hide: 'Hide',
+ unhide: 'Unhide',
+ moveLeft: 'Move left',
+ moveRight: 'Move right',
+ resetColor: 'Reset color',
+ cancelText: 'Cancel',
+ chooseText: 'Confirm color',
+ },
+ conditionformat: {
+ rule: 'Rule',
+ newRule: 'New rule',
+ editRule: 'Edit rule',
+ deleteRule: 'Delete rule',
+ showRules: 'Show its formatting rules',
+ manageRules: 'Conditional Formatting Rule Manager',
+ format: 'Format',
+ applyRange: 'Apply range',
+ selectRange: 'Click to select application range',
+ ruleTypeItem1: 'Format all cells based on their respective values',
+ ruleTypeItem2: 'Only format cells that contain',
+ ruleTypeItem3: 'Format only the top or bottom numbers',
+ ruleTypeItem4: 'Format only values above or below the average',
+ ruleTypeItem5: 'Format only unique or repeated values',
+ textColor: 'Text color',
+ cellColor: 'Cell color',
+ confirm: 'Confirm',
+ cancel: 'Cancel',
+ close: 'Close',
+ sheet: 'Sheet',
+ currentSheet: 'CurrentSheet',
+ dataBar: 'dataBar',
+ dataBarColor: 'dataBar color',
+ colorGradation: 'colorGradation',
+ icons: 'icons',
+ cellValue: 'Cell value',
+ between: 'Between',
+ in: 'In',
+ between2: '',
+ contain: 'Contain',
+ duplicateValue: 'Duplicate value',
+ uniqueValue: 'Unique value',
+ top: 'Top',
+ last: 'Last',
+ oneself: '',
+ aboveAverage: 'Above average',
+ belowAverage: 'Below average',
+ chooseRuleType: 'Choose rule type',
+ editRuleDescription: 'Edit rule description',
+ newFormatRule: 'New format rule',
+ formatStyle: 'Format style',
+ fillType: 'Fill type',
+ color: 'Color',
+ twocolor: 'Two-color',
+ tricolor: 'Tricolor',
+ multicolor: 'Multi color',
+ grayColor: 'Gray color',
+ gradient: 'Gradient',
+ solid: 'Solid',
+ maxValue: 'Max value',
+ medianValue: 'Median value',
+ minValue: 'Min value',
+ threeWayArrow: 'Three-way arrow',
+ fourWayArrow: 'Four-way arrow',
+ fiveWayArrow: 'Five-way arrow',
+ threeTriangles: 'Three triangles',
+ threeColorTrafficLight: 'Three-color traffic light',
+ fourColorTrafficLight: 'Four-color traffic light',
+ rimless: 'Rimless',
+ bordered: 'Bordered',
+ },
};
\ No newline at end of file
diff --git a/src/locale/zh.js b/src/locale/zh.js
index e062e66..d415a3d 100644
--- a/src/locale/zh.js
+++ b/src/locale/zh.js
@@ -392,5 +392,80 @@ export default {
byRow: '按行',
byCol: '按列',
generateNewMatrix: '生成新矩阵',
- }
+ },
+ sheetconfig: {
+ delete: '删除',
+ copy: '复制',
+ rename: '重命名',
+ changeColor: '更改颜色',
+ hide: '隐藏',
+ unhide: '取消隐藏',
+ moveLeft: '向左移',
+ moveRight: '向右移',
+ resetColor: '重置颜色',
+ cancelText: '取消',
+ chooseText: '确定颜色',
+ },
+ conditionformat: {
+ rule: '规则',
+ newRule: '新建规则',
+ editRule: '编辑规则',
+ deleteRule: '删除规则',
+ showRules: '显示其格式规则',
+ manageRules: '条件格式规则管理器',
+ format: '格式',
+ applyRange: '应用范围',
+ selectRange: '点击选择应用范围',
+ ruleTypeItem1: '基于各自值设置所有单元格的格式',
+ ruleTypeItem2: '只为包含以下内容的单元格设置格式',
+ ruleTypeItem3: '仅对排名靠前或靠后的数值设置格式',
+ ruleTypeItem4: '仅对高于或低于平均值的数值设置格式',
+ ruleTypeItem5: '仅对唯一值或重复值设置格式',
+ textColor: '文本颜色',
+ cellColor: '单元格颜色',
+ confirm: '确定',
+ cancel: '取消',
+ close: '关闭',
+ sheet: '表',
+ currentSheet: '当前工作表',
+ dataBar: '数据条',
+ dataBarColor: '数据条颜色',
+ colorGradation: '色阶',
+ icons: '图标集',
+ cellValue: '单元格值',
+ between: '介于',
+ in: '和',
+ between2: '之间',
+ contain: '包含',
+ duplicateValue: '重复值',
+ uniqueValue: '唯一值',
+ top: '前',
+ last: '后',
+ oneself: '个',
+ aboveAverage: '高于平均值',
+ belowAverage: '低于平均值',
+ chooseRuleType: '选择规则类型',
+ editRuleDescription: '编辑规则说明',
+ newFormatRule: '新建格式规则',
+ formatStyle: '格式样式',
+ fillType: '填充类型',
+ color: '颜色',
+ twocolor: '双色',
+ tricolor: '三色',
+ multicolor: '彩色',
+ grayColor: '灰色',
+ gradient: '渐变',
+ solid: '实心',
+ maxValue: '最大值',
+ medianValue: '中间值',
+ minValue: '最小值',
+ threeWayArrow: '三向箭头',
+ fourWayArrow: '四向箭头',
+ fiveWayArrow: '五向箭头',
+ threeTriangles: '3个三角形',
+ threeColorTrafficLight: '三色交通灯',
+ fourColorTrafficLight: '四色交通灯',
+ rimless: '无边框',
+ bordered: '有边框',
+ },
};