Luckysheet源码分析之1-项目结构

返回目录

说明:

  1. 基于开源项目 https://github.com/mengshukeji/Luckysheet 整理相关逻辑;
  2. 目录最小粒度到文件级别,正文最小粒度到函数方法一级;
  3. 按照源代码的目录级别设置缩进;
  4. 格式:目录或文件 - 相关说明; 函数或方法 - 相关说明 <- 引用到这个方法的js文件;

文章目录

/ - 根目录

package.json - npm配置文件

gulpfile.js - gulp配置文件

/dist - 打包完成的目标目录

/doc - 中英文的使用说明目录

/node_modules - npm安装的js第三方库

/src - lucksheet的源代码

config.js - 各色各样的配置参数 Line 55

core.js - 最外层创建表格及初始化 Line 198

index.html - demo用的页面文件

index.js - demo用的js文件

/controls - 各色控制器

alternateformat.js - 菜单栏-单元格颜色-交替颜色 Line 1226
(主要是menuButton.js消费 .luckysheet-icon-alternateformat click )
getModelBox: function(hasRowHeader, hasRowFooter) - Not used
init: function() <- menuButton.js
perfect: function() <- menuButton.js
checkboxChange: function(hasRowHeader, hasRowFooter) - Not used
modelboxOn: function() - Not used
modelToningColor: function() - Not used
addCustomModel: function(format) - Not used
colorSelectDialog: function(currenColor, colorType, source) - Not used
rangeDialog: function(value) - Not used
rangeIsExists: function(range, index) <- menuButton.js
getRangeMap: function(row, column) - Not used
getIndexByFormat: function(format) - Not used
getFormatByIndex: function() - Not used
new: function(cellrange) <- menuButton.js
update: function() - Not used
getComputeMap: function() <- flter.js/menuButton.js/updateCell.js/draw.js
compute: function(obj) - Not used
ref: function(historyRules, currentRules) - Not used
conditionformat.js - 条件格式 Line 3697
ruleTypeHtml: function() - Not used
textCellColorHtml: function() <- menuButton.js
init: function() <- menuButton.js
singleRangeDialog: function(source, value) - Not used
multiRangeDialog: function(dataItem, value) - Not used
getTxtByRange: function(range) <- handler.js
getRangeByTxt: function(txt) - Not used
colorSelectInit: function() - Not used
conditionformatDialog: function(title, content) <- menuButton.js
CFiconsDialog: function() <- menuButton.js
administerRuleDialog: function() <- menuButton.js
getConditionRuleList: function(index) - Not used
getConditionRuleName: function(conditionName, conditionRange, conditionValue) - Not used
newConditionRuleDialog: function(source) <- menuButton.js
editorConditionRuleDialog: function() - Not used
getRuleExplain: function(index) - Not used
daterangeInit: function(id) - Not used
CFSplitRange: function(range1, range2, range3, type) <- dropCell.js/handler.js/selection.js
getCFPartRange: function(sheetIndex, range1, range2) - Not used
checksCF: function(r, c, computeMap) <- filter.js/handler.js/keyboard.js/menuButton.js/updateCell.js/draw.js
getComputeMap: function() <- filter.js/handler.js/keyboard.js/menuButton.js/updateCell.js/draw.js
compute: function(ruleArr, d) <- locationCell.js
updateItem: function(type, cellrange, format) <- menuButton.js
getHistoryRules: function(fileH) - Not used
getCurrentRules: function(fileC) - Not used
ref: function(historyRules, currentRules) <- controlHistory.js
constant.js - 界面top menu/右键 menu等html构造 Line 1319
const gridHTML = function() - dom variable <- createdom.js
function rightclickHTML() - 右键菜单dom <- createdom.js
const pivottableconfigHTML = function() <- pivotTable.js
const pivottablesumHTML = function() <- pivotTable.js
function sheetconfigHTML() - 底部 表格标签操作dom <- createdom.js
const luckysheetPivotTableHTML = function() <- pivotTable.js
function filtermenuHTML() <- createdom.js/pivotTable.js
function filtersubmenuHTML()  <- createdom.js/pivotTable.js
function luckysheetAlternateformatHtml() <- alternateformat.js
function menuToolBar () - toolbar <- createdom.js
const luckysheetlodingHTML = function() <- core.js/sheetmanage.js/method.js
controlHistory.js - 操作回退和重做 Line 550
redo: function (e) <- handler.js/keyboard.js
undo: function () <- handler.js/keyboard.js
dropCell.js - 选区下拉 Line2708
createIcon: function() <- handler.js
update: function() <- handler.js
typeItemHide: function() <- handler.js
expendPlugins.js - Register plugins Line 22
function initPlugins(plugins , data) <- core.js
filter.js - 筛选相关的事件响应 Line 1777
function labelFilterOptionState($top, optionstate, rowhidden, caljs, notSave, str, edr, cindex, stc, edc) - 筛选配置状态 <-controlHistory.js/sheetmanage.js
function orderbydatafiler(str, stc, edr, edc, index, asc) - 筛选排序 - Not used
function createFilter() - 创建筛选按钮 <-controlHistory.js/freezen.js/server.js/sheetmanage.js/refresh.js
function createFilterOptions(luckysheet_filter_save, filterObj) - 创建筛选配置 <-controlHistory.js/freezen.js/server.js/sheetmanage.js/refresh.js
function initialFilterHandler() - 注册筛选相关的按钮菜单项的事件 <- core.js
formulaBar.js - 公式栏相关的事件 Line 293
export function formulaBarInitial() - 公示栏按钮的初始化 <- core.js
freezen.js - 单元格冻结相关 Line 1479
cutVolumn: function (arr, cutindex) - self <- handler.js/menuButton.js/extend.js/refresh.js
cancelFreezenVertical: function (sheetIndex) - self <- handler.js/menuButton.js
createFreezenVertical: function (freezenverticaldata, left) - self <- handler.js/menuButton.js/server.js/refresh.js
saveFreezen: function (freezenhorizontaldata, top, freezenverticaldata, left)  - self <- handler.js/menuButton.js/refresh.js
initialFreezen: function (sheetIndex) <- sheetmanage.js
changeFreezenIndex: function (originindex, type) <- formula.js
scrollFreezen: function () - self <- handler.js/mobile.js/formula.js
cancelFreezenHorizontal: function (sheetIndex) - self <- handler.js/menuButton.js
createFreezenHorizontal: function (freezenhorizontaldata, top) - self <- handler.js/menuButton.js/server.js/refresh.js
createAssistCanvas: function() - self <- handler.js/menuButton.js/resize.js/server.js/refresh.js
createCanvas: function(id, width, height, left, top) - self
removeAssistCanvas: function() - self
scrollAdapt: function() - self <- handler.js/menuButton.js/scroll.js
scrollAdaptOfselect: function() - self <- handler.js
scrollAdaptOfchart: function() - self
scrollAdaptOfpostil: function() - self
scrollAdaptOfdpicon: function() - self
scrollAdaptOffilteroptions: function() - self
handler.js - 一大堆grid上面的各色事件 Line 4113
export default function luckysheetHandler() <- core.js
ifFormulaGenerator.js - if公式生成器 Line 563
init: function() <- menuButton.js
ifFormulaDialog: function(fp)  <- menuButton.js
insertFormula.js - 插入函数 Line 482
init: function() <- formulaBar.js/menuButton.js
formulaListDialog: function()  <- formulaBar.js/menuButton.js
formulaParmDialog: function(formulaTxt, parm) - 参数弹出框 <- formulaBar.js/menuButton.js
keyboard.js - 键盘相关 Line917
function formulaMoveEvent(dir, ctrlKey, shiftKey) - self
export function keyboardInitial() <- core.js
locationCell.js - Line 494
createDialog: function() <- menuButton.js
init: function() <- menuButton.js
apply: function(range, type, value) <- menuButton.js
getRangeArr(minR, maxR, minC, maxC, cellSave, rangeArr) - self
deleteCellInSave(cellSave, range) - self
luckysheetConfigsetting.js - 表格配置项目参数 Line 34
matrixOperation.js - 选择框内表格各种操作(mouse menu) Line 1241
export function initialMatrixOperation() <- core.js
menuButton.js - 菜单项的点击响应函数 Line4480
focus: function($obj, value) - self
createButtonMenu: function(itemdata) - self
cancelPaintModel: function() <- handler.js/keyboard.js/cleargridelement.js
initialMenuButton: function() - 上部的一大堆menu按钮 <- handler.js
getQKBorder: function(width, type, color) <- handler.js
updateFormat: function(d, attr, foucsStatus) - self <-moreFormat.js
updateFormat_mc: function(d, foucsStatus) - self
borderfix: function(d, r, c) <- draw.js
menuButtonFocus: function(d, r, c) - self <- handler.js
checkstatus: function(d, r, c, a) - self  <- draw.js
setLineDash: function(canvasborder, type, hv, m_st, m_ed, line_st, line_ed)
moveMergeData: function(d, offset_r, offset_c) - self  <- draw.js
getRangeInMerge: function(st_r, rlen, st_c, clen, sheetIndex) - no used
mergeborer: function(d, row_index, col_index) <- formulBar.js/freezen.js/handler.js/keyboard.js/postil.js/select.js/server.js/sheetMove.js
mergeMoveMain: function(columnseleted, rowseleted, s, top , height, left , width) <- handler.js/mobile.js/rowColumnOperation.js/sheetMove.js/formula.js
mergeMove: function(mc, columnseleted, rowseleted, s, top , height, left , width) <- handler.js/mobile.js/rowColumnOperation.js/sheetMove.js/formula.js
getCellRealSize: function(d, cell_r, cell_c) <- functionImplementation.js
getTextSize: function(text, font) <- selection.js/draw.js/formula.js/getRowlen.js
getStyleByCell: function(d, r, c) <- selection.js/updateCell.js
mobile.js - 手机相关touch事件 Line 178
export default function mobileinit() <- handler.js
moreFormat.js - 日期和数字的更多格式 Line 1217
createDialog: function(type)
init: function() <- menuButton.js
orderBy.js - 单元格排序相关的响应事件 Line 273
export function orderByInitial() <- core.js
pivotTable.js - 数据透视表相关操作 Line 3130
getCellData: function (cursheetindex, datasheetindex, data_select_save) <- controlHistory.js/sheetmanage.js
showvaluecolrow: function () <- handler.js
resetOrderby: function (obj) <- handler.js
createPivotTable: function (e) <- handler.js
changePivotTable: function (index) <- sheetmanage.js
refreshPivotTable: function ()  <- sheetmanage.js
pivotclick: function (row_index, col_index, index) <- handler.js/sheetMove.js
isPivotRange: function (row_index, col_index) <- handler.js/rowColumnOperation.js/updateCell.js
initialPivotManage: function (restore) <- controlHistory.js/sheetmanage.js
drillDown: function(row_index, col_index) <- handler.js
postil.js - 批注框相关的响应事件 Line 833
init: function() - self
overshow: function(event) <- handler.js
getArrowCanvasSize: function(fromX, fromY, toX, toY) <- freezen.js
drawArrow: function(ctx, fromX, fromY, toX, toY, theta, headlen, width, color) - self
buildAllPs: function(data) <- sheetmanage.js/createdom.js
buildPs: function(r, c, postil) - self <- controlHistory.js/freezen.js/handler.js/server.js
newPs: function(r, c) <- menuButton.js
editPs: function(r, c) <- handler.js/menuButton.js
delPs: function(r, c) <- menuButton.js
showHidePs: function(r, c) <- menuButton.js
showHideAllPs: function() <- menuButton.js
removeActivePs: function() -self <-menuButton.js/rowColumnOperation.js
ref: function(data, rc) -self
positionSync: function() <- refresh.js
resize.js - 根据配置项调整sheet尺寸 Line 170
export default function luckysheetsizeauto() <- core.js/alternateformate.js/handler.js/menuButton.js
rowColumnOperation.js - 行列新增、删除、高宽和隐藏设置 Line 1620
export function rowColumnOperationInitial() <- core.js
function luckysheetcolsdbclick() - self
searchReplace.js - 查找和替换操作 Line 743
createDialog: function(source) <- keyboard.js
init: function() <- keyboard.js
searchNext: function() - self
searchAll: function() - self
getSearchIndexArr: function(searchText, range) - self
replace: function() - self
replaceAll: function() - self
select.js - 鼠标点选各组件的屏幕显示 Line 403
function seletedHighlistByindex(id, r1, r2, c1, c2) - 公式函数 选区实体框 <- formula.js
function selectHightlightShow() - Set selection highlight <- core.js/alternateformat.js/dropCell.js/filter.js/freezen.js/handler.js/keyboard.js/locationCell.js/mobile.js/orderBy.js/pivotTable.js/rowColumnOperation.js/searchReplace.js/selection.js/sheetmanage.js/sheetMove.js/splitColumn.js/extend.js/refresh.js
function selectIsOverlap() - 选区是否重叠 <- handler.js/keyboard.js/menuButton.js/
function selectionCopyShow(range) - 复制选区虚线框 <- conditionformat.js/handler.js/menuButton.js/selection.js/sheetmanage.js/refresh.js
function luckysheet_count_show(left, top, width, height, rowseleted, columnseleted) - 选区行列数显示 <- handler.js/insertFormula.js/rowColumnOperation.js/formula.js
selection.js - 复制、粘贴等事件处理 Line 1751
clearcopy: function (e) <- handler.js/cleargridelement.js
getHtmlBorderStyle: function(type, color) - self
copy: function (e) - copy事件 <- handler.js/keyboard.js/matrixOperation.js
copybyformat: function (e, txt) <- matrixOperation.js
paste: function (e, triggerType) - paste事件 <- handler.js
pasteHandler: function (data, borderInfo)  <- handler.js
pasteHandlerOfCutPaste: function(copyRange) <- handler.js
pasteHandlerOfCopyPaste: function(copyRange)  <- handler.js
pasteHandlerOfPaintModel: function(copyRange)  <- handler.js
matchcopy: function (data1, data2) - no used
server.js - websocket方式与服务器交互 Line 1072
historyParam: function(data, sheetIndex, range) <- menuButton.js/ refresh.js
saveParam: function (type, index, value, params) <- alternateformat.js/condition.js/controlHistory.js/filter.js/freezen.js/handler.js/keyboard.js/menuButton.js/pivotTable.js/postil.js/rowColumnOperation.js/sheetBar.js/sheetanage.js/formula.js/getdata.js/method.js/refresh.js
openWebSocket: function() <- core.js
wsUpdateMsg: function(item) - self
multipleRangeShow: function(id, name, r, c) - self
checksubmit: function(data) - no used
submitTimeout: function() - self
request: function () - self
imageRequest: function() - self
matchOpt: function(v, d) - self
deleteRepeatOpt: function(data, value) - self
setlocaldata: function (value, func) - self
cachelocaldata: function (func) <- sheetmanage.js
sheetBar.js - 表格底部名称栏区域 相关事件 Line 463
 (增、删、改、隐藏显示、颜色等等)
