Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
docs(index.html): index.html
Browse files Browse the repository at this point in the history
index.html
  • Loading branch information
Dushusir committed Aug 4, 2020
2 parents a5a7dc2 + fb3b512 commit 817c194
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 99 deletions.
54 changes: 36 additions & 18 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_co
import selection from './selection';
import controlHistory from './controlHistory';
import splitColumn from './splitColumn';
import { luckysheetdefaultstyle } from './constant';

import {
replaceHtml,
Expand All @@ -28,6 +29,7 @@ import {
ArrayUnique,
showrightclickmenu,
luckysheetactiveCell,
luckysheetContainerFocus,
} from '../utils/util';
import { getSheetIndex, getRangetxt } from '../methods/get';
import {
Expand Down Expand Up @@ -867,7 +869,7 @@ export default function luckysheetHandler() {
//数据透视表
pivotTable.pivotclick(row_index, col_index, Store.currentSheetIndex);

$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

//$("#luckysheet-cols-h-c .luckysheet-cols-h-cells-c .luckysheet-cols-h-cells-clip .luckysheet-cols-h-cell-sel").removeClass("luckysheet-cols-h-cell-sel").addClass("luckysheet-cols-h-cell-nosel");

Expand Down Expand Up @@ -3074,7 +3076,7 @@ export default function luckysheetHandler() {
//底部添加行按钮
$("#luckysheet-bottom-add-row").on("click", function (e) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

let $t = $(this), value = $("#luckysheet-bottom-add-row-input").val();

Expand Down Expand Up @@ -3259,7 +3261,7 @@ export default function luckysheetHandler() {
return;
}

//复制范围内包含部分合并单元格,提示
//截图范围内包含部分合并单元格,提示
if (Store.config["merge"] != null) {
let has_PartMC = false;

Expand Down Expand Up @@ -3292,14 +3294,6 @@ export default function luckysheetHandler() {
let st_c = Store.luckysheet_select_save[0].column[0],
ed_c = Store.luckysheet_select_save[0].column[1];

let shotData = datagridgrowth([], ed_r + 1, ed_c + 1);

for (let r = st_r; r <= ed_r; r++) {
for (let c = st_c; c <= ed_c; c++) {
shotData[r][c] = Store.flowdata[r][c];
}
}

let scrollHeight, rh_height;
if (st_r - 1 < 0) {
scrollHeight = 0;
Expand All @@ -3325,13 +3319,37 @@ export default function luckysheetHandler() {
height: Math.ceil(rh_height * devicePixelRatio)
}).css({ width: ch_width, height: rh_height });

let d = Store.flowdata;
Store.flowdata = shotData;

luckysheetDrawMain(scrollWidth, scrollHeight, ch_width, rh_height, 1, 1, null, null, newCanvas);

Store.flowdata = d;
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
let ctx_newCanvas = newCanvas.get(0).getContext("2d");

//补上 左边框和上边框
ctx_newCanvas.beginPath();
ctx_newCanvas.moveTo(
0,
0
);
ctx_newCanvas.lineTo(
0,
Store.devicePixelRatio * rh_height
);
ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2;
ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle;
ctx_newCanvas.stroke();
ctx_newCanvas.closePath();

ctx_newCanvas.beginPath();
ctx_newCanvas.moveTo(
0,
0
);
ctx_newCanvas.lineTo(
Store.devicePixelRatio * ch_width,
0
);
ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2;
ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle;
ctx_newCanvas.stroke();
ctx_newCanvas.closePath();

let image = new Image();
let url = newCanvas.get(0).toDataURL("image/png");
Expand Down Expand Up @@ -3549,7 +3567,7 @@ export default function luckysheetHandler() {
luckysheetMoveHighlightCell("down", 0, "rangeOfSelect");
}

$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
});


Expand Down
2 changes: 2 additions & 0 deletions src/controllers/ifFormulaGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ const ifFormulaGenerator = {
$("#luckysheet-ifFormulaGenerator-multiRange-dialog").css({ "left": (winw + scrollLeft - myw) / 2, "top": (winh + scrollTop - myh) / 3 }).show();
},
getIfList: function(compareValue, smallRange, largeRange, method, methodVal){
const locale_formula = locale().formula;

$("#luckysheet-ifFormulaGenerator-dialog .ifList").empty();

smallRange = parseInt(smallRange);
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/locationCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const luckysheetLocationCell = {
init: function(){
let _this = this;

const locale_location = locale().findAndReplace;

$(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", function(e){
$("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", true);
$("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666");
Expand Down Expand Up @@ -213,6 +215,7 @@ const luckysheetLocationCell = {
});
},
apply: function(range, type, value){
const locale_location = locale().findAndReplace;
let rangeArr = [];

if(type == "locationFormula" || type == "locationConstant" || type == "locationNull"){ //公式 常量 空值
Expand Down
38 changes: 19 additions & 19 deletions src/controllers/matrixOperation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import selection from './selection';
import {
numFormat,
numFormat,luckysheetContainerFocus,
} from '../utils/util';
import { hasPartMC, isEditMode } from '../global/validate';
import { getdatabyselection, getcellvalue } from '../global/getdata';
Expand All @@ -13,7 +13,7 @@ export function initialMatrixOperation(){
//复制为json格式字符串,首行为标题
$("#luckysheet-copy-json-head").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -86,7 +86,7 @@ export function initialMatrixOperation(){
//复制为json格式字符串,无标题,采用ABCD作为标题
$("#luckysheet-copy-json-nohead").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();


if(Store.luckysheet_select_save.length > 1){
Expand Down Expand Up @@ -147,7 +147,7 @@ export function initialMatrixOperation(){
//复制为一维数组
$("#luckysheet-copy-array1").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -204,7 +204,7 @@ export function initialMatrixOperation(){
//复制为二维数组
$("#luckysheet-copy-array2").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();


if(Store.luckysheet_select_save.length > 1){
Expand Down Expand Up @@ -383,7 +383,7 @@ export function initialMatrixOperation(){
//复制为对角线
$("#luckysheet-copy-diagonal").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -443,7 +443,7 @@ export function initialMatrixOperation(){
//复制为反对角线
$("#luckysheet-copy-antidiagonal").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();


if(Store.luckysheet_select_save.length > 1){
Expand Down Expand Up @@ -504,7 +504,7 @@ export function initialMatrixOperation(){
//复制为对角偏移n列
$("#luckysheet-copy-diagonaloffset").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -590,7 +590,7 @@ export function initialMatrixOperation(){
//复制为布尔值
$("#luckysheet-copy-boolvalue").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();


if(Store.luckysheet_select_save.length > 1){
Expand Down Expand Up @@ -671,7 +671,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 上下
$("#luckysheet-matrix-turn-up").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -707,7 +707,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 左右
$("#luckysheet-matrix-turn-left").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -743,7 +743,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 顺时针
$("#luckysheet-matrix-turn-cw").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -779,7 +779,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 逆时针
$("#luckysheet-matrix-turn-anticw").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -815,7 +815,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 转置
$("#luckysheet-matrix-turn-trans").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -864,7 +864,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 矩阵计算
$("#luckysheet-matrix-cal-confirm").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -957,7 +957,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除两端0值 按行
$("#luckysheet-matrix-delezero-row").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -1025,7 +1025,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除两端0值 按列
$("#luckysheet-matrix-delezero-column").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除重复值 按行
$("#luckysheet-matrix-delerpt-row").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down Expand Up @@ -1167,7 +1167,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除重复值 按列
$("#luckysheet-matrix-delerpt-column").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();

if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
Expand Down
Loading

0 comments on commit 817c194

Please sign in to comment.