Newer
Older
baseResourceFront / lamp / static / js / chunk-21c3.98a5c5de.js
yangqianqian on 23 Mar 2021 14 KB 修改UI
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-21c3"],{"+SMu":function(t,e,l){"use strict";l.d(e,"b",function(){return r}),l.d(e,"e",function(){return a}),l.d(e,"c",function(){return n}),l.d(e,"a",function(){return i}),l.d(e,"d",function(){return s});var o=l("t3Un");function r(){return Object(o.a)({url:"/dict/code/lampDeviceType",method:"get"})}function a(){return Object(o.a)({url:"/dict/code/priority",method:"get"})}function n(){return Object(o.a)({url:"/dict/code/lampStrategyType",method:"get"})}function i(t){return Object(o.a)({url:"dict/code/controllerType",method:"get",params:t})}function s(t){return Object(o.a)({url:"dict/code/lamppostType",method:"get",params:t})}},"0ozX":function(t,e,l){"use strict";l.d(e,"a",function(){return a}),l.d(e,"c",function(){return n}),l.d(e,"b",function(){return i});var o=l("t3Un"),r=l("Kw5r");function a(t){var e=new FormData;e.append("file",t);var l=r.default.prototype.baseConfig.lampBasePath;return Object(o.a)({url:l+"busDeviceController/batchImport",method:"post",headers:{"Content-Type":"multipart/form-data"},data:e})}function n(t){var e=new FormData;e.append("file",t);var l=r.default.prototype.baseConfig.lampBasePath;return Object(o.a)({url:l+"busDeviceLamppost/batchImport",method:"post",headers:{"Content-Type":"multipart/form-data"},data:e})}function i(t){var e=new FormData;e.append("file",t);var l=r.default.prototype.baseConfig.lampBasePath;return Object(o.a)({url:l+"busDeviceLamp/batchImport",method:"post",headers:{"Content-Type":"multipart/form-data"},data:e})}},"72sP":function(t,e,l){},QZoD:function(t,e,l){"use strict";var o=l("YUc6");l.n(o).a},YUc6:function(t,e,l){},vA0w:function(t,e,l){"use strict";var o=l("72sP");l.n(o).a},weOJ:function(t,e,l){"use strict";l.r(e);var o=l("pMp9"),r=l("qpgI"),a=l("+SMu"),n={name:"EditController",components:{DeptSelect:o.a},data:function(){return{dialogFormVisible:!1,dialogStatus:"",controllerForm:{id:"",controllerCode:"",controllerType:"",deptId:"",teleId:"",plantform:""},textMap:{update:"编辑控制器",create:"新增控制器",detail:"详情"},rules:{controllerCode:[{required:!0,message:"控制器编号不能为空",trigger:["blur","change"]}],controllerType:[{required:!0,message:"控制器类型不能为空",trigger:["blur","change"],validator:function(t,e,l){return 0===e||""===e?l(new Error("请选择控制器类型")):l()}}]},controllerTypeList:[],isEditMode:!1,btnLoading:!0}},created:function(){this.fetchControllerType()},methods:{initDialog:function(t,e){var l=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.btnLoading=!1,this.dialogStatus=t,this.dialogFormVisible=e,"create"===t?(this.resetForm(),this.isEditMode=!1,this.$nextTick(function(){l.$refs.dataForm.clearValidate()})):"update"===t&&(this.controllerForm={id:o.id,controllerCode:o.controllerCode,controllerType:o.controllerType,deptId:o.deptId,teleId:o.teleId,plantform:o.plantform},this.isEditMode=!0)},fetchControllerType:function(){var t=this;Object(a.a)().then(function(e){200===e.code&&(t.controllerTypeList=e.data)})},resetForm:function(){this.controllerForm={controllerCode:"",controllerType:"",deptId:"",teleId:"",plantform:""},this.btnLoading=!1},saveData:function(){this.btnLoading=!0,"update"===this.dialogStatus?this.updateData():"create"===this.dialogStatus&&this.createData()},createData:function(){var t=this;this.$refs.dataForm.validate(function(e){e?Object(r.b)(t.controllerForm).then(function(e){200===e.code?t.$confirm("新增成功,是否继续新增?","提示",{confirmButtonText:"是",cancelButtonText:"否",type:"info"}).then(function(){t.resetForm(),t.$nextTick(function(){t.$refs.dataForm.clearValidate()})}).catch(function(){t.$emit("watchChild"),t.dialogFormVisible=!1}):t.btnLoading=!1}).catch(function(){t.btnLoading=!1}):t.btnLoading=!1})},updateData:function(){var t=this;this.$refs.dataForm.validate(function(e){e?Object(r.t)(t.controllerForm).then(function(e){200===e.code?(t.$message.success("修改成功"),t.cancel()):t.btnLoading=!1}).catch(function(){t.btnLoading=!1}):t.btnLoading=!1})},cancel:function(){this.dialogFormVisible=!1,this.$emit("watchChild")}}},i=(l("QZoD"),l("KHd+")),s=Object(i.a)(n,function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("el-dialog",{attrs:{title:t.textMap[t.dialogStatus],"close-on-click-modal":!1,visible:t.dialogFormVisible,"append-to-body":""},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[l("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.controllerForm,"label-well-code":"right","label-width":"110px"}},[l("el-row",{attrs:{gutter:20}},[l("el-col",{attrs:{span:12}},[l("el-form-item",{attrs:{label:"控制器编号",prop:"controllerCode"}},[l("el-input",{attrs:{readonly:t.isEditMode,maxlength:15,clearable:"",type:"text",placeholder:"必填","show-word-limit":""},model:{value:t.controllerForm.controllerCode,callback:function(e){t.$set(t.controllerForm,"controllerCode","string"==typeof e?e.trim():e)},expression:"controllerForm.controllerCode"}})],1)],1),t._v(" "),l("el-col",{attrs:{span:12}},[l("el-form-item",{attrs:{label:"控制器类型",prop:"controllerType"}},[l("el-select",{attrs:{placeholder:"请选择控制器型号",clearable:""},model:{value:t.controllerForm.controllerType,callback:function(e){t.$set(t.controllerForm,"controllerType",e)},expression:"controllerForm.controllerType"}},t._l(t.controllerTypeList,function(t){return l("el-option",{key:t.value,attrs:{label:t.name,value:t.value}})}))],1)],1)],1),t._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{attrs:{span:15}},[l("el-form-item",{attrs:{label:"所属组织"}},[l("dept-select",{attrs:{"dept-show":!0,"need-top":!0,placeholder:"所属组织"},model:{value:t.controllerForm.deptId,callback:function(e){t.$set(t.controllerForm,"deptId",e)},expression:"controllerForm.deptId"}})],1)],1)],1),t._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{attrs:{span:15}},[l("el-form-item",{attrs:{label:"物联网平台"}},[l("el-input",{attrs:{maxlength:30,clearable:"",type:"text","show-word-limit":""},model:{value:t.controllerForm.plantform,callback:function(e){t.$set(t.controllerForm,"plantform","string"==typeof e?e.trim():e)},expression:"controllerForm.plantform"}})],1)],1)],1),t._v(" "),l("el-row",{attrs:{gutter:20}},[l("el-col",{attrs:{span:15}},[l("el-form-item",{attrs:{label:"电信设备编号"}},[l("el-input",{attrs:{clearable:"",type:"text",placeholder:"非必填"},model:{value:t.controllerForm.teleId,callback:function(e){t.$set(t.controllerForm,"teleId","string"==typeof e?e.trim():e)},expression:"controllerForm.teleId"}})],1)],1)],1)],1),t._v(" "),l("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[l("el-button",{attrs:{loading:t.btnLoading,type:"primary"},on:{click:t.saveData}},[t._v("保存")]),t._v(" "),l("el-button",{on:{click:t.cancel}},[t._v("取消")])],1)],1)},[],!1,null,"79f1bcf7",null);s.options.__file="editController.vue";var c=s.exports,d=l("0ozX"),u={name:"BusController",components:{EditController:c,DeptSelect:o.a},data:function(){return{fileList:[],listQuery:{controllerCode:"",controllerType:"",status:"",offset:1,limit:20,sort:"",order:""},columns:[{text:"控制器编号",value:"controllerCode",align:"center",width:140},{text:"控制器类型",value:"controllerTypeName",align:"center"},{text:"所属组织",value:"deptName",align:"center"},{text:"电信设备编号",value:"teleId",align:"center"},{text:"物联网平台",value:"plantform",align:"center"}],multipleSelection:[],list:[],total:0,controllerTypeList:[],statusList:[{value:"1",name:"在线"},{value:"0",name:"离线"}],listLoading:!1,fullscreenLoading:!1,dialogFormVisible:!1}},created:function(){this.fetchControllerType(),this.fetchData()},methods:{uploadFile:function(t){var e=this,l=t.file;if(!(l.size/1024/1024<5))return this.$message.error("请上传5M以下的excel文件"),!1;var o=this.$loading({lock:!0,text:"导入中,请稍后...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});Object(d.a)(l).then(function(t){o.close(),200===t.code?(e.$message.success("导入成功"),e.fileList=[],e.fetchData()):e.$message.error(t.message)}).catch(function(t){o.close(),e.$message.error(t.message)}),this.fileList=[]},batchExport:function(){var t=this,e=this.$loading({lock:!0,text:"下载中,请稍后...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});Object(r.n)(this.listQuery).then(function(t){e.close(),console.log("download===",t);var l=new Blob([t.data]),o=document.createElement("a"),r=window.URL.createObjectURL(l);o.href=r,o.download="控制器列表.xlsx",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(r)}).catch(function(l){e.close(),t.$message.error(l.message)})},checkSelection:function(){return 0!==this.multipleSelection.length},clearInput:function(){this.listQuery={controllerCode:"",controllerType:"",offset:1,limit:20,sort:"",order:""},this.fetchData(!1)},add:function(){this.dialogFormVisible=!0,this.$refs.editController.initDialog("create",this.dialogFormVisible)},edit:function(t){this.dialogFormVisible=!0,this.$refs.editController.initDialog("update",this.dialogFormVisible,t)},del:function(){var t=this;if(this.checkSelection()){var e=[];this.multipleSelection.forEach(function(t,l){e.push(t.id)}),this.$confirm("确定要删除所选控制器吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r.h)(e).then(function(e){200===e.code&&(t.$message.success("删除成功"),t.fetchData())})})}else this.$message.error("至少选中一项")},search:function(){this.fetchData(!1)},fetchData:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.listLoading=!0,console.log(this.listQuery),e||(this.listQuery.offset=1),Object(r.E)(this.listQuery).then(function(e){200===e.code?(t.list=e.data.rows,t.total=parseInt(e.data.total)):t.$message.error(e.message),t.listLoading=!1})},fetchControllerType:function(){var t=this;Object(a.a)().then(function(e){200===e.code&&(t.controllerTypeList=e.data)})},indexMethod:function(t){return this.listQuery.limit*(this.listQuery.offset-1)+t+1},handleSizeChange:function(t){this.listQuery.limit=t,this.fetchData()},handleCurrentChange:function(t){this.listQuery.offset=t,this.fetchData()},handleSelectionChange:function(t){this.multipleSelection=t}}},p=(l("vA0w"),Object(i.a)(u,function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("div",{staticClass:"app-container"},[l("div",{staticClass:"search-div"},[l("div",{staticClass:"search-left"},[l("el-form",{ref:"selectForm",staticClass:"form-container",attrs:{inline:!0,model:t.listQuery}},[l("el-row",[l("el-col",{attrs:{span:4}},[l("el-form-item",{staticClass:"selectForm-container-item"},[l("el-input",{attrs:{placeholder:"控制器编号",clearable:""},model:{value:t.listQuery.controllerCode,callback:function(e){t.$set(t.listQuery,"controllerCode","string"==typeof e?e.trim():e)},expression:"listQuery.controllerCode"}})],1)],1),t._v(" "),l("el-col",{attrs:{span:4}},[l("el-form-item",{staticClass:"selectForm-container-item"},[l("el-select",{attrs:{placeholder:"控制器类型",clearable:""},model:{value:t.listQuery.controllerType,callback:function(e){t.$set(t.listQuery,"controllerType",e)},expression:"listQuery.controllerType"}},t._l(t.controllerTypeList,function(t){return l("el-option",{key:t.value,attrs:{label:t.name,value:t.value}})}))],1)],1),t._v(" "),l("el-col",{attrs:{span:4}},[l("el-form-item",{staticClass:"selectForm-container-item"},[l("dept-select",{attrs:{"dept-show":!0,"need-top":!0,placeholder:"所属组织"},model:{value:t.listQuery.deptId,callback:function(e){t.$set(t.listQuery,"deptId",e)},expression:"listQuery.deptId"}})],1)],1),t._v(" "),l("el-col",{attrs:{span:4}},[l("el-form-item",{staticClass:"selectForm-container-item"},[l("el-select",{attrs:{placeholder:"选择设备状态",clearable:""},model:{value:t.listQuery.status,callback:function(e){t.$set(t.listQuery,"status",e)},expression:"listQuery.status"}},t._l(t.statusList,function(t){return l("el-option",{key:t.value,attrs:{label:t.name,value:t.value}})}))],1)],1),t._v(" "),l("el-col",{staticClass:"search-right",attrs:{span:6}},[l("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.search}},[t._v("搜索")])],1)],1)],1)],1)]),t._v(" "),l("div",[l("el-row",{staticClass:"table-title"},[l("el-col",{attrs:{span:4}},[l("div",{staticClass:"title-header"},[l("i",{staticClass:"el-icon-menu"}),t._v("数据列表")])]),t._v(" "),l("el-col",{staticClass:"edit_btns",attrs:{span:14,offset:6}},[t.hasPerm("/controller/delete")?l("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:t.del}},[t._v("删除")]):t._e(),t._v(" "),l("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:t.add}},[t._v("新增")]),t._v(" "),l("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:t.batchExport}},[t._v("导出")]),t._v(" "),l("el-upload",{staticClass:"edit_btn",staticStyle:{display:"inline"},attrs:{limit:1,"show-file-list":!1,"http-request":t.uploadFile,"file-list":t.fileList,action:"string",accept:".xls,.xlsx"}},[l("el-button",{attrs:{size:"small"}},[t._v("批量导入")])],1)],1)],1),t._v(" "),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticClass:"table",attrs:{data:t.list,border:""},on:{"selection-change":t.handleSelectionChange}},[t.hasPerm("/controller/delete")?l("el-table-column",{attrs:{align:"center",type:"selection",width:"55"}}):t._e(),t._v(" "),l("el-table-column",{attrs:{index:t.indexMethod,align:"center",type:"index",label:"#",width:"55"}}),t._v(" "),t._l(t.columns,function(e){return l("el-table-column",{key:e.value,attrs:{label:e.text,width:e.width,align:e.align,"show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(o){return[l("span",{class:e.class},[t._v(t._s(o.row[e.value]))])]}}])})}),t._v(" "),l("el-table-column",{attrs:{label:"操作",align:"center",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.hasPerm("/controller/edit")?l("el-button",{attrs:{type:"text"},on:{click:function(l){t.edit(e.row)}}},[t._v("编辑")]):t._e()]}}])})],2)],1),t._v(" "),l("div",{staticClass:"pagination-container"},[l("el-pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>t.listQuery.limit,expression:"total>listQuery.limit"}],attrs:{"current-page":t.listQuery.offset,"page-sizes":[20,30,50],"page-size":t.listQuery.limit,total:t.total,align:"center",layout:"total, sizes, prev, pager, next"},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),t._v(" "),l("edit-controller",{ref:"editController",on:{watchChild:t.fetchData}})],1)},[],!1,null,"cc06f0e0",null));p.options.__file="busController.vue";e.default=p.exports}}]);