EMS2.0-Documents/7.部署文档/Linux安装/项目前端文件/IEMS/js/chunk-cfcd9af8.d43d4123.js

2 lines
14 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cfcd9af8"],{"0e8f":function(t,e,a){"use strict";a.d(e,"d",(function(){return l})),a.d(e,"e",(function(){return n})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){return c})),a.d(e,"b",(function(){return u}));var s=a("b775"),i=a("4328"),r=a.n(i);function l(t){return Object(s["a"])({url:"user-service/dept/getDeptTreeList",method:"get",params:t})}function n(t){return Object(s["a"])({url:"user-service/dept/getDeptSubByDeptId",method:"get",params:t})}function o(t){var e=r.a.stringify(t);return Object(s["a"])({url:"user-service/dept/updateDept",method:"post",data:e})}function c(t){var e=r.a.stringify(t);return Object(s["a"])({url:"user-service/dept/saveDept",method:"post",data:e})}function u(t){return Object(s["a"])({headers:{"Content-Type":"application/json"},url:"user-service/dept/removeDept",method:"get",params:t})}},"27ea":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"decorate"}),a("div",{staticClass:"filter-container"},[a("el-cascader",{staticClass:"filter-item",attrs:{"show-all-levels":!1,options:t.deptIdList,placeholder:t.$t("listQuery.deptId"),props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},on:{change:t.handleFilter},model:{value:t.listQuery.deptId,callback:function(e){t.$set(t.listQuery,"deptId",e)},expression:"listQuery.deptId"}}),a("span",{staticClass:"btn-item",on:{click:t.handleFilter}},[a("i",{staticClass:"iconfont icon-sousuo"}),t._v(t._s(t.$t("btn.search")))]),a("span",{staticClass:"btn-item",on:{click:t.clearListQuery}},[a("i",{staticClass:"el-icon-refresh-left"}),t._v(" "+t._s(t.$t("btn.resetting")))]),a("div",{staticClass:"control-container"},[a("span",{staticClass:"btn-item",on:{click:function(e){return t.handleCreate()}}},[a("i",{staticClass:"iconfont icon-a-"}),t._v(t._s(t.$t("btn.add")))])])],1),a("div",{staticClass:"table-container"},[a("el-table",{ref:"table",attrs:{data:t.list,fit:"","max-height":"580","highlight-current-row":"","header-row-class-name":"table-header","row-class-name":"table-row"}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{property:"strategyName",align:"left",width:"200",label:t.$t("strategy.strategyName")}}),a("el-table-column",{attrs:{property:"strategyType",align:"left",label:t.$t("strategy.strategyType")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(1==e.row.strategyType?t.$t("strategy.balanced"):t.$t("strategy.security"))+" ")]}}])}),a("el-table-column",{attrs:{property:"describes",align:"left",label:t.$t("work.remark")}}),a("el-table-column",{attrs:{property:"createTime",align:"left",label:t.$t("site.createTime")}}),a("el-table-column",{attrs:{label:t.$t("table.operate"),width:"280",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"btnCancel",attrs:{title:t.$t("table.update")},on:{click:function(a){return t.updateGateway(e)}}},[a("i",{staticClass:"iconfont icon-wangguan"}),t._v(" "+t._s(t.$t("strategy.update")))]),a("span",{staticClass:"btnCancel",attrs:{title:t.$t("table.update")},on:{click:function(a){return t.handleUpdate(e)}}},[a("i",{staticClass:"iconfont icon-bianji"}),t._v(" "+t._s(t.$t("table.update")))]),a("span",{staticClass:"btnCancel delete",attrs:{title:t.$t("table.delete")},on:{click:function(a){return t.handleDelete(e)}}},[a("i",{staticClass:"iconfont icon-a--"}),t._v(t._s(t.$t("table.delete")))])]}}])})],1)],1),a("el-dialog",{attrs:{"close-on-click-modal":!1,title:t.textMap[t.dialogStatus],visible:t.addDialog},on:{"update:visible":function(e){t.addDialog=e}}},[a("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,inline:"","label-width":"130px"}},[a("el-form-item",{attrs:{label:t.$t("listQuery.deptId"),prop:"deptId"}},[a("el-cascader",{attrs:{"show-all-levels":!1,options:t.deptIdList,placeholder:t.$t("listQuery.deptId"),props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},model:{value:t.form.deptId,callback:function(e){t.$set(t.form,"deptId",e)},expression:"form.deptId"}})],1),a("el-form-item",{attrs:{label:t.$t("strategy.strategyName"),prop:"strategyName"}},[a("el-input",{attrs:{placeholder:t.$t("pEnter")+t.$t("strategy.strategyName"),maxlength:"20"},model:{value:t.form.strategyName,callback:function(e){t.$set(t.form,"strategyName",e)},expression:"form.strategyName"}})],1),a("el-form-item",{attrs:{label:t.$t("strategy.strategyType"),prop:"strategyType"}},[a("el-select",{attrs:{placeholder:t.$t("pSelect")},model:{value:t.form.strategyType,callback:function(e){t.$set(t.form,"strategyType",e)},expression:"form.strategyType"}},t._l(t.type,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:t.$t("work.remark"),prop:"describes"}},[a("el-input",{attrs:{placeholder:t.$t("pEnter")+t.$t("work.remark")},model:{value:t.form.describes,callback:function(e){t.$set(t.form,"describes",e)},expression:"form.describes"}})],1),a("el-form-item",{staticStyle:{width:"100%"},attrs:{label:t.$t("device.upload"),prop:"path"}},[a("el-upload",{ref:"upload",attrs:{action:"",drag:"",limit:1,"file-list":t.fileList,"before-upload":t.beforeUpload,"on-success":t.handleFileSuccess,"on-error":t.handleFileError,"on-remove":t.handleRemove,"http-request":t.uploadFile}},[a("i",{staticClass:"el-icon-upload"})])],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("span",{staticClass:"btn-item long",on:{click:function(e){t.addDialog=!1}}},[t._v(t._s(t.$t("btn.cancel")))]),a("span",{staticClass:"btn-item long",on:{click:function(e){"create"===t.dialogStatus?t.createData():t.updateData()}}},[t._v(t._s(t.$t("btn.define")))])])],1),a("el-dialog",{attrs:{"close-on-click-modal":!1,title:t.$t("table.update"),visible:t.upDialog},on:{"update:visible":function(e){t.upDialog=e}}},[a("el-transfer",{ref:"transfers",staticStyle:{width:"800px",margin:"0px auto"},attrs:{filterable:"","filter-placeholder":t.$t("pEnter")+t.$t("device.deviceName"),titles:[t.$t("table.optional"),t.$t("table.selected")],data:t.deviceList,"target-order":"unshift"},on:{change:t.changeList},model:{value:t.checkList,callback:function(e){t.checkList=e},expression:"checkList"}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("span",{staticClass:"btn-item long",on:{click:function(e){t.upDialog=!1}}},[t._v(t._s(t.$t("btn.cancel")))]),a("span",{staticClass:"btn-item long",on:{click:t.updateDatas}},[t._v(t._s(t.$t("btn.save")))])])],1)],1)},i=[],r=(a("d81d"),a("d3b7"),a("159b"),a("a15b"),a("b775"));function l(t){return Object(r["a"])({url:"alarm-service/strategy/getStrategyList",method:"get",params:t})}function n(t){return Object(r["a"])({url:"alarm-service/strategy/addStrategy",method:"post",data:t})}function o(t){return Object(r["a"])({url:"alarm-service/strategy/updateStrategy",method:"put",data:t})}function c(t){return Object(r["a"])({url:"alarm-service/strategy/updateStrategyGate",method:"put",params:t})}function u(t){return Object(r["a"])({url:"alarm-service/strategy/deleteStrategy",method:"delete",params:t})}function d(t){return Object(r["a"])({url:"alarm-service/strategy/deleteStrategyList",method:"delete",params:t})}function p(t){return Object(r["a"])({url:"alarm-service/strategy/getChooseStrategyGate",method:"get",params:t})}function f(t){return Object(r["a"])({url:"alarm-service/strategy/getStrategyGateByStrategyId",method:"get",params:t})}var h=a("0e8f"),g=a("91b6"),m={data:function(){return{checkList:[],deviceList:[],typeCode:"",scope:{},total:0,listQuery:{deptId:null,siteName:null,siteCode:null,curPage:1,pageSize:10},addDialog:!1,upDialog:!1,textMap:{update:this.$t("table.update"),create:this.$t("table.create")},type:[{value:1,label:this.$t("strategy.balanced")},{value:2,label:this.$t("strategy.security")}],dialogStatus:"",form:{deptId:null,describes:null,path:null,strategyId:null,strategyName:null,strategyType:null},forms:{deviceCodes:null,strategyId:null},list:null,fileList:null,deptIdList:null,listLoading:!1,createStatus:!1,url:"",rules:{strategyName:[{required:!0,message:this.$t("pEnter")+this.$t("strategy.strategyName"),trigger:"blur"}],strategyType:[{required:!0,message:this.$t("pEnter")+this.$t("strategy.strategyType"),trigger:"blur"}],deptId:[{required:!0,message:this.$t("pSelect")+this.$t("listQuery.deptId"),trigger:"blur"}],path:[{required:!0,message:this.$t("pEnter")+this.$t("device.upload"),trigger:"change"}],describes:[{required:!0,message:this.$t("pEnter")+this.$t("work.remark"),trigger:"blur"}]}}},created:function(){this.url=this.$store.state.user.url+"/trajectory-service",this.getList(),this.getDeptList()},methods:{getDeptList:function(){var t=this;Object(h["e"])().then((function(e){t.deptIdList=e.data&&t.getdeptIdList(e.data)}))},getdeptIdList:function(t){var e=this;t.length||(t=[t]);var a=t.map((function(t){var a={};return t.subBeanList?(a.children=e.getdeptIdList(t.subBeanList),a.label=t.nodeBean.deptName,a.value=t.nodeBean.deptId,a):(a.label=t.nodeBean.deptName,a.value=t.nodeBean.deptId,a)}));return a},getList:function(){var t=this;l(this.listQuery).then((function(e){t.listLoading=!1,console.log(e),t.list=e.data.list,t.total=e.data.totalRow||0}))},createData:function(){var t=this;this.createStatus||this.$refs.form.validate((function(e){e&&(t.createStatus=!0,n(t.form).then((function(e){200==e.status&&(t.addDialog=!1,t.createStatus=!1,t.$notify({title:t.$t("title.success"),message:t.$t("title.addSuccess"),type:"success",duration:3e3}),t.getList(),t.File.forEach((function(e){Object(g["a"])(e,t.url)})))})).catch((function(){t.createStatus=!1})))}))},updateData:function(){var t=this;this.$refs.form.validate((function(e){e&&o(t.form).then((function(e){200==e.status&&(t.addDialog=!1,t.$notify({title:t.$t("title.success"),message:t.$t("title.updateSuccess"),type:"success",duration:3e3}),t.getList())}))}))},updateDatas:function(){var t=this;c(this.forms).then((function(e){200==e.status&&(t.upDialog=!1,t.$notify({title:t.$t("title.success"),message:t.$t("title.updateSuccess"),type:"success",duration:3e3}),t.getList())}))},clearListQuery:function(){this.listQuery={deptId:null,siteName:null,siteCode:null,curPage:1,pageSize:10},this.getList()},resetForm:function(){for(var t in this.form)this.form[t]=null},handleCreate:function(){var t=this;this.resetForm(),this.fileList=[],this.addDialog=!0,this.dialogStatus="create",this.$nextTick((function(){t.$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(t){var e=this;this.form={strategyId:t.row.strategyId,deptId:t.row.deptId,describes:t.row.describes,path:t.row.path,strategyName:t.row.strategyName,strategyType:t.row.strategyType},this.fileList=this.form.path?[{url:this.form.path}]:[],this.dialogStatus="update",this.addDialog=!0,this.$nextTick((function(){e.$refs["form"].clearValidate()}))},handleDelete:function(t){var e=this;this.$confirm(this.$t("title.delPointOutWork"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){u({strategyId:t.row.strategyId}).then((function(t){200==t.status&&(e.getList(),e.$notify({title:e.$t("title.success"),message:e.$t("title.deleteSuccess"),type:"success",duration:3e3}))}))}))},deleteList:function(){var t=this;this.$refs.table.selection.length?this.$confirm(this.$t("title.delPointOutUser"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){var e=t.$refs.table.selection.map((function(t){return t.strategyId})),a=e.join(",");d({strategyIds:a}).then((function(e){200==e.status&&(t.getList(),t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3}))}))})):this.$notify({title:this.$t("title.fail"),message:this.$t("pSelect")+this.$t("user.user"),type:"warning",duration:3e3})},beforeUpload:function(t){return console.log(t),!0},handleFileSuccess:function(t){console.log(t,"handleFileSuccess"),200===t.status&&console.log(t,"200")},handleFileError:function(t){console.log(t,"err")},handleRemove:function(t,e){console.log(t,e,this.File),"create"===this.dialogStatus||this.File.length>=1?Object(g["a"])(this.form.path,this.url):this.File.push(this.form.path),this.form.path=""},uploadFile:function(t){var e=this;console.log(t),Object(g["b"])(t.file,this.url).then((function(t){console.log(t),e.form.path=t.data}))},updateGateway:function(t){var e=this;this.forms={deviceCodes:"",strategyId:t.row.strategyId},this.deviceList=[],f({strategyId:t.row.strategyId}).then((function(t){e.checkList=t.data.map((function(t){return t.deviceCode})),t.data.forEach((function(t){e.deviceList.push({deviceCode:t.deviceCode,deviceName:t.deviceName,label:t.deviceName,key:t.deviceCode})}))})),p({strategyId:t.row.strategyId}).then((function(t){t.data.forEach((function(t){e.deviceList.push({deviceCode:t.deviceCode,deviceName:t.deviceName,label:t.deviceName,key:t.deviceCode})}))})),this.upDialog=!0},changeList:function(){console.log(this.deviceList,this.checkList),this.forms.deviceCodes=this.checkList.join()}}},y=m,b=(a("9af8"),a("2877")),v=Object(b["a"])(y,s,i,!1,null,"a9702964",null);e["default"]=v.exports},"4bd5":function(t,e,a){},"91b6":function(t,e,a){"use strict";a.d(e,"b",(function(){return l})),a.d(e,"a",(function(){return n}));var s=a("b775"),i=a("4328"),r=a.n(i);function l(t,e){var a=new FormData;return a.append("file",t),a.append("host",e),Object(s["a"])({headers:{"Content-Type":"multipart/form-data"},url:"trajectory-service/file/uploadFile",method:"post",data:a})}function n(t,e){var a={host:e,fileUrl:t};return a=r.a.stringify(a),Object(s["a"])({url:"trajectory-service/file/deleteFileByUrl",method:"post",data:a})}},"9af8":function(t,e,a){"use strict";a("4bd5")}}]);
//# sourceMappingURL=chunk-cfcd9af8.d43d4123.js.map