From 27ad3ff7ce4838ed01afc8e7e999a553f3e9877b Mon Sep 17 00:00:00 2001
From: Anyon ' + lines.join(' ') + '').find('input').attr('name', uniqid).val(ret.data.uniqid || '');
- $form.find('[name="' + verify + '"]').attr('value', ret.data.code || '').val(ret.data.code || '');
- return (ret.data.code || $form.find('.verify.layui-hide').removeClass('layui-hide')), false;
- }
- }, false);
- });
-
- /*! 初始化登录图形 */
- $('[data-captcha]').map(function () {
- $(this).trigger('click');
- });
-
-});
\ No newline at end of file
+});
diff --git a/public/static/plugs/admin/excel.js b/public/static/plugs/admin/excel.js
deleted file mode 100644
index 244d9bc97..000000000
--- a/public/static/plugs/admin/excel.js
+++ /dev/null
@@ -1,207 +0,0 @@
-// +----------------------------------------------------------------------
-
-define(function () {
-
- /*! 定义构造函数 */
- function Excel(data, name) {
- if (data && name) this.export(data, name);
- }
-
- /*! 默认导出配置 */
- Excel.prototype.options = {writeOpt: {bookSST: false}};
-
- /*! 导出 Excel 文件 */
- Excel.prototype.export = function (data, name, options) {
- name = name || '数据导出_' + layui.util.toDateString(Date.now(), '_yyyyMMdd_HHmmss');
- if (name.substring(0, -5).toLowerCase() !== '.xlsx') name += '.xlsx';
- layui.excel.exportExcel(data, name, 'xlsx', $.extend(options || {}, this.options));
- };
-
- /*! 绑定导出的事件 */
- // 通用导出
- // 指定链接导出
- //
- // 自定义导出1
- // 自定义导出2
- //
- Excel.prototype.bind = function (done, filename, selector, options) {
- let that = this;
- this.options = $.extend(this.options, options || {});
- this.bindLoadDone(function (data, button) {
- that.export(done.call(that, data, []), button.dataset.filename || filename);
- }, selector);
- };
-
- /*! 加载所有数据 */
- Excel.prototype.bindLoadDone = function (done, selector) {
- let that = this;
- $('body').off('click', selector || '[data-form-export]').on('click', selector || '[data-form-export]', function () {
- let button = this, form = $(this).parents('form');
- let method = this.dataset.method || form.attr('method') || 'get';
- let location = this.dataset.excel || this.dataset.formExport || form.attr('action') || '';
- let sortType = $(this).attr('data-sort-type') || '', sortField = $(this).attr('data-sort-field') || '';
- if (sortField.length > 0 && sortType.length > 0) {
- location += (location.indexOf('?') > -1 ? '&' : '?') + '_order_=' + sortType + '&_field_=' + sortField;
- }
- that.load(location, form.serialize(), method).then((data) => done.call(that, data, button)).fail(function (ret) {
- $.msg.tips(ret || '数据加载失败');
- });
- });
- }
-
- /*! 加载导出的文档 */
- Excel.prototype.load = function (url, data, method) {
- return (function (defer, lists, loaded) {
- loaded = $.msg.loading('正在加载 0.00%');
- return (lists = []), LoadNextPage(1, 1), defer;
-
- function LoadNextPage(curPage, maxPage, urlParams) {
- let proc = (curPage / maxPage * 100).toFixed(2);
- $('[data-upload-count]').html(proc > 100 ? '100.00' : proc);
- if (curPage > maxPage) return $.msg.close(loaded), defer.resolve(lists);
- urlParams = (url.indexOf('?') > -1 ? '&' : '?') + 'output=json¬_cache_limit=1&limit=100&page=' + curPage;
- $.form.load(url + urlParams, data, method, function (ret) {
- if (ret.code) {
- lists = lists.concat(ret.data.list);
- if (ret.data.page) LoadNextPage((ret.data.page.current || 1) + 1, ret.data.page.pages || 1);
- } else {
- defer.reject('数据加载异常');
- }
- return false;
- }, false);
- }
- })($.Deferred());
- };
-
- /*! 设置表格导出样式 */
- // this.withStyle(data, {A: 60, B: 80, C: 99, E: 120, G: 120}, 99, 28)
- Excel.prototype.withStyle = function (data, colsWidth, defaultWidth, defaultHeight) {
- // 自动计算列序
- let idx, colN = 0, defaC = {}, lastCol;
- for (idx in data[0]) defaC[lastCol = layui.excel.numToTitle(++colN)] = defaultWidth || 99;
- defaC[lastCol] = 160;
-
- // 设置表头样式
- layui.excel.setExportCellStyle(data, 'A1:' + lastCol + '1', {
- s: {
- font: {sz: 12, bold: true, color: {rgb: "FFFFFF"}, name: '微软雅黑', shadow: true},
- fill: {bgColor: {indexed: 64}, fgColor: {rgb: '5FB878'}},
- alignment: {vertical: 'center', horizontal: 'center'}
- }
- });
-
- // 设置内容样式
- (function (style1, style2) {
- layui.excel.setExportCellStyle(data, 'A2:' + lastCol + data.length, {s: style1}, function (rawCell, newCell, row, config, curRow) {
- typeof rawCell !== 'object' && (rawCell = {v: rawCell});
- rawCell.s = Object.assign({}, style2, rawCell.s || {});
- return (curRow % 2 === 0) ? newCell : rawCell;
- });
- })({
- font: {sz: 10, shadow: true, name: '微软雅黑'},
- fill: {bgColor: {indexed: 64}, fgColor: {rgb: "EAEAEA"}},
- alignment: {vertical: 'center', horizontal: 'center'}
- }, {
- font: {sz: 10, shadow: true, name: '微软雅黑'},
- fill: {bgColor: {indexed: 64}, fgColor: {rgb: "FFFFFF"}},
- alignment: {vertical: 'center', horizontal: 'center'}
- });
-
- // 设置表格行宽高,需要设置最后的行或列宽高,否则部分不生效 ???
- let rowsC = {1: 33}, colsC = Object.assign({}, defaC, {A: 60}, colsWidth || {});
- rowsC[data.length] = defaultHeight || 28, this.options.extend = Object.assign({}, {
- '!cols': layui.excel.makeColConfig(colsC, defaultWidth || 99),
- '!rows': layui.excel.makeRowConfig(rowsC, defaultHeight || 28),
- }, this.options.extend || {});
- return data;
- }
-
- /*! 直接推送表格内容 */
- // url: 记录推送地址
- // sheet: 表格 Sheet 名称
- // cols: { _: 1, 表头名1: 字段名1, 表头名2: 字段名2 },其中字段 _ 配置起始行
- // filter: 数据过滤处理,如果返回 false 不上传记录
- // Excel.push(ACTION, '用户信息', {_:1, username: "用户名称", phone: "联系手机"})
- Excel.prototype.push = function (url, sheet, cols, filter) {
- let loaded, $input;
- $input = $('');
- $input.appendTo($('body')).click().on('change', function (event) {
- if (!event.target.files || event.target.files.length < 1) return $.msg.tips('没有可操作文件');
- loaded = $.msg.loading('读取 0.00%');
- try {
- // 导入Excel数据,并逐行上传处理
- layui.excel.importExcel(event.target.files, {}, function (data) {
- if (!data[0][sheet]) return $.msg.tips('未读取到表[' + sheet + ']的数据');
- let _cols = {}, _data = data[0][sheet], items = [], row, col, key, item;
- for (row in _data) if (parseInt(row) + 1 === parseInt(cols._ || '1')) {
- for (col in _data[row]) for (key in cols) if (_data[row][col] === cols[key]) _cols[key] = col;
- } else if (parseInt(row) + 1 > cols._ || 1) {
- item = {};
- for (key in _cols) item[key] = CellToValue(_data[row][_cols[key]]);
- items.push(item);
- }
- PushQueue(items, items.length, 0, 0, 1);
- });
- } catch (e) {
- $.msg.error('读取 Excel 文件失败!')
- }
- });
-
- /*! 单项推送数据 */
- function PushQueue(items, total, ers, oks, idx) {
- if ((total = items.length) < 1) return CleanAll(), $.msg.tips('未读取到有效数据');
- return (ers = 0, oks = 0, idx = 0), $('[data-load-name]').html('更新'), DoPostItem(idx, items[idx]);
-
- /*! 执行导入的数据 */
- function DoPostItem(idx, item, data) {
- if (idx >= total) {
- return CleanAll(), $.msg.success('共处理' + total + '条记录( 成功 ' + oks + ' 条, 失败 ' + ers + ' 条 )', 3, function () {
- $.form.reload();
- });
- } else {
- let proc = (idx * 100 / total).toFixed(2);
- $('[data-load-count]').html((proc > 100 ? '100.00' : proc) + '%( 成功 ' + oks + ' 条, 失败 ' + ers + ' 条 )');
- /*! 单元数据过滤 */
- data = item;
- if (filter && (data = filter(item)) === false) {
- return (ers++), DoPostItem(idx + 1, items[idx + 1]);
- }
- /*! 提交单个数据 */
- DoUpdate(url, data).then(function (ret) {
- (ret.code ? oks++ : ers++), DoPostItem(idx + 1, items[idx + 1]);
- });
- }
- }
- }
-
- /*! 清理文件选择器 */
- function CleanAll() {
- $input.remove();
- if (loaded) $.msg.close(loaded);
- }
-
- /*! 表格单元内容转换 */
- function CellToValue(v) {
- if (typeof v !== 'undefined' && /^\d+\.\d{12}$/.test(v)) {
- return LAY_EXCEL.dateCodeFormat(v, 'YYYY-MM-DD HH:ii:ss');
- } else {
- return typeof v !== 'undefined' ? v : '';
- }
- }
-
- /*! 队列方式上传数据 */
- function DoUpdate(url, item) {
- return (function (defer) {
- return $.form.load(url, item, 'post', function (ret) {
- return defer.resolve(ret), false;
- }, false), defer.promise();
- })($.Deferred());
- }
- }
-
- /*! 返回对象实例 */
- return new Excel;
-});
\ No newline at end of file
diff --git a/public/static/plugs/admin/queue.js b/public/static/plugs/admin/queue.js
deleted file mode 100644
index e3a4e4866..000000000
--- a/public/static/plugs/admin/queue.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// +----------------------------------------------------------------------
-
-define(function () {
-
- let template = '
1===e?0:1),c=a[r];if("string"==typeof c)return c;return c[Number(l(i))]}Mn.window.CKEDITOR_TRANSLATIONS||(Mn.window.CKEDITOR_TRANSLATIONS={});const Us=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig"];function qs(e){return Us.includes(e)?"rtl":"ltr"}class Gs{constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=qs(this.uiLanguage),this.contentLanguageDirection=qs(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce(((e,t)=>Ws(e,t))):e}(i),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Cs(t),"string"==typeof e&&(e={string:e});const i=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>it===e));return Array.isArray(t)}set(e,t){if(L(e))for(const[t,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=or(e);Xo(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!L(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find((([t])=>t===e));return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){if(this.isEmpty)return[];if(e)return this._styleProcessor.getStyleNames(this._styles);return this.getStylesEntries().map((([e])=>e))}clear(){this._styles={}}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const i=t.splice(0,t.length-1).join("."),n=er(this._styles,i);if(!n)return;!Object.keys(n).length&&this.remove(i)}}class sr{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(L(t))rr(i,or(e),t);else if(this._normalizers.has(e)){const n=this._normalizers.get(e),{path:s,value:o}=n(t);rr(i,s,o)}else rr(i,e,t)}getNormalized(e,t){if(!e)return Ws({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return er(t,i);const n=i(e,t);if(n)return n}return er(t,or(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(void 0===i)return[];if(this._reducers.has(e)){return this._reducers.get(e)(i)}return[[e,i]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter((t=>{const i=this.getNormalized(t,e);return i&&"object"==typeof i?Object.keys(i).length:i})),i=new Set([...t,...Object.keys(e)]);return Array.from(i)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function or(e){return e.replace("-",".")}function rr(e,t,i){let n=i;L(i)&&(n=Ws({},er(e,t),i)),ir(e,t,n)}class ar extends Ao{constructor(e,t,i,n){if(super(e),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=t,this._attrs=function(e){const t=Ys(e);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");lr(this._classes,e),this._attrs.delete("class")}this._styles=new nr(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof ar))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,i]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==i)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new To(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),i=Array.from(this._attrs).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;const n=function(e,t){if("string"==typeof t)return[new xo(e,t)];ie(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new xo(e,t):t instanceof Eo?new xo(e,t.data):t))}(this.document,t);for(const t of n)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;is?(e.nodesToHandle=n-s,e.offset=s):e.nodesToHandle=0);if("remove"==i.type&&e.offset<br> element)"),keystroke:"Shift+Enter"}]})}}class tw extends ro{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,n=t.document.selection,s=Array.from(n.getSelectedBlocks()),o=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(o){const t=s.filter((e=>iw(e)||sw(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,s.filter(iw))}))}_getValue(){const e=Zs(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!iw(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=Zs(e.getSelectedBlocks());return!!i&&sw(t,i)}_removeQuote(e,t){nw(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];nw(e,t).reverse().forEach((t=>{let n=iw(t.start);n||(n=e.createElement("blockQuote"),e.wrap(t,n)),i.push(n)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function iw(e){return"blockQuote"==e.parent.name?e.parent:null}function nw(e,t){let i,n=0;const s=[];for(;n
").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("
")||o.includes("
"))&&(o=`
${o}
`),e=o),s=this.editor.data.htmlProcessor.toView(e)}var o;const r=new f(this,"inputTransformation");this.fire(r,{content:s,dataTransfer:n,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const n=this.editor.data.toModel(i.content,"$clipboardHolder");0!=n.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:n,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=s._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,n=(e,i)=>{const n=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(n,t.selection,e.name)};this.listenTo(i,"copy",n,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?n(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,n)=>{const s=e.data.toView(n.content);i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:s,method:n.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",dw(n.content))),"cut"==n.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}class Pw extends(V()){constructor(){super(...arguments),this._stack=[]}add(e,t){const i=this._stack,n=i[0];this._insertDescriptor(e);const s=i[0];n===s||Iw(n,s)||this.fire("change:top",{oldDescriptor:n,newDescriptor:s,writer:t})}remove(e,t){const i=this._stack,n=i[0];this._removeDescriptor(e);const s=i[0];n===s||Iw(n,s)||this.fire("change:top",{oldDescriptor:n,newDescriptor:s,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(Iw(e,t[i]))return;i>-1&&t.splice(i,1);let n=0;for(;t[n]&&Vw(t[n],e);)n++;t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function Iw(e,t){return e&&t&&e.priority==t.priority&&Rw(e.classes)==Rw(t.classes)}function Vw(e,t){return e.priority>t.priority||!(e.priority