function showsheetconfigmenu() - 表格底部名称栏区域 相关事件
  (增、删、改、隐藏显示、颜色等等) - self
let luckysheetsheetrightclick = function ($t, $cur, e) -self
export function initialSheetBar() <- core.js
sheetmanage.js - sheet页面的相关操作 Line 1527
generateRandomSheetIndex: function(prefix) - self
generateRandomSheetName: function(file, isPivotTable) - self
generateCopySheetName: function(file, name) - self
getSheetByIndex: function(index) - no used
getCurSheetnoset: function() <- server.js
getCurSheet: function() <- server.js
addNewSheet: function(e, isPivotTable) <- handler.js/pivotTable.js/sheetBar.js/sheetmanage.js
setSheetHide: function(index) <- core.js/sheetBar.js
setSheetShow: function(index) <- core.js/sheetBar.js
ordersheet: function(property) - self
getCurrentOrder: function() - self
reOrderAllSheet: function() <- handler.js/sheetBar.js
createSheet: function() <- controlHistory.js/createsheet.js/method.js
locationSheet: function() <- sheetBar.js
copySheet: function(copyindex, e) <- controlHistory.js/sheetBar.js
hasSheet: function(index) <- controlHistory.js
createSheetbydata: function(data, isrenew) <- controlHistory.js
deleteSheet: function(index) <- controlHistory.js/menuButton.js/sheetBar.js
getGridData: function(d) <- core.js
buildGridData: function(file) <- self/core.js/menuButton.js/pivotTable.js/method.js
cutGridData: function(d) - no used
addGridData: function(celldata, row, column)  - no used
initialjfFile: function(menu, title) <- core.js
storeSheetParam: function() <- refresh.js
setSheetParam: function(isload) - self
restoreselect: function() - self
storeSheetParamALL: function() <- self/refresh.js
changeSheet: function(index, isPivotInitial, isNewSheet) <- self/conditionformat.js/controlHistory.js/pivotTable.js/searchReplace.js/server.js/sheetBar.js/formula.js/method.js
checkLoadSheetIndex: function(file) - self
showSheet: function() <- self/core.js/resize.js/createsheet.js/refresh.js
setCurSheet: function(index) - self
getSheetIndex: function(index) - self
changeSheetExec: function(index, isPivotInitial, isNewSheet) <- self/conditionformat.js/controlHistory.js/pivotTable.js/searchReplace.js/server.js/formula.js
sheetBarShowAndHide(index) <- pivotTable.js
delChart: function(chart_id, sheetIndex) <- server.js
saveChart: function(json) <- handler.js/server.js
getChart: function(sheetIndex, chart_id) <- plugin.js/get.js
getRangetxt: function(sheetIndex, range, currentIndex) <- conditionformat.js/handler.js/menuButton.js/pivotTable.js/rowColumnOperation.js/select.js/plugin.js/func.js/formula.js/get.js
getSheetName: function(sheetIndex) <- sheetBar.js
getSheetMerge: function() <- menuButton.js
getSheetData: function(sheetIndex) - self
getSheetConfig: function(sheetIndex) <- self/menuButton.js(这里好像是一个bug)
restoreFilter: function(sheetIndex) - self
restorePivot: function(sheetIndex) - self
restoreSheetAll: function(sheetIndex) <- self/createsheet.js
restoreFreezen: function(sheetIndex) - self
restoreCache: function() - self/server.js/createsheet.js
execCache: function(item) - self
sheetMove.js - 键盘方向键以及增加ctrl或/和shift的表格游走 Line 1994
function luckysheetMoveEndCell(postion, type, isScroll, terminal, onlyvalue) <- filter.js/plugin.js
function luckysheetMoveHighlightCell(postion, index, type, isScroll) - 方向键  调整单元格 <- formulaBar.js/handler.js/keyboard.js
function luckysheetMoveHighlightCell2(postion, type, isScroll) - ctrl + 方向键  调整单元格 <- keyboard.js/plugin.js
function luckysheetMoveHighlightRange(postion, index, type, isScroll) - shift + 方向键  调整选区 <- keyboard.js
function luckysheetMoveHighlightRange2(postion, type, isScroll) - ctrl + shift + 方向键  调整选区 <- keyboard.js/plugin.js
function rowHasMerge(r, c1, c2) - shift + 方向键 / ctrl + shift + 方向键 功能 - self
function colHasMerge(c, r1, r2) - self
function getRowMerge(rIndex, c1, c2) - self
function getColMerge(cIndex, r1, r2) - self
function getNextIndex(direction, focusIndex, strIndex, endIndex) - self
sheetSearch.js - Line 80
function luckysheetbinary_search(arr, key) - self
function luckysheetorder_search(arr, y) - self
function luckysheet_searcharray(arr, y) <- freezen.js/handler.js/menuButton.js/pivotTable.js/sheetSearch.js/draw.js/extend.js/location.js
sparkline.js - sparkline设置 Line 2256
let createClass = function (/* [baseclass, [mixin, ...]], definition */) - self
let clipval = function (val, min, max) - self
let quartile = function (values, q) <- plugin.js
let normalizeValue = function (val) - self
let normalizeValues = function (vals) - self
。。。
render: function (shapeseq, shapes, offsetX, offsetY, pixelWidth, pixelHeight,canvasid,ctx) <- draw.js
init: function (format, fclass) <- functionimplementation.js
splitColumn.js - 分列操作 Line 315
createDialog: function() <- handler.js
init: function() <- handler.js
update: function(r, c, dataArr) - self
dataPreview: function(dataArr) - self
getRegStr: function() - self
getDataArr: function(regStr) - self
updateCell.js - Line 115
export default function luckysheetupdateCell(row, row_pre, row_index, col, col_pre, col_index, d, cover, isnotfocus)
 <- formulaBar.js/handler.js/ifFormulaGenerator.js/keyboard.js/menuButton.js

