EMS2.0-Documents/7.部署文档/Window安装/项目前端文件/IEMS/js/chunk-3f1e6e41.f87b2bd5.js

2 lines
20 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3f1e6e41"],{"0e8f":function(e,t,i){"use strict";i.d(t,"d",(function(){return n})),i.d(t,"e",(function(){return l})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return c})),i.d(t,"b",(function(){return u}));var a=i("b775"),s=i("4328"),r=i.n(s);function n(e){return Object(a["a"])({url:"user-service/dept/getDeptTreeList",method:"get",params:e})}function l(e){return Object(a["a"])({url:"user-service/dept/getDeptSubByDeptId",method:"get",params:e})}function o(e){var t=r.a.stringify(e);return Object(a["a"])({url:"user-service/dept/updateDept",method:"post",data:t})}function c(e){var t=r.a.stringify(e);return Object(a["a"])({url:"user-service/dept/saveDept",method:"post",data:t})}function u(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"user-service/dept/removeDept",method:"get",params:e})}},"14cb":function(e,t,i){"use strict";i("1a02")},"1a02":function(e,t,i){},"333d":function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pagination-container"},[i("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},s=[],r=(i("a9e3"),{name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:0},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[5,10,20,30,70]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e})},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize})}}}),n=r,l=(i("14cb"),i("2877")),o=Object(l["a"])(n,a,s,!1,null,"4dfad654",null);t["a"]=o.exports},4381:function(e,t,i){"use strict";i("d3b7"),i("caad"),i("2532"),i("d9e2");var a=i("4360"),s={inserted:function(e,t){var i=t.value,s=a["a"].getters&&a["a"].getters.butPermission;if(console.log(s,"roles"),!(i&&i instanceof Array&&i.length>0))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");var r=i,n=s.some((function(e){return r.includes(e)}));if(console.log(n,"hasPermission"),n)a["a"].state.user.permissionFlag[r]=!1;else{a["a"].state.user.permissionFlag[r]=!0,console.log(a["a"].state.user.permissionFlag[r],"permissionRoles");var l=document.createElement("div");l.style.cursor="not-allowed",l.style.display="inline-block",e.style.pointerEvents="none",e.parentNode.insertBefore(l,e),e.parentNode&&e.parentNode.removeChild(e),l.appendChild(e),console.log(e,"permissionRoles")}}},r=function(e){e.directive("permission",s)};window.Vue&&(window["permission"]=s,Vue.use(r)),s.install=r;t["a"]=s},"571f":function(e,t,i){"use strict";i.d(t,"e",(function(){return s})),i.d(t,"f",(function(){return r})),i.d(t,"d",(function(){return n})),i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return c})),i.d(t,"g",(function(){return u}));var a=i("b775");function s(e){return Object(a["a"])({url:"device-service/site/getSiteList",method:"get",params:e})}function r(e){return Object(a["a"])({url:"device-service/site/getUnChoiceDevice",method:"get",params:e})}function n(e){return Object(a["a"])({url:"device-service/site/getHasChoiceDevice",method:"get",params:e})}function l(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"device-service/site/addSite",method:"post",data:e})}function o(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"device-service/site/addSiteDevice",method:"post",data:e})}function c(e){var t={siteById:e};return Object(a["a"])({url:"device-service/site/deleteSite",method:"delete",params:t})}function u(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"device-service/site/updateSite",method:"put",data:e})}},"599c":function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"d",(function(){return l})),i.d(t,"e",(function(){return o}));var a=i("b775");function s(e){return Object(a["a"])({url:"user-service/area/getAreaTreeList",method:"get",params:e})}function r(e){return Object(a["a"])({url:"user-service/area/getAreaSubByAreaId",method:"get",params:e})}function n(e){return Object(a["a"])({url:"user-service/area/removeArea",method:"get",params:e})}function l(e){return Object(a["a"])({url:"user-service/area/saveArea",method:"post",data:e})}function o(e){return Object(a["a"])({url:"user-service/area/updateArea",method:"post",data:e})}},"91b6":function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return l}));var a=i("b775"),s=i("4328"),r=i.n(s);function n(e,t){var i=new FormData;return i.append("file",e),i.append("host",t),Object(a["a"])({headers:{"Content-Type":"multipart/form-data"},url:"trajectory-service/file/uploadFile",method:"post",data:i})}function l(e,t){var i={host:t,fileUrl:e};return i=r.a.stringify(i),Object(a["a"])({url:"trajectory-service/file/deleteFileByUrl",method:"post",data:i})}},b4a6:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"decorate"}),i("div",{staticClass:"filter-container"},[i("el-cascader",{staticClass:"filter-item",attrs:{"show-all-levels":!1,options:e.deptIdList,placeholder:e.$t("listQuery.deptId"),props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},on:{change:e.handleFilter},model:{value:e.listQuery.deptId,callback:function(t){e.$set(e.listQuery,"deptId",t)},expression:"listQuery.deptId"}}),i("el-input",{staticClass:"filter-item",attrs:{placeholder:e.$t("site.siteName")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter.apply(null,arguments)}},model:{value:e.listQuery.siteName,callback:function(t){e.$set(e.listQuery,"siteName",t)},expression:"listQuery.siteName"}}),i("el-input",{staticClass:"filter-item",attrs:{placeholder:e.$t("site.siteCode")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter.apply(null,arguments)}},model:{value:e.listQuery.siteCode,callback:function(t){e.$set(e.listQuery,"siteCode",t)},expression:"listQuery.siteCode"}}),i("span",{staticClass:"btn-item",on:{click:e.handleFilter}},[i("i",{staticClass:"iconfont icon-sousuo"}),e._v(" "+e._s(e.$t("btn.search")))]),i("span",{staticClass:"btn-item",on:{click:e.clearListQuery}},[i("i",{staticClass:"el-icon-refresh-left"}),e._v(" "+e._s(e.$t("btn.resetting")))]),i("div",{staticClass:"control-container"},[i("span",{staticClass:"btn-item",on:{click:function(t){return e.handleCreate()}}},[i("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("site.addSite")))])])],1),i("div",{staticClass:"table-container"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,fit:"","max-height":"580","highlight-current-row":"","header-row-class-name":"table-header","row-class-name":"table-row"}},[i("el-table-column",{attrs:{property:"siteName",align:"left",label:e.$t("site.siteName")}}),i("el-table-column",{attrs:{property:"siteCode",align:"left",label:e.$t("site.siteCode")}}),i("el-table-column",{attrs:{property:"deptName",align:"left",label:e.$t("listQuery.deptId")}}),i("el-table-column",{attrs:{property:"longitude",align:"left",label:e.$t("table.longitude")}}),i("el-table-column",{attrs:{property:"latitude",align:"left",label:e.$t("table.latitude")}}),i("el-table-column",{attrs:{property:"address",align:"left",label:e.$t("table.address")}}),i("el-table-column",{attrs:{label:e.$t("table.operate"),width:"360",align:"left"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",{staticClass:"btnCancel",attrs:{title:e.$t("table.update")},on:{click:function(i){return e.handleUpdate(t)}}},[i("i",{staticClass:"iconfont icon-bianji"}),e._v(e._s(e.$t("table.update")))]),i("span",{staticClass:"btnCancel",attrs:{title:e.$t("site.associated")},on:{click:function(i){return e.openDevice(t)}}},[i("i",{staticClass:"iconfont icon-jiguiliebiao"}),e._v(e._s(e.$t("site.associated")))]),i("span",{staticClass:"btnCancel delete",attrs:{title:e.$t("table.delete")},on:{click:function(i){return e.handleDelete(t)}}},[i("i",{staticClass:"iconfont icon-a--"}),e._v(e._s(e.$t("table.delete")))])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.curPage,limit:e.listQuery.pageSize},on:{"update:page":function(t){return e.$set(e.listQuery,"curPage",t)},"update:limit":function(t){return e.$set(e.listQuery,"pageSize",t)},pagination:e.getList}})],1),i("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.textMap[e.dialogStatus],visible:e.addDialog},on:{"update:visible":function(t){e.addDialog=t}}},[i("el-form",{ref:"form",attrs:{rules:e.rules,"status-icon":"",model:e.form,inline:"","label-width":"130px"}},[i("el-form-item",{attrs:{label:e.$t("site.siteName"),prop:"siteName"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("site.siteName"),maxlength:"20"},model:{value:e.form.siteName,callback:function(t){e.$set(e.form,"siteName",t)},expression:"form.siteName"}})],1),i("el-form-item",{attrs:{label:e.$t("site.siteCode"),prop:"siteCode"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("site.siteCode"),maxlength:"20",disabled:"update"===e.dialogStatus},model:{value:e.form.siteCode,callback:function(t){e.$set(e.form,"siteCode",t)},expression:"form.siteCode"}})],1),i("el-form-item",{attrs:{label:e.$t("listQuery.deptId"),prop:"deptId"}},[i("el-cascader",{attrs:{"show-all-levels":!1,options:e.deptIdList,props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},on:{change:function(t){return e.handleChange(e.form)}},model:{value:e.form.deptId,callback:function(t){e.$set(e.form,"deptId",t)},expression:"form.deptId"}})],1),i("el-form-item",{attrs:{label:e.$t("listQuery.areaId"),prop:"areaId"}},[i("el-cascader",{attrs:{"show-all-levels":!1,options:e.areaIdList,props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},model:{value:e.form.areaId,callback:function(t){e.$set(e.form,"areaId",t)},expression:"form.areaId"}})],1),i("el-form-item",{attrs:{label:e.$t("site.director"),prop:"director"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("site.director"),maxlength:"20"},model:{value:e.form.director,callback:function(t){e.$set(e.form,"director",t)},expression:"form.director"}})],1),i("el-form-item",{attrs:{label:e.$t("table.longitude"),prop:"longitude"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("table.longitude"),maxlength:"20"},model:{value:e.form.longitude,callback:function(t){e.$set(e.form,"longitude",t)},expression:"form.longitude"}})],1),i("el-form-item",{attrs:{label:e.$t("table.latitude"),prop:"latitude"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("table.latitude"),maxlength:"20"},model:{value:e.form.latitude,callback:function(t){e.$set(e.form,"latitude",t)},expression:"form.latitude"}})],1),i("el-form-item",{attrs:{label:e.$t("table.address"),prop:"address"}},[i("el-input",{attrs:{type:"textarea",placeholder:e.$t("pEnter")+e.$t("table.address"),maxlength:"100"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1),i("el-form-item",{staticStyle:{width:"100%"},attrs:{label:e.$t("device.photo")}},[i("el-upload",{ref:"upload",attrs:{action:"","file-list":e.fileList,"list-type":"picture-card","before-upload":e.beforeUpload,"on-success":e.handleFileSuccess,"on-error":e.handleFileError,"on-remove":e.handleRemove,"http-request":e.uploadFile}},[i("i",{staticClass:"el-icon-plus"})])],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("span",{staticClass:"btn-item long",on:{click:function(t){e.addDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),i("span",{staticClass:"btn-item long",on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(e._s(e.$t("btn.define")))])])],1),i("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.$t("site.associated"),visible:e.deviceDialog},on:{"update:visible":function(t){e.deviceDialog=t}}},[i("el-transfer",{ref:"transfers",staticStyle:{width:"800px",margin:"0px auto"},attrs:{filterable:"","filter-placeholder":e.$t("pEnter")+e.$t("device.deviceName"),titles:[e.$t("table.optional"),e.$t("table.selected")],data:e.deviceCanList,"target-order":"unshift"},model:{value:e.deviceList,callback:function(t){e.deviceList=t},expression:"deviceList"}}),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("span",{staticClass:"btn-item long",on:{click:function(t){e.deviceDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),i("span",{staticClass:"btn-item long",on:{click:e.openDeviceUpdata}},[e._v(e._s(e.$t("btn.define")))])])],1)],1)},s=[],r=i("1da1"),n=(i("96cf"),i("d9e2"),i("d81d"),i("d3b7"),i("159b"),i("ac1f"),i("00b4"),i("571f")),l=i("599c"),o=i("0e8f"),c=i("91b6"),u=i("333d"),d=i("4381"),p={components:{Pagination:u["a"]},directives:{permission:d["a"]},data:function(){var e=this,t=function(t,i,a){e.form.picture?a():a(new Error(e.$t("pEnter")+e.$t("device.photo")))};return{total:0,listQuery:{deptId:null,siteName:null,siteCode:null,curPage:1,pageSize:10},addDialog:!1,deviceDialog:!1,textMap:{update:this.$t("table.update"),create:this.$t("table.create")},dialogStatus:"",form:{siteId:"",siteName:"",siteCode:"",deptId:"",director:"",longitude:"",latitude:"",address:"",picture:""},deptIdList:[],list:null,listLoading:!1,createStatus:!1,siteId:null,siteCode:null,deviceCanList:[],deviceList:[],fileList:[],File:[],fileUrl:[],url:"",rules:{picture:[{required:!0,validator:t,trigger:"change"}],siteName:[{required:!0,message:this.$t("pEnter")+this.$t("site.siteName"),trigger:"blur"}],siteCode:[{required:!0,message:this.$t("pEnter")+this.$t("site.siteCode"),trigger:"blur"}],deptId:[{required:!0,message:this.$t("pSelect")+this.$t("listQuery.deptId"),trigger:"blur"}],longitude:[{required:!0,message:this.$t("pEnter")+this.$t("table.longitude"),trigger:"blur"}],latitude:[{required:!0,message:this.$t("pEnter")+this.$t("table.latitude"),trigger:"blur"}],address:[{required:!0,message:this.$t("pEnter")+this.$t("table.address"),trigger:"blur"}],director:[{required:!0,message:this.$t("pEnter")+this.$t("site.director"),trigger:"blur"}]}}},created:function(){var e=this;this.url=this.$store.state.user.url+"/trajectory-service",this.getList(),Object(o["e"])().then((function(t){e.deptIdList=t.data&&e.getdeptIdList(t.data)})),Object(l["a"])().then((function(t){e.areaIdList=t.data&&e.getAreaIdList(t.data)}))},methods:{getList:function(){var e=this;this.listLoading=!0,Object(n["e"])(this.listQuery).then((function(t){e.listLoading=!1,console.log(t),e.list=t.data.list,e.total=t.data.totalRow||0}))},getdeptIdList:function(e){var t=this;e.length||(e=[e]);var i=e.map((function(e){var i={};return e.subBeanList?(i.children=t.getdeptIdList(e.subBeanList),i.label=e.nodeBean.deptName,i.value=e.nodeBean.deptId,i):(i.label=e.nodeBean.deptName,i.value=e.nodeBean.deptId,i)}));return i},getAreaIdList:function(e){var t=this;e.length||(e=[e]);var i=e.map((function(e){var i={};return e.subList?(i.children=t.getAreaIdList(e.subList),i.label=e.areaName,i.value=e.areaId,i):(i.label=e.areaName,i.value=e.areaId,i)}));return i},createData:function(){var e=this;this.createStatus||this.$refs.form.validate((function(t){t&&(e.createStatus=!0,Object(n["a"])(e.form).then((function(t){200==t.status&&(e.addDialog=!1,e.createStatus=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.addSuccess"),type:"success",duration:3e3}),e.getList(),e.File.forEach((function(t){Object(c["a"])(t,e.url)})))})).catch((function(){e.createStatus=!1})))}))},updateData:function(){var e=this;this.$refs.form.validate((function(t){t&&Object(n["g"])(e.form).then((function(t){200==t.status&&(e.addDialog=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.updateSuccess"),type:"success",duration:3e3}),e.getList(),e.File.forEach((function(t){Object(c["a"])(t,e.url)})))}))}))},clearListQuery:function(){this.listQuery={deptId:null,siteName:null,siteCode:null,curPage:1,pageSize:10},this.getList()},resetForm:function(){for(var e in this.form)this.form[e]=null},handleCreate:function(){var e=this;this.resetForm(),this.fileList=[],this.addDialog=!0,this.dialogStatus="create",this.$nextTick((function(){e.$refs["form"].clearValidate()}))},handleFilter:function(){this.listQuery.curPage=1,""==this.listQuery.siteName&&(this.listQuery.siteName=null),""==this.listQuery.siteCode&&(this.listQuery.siteCode=null),this.getList()},handleUpdate:function(e){var t=this;this.pswAgain="",this.form={siteId:e.row.siteId,siteName:e.row.siteName,siteCode:e.row.siteCode,deptId:e.row.deptId,director:e.row.director,longitude:e.row.longitude,latitude:e.row.latitude,picture:e.row.picture,address:e.row.address,areaId:e.row.areaId},this.fileList=this.form.picture?[{name:"icon",url:this.form.picture}]:[],this.dialogStatus="update",this.addDialog=!0,this.$nextTick((function(){t.$refs["form"].clearValidate()}))},handleDelete:function(e){var t=this;this.$confirm(this.$t("title.delPointOutSite"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){Object(n["c"])(e.row.siteId).then((function(e){200==e.status&&(t.getList(),t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3}))}))}))},openDevice:function(e){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t.deviceCanList=[],t.deviceList=[],t.siteId=e.row.siteId,t.siteCode=e.row.siteCode,i.next=6,Object(n["f"])({siteCode:e.row.siteCode}).then((function(e){e.data.forEach((function(e){t.deviceCanList.push({label:e.deviceName,key:e.deviceCode})}))}));case 6:return i.next=8,Object(n["d"])({siteCode:e.row.siteCode}).then((function(e){e.data.forEach((function(e){t.deviceCanList.push({label:e.deviceName,key:e.deviceCode}),t.deviceList.push(e.deviceCode)}))}));case 8:t.deviceDialog=!0;case 9:case"end":return i.stop()}}),i)})))()},openDeviceUpdata:function(){var e=this,t=[];this.deviceList.forEach((function(i){t.push({siteCode:e.siteCode,deviceCode:i})}));var i={list:t,siteCode:this.siteCode};Object(n["b"])(i).then((function(t){200==t.status&&(e.deviceDialog=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.addSuccess"),type:"success",duration:3e3}),e.getList())})).catch((function(){}))},beforeUpload:function(e){if(console.log(this.form.picture),this.form.picture)return this.$message.error(this.$t("pictureUp.pDel")),!1;console.log(e,"file");var t=/^image\/(jpeg|png|jpg|(svg\+xml))$/.test(e.type),i=e.size/1024/1024<5;return t?i?t&&i:(this.$message.error(this.$t("pictureUp.size")),!1):(this.$message.error(this.$t("pictureUp.format")),!1)},handleFileSuccess:function(e){console.log(e,"handleFileSuccess"),200===e.status&&console.log(e,"200")},handleFileError:function(e){console.log(e,"err")},handleRemove:function(e,t){console.log(e,t,this.File),"create"===this.dialogStatus||this.File.length>=1?Object(c["a"])(this.form.picture,this.url):this.File.push(this.form.picture),this.form.picture=""},uploadFile:function(e){var t=this;console.log(e),Object(c["b"])(e.file,this.url).then((function(e){console.log(e),t.form.picture=e.data}))}}},f=p,m=i("2877"),h=Object(m["a"])(f,a,s,!1,null,"12861fd6",null);t["default"]=h.exports}}]);
//# sourceMappingURL=chunk-3f1e6e41.f87b2bd5.js.map