You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
17 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-625eca90"],{"09f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),Math.easeInOutQuad=function(t,e,i,a){return t/=a/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function s(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function n(t,e,i){var n=o(),r=t-n,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var o=Math.easeInOutQuad(c,n,r,e);s(o),c<e?a(t):i&&"function"===typeof i&&i()};u()}},"2d64":function(t,e,i){"use strict";var a=i("5530"),s=i("9256"),o={page:{url:"/station/page",method:"POST"},save:{url:"/station",method:"POST"},update:{url:"/station",method:"PUT"},delete:{url:"/station",method:"DELETE"},preview:{method:"POST",url:"/station/preview"},export:{method:"POST",url:"/station/export"},import:{method:"POST",url:"/station/import"}};e["a"]={page:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.page),{},{data:t}))},save:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.save),{},{data:t}))},update:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.update),{},{data:t}))},delete:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.delete),{},{data:t}))},preview:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.preview),{},{data:t}))},export:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.export),{},{responseType:"blob",data:t}))},import:function(t){return Object(s["a"])(Object(a["a"])(Object(a["a"])({},o.import),{},{data:t}))}}},f2193:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item search-item",attrs:{placeholder:t.$t("table.station.name")},model:{value:t.queryParams.model.name,callback:function(e){t.$set(t.queryParams.model,"name",e)},expression:"queryParams.model.name"}}),i("treeselect",{staticClass:"filter-item search-item",attrs:{"clear-value-text":t.$t("common.clear"),"load-options":t.loadListOptions,multiple:!1,options:t.orgList,placeholder:t.$t("table.station.orgId"),searchable:!0},model:{value:t.queryParams.model.orgId.key,callback:function(e){t.$set(t.queryParams.model.orgId,"key",e)},expression:"queryParams.model.orgId.key"}}),i("el-date-picker",{staticClass:"filter-item search-item date-range-item",attrs:{"range-separator":null,"end-placeholder":"结束日期",format:"yyyy-MM-dd HH:mm:ss","start-placeholder":"开始日期",type:"daterange","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.queryParams.timeRange,callback:function(e){t.$set(t.queryParams,"timeRange",e)},expression:"queryParams.timeRange"}}),i("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"primary"},on:{click:t.search}},[t._v(t._s(t.$t("table.search")))]),i("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"warning"},on:{click:t.reset}},[t._v(t._s(t.$t("table.reset")))]),i("el-button",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["station:add"],expression:"['station:add']"}],staticClass:"filter-item",attrs:{plain:"",type:"danger"},on:{click:t.add}},[t._v(" "+t._s(t.$t("table.add"))+" ")]),i("el-dropdown",{directives:[{name:"has-any-permission",rawName:"v-has-any-permission",value:["station:delete","station:export","station:import"],expression:"['station:delete','station:export','station:import']"}],staticClass:"filter-item",attrs:{trigger:"click"}},[i("el-button",[t._v(" "+t._s(t.$t("table.more"))+" "),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["station:delete"],expression:"['station:delete']"}],nativeOn:{click:function(e){return t.batchDelete(e)}}},[t._v(" "+t._s(t.$t("table.delete"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["station:export"],expression:"['station:export']"}],nativeOn:{click:function(e){return t.exportExcel(e)}}},[t._v(" "+t._s(t.$t("table.export"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["station:export"],expression:"['station:export']"}],nativeOn:{click:function(e){return t.exportExcelPreview(e)}}},[t._v(" "+t._s(t.$t("table.exportPreview"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["station:import"],expression:"['station:import']"}],nativeOn:{click:function(e){return t.importExcel(e)}}},[t._v(" "+t._s(t.$t("table.import"))+" ")])],1)],1)],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],key:t.tableKey,ref:"table",staticStyle:{width:"100%"},attrs:{data:t.tableData.records,border:"",fit:"","row-key":"id"},on:{"filter-change":t.filterChange,"selection-change":t.onSelectChange,"sort-change":t.sortChange,"cell-click":t.cellClick}},[i("el-table-column",{attrs:{align:"center",type:"selection",width:"40px","reserve-selection":!0}}),i("el-table-column",{attrs:{label:t.$t("table.station.name"),"show-overflow-tooltip":!0,align:"center",prop:"name"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(e.row.name))])]}}])}),i("el-table-column",{attrs:{label:t.$t("table.station.describe"),"show-overflow-tooltip":!0,align:"center",prop:"describe"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(e.row.describe))])]}}])}),i("el-table-column",{attrs:{label:t.$t("table.station.orgId"),align:"center","show-overflow-tooltip":!0,width:"180px"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(" "+t._s(e.row.org.data?e.row.org.data.label:e.row.org.key)+" ")])]}}])}),i("el-table-column",{attrs:{"filter-multiple":!1,"column-key":"status",filters:[{text:t.$t("common.status.valid"),value:!0},{text:t.$t("common.status.invalid"),value:!1}],label:t.$t("table.station.status"),"class-name":"status-col",width:"70px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("el-tag",{attrs:{type:t._f("statusFilter")(a.status)}},[t._v(t._s(a.status?t.$t("common.status.valid"):t.$t("common.status.invalid"))+" ")])]}}])}),i("el-table-column",{attrs:{label:t.$t("table.createTime"),align:"center",prop:"createTime",sortable:"custom",width:"170px"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(e.row.createTime))])]}}])}),i("el-table-column",{attrs:{label:t.$t("table.operation"),align:"center","column-key":"operation","class-name":"small-padding fixed-width",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["station:update"],expression:"['station:update']"}],staticClass:"el-icon-edit table-operation",staticStyle:{color:"#2db7f5"},on:{click:function(e){return t.edit(a)}}}),i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["station:delete"],expression:"['station:delete']"}],staticClass:"el-icon-delete table-operation",staticStyle:{color:"#f50"},on:{click:function(e){return t.singleDelete(a)}}}),i("el-link",{directives:[{name:"has-no-permission",rawName:"v-has-no-permission",value:["station:update","station:delete"],expression:"['station:update', 'station:delete']"}],staticClass:"no-perm"},[t._v(t._s(t.$t("tips.noPermission"))+" ")])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.tableData.total>0,expression:"tableData.total > 0"}],attrs:{limit:t.queryParams.size,page:t.queryParams.current,total:Number(t.tableData.total)},on:{"update:limit":function(e){return t.$set(t.queryParams,"size",e)},"update:page":function(e){return t.$set(t.queryParams,"current",e)},pagination:t.fetch}}),i("station-edit",{ref:"edit",attrs:{"dialog-visible":t.dialog.isVisible,type:t.dialog.type},on:{close:t.editClose,success:t.editSuccess}}),i("file-import",{ref:"import",attrs:{"dialog-visible":t.fileImport.isVisible,type:t.fileImport.type,action:t.fileImport.action,accept:".xls,.xlsx"},on:{close:t.importClose,success:t.importSuccess}}),i("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!0,title:"预览",width:"80%",top:"50px",visible:t.preview.isVisible},on:{"update:visible":function(e){return t.$set(t.preview,"isVisible",e)}}},[i("el-scrollbar",[i("div",{domProps:{innerHTML:t._s(t.preview.context)}})])],1)],1)},s=[],o=(i("4160"),i("caad"),i("d81d"),i("d3b7"),i("ac1f"),i("2532"),i("841c"),i("1276"),i("159b"),i("5530")),n=i("ca17"),r=i.n(n),l=(i("542c"),i("a888")),c=i("6188"),u=i("333d"),m=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{"close-on-click-modal":!1,"close-on-press-escape":!0,title:t.title,type:t.type,visible:t.isVisible,width:t.width,top:"50px"},on:{"update:visible":function(e){t.isVisible=e}}},[i("el-form",{ref:"form",attrs:{model:t.station,rules:t.rules,"label-position":"right","label-width":"100px"}},[i("el-form-item",{attrs:{label:t.$t("table.station.name"),prop:"name"}},[i("el-input",{model:{value:t.station.name,callback:function(e){t.$set(t.station,"name",e)},expression:"station.name"}})],1),i("el-form-item",{attrs:{label:t.$t("table.station.orgId"),prop:"orgId"}},[i("treeselect",{staticStyle:{width:"100%"},attrs:{"clear-value-text":t.$t("common.clear"),"load-options":t.loadListOptions,multiple:!1,options:t.orgList,searchable:!0,placeholder:" "},model:{value:t.station.org.key,callback:function(e){t.$set(t.station.org,"key",e)},expression:"station.org.key"}})],1),i("el-form-item",{attrs:{label:t.$t("table.station.status"),prop:"status"}},[i("el-radio-group",{model:{value:t.station.status,callback:function(e){t.$set(t.station,"status",e)},expression:"station.status"}},[i("el-radio",{attrs:{label:!0}},[t._v(t._s(t.$t("common.status.valid")))]),i("el-radio",{attrs:{label:!1}},[t._v(t._s(t.$t("common.status.invalid")))])],1)],1),i("el-form-item",{attrs:{label:t.$t("table.station.describe"),prop:"describe"}},[i("el-input",{model:{value:t.station.describe,callback:function(e){t.$set(t.station,"describe",e)},expression:"station.describe"}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(e){t.isVisible=!1}}},[t._v(t._s(t.$t("common.cancel")))]),i("el-button",{attrs:{plain:"",type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("common.confirm")))])],1)],1)},d=[],p=i("2d64"),h={name:"StationEdit",components:{Treeselect:r.a},props:{dialogVisible:{type:Boolean,default:!1},type:{type:String,default:"add"}},data:function(){var t=this;return{remoteStationLoading:!1,station:this.initStation(),screenWidth:0,width:this.initWidth(),orgList:[],stationList:[],rules:{name:[{required:!0,message:this.$t("rules.require"),trigger:"blur"},{min:1,max:255,message:this.$t("rules.range4to10"),trigger:"blur"},{validator:function(e,i,a){t.station.id,a()},trigger:"blur"}],status:{required:!0,message:this.$t("rules.require"),trigger:"blur"}}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){return"add"===this.type?this.$t("common.add"):this.$t("common.edit")}},watch:{},mounted:function(){var t=this;window.onresize=function(){return function(){t.width=t.initWidth()}()}},methods:{initStation:function(){return{id:"",name:"",org:{key:null,data:null},status:!0,describe:""}},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"800px"},loadListOptions:function(t){var e=t.callback;e()},setStation:function(t,e){var i=this;i.orgList=e,t&&(i.station=Object(o["a"])({},t))},close:function(){this.$emit("close")},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.station=this.initStation()},submitForm:function(){var t=this;this.$refs.form.validate((function(e){if(!e)return!1;t.editSubmit()}))},editSubmit:function(){var t=this;"add"===t.type?t.save():t.update()},save:function(){var t=this;p["a"].save(this.station).then((function(e){var i=e.data;i.isSuccess&&(t.isVisible=!1,t.$message({message:t.$t("tips.createSuccess"),type:"success"}),t.$emit("success"))}))},update:function(){var t=this;p["a"].update(this.station).then((function(e){var i=e.data;i.isSuccess&&(t.isVisible=!1,t.$message({message:t.$t("tips.updateSuccess"),type:"success"}),t.$emit("success"))}))}}},f=h,b=i("2877"),v=Object(b["a"])(f,m,d,!1,null,"64b2cd55",null),g=v.exports,y=i("c38b"),w=i("1771"),$={name:"StationManage",directives:{elDragDialog:l["a"]},components:{Pagination:u["a"],StationEdit:g,Treeselect:r.a,FileImport:c["a"]},filters:{statusFilter:function(t){var e={false:"danger",true:"success"};return e[t]||"success"}},data:function(){return{dialog:{isVisible:!1,type:"add"},preview:{isVisible:!1,context:""},fileImport:{isVisible:!1,type:"import",action:"".concat("https://pos.admin.api.lotus-wallet.com","/station/import")},tableKey:0,orgList:[],queryParams:Object(w["e"])({model:{orgId:{key:null}}}),selection:[],loading:!1,tableData:{total:0}}},computed:{},watch:{$route:function(){"/user/station"===this.$route.path&&this.initOrg()}},mounted:function(){this.initOrg(),this.fetch()},methods:{initOrg:function(){var t=this;y["a"].allTree({status:!0}).then((function(e){var i=e.data;t.orgList=i.data})).catch((function(){t.$message({message:t.$t("tips.getDataFail"),type:"error"})}))},loadListOptions:function(t){var e=t.callback;e()},editClose:function(){this.dialog.isVisible=!1},editSuccess:function(){this.search()},onSelectChange:function(t){this.selection=t},search:function(){this.fetch(Object(o["a"])({},this.queryParams))},reset:function(){this.queryParams=Object(w["e"])({model:{orgId:{key:null}}}),this.$refs.table.clearSort(),this.$refs.table.clearFilter(),this.search()},exportExcelPreview:function(){var t=this;this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.map.fileName="导出岗位数据",p["a"].preview(Object(o["a"])(Object(o["a"])({},this.queryParams),{size:1e4})).then((function(e){var i=e.data;t.preview.isVisible=!0,t.preview.context=i.data}))},exportExcel:function(){this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.map.fileName="导出岗位数据",p["a"].export(Object(o["a"])(Object(o["a"])({},this.queryParams),{size:1e4})).then((function(t){Object(w["a"])(t)}))},importExcel:function(){this.fileImport.type="upload",this.fileImport.isVisible=!0,this.$refs.import.setModel(!1)},importSuccess:function(){this.search()},importClose:function(){this.fileImport.isVisible=!1},singleDelete:function(t){this.$refs.table.clearSelection(),this.$refs.table.toggleRowSelection(t,!0),this.batchDelete()},batchDelete:function(){var t=this;this.selection.length?this.$confirm(this.$t("tips.confirmDelete"),this.$t("common.tips"),{confirmButtonText:this.$t("common.confirm"),cancelButtonText:this.$t("common.cancel"),type:"warning"}).then((function(){var e=[];t.selection.forEach((function(t){e.push(t.id)})),t.delete(e)})).catch((function(){t.clearSelections()})):this.$message({message:this.$t("tips.noDataSelected"),type:"warning"})},clearSelections:function(){this.$refs.table.clearSelection()},delete:function(t){var e=this;p["a"].delete({ids:t}).then((function(t){var i=t.data;i.isSuccess&&e.$message({message:e.$t("tips.deleteSuccess"),type:"success"}),e.search()}))},add:function(){this.dialog.type="add",this.dialog.isVisible=!0,this.$refs.edit.setStation(!1,this.orgList)},edit:function(t){this.$refs.edit.setStation(t,this.orgList),this.dialog.type="edit",this.dialog.isVisible=!0},fetch:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.loading=!0,this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.current=e.current?e.current:this.queryParams.current,this.queryParams.size=e.size?e.size:this.queryParams.size,p["a"].page(this.queryParams).then((function(e){var i=e.data;i.isSuccess&&(t.tableData=i.data)})).finally((function(){return t.loading=!1}))},sortChange:function(t){this.queryParams.sort=t.prop,this.queryParams.order=t.order,this.queryParams.sort&&this.search()},filterChange:function(t){for(var e in t)if(e.includes(".")){var i={};i[e.split(".")[1]]=t[e][0],this.queryParams.model[e.split(".")[0]]=i}else this.queryParams.model[e]=t[e][0];this.search()},cellClick:function(t,e){var i=this;if("operation"!==e["columnKey"]){var a=!1;this.selection.forEach((function(e){e.id===t.id&&(a=!0,i.$refs.table.toggleRowSelection(t))})),a||this.$refs.table.toggleRowSelection(t,!0)}}}},x=$,P=Object(b["a"])(x,a,s,!1,null,"0168e1b3",null);e["default"]=P.exports}}]);