/css - 图片、图标和样式文件

/data

chartJson.js - 图标chart相关的参数设定

/demoData - sample里面用到的demo数据,对应index.html的9个sheet

/expendPlugins\chart - (疑似)图表工具

chartmix.css - 样式文件
chartmix.umd.min.js - 经过压缩处理的chartmix文件
plugin.js - Line 1508
chart(data, isDemo) - Initialize the chart component
renderCharts(chartLists, isDemo) - rendercharts
jfrefreshchartall(flowdata1, r_st, r_ed, c_st, c_ed)
chart_selection()
createLuckyChart(width, height, left, top) - create chart
delChart(chart_id) - delete chart
showNeedRangeShow(chart_id) - 设置某个图表的高亮区域状态为显示,处理当前页的所有图表
hideAllNeedRangeShow - 隐藏当前sheet所有的图表高亮区域
selectRangeBorderShow(chart_id) - 选择区域高亮
selectRangeBorderHide(settingShow) - 选择区域高亮隐藏
showChartSettingComponent(refresh, chart_id) - 显示图表设置界面
hideChartSettingComponent(refresh) - 隐藏图表设置界面
renderChartShow(index) - 隐藏其他sheet的图表,显示当前sheet的图表

/fonts - 字体

/function

func.js - Line 1881
 luckysheet_compareWith() - 比较或运算
 luckysheet_getarraydata() - 解析 公式中{1,2,3;2,3,4} 为数组[[1,2,3],[2,3,4]]
 luckysheet_getcelldata(txt)
 luckysheet_parseData(value) - 解析单个取得的值,有字符串,数字,引用单元格或者函数
 luckysheet_getValue() - 解析获取函数参数
 luckysheet_indirect_check()
 luckysheet_indirect_check_return(txt)
 luckysheet_offset_check()
