diff --git a/docs/guide/api.md b/docs/guide/api.md index ef00c64a5..65dcd2246 100644 --- a/docs/guide/api.md +++ b/docs/guide/api.md @@ -2560,17 +2560,13 @@ Use note: ### refreshFormula([setting]) -[todo] - - **Parameter**: - - {PlainObject} [setting]: optional parameters - + {Object | String} [range]: Set the target selection range of the parameter. The supported selection format is `"A1:B2"`, `"sheetName!A1:B2"` or `{row:[0,1], column:[0,1]}`, allows an array of multiple selections; the default is the current selection ;The default is the entire current worksheet - + {Function} [success]: callback function for the end of the operation + - {Function} [success]: callback function for the end of the operation - **Explanation**: - Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end. It is generally recommended to specify the affected cell range to prevent For performance issues, if you can't determine it, leave it blank to keep the entire worksheet traversed and refreshed. + Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end. ------------ diff --git a/docs/guide/config.md b/docs/guide/config.md index acdd0e3b7..a4e813ed4 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -73,6 +73,7 @@ The following are all supported setting parameters - The height of the column header area [columnHeaderHeight](#columnHeaderHeight) - Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar) - Initialize the default font size [defaultFontSize](#defaultFontSize) +- Pager [pager](#pager) ### container - Type: String @@ -567,6 +568,21 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect ------------ +### pager +- Type:Object +- Default:null +- Usage:Pager button settings, the first version of the solution is directly used jquery plug-in [sPage](https://github.com/jvbei/sPage) + Clicking the paging button will trigger the hook function `onTogglePager`, which returns the current page number, which is the same as the `backFun` method of `sPage`. This pager setting is only responsible for the UI part. For the specific data request and data rendering after switching paging, please enter the `onTogglePager` custom processing in the number of hook lines. + ```js + pager: { + pageIndex: 1, //Current page number + pageSize: 10, //How many rows of data are displayed on each page + total: 50, //Total number of rows of data + selectOption: [10, 20] //Options that allow setting the number of rows per page + } + ``` + +------------ ## Hook Function (TODO) @@ -1251,4 +1267,16 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura - Default: null - Usage: Customized method of drilling down cell data, note that this hook function is mounted under options: `options.fireMousedown` +------------ + +## Pager + +### onTogglePager + +- Type: Function +- Default: null +- Usage: Click the page button to call back the function, return the current page number, refer to [sPage backFun](https://github.com/jvbei/sPage) +- Parameter: + - {Object} [page]: Return the current page object + ------------ \ No newline at end of file diff --git a/docs/zh/guide/api.md b/docs/zh/guide/api.md index ab5c02e36..51a022eed 100644 --- a/docs/zh/guide/api.md +++ b/docs/zh/guide/api.md @@ -2474,19 +2474,15 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开 ------------ -### refreshFormula([setting]) - -[todo] +### refreshFormula([success]) - **参数**: - - {PlainObject} [setting]: 可选参数 - + {Object | String} [range]: 选区范围,支持选区的格式为`"A1:B2"`、`"sheetName!A1:B2"`或者`{row:[0,1],column:[0,1]}`,只能为单个选区;默认为整个当前工作表 - + {Function} [success]: 操作结束的回调函数 + - {Function} [success]: 操作结束的回调函数 - **说明**: - 强制刷新公式。当你直接修改了多个单元格的值,且没有触发刷新,且这些单元格跟公式相关联,则可以使用这个api最后强制触发一次公式刷新,一般是建议指定受影响的单元格范围便于防止性能问题,如果无法确定,则留空保持整个工作表遍历刷新。 + 强制刷新公式。当你直接修改了多个单元格的值,且没有触发刷新,且这些单元格跟公式相关联,则可以使用这个api最后强制触发一次公式刷新。 ------------ diff --git a/docs/zh/guide/config.md b/docs/zh/guide/config.md index 8e111e325..1f3235c38 100644 --- a/docs/zh/guide/config.md +++ b/docs/zh/guide/config.md @@ -76,6 +76,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有 - 初始化默认字体大小 [defaultFontSize](#defaultFontSize) - 是否限制工作表名长度 [limitSheetNameLength](#limitSheetNameLength) - 默认允许工作表名的最大长度 [defaultSheetNameMaxLength](#defaultSheetNameMaxLength) +- 分页器 [pager](#pager) ### container - 类型:String @@ -661,6 +662,22 @@ Luckysheet开放了更细致的自定义配置选项,分别有 ------------ +### pager +- 类型:Object +- 默认值:null +- 作用:分页器按钮设置,初版方案是直接使用的jquery插件 [sPage](https://github.com/jvbei/sPage) + 点击分页按钮会触发钩子函数 `onTogglePager`,返回当前页码,同`sPage`的`backFun`方法,此分页器设置只负责UI部分,具体切换分页后的数据请求和数据渲染,请在`onTogglePager`钩子行数里自定义处理。 + ```js + pager: { + pageIndex: 1, //当前的页码 + pageSize: 10, //每页显示多少行数据 + total: 50, //数据总行数 + selectOption: [10, 20] //允许设置每页行数的选项 + } + ``` + +------------ + ## 钩子函数 钩子函数应用于二次开发时,会在各个常用鼠标或者键盘操作时植入钩子,调用开发者传入的函数,起到扩展Luckysheet功能的作用。 @@ -932,6 +949,18 @@ Luckysheet开放了更细致的自定义配置选项,分别有 + {Boolean} [hyperlinkClick]:点击超链接 - {Object} [ctx]: 当前画布的context +------------ +### scroll + +- 类型:Function +- 默认值:null +- 作用:鼠标滚动事件 +- 参数:{, , } + - {Object} [position]: + + {Number} [scrollLeft]:横向滚动条的位置 + + {Number} [scrollTop]:垂直滚动条的位置 + + {Number} [canvasHeight]:canvas高度 + ------------ ## 选区操作(包括单元格) @@ -1519,4 +1548,16 @@ Luckysheet开放了更细致的自定义配置选项,分别有 - 默认值:null - 作用:单元格数据下钻自定义方法,注意此钩子函数是挂载在options下:`options.fireMousedown` +------------ + +## 分页器 + +### onTogglePager + +- 类型:Function +- 默认值:null +- 作用:点击分页按钮回调函数,返回当前页码,具体参数参照[sPage backFun](https://github.com/jvbei/sPage) +- 参数: + - {Object} [page]: 返回当前分页对象 + ------------ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 3a84a7f7b..0e3e2ff3c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -96,7 +96,8 @@ const paths = { 'src/plugins/js/localforage.min.js', 'src/plugins/js/lodash.min.js', 'src/plugins/js/jstat.min.js', - 'src/plugins/js/crypto-api.min.js' + 'src/plugins/js/crypto-api.min.js', + 'src/plugins/js/jquery.sPage.min.js' ], //plugins concat diff --git a/src/controllers/controlHistory.js b/src/controllers/controlHistory.js index 67f48e4bc..c27d68eaa 100644 --- a/src/controllers/controlHistory.js +++ b/src/controllers/controlHistory.js @@ -428,8 +428,11 @@ const controlHistory = { } Store.clearjfundo = true; + // 撤销的时候curdata 跟 data 数据要调换一下 + let newCtr = {...ctr, ...{data: ctr.curdata, curdata: ctr.data}} // 钩子函数 - method.createHookFunction('updated',ctr) + method.createHookFunction('updated', newCtr) + }, undo: function () { if (Store.jfundo.length == 0) { diff --git a/src/controllers/protection.js b/src/controllers/protection.js index 358d61a4d..81cebf62b 100644 --- a/src/controllers/protection.js +++ b/src/controllers/protection.js @@ -909,7 +909,7 @@ export function checkProtectionLocked(r, c, sheetIndex){ return true; } - if(cell!=null && cell.lo!=null && cell.lo!=1){ + if(cell && !cell.lo){ return true; } @@ -922,7 +922,7 @@ export function checkProtectionLocked(r, c, sheetIndex){ //cell hidden state export function checkProtectionCellHidden(r, c, sheetIndex){ let sheetFile = sheetmanage.getSheetByIndex(sheetIndex); - if(sheetFile==null){ + if(!sheetFile || !sheetFile.data[r] || !sheetFile.data[r][c]){ return true; } @@ -945,6 +945,10 @@ export function checkProtectionCellHidden(r, c, sheetIndex){ //cell range locked state export function checkProtectionLockedRangeList(rangeList, sheetIndex){ + //EPM-BUDGET-START + if (rangeList[0].column[0] !== rangeList[0].column[1]) return true + //EPM-BUDGET-END + let sheetFile = sheetmanage.getSheetByIndex(sheetIndex); if(sheetFile==null){ return true; @@ -964,6 +968,13 @@ export function checkProtectionLockedRangeList(rangeList, sheetIndex){ return true; } + //EPM-BUDGET-START + let cell = sheetFile.data[rangeList[0].row[0]][rangeList[0].column[0]] + if(cell&& !cell.lo){ + return true; + } + //EPM-BUDGET-END + const _locale = locale(); const local_protection = _locale.protection; @@ -1003,7 +1014,7 @@ export function checkProtectionSelectLockedOrUnLockedCells(r, c, sheetIndex){ return true; } - if(cell!=null && cell.lo!=null && cell.lo!=1){//unlocked + if(cell && !cell.lo){//unlocked if(aut.selectunLockedCells==1 || aut.selectunLockedCells==null){ return true; } diff --git a/src/controllers/selection.js b/src/controllers/selection.js index 0a04fe646..e4d51649b 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -811,12 +811,16 @@ const selection = { for (let r = 0; r < rlen; r++) { let x = [].concat(d[r + curR]); for (let c = 0; c < clen; c++) { - + let originCell = x[c + curC]; let value = dataChe[r][c]; if(isRealNum(value)){ - value = parseFloat(value); + // 如果单元格设置了纯文本格式,那么就不要转成数值类型了,防止数值过大自动转成科学计数法 + if (originCell && originCell.ct && originCell.ct.fa === '@') { + value = String(value); + } else { + value = parseFloat(value); + } } - let originCell = x[c + curC]; if(originCell instanceof Object){ originCell.v = value; if(originCell.ct!=null && originCell.ct.fa!=null){ diff --git a/src/controllers/sheetBar.js b/src/controllers/sheetBar.js index 3de909b08..d39a0bece 100644 --- a/src/controllers/sheetBar.js +++ b/src/controllers/sheetBar.js @@ -16,7 +16,7 @@ import {selectTextDom} from '../global/cursorPos'; import locale from '../locale/locale'; import Store from '../store'; import luckysheetConfigsetting from './luckysheetConfigsetting'; - +import {pagerInit} from '../global/api' //表格底部名称栏区域 相关事件(增、删、改、隐藏显示、颜色等等) @@ -525,4 +525,9 @@ export function initialSheetBar(){ $("#luckysheet-input-box").removeAttr("style"); }); + // 初始化分页器 + if (luckysheetConfigsetting.pager) { + pagerInit(luckysheetConfigsetting.pager) + } + } diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index 368e0b5d7..5aed3c2fd 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -592,33 +592,39 @@ const sheetmanage = { return ret; }, buildGridData: function(file) { + // 如果已经存在二维数据data,那么直接返回data;如果只有celldata,那么就转化成二维数组data,再返回 let row = file.row == null ? Store.defaultrowNum : file.row, - column = file.column == null ? Store.defaultcolumnNum : file.column; - let data = datagridgrowth([], row, column); - - let celldata = file.celldata; - if(celldata != null){ - for(let i = 0; i < celldata.length; i++){ - let item = celldata[i]; - let r = item.r; - let c = item.c; - let v = item.v; - - if(r >= data.length){ - data = datagridgrowth(data, r - data.length + 1, 0); + column = file.column == null ? Store.defaultcolumnNum : file.column, + data = file.data && file.data.length > 0 ? file.data : datagridgrowth([], row, column), + celldata = file.celldata; + if (file.data && file.data.length > 0) { + for (let i = 0; i < data.length; i++) { + for (let j = 0; j < data[0].length; j++) { + setcellvalue(i, j, data, data[i][j]); } - if(c >= data[0].length){ - data = datagridgrowth(data, 0, c - data[0].length + 1); + } + } else { + if(celldata && celldata.length > 0){ + for(let i = 0; i < celldata.length; i++){ + let item = celldata[i]; + let r = item.r; + let c = item.c; + let v = item.v; + + if(r >= data.length){ + data = datagridgrowth(data, r - data.length + 1, 0); + } + if(c >= data[0].length){ + data = datagridgrowth(data, 0, c - data[0].length + 1); + } + setcellvalue(r, c, data, v); } - - setcellvalue(r, c, data, v); } } //亿万格式+精确度 恢复全局初始化 luckysheetConfigsetting.autoFormatw = false; luckysheetConfigsetting.accuracy = undefined; - return data; }, cutGridData: function(d) { @@ -1145,9 +1151,8 @@ const sheetmanage = { _this.storeSheetParamALL(); _this.setCurSheet(index); - let file = Store.luckysheetfile[_this.getSheetIndex(index)], - data = file.data, - cfg = file.config; + let file = Store.luckysheetfile[_this.getSheetIndex(index)] + if (!!file.isPivotTable) { Store.luckysheetcurrentisPivotTable = true; if (!isPivotInitial) { @@ -1162,7 +1167,8 @@ const sheetmanage = { let load = file["load"]; if (load != null) { - + let data = _this.buildGridData(file); + file.data = data; // _this.loadOtherFile(file); _this.mergeCalculation(index); diff --git a/src/core.js b/src/core.js index bee8a459b..013ce6b1a 100644 --- a/src/core.js +++ b/src/core.js @@ -134,6 +134,8 @@ luckysheet.create = function (setting) { luckysheetConfigsetting.container = extendsetting.container; luckysheetConfigsetting.hook = extendsetting.hook; + luckysheetConfigsetting.pager = extendsetting.pager; + if (Store.lang === 'zh') flatpickr.localize(Mandarin.zh); // Store the currently used plugins for monitoring asynchronous loading diff --git a/src/css/luckysheet-core.css b/src/css/luckysheet-core.css index c995f00c0..e4840816b 100644 --- a/src/css/luckysheet-core.css +++ b/src/css/luckysheet-core.css @@ -1043,7 +1043,7 @@ div.luckysheet-sheets-m:hover { padding: 0px 0px; margin-left: 0px; position: relative; - width: 70%; + max-width: 50%; vertical-align: bottom; } @@ -7220,7 +7220,7 @@ fieldset[disabled] .btn-danger.focus { border: 1px solid #ccc; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); position: absolute; - z-index: 1000; + z-index: 10000; box-sizing: border-box; } #luckysheet-dataVerification-dropdown-List .dropdown-List-item{ diff --git a/src/global/api.js b/src/global/api.js index b1804fbec..e1bba2f6e 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -6491,4 +6491,45 @@ export function getTxtByRange(range=Store.luckysheet_select_save){ range = [range]; } return conditionformat.getTxtByRange(range); -} \ No newline at end of file +} + + +/** + * 初始化分页器 + * @param {Object} config 分页器配置 + * @param {Number} config.pageIndex 当前的页码 + * @param {Number} config.pageSize 每页显示多少条数据 + * @param {Array} config.selectOption 选择每页的条数 + * @param {Number} config.total 总条数 + */ +export function pagerInit (config) { + $('#luckysheet-bottom-pager').remove() + $('#luckysheet-sheet-area').append('
') + $("#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 + backFun: function (page) { + page.pageIndex = page.page + if(!method.createHookFunction("onTogglePager", page)){ return; } + } + }); +} + +/** + * 刷新公式 + * @param {Function} success 回调函数 + */ +export function refreshFormula (success) { + formula.execFunctionGroupForce(true); + luckysheetrefreshgrid() + setTimeout(() => { + if (success && typeof success === 'function') { + success(); + } + }) +} diff --git a/src/global/draw.js b/src/global/draw.js index e36a9cfb4..fc6a7e89d 100644 --- a/src/global/draw.js +++ b/src/global/draw.js @@ -2141,7 +2141,10 @@ function cellTextRender(textInfo, ctx, option){ ctx.font = word.style; } - ctx.fillText(word.content, (pos_x + word.left)/Store.zoomRatio, (pos_y+word.top)/Store.zoomRatio); + // 暂时未排查到word.content第一次会是object,先做下判断来渲染,后续找到问题再复原 + let txt = typeof word.content === 'object' ? word.content.m : word.content + ctx.fillText(txt, (pos_x + word.left)/Store.zoomRatio, (pos_y+word.top)/Store.zoomRatio); + if(word.cancelLine!=null){ let c = word.cancelLine; diff --git a/src/global/getdata.js b/src/global/getdata.js index 3e3586711..239de149f 100644 --- a/src/global/getdata.js +++ b/src/global/getdata.js @@ -260,7 +260,7 @@ export function getOrigincell(r, c, i) { data = sheet.data; } - if(data==null){ + if(!data || !data[r] || !data[r][c]){ return; } diff --git a/src/global/refresh.js b/src/global/refresh.js index 5cfb75420..3dd5db052 100644 --- a/src/global/refresh.js +++ b/src/global/refresh.js @@ -111,7 +111,8 @@ function jfrefreshgrid(data, range, allParam, isRunExecFunction = true, isRefres "dataVerification": $.extend(true, [], file["dataVerification"]), "curDataVerification": curDataVerification, "dynamicArray": $.extend(true, [], file["dynamicArray"]), - "curDynamicArray": curDynamicArray + "curDynamicArray": curDynamicArray, + "dataRange": [...file.luckysheet_select_save] }); } @@ -449,7 +450,8 @@ function jfrefreshgrid_adRC(data, cfg, ctrlType, ctrlValue, calc, filterObj, cf, "dataVerification": $.extend(true, {}, file.dataVerification), "curDataVerification": dataVerification, "hyperlink": $.extend(true, {}, file.hyperlink), - "curHyperlink": hyperlink + "curHyperlink": hyperlink, + "dataRange": [...file.luckysheet_select_save] }); } @@ -684,7 +686,8 @@ function jfrefreshgrid_deleteCell(data, cfg, ctrl, calc, filterObj, cf, dataVeri "dataVerification": $.extend(true, {}, file.dataVerification), "curDataVerification": dataVerification, "hyperlink": $.extend(true, {}, file.hyperlink), - "curHyperlink": hyperlink + "curHyperlink": hyperlink, + "dataRange": [...file.luckysheet_select_save] }); } diff --git a/src/global/scroll.js b/src/global/scroll.js index f2a5d1e01..a3fb589ff 100644 --- a/src/global/scroll.js +++ b/src/global/scroll.js @@ -2,7 +2,7 @@ import luckysheetFreezen from '../controllers/freezen'; import { luckysheet_searcharray } from '../controllers/sheetSearch'; import { luckysheetrefreshgrid } from '../global/refresh'; import Store from '../store'; - +import method from '../global/method' let scrollRequestAnimationFrameIni = true,scrollRequestAnimationFrame = false, scrollTimeOutCancel=null; @@ -17,7 +17,8 @@ function execScroll(){ export default function luckysheetscrollevent(isadjust) { let $t = $("#luckysheet-cell-main"); let scrollLeft = $("#luckysheet-scrollbar-x").scrollLeft(), - scrollTop = $("#luckysheet-scrollbar-y").scrollTop(); + scrollTop = $("#luckysheet-scrollbar-y").scrollTop(), + canvasHeight = $("#luckysheetTableContent").height(); // canvas高度 // clearTimeout(scrollTimeOutCancel); @@ -106,4 +107,7 @@ export default function luckysheetscrollevent(isadjust) { if(luckysheetFreezen.freezenhorizontaldata != null || luckysheetFreezen.freezenverticaldata != null){ luckysheetFreezen.scrollAdapt(); } + + if(!method.createHookFunction("scroll", {scrollLeft, scrollTop, canvasHeight})){ return; } + } \ No newline at end of file diff --git a/src/index.html b/src/index.html index a64c40967..58a20c399 100644 --- a/src/index.html +++ b/src/index.html @@ -76,6 +76,12 @@ options = { container: 'luckysheet', lang: lang, + // pager: { + // pageIndex: 1, + // pageSize: 10, + // total: 50, + // selectOption: [10, 20] + // }, forceCalculation:false, plugins: ['chart'], fontList:[ diff --git a/src/plugins/images/js.png b/src/plugins/images/js.png new file mode 100644 index 000000000..11264e03b Binary files /dev/null and b/src/plugins/images/js.png differ diff --git a/src/plugins/jquery.sPage.css b/src/plugins/jquery.sPage.css new file mode 100644 index 000000000..2224334a5 --- /dev/null +++ b/src/plugins/jquery.sPage.css @@ -0,0 +1,132 @@ +#luckysheet-bottom-pager { + margin-right: 10px; + float: right; +} +.spage-total { + display: inline-block; + margin-right: 10px; + line-height: 29px; + color: #666; + font-size: 14px +} + +.spage-number { + display: inline-block; + color: #666; + font-size: 14px +} +.selectNum { + font-size: 14px; + height: 27px; + box-sizing: border-box; + vertical-align: top; + line-height: 27px; + border: 1px solid #ddd; + margin-left: 5px; + vertical-align: middle; +} +.spage-number button { + position: relative; + box-sizing: border-box; + display: inline-block; + margin-left: -1px; + padding: 0 10px; + line-height: 27px; + border: 1px solid #ddd; + text-align: center; + transition: all .2s; + cursor: pointer; + outline: none; + background: 0 0; + user-select: none; + color: #333; + background: #fff; + vertical-align: middle; +} +.prevBtn, .nextBtn { + width: 16px; + height: 27px; + background: url(images/js.png) no-repeat center center; + background-size: 100% auto; + display: block; + transform: rotate(180deg); +} +.nextBtn { + transform: rotate(0); +} +.spage-number button.active { + background: #2d98e6; + color: #fff; + border-color: #2d98e6; + z-index: 3 +} + +.spage-number button.active:hover { + background: #2d98e6; + color: #fff; + border-color: #2d98e6; + z-index: 3 +} + +.spage-number button:hover { + background-color: #eee +} + +.spage-number button.button-disabled { + cursor: not-allowed; + color: #ccc +} + +.spage-number .spage-after, +.spage-before { + padding: 0; + width: 40px +} + +.spage-skip { + display: inline-block; + margin-left: 5px; + line-height: 27px; + color: #666; + font-size: 14px +} + +.spage-skip input { + box-sizing: border-box; + display: inline-block; + width: 45px; + height: 29px; + text-align: center; + vertical-align: top; + border: 1px solid #ddd; + background: 0 0; + outline: none; + transition: all .2s +} + +.spage-skip input:focus { + border-color: #2d98e6 +} + +.spage-skip button { + display: inline-block; + padding: 0 14px; + line-height: 27px; + vertical-align: top; + color: #333; + border: 1px solid #ddd; + cursor: pointer; + transition: all .2s; + outline: none; + background: 0 0; + user-select: none; + background-color: #fff; +} + +.spage-skip button:hover { + background: #2d98e6; + color: #fff; + border: 1px solid #2d98e6 +} + + diff --git a/src/plugins/js/jquery.sPage.min.js b/src/plugins/js/jquery.sPage.min.js new file mode 100644 index 000000000..fffd2e9dc --- /dev/null +++ b/src/plugins/js/jquery.sPage.min.js @@ -0,0 +1,202 @@ +/* jQuery分页插件sPage version:1.2.2 github:https://github.com/jvbei/sPage */ +(function (p, t, e, a) { + "use strict"; + var s = { + page: 1, + pageSize: 200, + total: 0, + showTotal: false, + totalTxt: "共{total}条", + noData: false, + showSkip: false, + showPN: true, + prevPage: "上一页", + nextPage: "下一页", + fastForward: 0, + selectOption: [], + backFun: function (t) {} + }; + var img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABAUlEQVQ4T5WTsUrEQBCG//FYxC7BlxDfZ9t0O8EivY0YBEGbqwTJbBauUA8tfIqzsBH18BXyDKkSiUQIRza32XJ2/2+/2WUIIytJkmOl1Ilz7m1sf1gj3wFmPgOwFZHNFMQL6ELMfA5gMwWZBHQQY8wtEb2KyPuYyV5AD1kS0fMYJAgAgIwxd0TkROQj6BF3dfM8P6iq6h5AMYSEGvzxtNaLOI5d0zTLsiy/u9osADMrACsANyKynQXowm3bPgG4ttZ+/rcYZOALBxlkWXZY1/XD7s1BBn34BcDlUDvoG/vwGsCVL+xtQWt9FEXRI4ALa+3P7GFK0/QUgCqK4mvfOP8CEjZjEfl6lvkAAAAASUVORK5CYII=' + function i(t, e) { + this.element = p(t); + this.settings = p.extend({}, s, e); + this.pageNum = 1, this.pageList = [], this.pageTatol = 0; + this.init() + } + p.extend(i.prototype, { + init: function () { + this.element.empty(); + this.viewHtml() + this.clickBtn() + }, + creatHtml: function (t) { + t == this.settings.page ? this.pageList.push('