Browse Source

fix(destroy function repaire): repair

master
liuyang 5 years ago
parent
commit
02b9fe75f2
  1. 4
      gulpfile.js
  2. 10
      src/controllers/constant.js
  3. 2
      src/controllers/menuButton.js
  4. 4
      src/controllers/print.js
  5. 103
      src/global/method.js
  6. 6
      src/index.html
  7. 2
      src/store/index.js

4
gulpfile.js

@ -173,7 +173,9 @@ async function core() {
file: 'dist/luckysheet.umd.js', file: 'dist/luckysheet.umd.js',
format: 'umd', format: 'umd',
name: 'luckysheet', name: 'luckysheet',
sourcemap: true sourcemap: true,
inlineDynamicImports:true,
}); });
if(production){ if(production){

10
src/controllers/constant.js

@ -230,9 +230,9 @@ const gridHTML = function(){
<div class="luckysheet-zoom-ratioText" id="luckysheet-zoom-ratioText">100%</div> <div class="luckysheet-zoom-ratioText" id="luckysheet-zoom-ratioText">100%</div>
</div> </div>
<div class="luckysheet-print-viewList"> <div class="luckysheet-print-viewList">
<div type="viewNormal" class="luckysheet-print-viewBtn luckysheet-print-viewNormal luckysheet-print-viewBtn-active" title="${locale_print.normalBtn}"><i class="icon iconfont icon-caidan1"></i></div> <div type="viewNormal" class="luckysheet-print-viewBtn luckysheet-print-viewNormal luckysheet-print-viewBtn-active" title="${locale_print.normalBtn}"><i class="icon iconfont icon-putong"></i></div>
<div type="viewLayout" class="luckysheet-print-viewBtn luckysheet-print-viewLayout" title="${locale_print.layoutBtn}"><i class="icon iconfont icon-caidan1"></i></div> <div type="viewLayout" class="luckysheet-print-viewBtn luckysheet-print-viewLayout" title="${locale_print.layoutBtn}"><i class="icon iconfont icon-yemianbuju"></i></div>
<div type="viewPage" class="luckysheet-print-viewBtn luckysheet-print-viewPage" title="${locale_print.pageBtn}"><i class="icon iconfont icon-caidan1"></i></div> <div type="viewPage" class="luckysheet-print-viewBtn luckysheet-print-viewPage" title="${locale_print.pageBtn}"><i class="icon iconfont icon-fenyeyulan"></i></div>
</div> </div>
<div class="luckysheet-sta-content" id="luckysheet-sta-content"></div> <div class="luckysheet-sta-content" id="luckysheet-sta-content"></div>
<div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div> <div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div>
@ -1415,7 +1415,7 @@ function menuToolBar (){
<div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block"
style="user-select: none;"> style="user-select: none;">
<div class="luckysheet-icon 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-rotation-none iconfont icon-quanping" <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none iconfont icon-biaogesuoding"
style="user-select: none;"> style="user-select: none;">
</div> </div>
</div> </div>
@ -1431,7 +1431,7 @@ function menuToolBar (){
style="user-select: none;"> style="user-select: none;">
<div class="luckysheet-icon 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-autofilter iconfont icon-shezhi" <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-dayin"
style="user-select: none;"> style="user-select: none;">
</div> </div>
</div> </div>

2
src/controllers/menuButton.js

@ -2809,7 +2809,7 @@ const menuButton = {
const locale_print = _locale.print; const locale_print = _locale.print;
if($menuButton.length == 0){ if($menuButton.length == 0){
let itemdata = [ let itemdata = [
{"text": locale_print.menuItemPrint, "value": "print", "example": '<i class="iconfont icon-sousuo" aria-hidden="true"></i>'}, {"text": locale_print.menuItemPrint, "value": "print", "example": '<i class="iconfont icon-dayin" aria-hidden="true"></i>'},
{"text": "", "value": "split", "example": ""}, {"text": "", "value": "split", "example": ""},
{"text": locale_print.menuItemAreas, "value": "areas", "example": '<i class="iconfont icon-tihuan" aria-hidden="true"></i>'}, {"text": locale_print.menuItemAreas, "value": "areas", "example": '<i class="iconfont icon-tihuan" aria-hidden="true"></i>'},
{"text": locale_print.menuItemRows, "value": "rows", "example": '<i class="iconfont icon-zhuandao1" aria-hidden="true"></i>'}, {"text": locale_print.menuItemRows, "value": "rows", "example": '<i class="iconfont icon-zhuandao1" aria-hidden="true"></i>'},

4
src/controllers/print.js

@ -3,7 +3,7 @@ import {zoomChange} from './zoom';
import sheetmanage from './sheetmanage'; import sheetmanage from './sheetmanage';
import server from './server'; import server from './server';
import Store from '../store'; import Store from '../store';
// import { jsPDF } from "jspdf"; import { jsPDF } from "jspdf";
let ExcelPlaceholder = { let ExcelPlaceholder = {
"[tabName]":"&A", "[tabName]":"&A",
@ -71,6 +71,8 @@ export function viewChange(curType, preType){
// server.saveParam("all", Store.currentSheetIndex, curZoom, { "k": "zoomRatio" }); // server.saveParam("all", Store.currentSheetIndex, curZoom, { "k": "zoomRatio" });
server.saveParam("cg", Store.currentSheetIndex, curType, { "k": "curentsheetView" }); server.saveParam("cg", Store.currentSheetIndex, curType, { "k": "curentsheetView" });
Store.currentSheetView = curType;
zoomChange(curZoom); zoomChange(curZoom);
} }

103
src/global/method.js

@ -2,6 +2,8 @@ import server from '../controllers/server';
import { luckysheetlodingHTML, luckyColor } from '../controllers/constant'; import { luckysheetlodingHTML, luckyColor } from '../controllers/constant';
import sheetmanage from '../controllers/sheetmanage'; import sheetmanage from '../controllers/sheetmanage';
import luckysheetformula from './formula'; import luckysheetformula from './formula';
import imageCtrl from '../controllers/imageCtrl';
import dataVerificationCtrl from '../controllers/dataVerificationCtrl';
import pivotTable from '../controllers/pivotTable'; import pivotTable from '../controllers/pivotTable';
import luckysheetFreezen from '../controllers/freezen'; import luckysheetFreezen from '../controllers/freezen';
import { getSheetIndex } from '../methods/get'; import { getSheetIndex } from '../methods/get';
@ -147,8 +149,10 @@ const defaultConfig = {
fontList:[], fontList:[],
currentSheetView:"viewNormal",
}, },
defualtFormula:{ defaultFormula:{
searchFunctionCell: null, searchFunctionCell: null,
functionlistPosition: {}, functionlistPosition: {},
rangechangeindex: null, rangechangeindex: null,
@ -192,14 +196,14 @@ const defaultConfig = {
functionResizeTimeout: null, functionResizeTimeout: null,
data_parm_index: 0 //选择公式后参数索引标记 data_parm_index: 0 //选择公式后参数索引标记
}, },
defualtSheet:{ defaultSheet:{
sheetMaxIndex: 0, sheetMaxIndex: 0,
nulldata: null, nulldata: null,
mergeCalculationSheet:{}, mergeCalculationSheet:{},
checkLoadSheetIndexToDataIndex:{}, checkLoadSheetIndexToDataIndex:{},
CacheNotLoadControll:[], CacheNotLoadControll:[],
}, },
defualtPivotTable:{ defaultPivotTable:{
pivotDatas: null, pivotDatas: null,
pivotSheetIndex: 0, pivotSheetIndex: 0,
pivotDataSheetIndex: 0, pivotDataSheetIndex: 0,
@ -224,6 +228,64 @@ const defaultConfig = {
movesave: {}, movesave: {},
drawPivotTable: true, drawPivotTable: true,
pivotTableBoundary: [12, 6], pivotTableBoundary: [12, 6],
},
defaultImage:{
imgItem: {
type: '3', //1移动并调整单元格大小 2移动并且不调整单元格的大小 3不要移动单元格并调整其大小
src: '', //图片url
originWidth: null, //图片原始宽度
originHeight: null, //图片原始高度
default: {
width: null, //图片 宽度
height: null, //图片 高度
left: null, //图片离表格左边的 位置
top: null, //图片离表格顶部的 位置
},
crop: {
width: null, //图片裁剪后 宽度
height: null, //图片裁剪后 高度
offsetLeft: 0, //图片裁剪后离未裁剪时 左边的位移
offsetTop: 0, //图片裁剪后离未裁剪时 顶部的位移
},
isFixedPos: false, //固定位置
fixedLeft: null, //固定位置 左位移
fixedTop: null, //固定位置 右位移
border: {
width: 0, //边框宽度
radius: 0, //边框半径
style: 'solid', //边框类型
color: '#000', //边框颜色
}
},
images: null,
currentImgId: null,
currentWinW: null,
currentWinH: null,
resize: null,
resizeXY: null,
move: false,
moveXY: null,
cropChange: null,
cropChangeXY: null,
cropChangeObj: null,
copyImgItemObj: null,
},
defaultDataVerification:{
defaultItem: {
type: 'dropdown', //类型
type2: null, //
value1: '', //
value2: '', //
checked: false,
remote: false, //自动远程获取选项
prohibitInput: false, //输入数据无效时禁止输入
hintShow: false, //选中单元格时显示提示语
hintText: '', //
},
curItem: null,
dataVerification: null,
selectRange: [],
selectStatus: false,
} }
} }
@ -396,26 +458,43 @@ const method = {
} }
} }
let defualtFormula = $.extend(true, {}, defaultConfig.defualtFormula); let defaultFormula = $.extend(true, {}, defaultConfig.defaultFormula);
for(let key in defualtFormula){ for(let key in defaultFormula){
if(key in luckysheetformula){ if(key in luckysheetformula){
luckysheetformula[key] = defualtFormula[key]; luckysheetformula[key] = defaultFormula[key];
} }
} }
let defualtSheet = $.extend(true, {}, defaultConfig.defualtSheet); let defaultSheet = $.extend(true, {}, defaultConfig.defaultSheet);
for(let key in defualtSheet){ for(let key in defaultSheet){
if(key in sheetmanage){ if(key in sheetmanage){
sheetmanage[key] = defualtSheet[key]; sheetmanage[key] = defaultSheet[key];
} }
} }
let defualtPivotTable = $.extend(true, {}, defaultConfig.defualtPivotTable); let defaultPivotTable = $.extend(true, {}, defaultConfig.defaultPivotTable);
for(let key in defualtPivotTable){ for(let key in defaultPivotTable){
if(key in pivotTable){ if(key in pivotTable){
pivotTable[key] = defualtPivotTable[key]; pivotTable[key] = defaultPivotTable[key];
} }
} }
let defaultImage = $.extend(true, {}, defaultConfig.defaultImage);
for(let key in defaultImage){
if(key in imageCtrl){
imageCtrl[key] = defaultImage[key];
}
}
let defaultDataVerification = $.extend(true, {}, defaultConfig.defaultDataVerification);
for(let key in defaultDataVerification){
if(key in dataVerificationCtrl){
dataVerificationCtrl[key] = defaultDataVerification[key];
}
}
}, },
editorChart:function(c){ editorChart:function(c){
let chart_selection_color = luckyColor[0]; let chart_selection_color = luckyColor[0];

6
src/index.html

@ -54,7 +54,7 @@
} }
], ],
data: data:
// [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification] [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification]
/*[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[ /*[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[
{"r":0,"c":0, {"r":0,"c":0,
"v":{ "v":{
@ -96,7 +96,7 @@
{"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}} {"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
],"calcChain":[]}]*/ ],"calcChain":[]}]*/
/*
[{ [{
"name": "Cell", "name": "Cell",
"config": { "config": {
@ -1782,7 +1782,7 @@
], ],
"scrollLeft": 0, "scrollLeft": 0,
"scrollTop": 0 "scrollTop": 0
}] }]*/
}) })
}) })

2
src/store/index.js

@ -133,6 +133,8 @@ const Store = {
fontList:[], fontList:[],
currentSheetView:"viewNormal",
} }
export default Store; export default Store;
Loading…
Cancel
Save