functionImplementation.js - 各色funciton的具体实现 Line 27454
functionlist.js - 中英文版的各色function目录大全 Line 17886
luckysheet_function.js - 把function平展开 Line 12
matrix_methods.js - Line 340

/global

analysis.js - Line 38
<- pivotTable.js
array.js - Line 67
<- pivotTable.js
border.js - 获取表格边框数据计算值 Line 1034
<- dropCell.js/handler.js/selection.js/draw.js
browser.js - 判断浏览器类型 Line 154
<- handler.js/select.js/draw.js/editor.js/tooltip.js
cleargridelement.js - 清场 Line 34
<- controlHistory.js/filter.js/keyboard.js/orderBy.js/pivotTable.js/sheetBar.js/sheetManage.js/updateCell.js
count.js - 右小角的计数、求和、最大值、最小值、平均值 LIne 75
<- dropCell.js/handler.js/menuButton.js/rowColumnOperation.js/sheetMove.js
createdom.js - 创建界面的dom元素 Line 117
<- sheetmanage.js
createsheet.js - 创建sheet Line 56
<- method.js
cursorPos.js - Line 51
luckysheetRangeLast(obj) <- postil.js/updateCell.js/formula.js
getCursortPosition - no used
datecontroll.js - 日期相关的一些方法 Line 87
draw.js - canvas绘制 Line 2098
function luckysheetDrawgrid(scrollWidth, scrollHeight, drawWidth, drawHeight, offsetLeft, offsetTop) <- refresh.js
function luckysheetDrawgridRowTitle(scrollHeight, drawHeight, offsetTop) <- refresh.js
function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) <- refresh.js
function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, offsetLeft, offsetTop, columnOffsetCell, rowOffsetCell, mycanvas) <- handler.js/refresh.js
dynamicArray.js - Line 138
 dynamicArrayCompute(dynamicArray) - 动态数组计算 <- draw.js/getdata.js
 dynamicArraySpillEditCompute(computeObj, r, c) - self
 dynamicArrayRangeIsAllNull(range, data) - 范围是否都是空单元格(除第一个单元格) - self
 dynamicArrayHightShow(r, c) - 点击表格区域是否属于动态数组区域 <- select.js
