1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-84abe82e"],{"025d":function(t,e,i){t.exports=i.p+"static/img/bigScreenTwo.1603094d.png"},1:function(t,e){},"2f21":function(t,e,i){"use strict";var n=i("79e5");t.exports=function(t,e){return!!t&&n((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"3cdc":function(t,e,i){"use strict";i("55dd");var n=i("5530"),o=i("c7eb"),s=(i("96cf"),i("1da1")),a=i("7e1e"),c=i("ed08"),r=i("e350");e["a"]={data:function(){return{data:[],sort:["id,desc"],page:0,size:10,total:0,url:"",params:{},query:{},time:50,isAdd:!1,downloadLoading:!1,loading:!0,delLoading:!1,delAllLoading:!1,dialog:!1,form:{},resetForm:{},title:""}},methods:{parseTime:c["d"],downloadFile:c["c"],checkPermission:r["a"],init:function(){var t=Object(s["a"])(Object(o["a"])().mark((function t(){var e=this;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.beforeInit();case 2:if(t.sent){t.next=4;break}return t.abrupt("return");case 4:return t.abrupt("return",new Promise((function(t,i){e.loading=!0,Object(a["b"])(e.url,e.getQueryParame()).then((function(i){e.total=i.totalElements,e.data=i.content,setTimeout((function(){e.loading=!1}),e.time),t(i)})).catch((function(t){e.loading=!1,i(t)}))})));case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),beforeInit:function(){return!0},getQueryParame:function(){return Object(n["a"])(Object(n["a"])({page:this.page,size:this.size,sort:this.sort},this.query),this.params)},pageChange:function(t){this.page=t-1,this.init()},sizeChange:function(t){this.page=0,this.size=t,this.init()},dleChangePage:function(t){void 0===t&&(t=1),this.data.length===t&&0!==this.page&&(this.page=this.page-1)},toQuery:function(){this.page=0,this.init()},submitSuccessNotify:function(){this.$notify({title:"提交成功",type:"success",duration:2500})},addSuccessNotify:function(){this.$notify({title:"新增成功",type:"success",duration:2500})},editSuccessNotify:function(){this.$notify({title:"编辑成功",type:"success",duration:2500})},delSuccessNotify:function(){this.$notify({title:"删除成功",type:"success",duration:2500})},notify:function(t,e){this.$notify({title:t,type:e,duration:2500})},beforeDelMethod:function(){return!0},delMethod:function(t){var e=this;this.beforeDelMethod()&&(this.delLoading=!0,this.crudMethod.del(t).then((function(){e.delLoading=!1,e.$refs[t].doClose(),e.dleChangePage(),e.delSuccessNotify(),e.afterDelMethod(),e.init()})).catch((function(){e.delLoading=!1,e.$refs[t].doClose()})))},afterDelMethod:function(){},beforeDelAllMethod:function(){var t=this;this.$confirm("你确定删除选中的数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.delAllMethod()}))},delAllMethod:function(){var t=this;this.delAllLoading=!0;for(var e=this.$refs.table.selection,i=[],n=0;n<e.length;n++)i.push(e[n].id);this.crudMethod.delAll(i).then((function(){t.delAllLoading=!1,t.dleChangePage(i.length),t.init(),t.$notify({title:"删除成功",type:"success",duration:2500})})).catch((function(){t.delAllLoading=!1}))},beforeShowAddForm:function(){},showAddFormDialog:function(){this.isAdd=!0,this.resetForm=JSON.parse(JSON.stringify(this.form)),this.beforeShowAddForm(),this.dialog=!0},beforeShowEditForm:function(t){},showEditFormDialog:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.isAdd=!1,t&&(this.resetForm=JSON.parse(JSON.stringify(this.form)),this.form=JSON.parse(JSON.stringify(t))),this.beforeShowEditForm(t),this.dialog=!0},addMethod:function(){var t=this;this.crudMethod.add(this.form).then((function(){t.addSuccessNotify(),t.loading=!1,t.afterAddMethod(),t.cancel(),t.init()})).catch((function(){t.loading=!1,t.afterAddErrorMethod()}))},afterAddMethod:function(){},afterAddErrorMethod:function(){},editMethod:function(){var t=this;this.crudMethod.edit(this.form).then((function(){t.editSuccessNotify(),t.loading=!1,t.afterEditMethod(),t.cancel(),t.init()})).catch((function(){t.loading=!1}))},afterEditMetho
|