(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-227a6a15"],{4381:function(e,t,i){"use strict";i("d3b7"),i("caad"),i("2532"),i("d9e2");var a=i("4360"),n={inserted:function(e,t){var i=t.value,n=a["a"].getters&&a["a"].getters.butPermission;if(console.log(n,"roles"),!(i&&i instanceof Array&&i.length>0))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");var s=i,o=n.some((function(e){return s.includes(e)}));if(console.log(o,"hasPermission"),o)a["a"].state.user.permissionFlag[s]=!1;else{a["a"].state.user.permissionFlag[s]=!0,console.log(a["a"].state.user.permissionFlag[s],"permissionRoles");var r=document.createElement("div");r.style.cursor="not-allowed",r.style.display="inline-block",e.style.pointerEvents="none",e.parentNode.insertBefore(r,e),e.parentNode&&e.parentNode.removeChild(e),r.appendChild(e),console.log(e,"permissionRoles")}}},s=function(e){e.directive("permission",n)};window.Vue&&(window["permission"]=n,Vue.use(s)),n.install=s;t["a"]=n},7930:function(e,t,i){"use strict";i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return o})),i.d(t,"d",(function(){return r}));var a=i("b775");function n(e){return Object(a["a"])({url:"device-service/type/getTypeList",method:"get",params:e})}function s(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"device-service/type/addType",method:"post",data:e})}function o(e){var t={typeById:e};return Object(a["a"])({url:"device-service/type/deleteType",method:"delete",params:t})}function r(e){return Object(a["a"])({headers:{"Content-Type":"application/json"},url:"device-service/type/updateType",method:"put",data:e})}},"7db4":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 department"},[i("div",{staticClass:"decorate"}),i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item",staticStyle:{width:"180px"},attrs:{placeholder:e.$t("deviceType.typeName")},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.typeName,callback:function(t){e.$set(e.listQuery,"typeName",t)},expression:"listQuery.typeName"}}),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(0)}}},[i("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("deviceType.addAType")))])])],1),i("div",{staticClass:"table-container"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.data,"row-key":"typeId","max-height":"580","default-expand-all":"","header-row-class-name":"table-header","row-class-name":"table-row","highlight-current-row":"","tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"expand-change":e.getChange,"current-change":e.handleCurrentChange}},[i("el-table-column",{attrs:{prop:"typeName",align:"left",label:e.$t("deviceType.typeName")}}),i("el-table-column",{attrs:{prop:"typeCode",align:"left",label:e.$t("deviceType.typeCode")}}),i("el-table-column",{attrs:{label:e.$t("deviceType.icon"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:e.row.icon}})]}}])}),i("el-table-column",{attrs:{label:e.$t("table.operate"),width:"260",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("deviceType.addSon")},on:{click:function(i){return e.handleCreate(1,t)}}},[i("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("btn.add")))]),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)],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,model:e.form,inline:"","label-width":"130px"}},[i("el-form-item",{attrs:{label:e.$t("deviceType.typeName"),prop:"typeName"}},[i("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("deviceType.typeName"),maxlength:"20"},model:{value:e.form.typeName,callback:function(t){e.$set(e.form,"typeName",t)},expression:"form.typeName"}})],1),i("el-form-item",{attrs:{label:e.$t("deviceType.typeCode"),prop:"typeCode"}},[i("el-input",{attrs:{disabled:"update"===e.dialogStatus,placeholder:e.$t("pEnter")+e.$t("deviceType.typeCode")},model:{value:e.form.typeCode,callback:function(t){e.$set(e.form,"typeCode",t)},expression:"form.typeCode"}})],1),i("el-form-item",{staticStyle:{width:"100%"},attrs:{label:e.$t("deviceType.uploadIcon")}},[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)],1)},n=[],s=(i("d9e2"),i("d3b7"),i("159b"),i("ac1f"),i("00b4"),i("7930")),o=i("91b6"),r=i("4381"),l={computed:{userName:function(){return this.$store.state.user.userName}},directives:{permission:r["a"]},data:function(){var e=this,t=function(t,i,a){e.form.icon?a():a(new Error(e.$t("pEnter")+e.$t("deviceType.icon")))};return{fileList:[],File:[],url:"",imageList:[],beforeUploadImg:!0,listLoading:!1,createStatus:!1,parentIdBox:[],textMap:{update:this.$t("table.update"),create:this.$t("table.create")},dialogStatus:"",parentName:"",form:{typeId:"",parentId:"",typeName:"",typeCode:""},currentRow:null,addDialog:!1,total:0,listQuery:{typeName:null,typeCode:null},data:[],rules:{typeName:[{required:!0,message:this.$t("pEnter")+this.$t("deviceType.typeName"),trigger:"blur"}],typeCode:[{required:!0,message:this.$t("pEnter")+this.$t("deviceType.typeCode"),trigger:"blur"}],icon:[{required:!0,validator:t,trigger:"change"}]}}},created:function(){this.url=this.$store.state.user.url+"/trajectory-service",this.getList()},methods:{clearListQuery:function(){this.listQuery={typeName:null,typeCode:null},this.getList()},getList:function(){var e=this;this.listLoading=!0,Object(s["c"])(this.listQuery).then((function(t){e.listLoading=!1,e.data=e.filterDeptList(t.data.list),e.total=t.data.totalRow}))},filterDeptList:function(e){var t=this,i=[];return e.forEach((function(e){var a=e;console.log(e),e&&(e.subList&&(a.children=t.filterDeptList(e.subList,!0)),e.id=e.deptId+1,i.push(a))})),i},handleFilter:function(){this.listLoading=!0,this.getList()},handleUpdate:function(e){var t=this;this.form={typeId:e.row.typeId,parentId:e.row.parentId,typeName:e.row.typeName,typeCode:e.row.typeCode,icon:e.row.icon},this.fileList=this.form.icon?[{name:"icon",url:this.form.icon}]:[],this.dialogStatus="update",this.addDialog=!0,this.parentName=e.row._parent?e.row._parent.typeName:"无",this.$nextTick((function(){t.$refs["form"].clearValidate()}))},updateData:function(){var e=this;this.$refs.form.validate((function(t){t&&Object(s["d"])(e.form).then((function(){e.$notify({title:e.$t("title.success"),message:e.$t("title.updateSuccess"),type:"success",duration:3e3}),e.getList(),e.File.forEach((function(t){Object(o["a"])(t,e.url)})),e.File=[],e.addDialog=!1}))}))},resetForm:function(){for(var e in this.form)this.form[e]=null},handleCreate:function(e,t){var i=this;this.fileList=[],0===e?(this.resetForm(),this.addDialog=!0,this.dialogStatus="create",this.form.parentId=0,this.$nextTick((function(){i.$refs["form"].clearValidate()}))):(this.resetForm(),this.addDialog=!0,this.dialogStatus="create",this.form.parentId=t.typeId,this.$nextTick((function(){i.$refs["form"].clearValidate()})))},createData:function(){var e=this;this.createStatus||this.$refs.form.validate((function(t){t&&(e.createStatus=!0,0===e.form.parentId?e.form.parentId=0:e.form.parentId=e.currentRow.typeId,Object(s["a"])(e.form).then((function(){e.createStatus=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.addSuccess"),type:"success",duration:3e3}),e.parentName="",e.currentRow=null,e.getList(),e.addDialog=!1})).catch((function(){e.createStatus=!1})))}))},handleDelete:function(e){var t=this;0!=e.row.subList.length?this.$notify({title:this.$t("title.warning"),message:this.$t("deviceType.delSon"),type:"warning",duration:3e3}):this.$confirm(this.$t("title.delPointOutDeviceType"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){Object(s["b"])(e.row.typeId).then((function(){t.getList(),t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3})}))}))},handleCurrentChange:function(e){this.currentRow=e||null},getChange:function(e,t){console.log(e,t)},beforeUpload:function(e){if(console.log(this.form.icon),this.form.icon)return this.$message.error(this.$t("photoUp.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("photoUp.size")),!1):(this.$message.error(this.$t("photoUp.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(o["a"])(this.form.icon,this.url):this.File.push(this.form.icon),this.form.icon=""},uploadFile:function(e){var t=this;console.log(e),Object(o["b"])(e.file,this.url).then((function(e){console.log(e),t.form.icon=e.data}))}}},c=l,d=i("2877"),u=Object(d["a"])(c,a,n,!1,null,null,null);t["default"]=u.exports},"91b6":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return r}));var a=i("b775"),n=i("4328"),s=i.n(n);function o(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 r(e,t){var i={host:t,fileUrl:e};return i=s.a.stringify(i),Object(a["a"])({url:"trajectory-service/file/deleteFileByUrl",method:"post",data:i})}}}]); //# sourceMappingURL=chunk-227a6a15.0f245f24.js.map