editor.js - worker+blob实现深拷贝替换extend Line 162
<-dropCell.js/filter.js/handler.js/ifFormulaGenerator.js/matrixOperation.js/menuButton.js/moreFormat.js/orderBy.js/pivotTable.js/postil.js/rowColumnOperation.js/searchReplace.js/selection.js/sheetmanage.js/splitColumn.js/functionImplementation.js/createdom.js/createsheet.js/extend.js/formula.js/getdata.js/method.js/refresh.js/sort.js
extend.js - 新增行/列、删除行/列 Line 1488
function luckysheetextendtable(type, index, value, direction) <-handler.js/rowColumnOperation.js/sheetmanage.js
function luckysheetextendData(rowlen, newData) <- method.js
function luckysheetdeletetable(type, st, ed) <- rowColumnOperation.js/sheetmanage.js
format.js - 各种类型的格式 Line 1935
- no used 
formula.js - 公式栏具体干活的方法 Line 4913
<- menuButton.js
func_methods.js - 单元格的若干Get方法 Line 675
<- searchReplace.js/func.js/functionImplementation.js/func_methods.js
getdata.js - 获取单元格数 Line 221
export function getdatabyselection(range, sheetIndex) <- core.js/handler.js/matrixOperation.js/pivotTable.js/selection.js/plugin.js/func.js/count.js/getdata.js
export function getdatabyselectionD(d, range) <- pivotTable.js/func.js
export function getdatabyselectionNoCopy(range) <- count.js
export function getcellvalue(r, c, data, type) <- core.js/conditionformat.js/matrixOperation.js/orderBy.js/pivotTable.js/rowColumnOperation.js/selection.js/sheetmanage.js/splitColumn.js/updateCell.js/plugin.js/functionImplementation.js/array.js/draw.js/format.js/formula.js/getRowlen.js
export function datagridgrowth(data, addr, addc, iscallback) <- handler.js/pivotTable.js/selection.js/sheetmanage.js/createdom.js/ceatesheet.js/editor.js/extend.js
getRowlen.js - 行高相关的3个函数 Line 171
function rowlenByRange(d, r1, r2, cfg) - 计算范围行高 <- filter.js/handler.js/orderBy.js/selection.js/sort.js
function computeRowlenArr(rowHeight, cfg) - 计算表格行高数组 <- refresh.js
function getCellTextSplitArr(strValue, strArr, cellWidth, canvas) - 获取换行单元格截断数组 <- menuButton.js/draw.js/formula.js
json.js - 获取json值和判断key是否存在 Line 33
parseJsonParm: function(obj) <- filter.js
hasKey: function(obj) <- controlHistory.js
loading.js - Line 7
export function showloading(txt) <- server.js
export function hideloading() <- server.js
location.js - 单元格行列定位 Line 73
function rowLocationByIndex(row_index) <- dropCell.js/freezen.js/menuButton.js/rowColumnOperation.js/select.js
function rowLocation(y) <- dropCell.js/formulaBar.js/freezen.js/handler.js/menuButton.js/mobile.js/postil.js/rowColumnOperation.js/select.js/plugin.js/formula.js
function colLocationByIndex(col_index) <- dropCell.js/freezen.js/menuButton.js/rowColumnOperation.js/select.js/formula.js/getRowlen.js
function colLocation(x)  <- dropCell.js/formulaBar.js/freezen.js/handler.js/menuButton.js/mobile.js/postil.js/rowColumnOperation.js/select.js/plugin.js/formula.js
function mouseposition(x, y) <- formulaBar.js/handler.js/mobile.js/postil.js/rowColumnOperation.js/plugin.js/formula.js
method.js - 翻页、重载、清除等操作 Line 185
refresh.js - 各种状况下的刷新表格 Line 963
function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, isRunExecFunction=true)
 <- core.js/controlHistory.js/dropCell.js/filter.js/handler.js/menuButton.js/orderBy.js/pivotTable.js/rowColumnOperation.js/searchReplace.js/selection.js/server.js/sheetmanage.js/splitColumn.js/functionImplementation.js/editor.js/extend.js/formula.js/sort.js
