Browse Source

feat(date format): date format Chinese

master
wpxp123456 5 years ago
parent
commit
8f8d0cb8c5
  1. 12
      src/controllers/constant.js
  2. 8
      src/controllers/moreFormat.js
  3. 200
      src/controllers/rowColumnOperation.js
  4. 8
      src/locale/zh.js

12
src/controllers/constant.js

@ -320,6 +320,18 @@ function rightclickHTML(){
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>
</div>
</div>
<div id="luckysheet-hide-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.hideSelected}
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>
</div>
</div>
<div id="luckysheet-show-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
${rightclick.showHide}
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>
</div>
</div>
<div id="luckysheet-column-row-width-selected" class="luckysheet-cols-menuitem luckysheet-mousedown-cancel">
<div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">
<span class="luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel">${rightclick.column}</span>

8
src/controllers/moreFormat.js

@ -675,19 +675,19 @@ const luckysheetMoreFormat = {
},
{
"name": "下午01:30",
"value": 'AM/PM hh:mm'
"value": '上午/下午 hh:mm'
},
{
"name": "下午1:30",
"value": 'AM/PM h:mm'
"value": '上午/下午 h:mm'
},
{
"name": "下午1:30:30",
"value": 'AM/PM h:mm:ss'
"value": '上午/下午 h:mm:ss'
},
{
"name": "08-05 下午01:30",
"value": "MM-dd AM/PM hh:mm"
"value": "MM-dd 上午/下午 hh:mm"
},
// {
// "name": "1930年8月5日星期二",

200
src/controllers/rowColumnOperation.js

@ -1374,7 +1374,85 @@ export function rowColumnOperationInitial(){
luckysheetdeletetable('column', st_index, ed_index);
})
//隐藏、显示行
//隐藏选中行列
$("#luckysheet-hide-selected").click(function (event) {
if(Store.luckysheetRightHeadClickIs == 'row' && !checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
return;
}
if(Store.luckysheetRightHeadClickIs == 'column' && !checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns")){
return;
}
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(Store.luckysheetRightHeadClickIs == 'row'){
if(cfg["rowhidden"] == null){
cfg["rowhidden"] = {};
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let r1 = Store.luckysheet_select_save[s].row[0],
r2 = Store.luckysheet_select_save[s].row[1];
for(let r = r1; r <= r2; r++){
cfg["rowhidden"][r] = 0;
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidRows";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
Store.jfundo = [];
Store.jfredo.push(redo);
}
server.saveParam("cg", Store.currentSheetIndex, cfg["rowhidden"], { "k": "rowhidden" });
}
else if(Store.luckysheetRightHeadClickIs == 'column'){
if(cfg["colhidden"] == null){
cfg["colhidden"] = {};
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let c1 = Store.luckysheet_select_save[s].column[0],
c2 = Store.luckysheet_select_save[s].column[1];
for(let c = c1; c <= c2; c++){
cfg["colhidden"][c] = 0;
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidCols";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
Store.jfundo = [];
Store.jfredo.push(redo);
}
server.saveParam("cg", Store.currentSheetIndex, cfg["colhidden"], { "k": "colhidden" });
}
//config
Store.config = cfg;
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config;
//行高、列宽 刷新
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
})
$("#luckysheet-hidRows").click(function (event) {
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
return;
@ -1418,31 +1496,31 @@ export function rowColumnOperationInitial(){
//行高、列宽 刷新
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
})
$("#luckysheet-showHidRows").click(function (event) {
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
$("#luckysheet-hidCols").click(function (event) {
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns")){
return;
}
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(cfg["rowhidden"] == null){
return;
if(cfg["colhidden"] == null){
cfg["colhidden"] = {};
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let r1 = Store.luckysheet_select_save[s].row[0],
r2 = Store.luckysheet_select_save[s].row[1];
let c1 = Store.luckysheet_select_save[s].column[0],
c2 = Store.luckysheet_select_save[s].column[1];
for(let r = r1; r <= r2; r++){
delete cfg["rowhidden"][r];
for(let c = c1; c <= c2; c++){
cfg["colhidden"][c] = 0;
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidRows";
redo["type"] = "showHidCols";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
@ -1455,38 +1533,116 @@ export function rowColumnOperationInitial(){
Store.config = cfg;
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config;
server.saveParam("cg", Store.currentSheetIndex, cfg["rowhidden"], { "k": "rowhidden" });
server.saveParam("cg", Store.currentSheetIndex, cfg["colhidden"], { "k": "colhidden" });
//行高、列宽 刷新
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
})
//隐藏、显示列
$("#luckysheet-hidCols").click(function (event) {
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns")){
//显示选中行
$("#luckysheet-show-selected").click(function (event) {
if(Store.luckysheetRightHeadClickIs == 'row' && !checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
return;
}
if(Store.luckysheetRightHeadClickIs == 'column' && !checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatColumns")){
return;
}
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(cfg["colhidden"] == null){
cfg["colhidden"] = {};
if(Store.luckysheetRightHeadClickIs == 'row'){
if(cfg["rowhidden"] == null){
return;
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let r1 = Store.luckysheet_select_save[s].row[0],
r2 = Store.luckysheet_select_save[s].row[1];
for(let r = r1; r <= r2; r++){
delete cfg["rowhidden"][r];
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidRows";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
Store.jfundo = [];
Store.jfredo.push(redo);
}
server.saveParam("cg", Store.currentSheetIndex, cfg["rowhidden"], { "k": "rowhidden" });
}
else if(Store.luckysheetRightHeadClickIs == 'column'){
if(cfg["colhidden"] == null){
return;
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let c1 = Store.luckysheet_select_save[s].column[0],
c2 = Store.luckysheet_select_save[s].column[1];
for(let c = c1; c <= c2; c++){
delete cfg["colhidden"][c];
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidCols";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
Store.jfundo = [];
Store.jfredo.push(redo);
}
server.saveParam("cg", Store.currentSheetIndex, cfg["colhidden"], { "k": "colhidden" });
}
//config
Store.config = cfg;
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config;
//行高、列宽 刷新
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
})
$("#luckysheet-showHidRows").click(function (event) {
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
return;
}
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(cfg["rowhidden"] == null){
return;
}
for(let s = 0; s < Store.luckysheet_select_save.length; s++){
let c1 = Store.luckysheet_select_save[s].column[0],
c2 = Store.luckysheet_select_save[s].column[1];
let r1 = Store.luckysheet_select_save[s].row[0],
r2 = Store.luckysheet_select_save[s].row[1];
for(let c = c1; c <= c2; c++){
cfg["colhidden"][c] = 0;
for(let r = r1; r <= r2; r++){
delete cfg["rowhidden"][r];
}
}
//保存撤销
if(Store.clearjfundo){
let redo = {};
redo["type"] = "showHidCols";
redo["type"] = "showHidRows";
redo["sheetIndex"] = Store.currentSheetIndex;
redo["config"] = $.extend(true, {}, Store.config);
redo["curconfig"] = cfg;
@ -1499,7 +1655,7 @@ export function rowColumnOperationInitial(){
Store.config = cfg;
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config;
server.saveParam("cg", Store.currentSheetIndex, cfg["colhidden"], { "k": "colhidden" });
server.saveParam("cg", Store.currentSheetIndex, cfg["rowhidden"], { "k": "rowhidden" });
//行高、列宽 刷新
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);

8
src/locale/zh.js

@ -9390,19 +9390,19 @@ export default {
},
{
"name": "下午01:30",
"value": 'AM/PM hh:mm'
"value": '上午/下午 hh:mm'
},
{
"name": "下午1:30",
"value": 'AM/PM h:mm'
"value": '上午/下午 h:mm'
},
{
"name": "下午1:30:30",
"value": 'AM/PM h:mm:ss'
"value": '上午/下午 h:mm:ss'
},
{
"name": "08-05 下午01:30",
"value": "MM-dd AM/PM hh:mm"
"value": "MM-dd 上午/下午 hh:mm"
},
// {
// "name": "1930年8月5日星期二",

Loading…
Cancel
Save