diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..9079579 Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..3ac9d40 --- /dev/null +++ b/index.html @@ -0,0 +1,97 @@ +
确认要删除选择的数据吗?
',onOk:function(){t=e.$refs.detail.delRow();var n=e.detailOptions.key;t.forEach(function(t){t.hasOwnProperty(n)&&t[n]&&e.detailOptions.delKeys.push(t[n])}),e.updateDetailTableSummaryTotal()}}):this.$message.error("请选择要删除的行!")},updateDetailTableSummaryTotal:function(){var e=this;this.$refs.detail&&(this.$refs.detail.paginations.total=this.$refs.detail.rowData.length,this.$refs.detail.summary&&this.$refs.detail.columns.forEach(function(t){t.summary&&e.$refs.detail.getInputSummaries(null,null,null,t)}))}},E={onInit:function(){console.log("Create执行前")},onInited:function(){console.log("Create执行后")},mounted:function(){console.log("mounted")},searchBefore:function(e){return!0},searchAfter:function(e,t){return!0},searchDetailBefore:function(e){return!0},searchDetailAfter:function(e,t){return!0},delBefore:function(e,t){return!0},delAfter:function(e){return!0},delDetailRow:function(e){return!0},addBefore:function(e){return!0},addBeforeAsync:function(e){var t=this;return y()(g.a.mark(function e(){return g.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e,t)}))()},addAfter:function(e){return!0},updateBefore:function(e){return!0},updateBeforeAsync:function(e){var t=this;return y()(g.a.mark(function e(){return g.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e,t)}))()},updateAfter:function(e){return!0},auditBefore:function(e,t){return!0},auditAfter:function(e,t){return!0},resetAddFormBefore:function(){return!0},resetAddFormAfter:function(){return!0},resetUpdateFormBefore:function(){return!0},resetUpdateFormAfter:function(){return!0},modelOpenBefore:function(e){},modelOpenAfter:function(e){},importAfter:function(e){this.search()},importExcelBefore:function(e){return!0},reloadDicSource:function(){this.initDicKeys()},exportBefore:function(e){return!0},onModelClose:function(e){this.boxModel=!1}},C={parentCall:function(e){if("function"!=typeof e)return console.log("扩展组件需要传入一个回调方法才能获取父级Vue对象");e(this)},getCurrentAction:function(){return this.currentReadonly?"":"--"+(this.currentAction==this.const.ADD?"新增":"编辑")},quickSearchKeyPress:function(e){13==e.keyCode&&""!=this._searchFormFields[this.singleSearch.field]&&this.search()},getButtons:function(){var e=this,t=this.buttons.findIndex(function(e){return"Search"==e.value});if(-1!=t&&this.buttons.splice(t+1,0,{icon:"ios-arrow-down",class:"r-dropdown",name:"",type:this.buttons[t].type,onClick:function(){e.searchBoxShow=!e.searchBoxShow}}),this.maxBtnLength+=-1==t?0:1,this.buttons.length<=this.maxBtnLength)return this.buttons;var n=this.buttons.slice(0,this.maxBtnLength);return n[this.maxBtnLength-1].last=!0,n},extendBtn:function(e,t){e&&t&&t instanceof Array&&t.forEach(function(t){e.splice(void 0==t.index?e.length:t.index,0,t)})},initBoxButtons:function(){var e,t,n=this,o=this.$route.path,i=this.permission.getButtons(o,null,this.extend.tableAction);i&&i.forEach(function(e){var t={};for(var o in e)t[o]=e[o];n.buttons.push(t)}),this.extend||(this.extend={}),this.extend.buttons||(this.extend.buttons={}),this.extend.buttons.view&&this.extendBtn(this.buttons,this.extend.buttons.view);var r=[],a=this.buttons.some(function(e){if(e.value&&(e.value.toLowerCase()==n.const.ADD.toLowerCase()||e.value.toLowerCase()==n.const.EDIT.toLowerCase()))return!0});this.currentReadonly=!a;var l,s={name:"刷新",icon:"md-refresh",onClick:function(){this.currentAction!=this.const.ADD&&this.refreshRow()}};if(this.buttons.some(function(e){if(e.value==n.const.IMPORT)return!0})&&(this.upload.url=this.getUrl(this.const.IMPORT),this.upload.template.fileName=this.table.cnName,this.upload.template.url=this.http.ipAddress+this.getUrl(this.const.DOWNLOADTEMPLATE,!0)),!a)return this.editFormOptions.forEach(function(e){e.forEach(function(e){e.disabled=!0})}),this.detail.columns.forEach(function(e){e.hasOwnProperty("edit")&&(e.edit=!1)}),this.extendBtn(r,this.extend.buttons.box),(l=this.boxButtons).push.apply(l,r),this.detailOptions.buttons.push(s),this.extendBtn(this.detailOptions.buttons,this.extend.buttons.detail),r;this.detailOptions.edit=!0,r.push.apply(r,[{name:"保 存",icon:"md-checkmark",type:"error",value:"save",onClick:function(){this.save()}},{name:"重 置",icon:"md-refresh",type:"success",onClick:function(){this.resetEdit()}}]),(e=this.detailOptions.buttons).push.apply(e,[{name:"添加行",icon:"md-add",onClick:function(){this.addRow()}},{name:"删除行",icon:"md-close",onClick:function(){this.delRow()}}]),this.extendBtn(r,this.extend.buttons.box),this.detailOptions.buttons.push(s),this.extendBtn(this.detailOptions.buttons,this.extend.buttons.detail),(t=this.boxButtons).push.apply(t,r)},onClick:function(e){e.apply(this)},changeDropdown:function(e,t){var n=this.buttons.filter(function(t){return t.name==e});n&&n.length>0&&n[0].onClick.apply(this)},emptyValue:function(e){return"string"==typeof e&&""===e.trim()||(e instanceof Array&&!e.length||(null===e||void 0===e||""===e))},getSearchParameters:function(){var e=this;this.fiexdSearchForm||(this.searchBoxShow=!1);var t={wheres:[]},n=function(n){var o=e._searchFormFields[n];if(e.emptyValue(o))return"continue";"number"==typeof o&&(o+="");var i=e.getSearchItem(n);if("cascader"==i&&(o=o.length?o[o.length-1]+"":""),"string"==typeof o||-1==["date","datetime","range"].indexOf(i))return t.wheres.push({name:n,value:"string"==typeof o?(o+"").trim():o.join(","),displayType:i}),"continue";for(var r=function(r){e.emptyValue(o[r])||t.wheres.push({name:n,value:(o[r]+"").trim(),displayType:-1!=["date","datetime","range"].indexOf(i)?r?"lessorequal":"thanorequal":i})},a=0;a确认要删除选择的数据吗?
',onOk:function(){if(!o){o=!0;var t=e.getUrl(e.const.DEL);e.http.post(t,n,"正在删除数据....").then(function(t){if(!t.status)return e.$error(t.message);e.$success(t.message),e.delAfter(t)&&e.refresh()})}}})}},modelOpenBeforeAsync:function(e){var t=this;return y()(g.a.mark(function e(){return g.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e,t)}))()},initBox:function(){var e=this;return y()(g.a.mark(function t(){return g.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.modelOpenBeforeAsync(e.currentRow);case 2:if(t.sent){t.next=4;break}return t.abrupt("return",!1);case 4:return e.modelOpenBefore(e.currentRow),e.boxInit||(e.boxInit=!0,e.boxModel=!0),t.abrupt("return",!0);case 7:case"end":return t.stop()}},t,e)}))()},setEditForm:function(e){var t=this;this.$refs.table.remoteColumns.forEach(function(e){t.editFormOptions.forEach(function(t){t.forEach(function(t){t.field==e.field&&(t.data.data=i()([],t.data,e.bind.data))})})}),this._editFormFields,this._editFormFields[this.table.key]=e[this.table.key],this.resetEditForm(e),this.currentAction=this.const.EDIT,this.boxModel=!0},linkData:function(e,t){var n=this;return y()(g.a.mark(function t(){return g.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n.currentAction=n.const.EDIT,n.currentRow=e,t.next=4,n.initBox();case 4:if(t.sent){t.next=6;break}return t.abrupt("return");case 6:n.resetDetailTable(e),n.setEditForm(e),n.setContinueAdd(!1),n.getRemoteFormDefaultKeyValue(),n.modelOpenProcess(e);case 11:case"end":return t.stop()}},t,n)}))()},setContinueAdd:function(e){if(this.continueAdd){var t=this.boxButtons.find(function(e){return"save"==e.value});t&&(t.name=e?this.continueAddName:"保 存")}},resetAdd:function(){this.hasDetail&&this.$refs.detail&&this.$refs.detail.reset();var e={};this.editFormOptions.forEach(function(t){t.forEach(function(t){"switch"==t.type&&(e[t.field]=1)})}),this.resetEditForm(e)},add:function(){var e=this;return y()(g.a.mark(function t(){return g.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.currentAction=e.const.ADD,e.currentRow={},t.next=4,e.initBox();case 4:if(t.sent){t.next=6;break}return t.abrupt("return");case 6:e.resetAdd(),e.setContinueAdd(!0),e.boxModel=!0,e.modelOpenProcess();case 10:case"end":return t.stop()}},t,e)}))()},edit:function(){var e=this;return y()(g.a.mark(function t(){var n;return g.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.currentAction=e.const.EDIT,0!=(n=e.$refs.table.getSelected()).length){t.next=4;break}return t.abrupt("return",e.$error("请选择要编辑的行!"));case 4:return e.currentRow=n[0],t.next=7,e.initBox();case 7:if(t.sent){t.next=9;break}return t.abrupt("return");case 9:e.setContinueAdd(!1),e.resetDetailTable(),e.setEditForm(n[0]),e.getRemoteFormDefaultKeyValue(),e.modelOpenProcess(n[0]);case 14:case"end":return t.stop()}},t,e)}))()},getRemoteFormDefaultKeyValue:function(){var e=this;this.currentAction==this.const.EDIT&&0!=this.remoteKeys.length&&this.editFormOptions.forEach(function(t,n){t.forEach(function(t,o){if(t.remote){var i=e.columns.find(function(e){return e.bind&&e.bind.key==t.dataKey});if(!i)return;var r=e.currentRow[t.field],a=i.bind.data.find(function(e){return e.key==r});t.data=[{key:r,value:a?a.value:r}],e.editFormOptions[n].splice(o,1,t)}})})},modelOpenProcess:function(e){var t=this;this.$nextTick(function(){t.modelOpenAfter(e)})},import:function(){this.upload.excel=!0,this.$refs.upload_excel&&this.$refs.upload_excel.reset()},download:function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.setRequestHeader("Content-type","application/json"),n.setRequestHeader("Authorization",this.$store.getters.getToken());var o=this.$refs.export;n.responseType="blob",n.onload=function(e){if(200==n.status){var i=n.response;o.download=t;var r=new Blob([i]);o.href=URL.createObjectURL(r),o.click()}else this.$error("下载文件出错了..")},n.send()},export:function(){var e=this,t=this.getUrl(this.const.EXPORT),n=this.getSearchParameters(),o={order:this.pagination.order,wheres:n.wheres||[]};if(this.exportBefore(o)){o.wheres&&"object"==m()(o.wheres)&&(o.wheres=p()(o.wheres));var i=this.http;i.post(t,o,"正在导出数据....").then(function(t){if(!t.status)return e.$error(t.message);var n=e.getUrl(e.const.DOWNLOAD);n="/"==n[0]?n.substring(1):n,e.download(i.ipAddress+n+"?path="+t.data,e.table.cnName+".xlsx")})}},getSelectRows:function(){return this.$refs.table.getSelected()},getDetailSelectRows:function(){return this.$refs.detail?this.$refs.detail.getSelected():[]},audit:function(){var e=this.$refs.table.getSelected();return 0==e.length?this.$error("请选择要审核的行!"):e.every(function(e){return e.AuditStatus>0})?this.$error("只能选择审核中的数据!"):(this.auditParam.rows=e.length,void(this.auditParam.model=!0))},saveAudit:function(){var e=this,t=this.$refs.table.getSelected();if(-1==this.auditParam.status)return this.$error("请选择审核结果!");if(t.length!=this.auditParam.rows)return this.$error("所选数据已发生变化,请重新选择审数据!");var n=t.map(function(t){return t[e.table.key]});if(this.auditBefore(n,t)){var o=this.getUrl(this.const.AUDIT)+"?auditReason="+this.auditParam.reason+"&auditStatus="+this.auditParam.status;this.http.post(o,n,"审核中....").then(function(n){if(e.auditAfter(n,t)){if(!n.status)return e.$error(n.message);e.auditParam.rows=0,e.auditParam.status=-1,e.auditParam.reason="",e.auditParam.model=!1,e.$success(n.message),e.refresh()}})}},openViewColumns:function(){var e,t=this;0==this.viewColumns&&((e=this.viewColumns).push.apply(e,[{title:"名称",key:"title"},{title:"字段",key:"field"},{title:"类型",key:"type"},{title:"是否显示",key:"hidden"},{title:"绑定数据源",key:"bind"}]),this.columns.forEach(function(e){t.viewData.push({title:e.title,field:e.field,type:e.type,hidden:e.hidden?"否":"是",bind:e.bind?e.bind.dicNo:"--",cellClassName:{title:"table-info-cell-title"}})}));this.viewModel=!0},viewModelCancel:function(){this.viewModel=!1},initFormOptions:function(e,t,n,o){var r=this;e.forEach(function(e){e.forEach(function(e){if("img"!=e.type&&"excel"!=e.type&&"file"!=e.type&&"img"!=e.columnType||(e.url=r.http.ipAddress+"api"+r.table.url+"Upload",r.uploadfiled.push(e.field)),!e.dataKey)return!0;if(e.remote)return r.remoteKeys.push(e.dataKey),e.data=[],!0;if("checkbox"!=e.type||n[e.field]instanceof Array||(n[e.field]=[]),-1==t.indexOf(e.dataKey)){t.push(e.dataKey);var a={dicNo:e.dataKey,data:[],fileds:[e.field],orginData:[]};"cascader"==e.type&&(a.type="cascader"),o&&(a.e_type=e.type),r.dicKeys.push(a)}else"cascader"==e.type&&(e.hasOwnProperty("changeOnSelect")||(e.changeOnSelect=!0),r.dicKeys.forEach(function(t){t.dicNo==e.dataKey&&(t.type="cascader",t.fileds.push(e.field))}));i()(e,r.dicKeys.filter(function(t){return t.dicNo==e.dataKey})[0])})})},initColumns:function(e,t,n){var o=this;e&&e instanceof Array&&e.forEach(function(e){if(!e.bind||e.bind.data&&e.bind.data.length>0)return!0;var i=e.bind.key||e.bind.dicNo;if(-1!=o.remoteKeys.indexOf(i))return e.bind.remote=!0,!0;-1==o.hasKeyField.indexOf(e.field)&&o.hasKeyField.push(e.field);var r=t.filter(function(e){return e.dicNo==i});r&&0!=r.length||(t.push({dicNo:i,data:[]}),r=[t[t.length-1]],n.push(i)),"cascader"==r[0].type?e.bind={data:r[0].orginData,tyep:"select"}:e.bind=r[0],e.bind.type=e.bind.e_type||"string"})},bindOptions:function(e){var t=this;e.forEach(function(e){t.dicKeys.forEach(function(n){if(n.dicNo!=e.dicNo)return!0;var o,i,r;if("cascader"==n.type)(o=n.data).push.apply(o,x()(t.base.convertTree(JSON.parse(p()(e.data)),function(e,t,n){e.label=e.value,e.value=e.key}))),(i=n.orginData).push.apply(i,x()(e.data));else if(e.data.length>0&&!e.data[0].hasOwnProperty("key")){for(var a,l=e.data,s=new Array(l.length),u=0;u
<\/p>$/gim,t.EMPTY_P_REGEX=/
/gim},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(150))},function(e,t,n){var o=n(8),i=n(80),r=n(17),a=n(67),l=n(79),s=n(107),u=i("wks"),c=o.Symbol,d=s?c:c&&c.withoutSetter||a;e.exports=function(e){return r(u,e)&&(l||"string"==typeof u[e])||(l&&r(c,e)?u[e]=c[e]:u[e]=d("Symbol."+e)),u[e]}},function(e,t,n){var o=n(11),i=n(17),r=n(101),a=n(18).f;e.exports=function(e){var t=o.Symbol||(o.Symbol={});i(t,e)||a(t,e,{value:r.f(e)})}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var o=n(11);e.exports=function(e){return o[e+"Prototype"]}},function(e,t,n){var o=n(12);e.exports=!o(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,n){e.exports=n(203)},function(e,t,n){var o=n(26),i={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return i.call(o(e),t)}},function(e,t,n){var o=n(15),i=n(108),r=n(20),a=n(64),l=Object.defineProperty;t.f=o?l:function(e,t,n){if(r(e),t=a(t),r(n),i)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var o=n(15),i=n(18),r=n(38);e.exports=o?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(13);e.exports=function(e){if(!o(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function l(e){for(var t=-1,n=0;n