function jfrefreshgridall(colwidth, rowheight, data, cfg, range, ctrlType, ctrlValue, cdformat, changeSize)
 <- controlHistory.js/pivotTable.js/rowColumnOperation.js/editor.js
function jfrefreshrange(data, range, cdformat) - 单元格数据更新联动
 <- controlHistory.js/editor.js
function jfrefreshgrid_adRC(data, cfg, ctrlType, ctrlValue, calc, filterObj, cf, af, freezen) - 删除、增加行列 刷新表格
 <- controlHistory.js/extend.js
function jfrefreshgrid_pastcut(source, target, RowlChange) - 复制剪切 刷新表格
 <- controlHistory.js/selection.js
function jfrefreshgrid_rhcw(rowheight, colwidth) - 行高、列宽改变 刷新表格 
 <- controlHistory.js/filter.js/handler.js/rowColumnOperation.js/server.js/sheetmanage.js/extend.js
function luckysheetrefreshgrid(scrollWidth, scrollHeight) - Refresh the canvas display data according to scrollHeight and scrollWidth
 <- core.js/alternateformat.js/conditionformat.js/controlHistory.js/handler.js/menuButton.js/postil.js/resize.js/server.js/sheetmanage.js/createsheet.js/scroll.js
rhchInit.js - sheet的行高、列宽设置 Line 75
export default function rhchInit(rowheight, colwidth) <- createdom.js/createsheet.js/rhchinit.js
scroll.js - 全局滚动事件 Line 86
export default function luckysheetscrollevent(isadjust) <- handler.js
setdata.js - Line 220
 setcellvalue(r, c, d, v) - Set cell value
  <- core.js/menuButton.js/searchReplace.js/sheetmanage.js/splitColumn.js/extend.js/formula.js/refresh.js
 setAccuracy(autoFormatw, accuracy) - 根据亿万格式autoFormatw和精确度accuracy 转换成 w/w0/w0.00 or 0/0.0格式
  - self
