Browse Source

fix(bug fix): pivotTable blank title disapear, merge cell is recognized as range

master
wbfsa 5 years ago
parent
commit
47fe25c321
  1. 2
      src/controllers/constant.js
  2. 8
      src/controllers/handler.js
  3. 8
      src/controllers/menuButton.js
  4. 12
      src/controllers/pivotTable.js
  5. 6
      src/controllers/rowColumnOperation.js
  6. 18
      src/controllers/select.js
  7. 18
      src/global/draw.js
  8. 12
      src/global/formula.js
  9. 6
      src/locale/en.js

2
src/controllers/constant.js

@ -976,7 +976,7 @@ function menuToolBar (){
<div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"
style="user-select: none;">
<div class="luckysheet-icon luckysheet-inline-block " style="user-select: none;">
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-overflow"
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-clip"
style="user-select: none;">
</div>
</div>

8
src/controllers/handler.js

@ -16,7 +16,7 @@ import luckysheetsizeauto from './resize';
import {
luckysheetMoveHighlightCell,
} from './sheetMove';
import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_count_show } from './select';
import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_count_show,selectHelpboxFill } from './select';
import selection from './selection';
import controlHistory from './controlHistory';
import splitColumn from './splitColumn';
@ -442,7 +442,7 @@ export default function luckysheetHandler() {
"column_focus": col_index
};
}
formula.rangeSetValue({ "row": rowseleted, "column": columnseleted });
formula.rangestart = true;
@ -857,7 +857,7 @@ export default function luckysheetHandler() {
hideAllNeedRangeShow();
}
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]));
// selectHelpboxFill();
//数据透视表
pivotTable.pivotclick(row_index, col_index, Store.currentSheetIndex);
@ -1416,7 +1416,7 @@ export default function luckysheetHandler() {
selectHightlightShow();
luckysheetFreezen.scrollFreezen();
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]));
// selectHelpboxFill();
//交替颜色选择范围
if ($("#luckysheet-alternateformat-rangeDialog").is(":visible")) {

8
src/controllers/menuButton.js

@ -966,7 +966,7 @@ const menuButton = {
let colormenu = replaceHtml(_this.color, { "id": subcolormenuid, "coloritem": "", "colorself": "", "sub": "luckysheet-menuButton-sub",resetColor:locale_toolbar.resetColor });
$("body").append(menu + colormenu + submenu);
$menuButton = $("#" + menuButtonId).width(160);
$menuButton = $("#" + menuButtonId).width(170);
_this.focus($menuButton, "border-all");
$("#" + submenuid + " canvas").each(function(i){
@ -1196,7 +1196,7 @@ const menuButton = {
let menu = replaceHtml(_this.menu, { "id": "merge-menu", "item": itemset, "subclass": "", "sub": "" });
$("body").append(menu);
$menuButton = $("#"+menuButtonId).width(100);
$menuButton = $("#"+menuButtonId).width(110);
_this.focus($menuButton);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
@ -1391,7 +1391,7 @@ const menuButton = {
$("body").append(menu);
$menuButton = $("#" + menuButtonId).width(120);
_this.focus($menuButton);
_this.focus($menuButton, "clip");
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
@ -1493,7 +1493,7 @@ const menuButton = {
let menu = replaceHtml(_this.menu, { "id": "freezen-menu", "item": itemset, "subclass": "", "sub": "" });
$("body").append(menu);
$menuButton = $("#" + menuButtonId).width(160);
$menuButton = $("#" + menuButtonId).width(170);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();

12
src/controllers/pivotTable.js

@ -759,13 +759,15 @@ const pivotTable = {
return;
}
if (this.isPivotRange(row_index, col_index)) {
$("#luckysheet-modal-dialog-slider-pivot").show();
let slider = $("#luckysheet-modal-dialog-slider-pivot");
let isRangeClick = this.isPivotRange(row_index, col_index);
if (isRangeClick && slider.is(":hidden")) {
slider.show();
luckysheetsizeauto();
$("#luckysheet-sta-content").css("padding-right", 260);
}
else {
$("#luckysheet-modal-dialog-slider-pivot").hide();
else if(!isRangeClick && slider.is(":visible")) {
slider.hide();
luckysheetsizeauto();
$("#luckysheet-sta-content").css("padding-right", 10);
}
@ -3009,7 +3011,7 @@ const pivotTable = {
}
}
if (values.length == 1 && column.length > 0) {
if (values.length == 1 && column.length > 0 && row.length > 0 ) {
retdata[0][0] = values[0].fullname;
retdata.splice(column.length, 1);
}

6
src/controllers/rowColumnOperation.js

@ -3,7 +3,7 @@ import pivotTable from './pivotTable';
import luckysheetPostil from './postil';
import menuButton from './menuButton';
import server from './server';
import { selectHightlightShow, luckysheet_count_show } from './select';
import { selectHightlightShow, luckysheet_count_show,selectHelpboxFill } from './select';
import {
getObjType,
showrightclickmenu,
@ -333,7 +333,7 @@ export function rowColumnOperationInitial(){
}
}
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]));
selectHelpboxFill();
setTimeout(function () {
clearTimeout(Store.countfuncTimeout);
@ -700,7 +700,7 @@ export function rowColumnOperationInitial(){
}
}
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]));
selectHelpboxFill();
setTimeout(function () {
clearTimeout(Store.countfuncTimeout);

18
src/controllers/select.js

@ -170,7 +170,7 @@ function selectHightlightShow() {
selectTitlesShow(Store.luckysheet_select_save);
//左上角范围显示
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]));
selectHelpboxFill();
//动态数组显示
if(Store.luckysheet_select_save.length == 1 && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1]){
@ -394,10 +394,26 @@ function luckysheet_count_show(left, top, width, height, rowseleted, columnselet
}
}
function selectHelpboxFill(){
let range = Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1];
let rf = range["row_focus"], cf = range["column_focus"];
if(Store.config["merge"] != null && (rf + "_" + cf) in Store.config["merge"]){
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, {
column:[cf, cf],
row:[rf, rf],
}));
}
else{
$("#luckysheet-helpbox-cell").text(getRangetxt(Store.currentSheetIndex, range));
}
}
export {
seletedHighlistByindex,
selectHightlightShow,
selectIsOverlap,
selectionCopyShow,
luckysheet_count_show,
selectHelpboxFill
}

