|
|
@ -21,7 +21,7 @@ import { isRealNull, valueIsError, isRealNum, isEditMode, hasPartMC } from "./va |
|
|
|
import { isdatetime, diff } from "./datecontroll"; |
|
|
|
import { getBorderInfoCompute } from './border'; |
|
|
|
import { luckysheetDrawMain } from './draw'; |
|
|
|
|
|
|
|
import pivotTable from '../controllers/pivotTable'; |
|
|
|
import server from "../controllers/server"; |
|
|
|
import menuButton from '../controllers/menuButton'; |
|
|
|
import selection from "../controllers/selection"; |
|
|
@ -2850,10 +2850,6 @@ export function setRangeFormat(attr, value, options = {}) { |
|
|
|
|
|
|
|
let file = Store.luckysheetfile[order]; |
|
|
|
|
|
|
|
if(file == null){ |
|
|
|
return tooltip.info("The order parameter is invalid.", ""); |
|
|
|
} |
|
|
|
let sheetData = $.extend(true, [], file.data); |
|
|
|
let result = [] |
|
|
|
|
|
|
|
for (let i = 0; i < range.length; i++) { |
|
|
@ -2877,7 +2873,6 @@ export function setRangeFormat(attr, value, options = {}) { |
|
|
|
luckysheetrefreshgrid(); |
|
|
|
|
|
|
|
if (success && typeof success === 'function') { |
|
|
|
success() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -6617,16 +6612,20 @@ export function getTxtByRange(range=Store.luckysheet_select_save){ |
|
|
|
* @param {Number} config.total 总条数 |
|
|
|
*/ |
|
|
|
export function pagerInit (config) { |
|
|
|
const {prevPage, nextPage, total} = locale().button; |
|
|
|
$('#luckysheet-bottom-pager').remove() |
|
|
|
$('#luckysheet-sheet-area').append('<div id="luckysheet-bottom-pager" style="font-size: 14px; margin-left: 10px; display: inline-block;"></div>') |
|
|
|
$('#luckysheet-sheet-content').after('<div id="luckysheet-bottom-pager" style="font-size: 14px; margin-left: 10px; display: inline-block;"></div>') |
|
|
|
$("#luckysheet-bottom-pager").sPage({ |
|
|
|
page: config.pageIndex, //当前页码,必填
|
|
|
|
total: config.total, //数据总条数,必填
|
|
|
|
selectOption: config.selectOption, // 选择每页的行数,
|
|
|
|
pageSize: config.pageSize, //每页显示多少条数据,默认10条
|
|
|
|
showTotal: true, // 是否显示总数
|
|
|
|
showSkip: config.showSkip || true, //是否显示跳页,默认关闭:false
|
|
|
|
showPN: config.showPN || true, //是否显示上下翻页,默认开启:true
|
|
|
|
showTotal: config.showTotal, // 是否显示总数,默认关闭:false
|
|
|
|
showSkip: config.showSkip, //是否显示跳页,默认关闭:false
|
|
|
|
showPN: config.showPN, //是否显示上下翻页,默认开启:true
|
|
|
|
prevPage: config.prevPage || prevPage, //上翻页文字描述,默认"上一页"
|
|
|
|
nextPage: config.nextPage || nextPage, //下翻页文字描述,默认"下一页"
|
|
|
|
totalTxt: config.totalTxt || total + config.total, // 数据总条数文字描述,{total}为占位符,默认"总共:{total}"
|
|
|
|
backFun: function (page) { |
|
|
|
page.pageIndex = page.page |
|
|
|
if(!method.createHookFunction("onTogglePager", page)){ return; } |
|
|
@ -6648,6 +6647,53 @@ export function refreshFormula (success) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新sheet数据 |
|
|
|
* @param {Array} data 工作簿配置,可以包含多个表 |
|
|
|
* @param {Object} options 可选参数 |
|
|
|
* @param {Function} options.success 操作结束的回调函数 |
|
|
|
* |
|
|
|
*/ |
|
|
|
export function updataSheet (options = {}) { |
|
|
|
let {data, success} = options |
|
|
|
let files = Store.luckysheetfile |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
for (let j = 0; j < files.length; j++) { |
|
|
|
if (files[j].index === data[i].index) { |
|
|
|
files[j] = data[i] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
let file = files[sheetmanage.getSheetIndex(Store.currentSheetIndex)], |
|
|
|
sheetData = sheetmanage.buildGridData(file); |
|
|
|
file.data = sheetData |
|
|
|
|
|
|
|
if (!!file.isPivotTable) { |
|
|
|
Store.luckysheetcurrentisPivotTable = true; |
|
|
|
if (!isPivotInitial) { |
|
|
|
pivotTable.changePivotTable(index); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
Store.luckysheetcurrentisPivotTable = false; |
|
|
|
$("#luckysheet-modal-dialog-slider-pivot").hide(); |
|
|
|
luckysheetsizeauto(false); |
|
|
|
} |
|
|
|
sheetmanage.mergeCalculation(file["index"]); |
|
|
|
sheetmanage.setSheetParam(); |
|
|
|
setTimeout(function () { |
|
|
|
sheetmanage.showSheet(); |
|
|
|
sheetmanage.restoreCache(); |
|
|
|
formula.execFunctionGroupForce(luckysheetConfigsetting.forceCalculation); |
|
|
|
sheetmanage.restoreSheetAll(Store.currentSheetIndex); |
|
|
|
luckysheetrefreshgrid(); |
|
|
|
if (success && typeof success === 'function') { |
|
|
|
success(); |
|
|
|
} |
|
|
|
}, 1); |
|
|
|
server.saveParam("shs", null, Store.currentSheetIndex); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 刷新状态栏的状态 |
|
|
|
* @param {Array} data 操作数据 |
|
|
|