sort.js - 排序相关方法(选区和单列) Line 371
 function orderbydata(data, index, isAsc) - 数据排序方法
  <- filter.js/orderBy.js/pivotTable.js/functionImplementation.js
 function orderbydata1D(data, isAsc)
  <- filter.js/pivotTable.js
 function sortSelection(isAsc) - 排序选区数据
  <- constant.js/menuButton.js
 function sortColumnSeletion(colIndex, isAsc) - 排序一列数据
  <- orderBy.js
tooltip.js - tooltip 相关方法 Line 312
 info: function (title, content)
  <- 好多js会显示tooltip
 confirm: function (title, content, func1, func2, name1, name2)
  <- sheetBar.js/splitColumn.js
 screenshot: function (title, content, imgurl)
  <- handler.js
 chartPointConfig: function (id, savefunc1, closefunc2)
  - no used
 createHoverTip: function (obj, to)
  <- sheetmanage.js
 popover: function(content, position, close, style, btntxt, exitsFuc)
  <- menuButton.js
validate.js - 各类校验规则 Line 198
(review前面代码,有些地方是不是可以考虑直接调用这里的方法)
 isRealNull(val) - 是否是空值
 isRealNum(val) - 是否是纯数字
 valueIsError(value) - 是否是错误类型
 hasChinaword(s) - 是否有中文
 isEditMode - 是否为非编辑模式
 hasPartMC(cfg, r1, r2, c1, c2) - 范围是否只包含部分合并单元格