18
src/global/draw.js

@ -14,6 +14,7 @@ import { getBorderInfoCompute } from './border';
import { getSheetIndex } from '../methods/get';
import { getObjType, chatatABC, luckysheetfontformat } from '../utils/util';
import Store from '../store';
import locale from '../locale/locale';
function luckysheetDrawgrid(scrollWidth, scrollHeight, drawWidth, drawHeight, offsetLeft, offsetTop) {
if($("#luckysheetTableContent").length == 0){
@ -673,7 +674,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
);
luckysheetTableContent.lineTo(
Store.devicePixelRatio * (end_c - 2 + 0.5 + offsetLeft),
Store.devicePixelRatio * (end_r - 2 + offsetTop)
Store.devicePixelRatio * (end_r - 2 + 0.5 + offsetTop)
);
luckysheetTableContent.lineWidth = Store.devicePixelRatio;
luckysheetTableContent.strokeStyle = "#000000";
@ -688,7 +689,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
Store.devicePixelRatio * (end_r - 2 + 0.5 + offsetTop)
);
luckysheetTableContent.lineTo(
Store.devicePixelRatio * (end_c - 2 + offsetLeft),
Store.devicePixelRatio * (end_c - 2 + 0.5 + offsetLeft),
Store.devicePixelRatio * (end_r - 2 + 0.5 + offsetTop)
);
luckysheetTableContent.lineWidth = Store.devicePixelRatio;
@ -698,11 +699,16 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
}
if (r == 6 && c == 3) {
luckysheetTableContent.save();
luckysheetTableContent.font="bold 30px Arial";
luckysheetTableContent.fillStyle = "#626675";
luckysheetTableContent.textAlign="center";
luckysheetTableContent.fillText(
"Pivot Table",
Store.devicePixelRatio * (start_c + 4 + offsetLeft),
locale().pivotTable.title,
Store.devicePixelRatio * (start_c + (end_c - start_c) / 2 + 4 + offsetLeft),
Store.devicePixelRatio *(start_r + (end_r - start_r) / 2 - 1 + offsetTop)
);
luckysheetTableContent.restore();
}
}
else if (!!Store.luckysheetcurrentisPivotTable) {
@ -714,7 +720,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
);
luckysheetTableContent.lineTo(
Store.devicePixelRatio*(end_c - 2 + 0.5 + offsetLeft),
Store.devicePixelRatio*(end_r - 2 + offsetTop)
Store.devicePixelRatio*(end_r - 2 + 0.5 + offsetTop)
);
luckysheetTableContent.lineWidth = Store.devicePixelRatio;
luckysheetTableContent.strokeStyle = "#000000";
@ -738,6 +744,8 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
}
}
}
//边框单独渲染
if(Store.config["borderInfo"] != null && Store.config["borderInfo"].length > 0){

12
src/global/formula.js

@ -2230,7 +2230,17 @@ const luckysheetformula = {
rangeSetValue: function(selected, obj) {
let _this = this;
let range = getRangetxt(Store.currentSheetIndex, selected, _this.rangetosheet);
let range="", rf = selected["row"][0], cf = selected["column"][0];
if(Store.config["merge"] != null && (rf + "_" + cf) in Store.config["merge"]){
range = getRangetxt(Store.currentSheetIndex, {
column:[cf, cf],
row:[rf, rf],
}, _this.rangetosheet);
}
else{
range = getRangetxt(Store.currentSheetIndex, selected, _this.rangetosheet);
}
let $editor;
if (_this.rangestart || _this.rangedrag_column_start || _this.rangedrag_row_start) {

6
src/locale/en.js

@ -706,12 +706,12 @@ export default {
setAs: 'Set as',
setAsByArea: 'For the selected area, set to',
applyRange: 'Apply range',
selectRange: 'Click to select application range',
selectRange: 'Select application range',
selectRange_percent: 'Percentage of selected range',
selectRange_average: 'Average value of selected range',
selectRange_value: 'Value in the selected range',
pleaseSelectRange: 'Please select application range',
selectDataRange: 'Click to select data range',
selectDataRange: 'Select data range',
selectCell: 'select cell',
pleaseSelectCell: 'Please select cell',
pleaseSelectADate: 'Please select a date',
@ -937,7 +937,7 @@ export default {
pivotTable:{
title:"PivotTable",
closePannel:"Close",
editRange:"Select data range",
editRange:"Range",
tipPivotFieldSelected:"Select the fields",
tipClearSelectedField:"Clear all fields",
btnClearSelectedField:"Clear",

Loading…
Cancel
Save