/locale - 中英文说明

/methods

/plugins - 插件相关文档

/css - 插件样式库
/images - 插件图片库
/js - 插件的JS文件

/store - 数据属性

index.js - 定义sheet相关的属性信息

/utils - 工具类

chartUtil.js - 图表相关的方法(、、替换html字符串等)
generateRandomKey(prefix) - 生成随机图表id
deepCopy(obj) - 深度克隆数据
isObject(o) - 判断参数是否是Object类型
isMap(obj) - 判断参数是否是Map类型
replaceHtml(temp, dataarry) - 替换temp中的${xxx}为指定内容
hasChinaword(s) - 是否包含汉字
math.js - 与算数相关的一些方法(如判断整数、数据类型转换、四舍五入、
isInteger(obj) -  判断obj是否为一个整数
toInteger(floatNum) - 将一个浮点数转成整数,返回整数和倍数
operation(a, b, op) - 实现加减乘除运算,确保不丢失精度
fixed(num, precision) - 做小数点的四舍五入计算
polyfill.js - polyfill event in firefox (这个不知道干啥用的,感觉是firefox的适配器)
util.js - 大量工具类 Line 642
isJsonString(str) - 判断参数是否json字符串格式
common_extend(jsonbject1, jsonbject2) - 两个object合并
replaceHtml(temp, dataarry) - 替换temp中的${xxx}为指定内容 ,temp:字符串  (这个貌似与chartUtil.js 重复了)
getObjType(obj) - 获取数据类型
hexToRgb(hex) - 颜色 16进制转rgb
rgbTohex(color) - 颜色 rgb转16进制
ABCatNum(abc) - 列下标  字母转数字
chatatABC(index) - 列下标  数字转字母
ceateABC(index)
createABCdim(x, count)
getByteLen(val) - 计算字符串字节长度
ArrayUnique(dataArr) - 数组去重
luckysheetfontformat(format) - 获取字体配置
showrightclickmenu($menu, x, y) - 右键菜单
luckysheetactiveCell() - 单元格编辑聚焦
numFormat(num, type) - 数字格式
numfloatlen(n)
mouseclickposition($menu, x, y, p) - 二级菜单显示位置
seriesLoadScripts(scripts, options, callback) - 串行加载指定的脚本
parallelLoadScripts(scripts, options, callback) - 并行加载指定的脚本
loadLink(url) - 动态添加css
loadLinks(urls) - 动态添加一组css
  • 7
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值