YM-WMS-WCS/dist/js/chunk-14dfb0d6.10711882.js

1 line
12 KiB
JavaScript
Raw Normal View History

2023-04-21 16:53:32 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-14dfb0d6","chunk-18360c16"],{"0abe":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"120px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.dataFormSubmitHandle()}}},[a("el-form-item",{attrs:{prop:"name",label:t.$t("role.name")}},[a("el-input",{attrs:{placeholder:t.$t("role.name")},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{prop:"remark",label:t.$t("role.remark")}},[a("el-input",{attrs:{placeholder:t.$t("role.remark")},model:{value:t.dataForm.remark,callback:function(e){t.$set(t.dataForm,"remark",e)},expression:"dataForm.remark"}})],1),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{size:"mini",label:t.$t("role.menuList")}},[a("el-tree",{ref:"menuListTree",attrs:{data:t.menuList,props:{label:"name",children:"children"},"node-key":"id",accordion:"","show-checkbox":""}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{size:"mini",label:t.$t("role.deptList")}},[a("el-tree",{ref:"deptListTree",attrs:{data:t.deptList,props:{label:"name",children:"children"},"node-key":"id",accordion:"","show-checkbox":""}})],1)],1)],1)],1)},r=[],n=(a("99af"),a("4160"),a("d3b7"),a("3ca3"),a("159b"),a("ddb0"),a("2909")),s=a("5530"),o=a("b047c"),d=a.n(o),c=a("3d7b"),l={mixins:[c["a"]],data:function(){return{urlOptions:{submitURL:"/sys/role/",infoURL:"/sys/role"},visible:!1,menuList:[],deptList:[],dataForm:{id:"",name:"",menuIdList:[],deptIdList:[],remark:""}}},computed:{dataRule:function(){return{name:[{required:!0,message:this.$t("validate.required"),trigger:"blur"}]}}},methods:{init:function(t){var e=this;this.dataForm.id=t||"",this.$nextTick((function(){e.$refs["dataForm"].resetFields(),e.$refs.menuListTree.setCheckedKeys([]),e.$refs.deptListTree.setCheckedKeys([]),Promise.all([e.getMenuList(),e.getDeptList()]).then((function(){e.dataForm.id&&e.getInfo()}))}))},getMenuList:function(){var t=this;return this.$http.get("/sys/menu/select").then((function(e){var a=e.data;if(0!==a.code)return t.$message.error(a.msg);t.menuList=a.data})).catch((function(){}))},getDeptList:function(){var t=this;return this.$http.get("/sys/dept/list").then((function(e){var a=e.data;if(0!==a.code)return t.$message.error(a.msg);t.deptList=a.data})).catch((function(){}))},getInfo:function(){var t=this;this.$http.get("/sys/role/".concat(this.dataForm.id)).then((function(e){var a=e.data;if(0!==a.code)return t.$message.error(a.msg);t.dataForm=Object(s["a"])(Object(s["a"])({},t.dataForm),a.data),t.dataForm.menuIdList.forEach((function(e){return t.$refs.menuListTree.setChecked(e,!0)})),t.$refs.deptListTree.setCheckedKeys(t.dataForm.deptIdList)})).catch((function(){}))},dataFormSubmit:d()((function(){var t=this;this.$refs["dataForm"].validate((function(e){if(!e)return!1;t.dataForm.menuIdList=[].concat(Object(n["a"])(t.$refs.menuListTree.getHalfCheckedKeys()),Object(n["a"])(t.$refs.menuListTree.getCheckedKeys())),t.dataForm.deptIdList=t.$refs.deptListTree.getCheckedKeys(),t.$http[t.dataForm.id?"put":"post"]("/sys/role",t.dataForm).then((function(e){var a=e.data;if(0!==a.code)return t.$message.error(a.msg);t.$message({message:t.$t("prompt.success"),type:"success",duration:500,onClose:function(){t.visible=!1,t.$emit("successSubmit")}})})).catch((function(){}))}))}),1e3,{leading:!0,trailing:!1})}},u=l,m=a("2877"),f=Object(m["a"])(u,i,r,!1,null,null,null);e["default"]=f.exports},2909:function(t,e,a){"use strict";a.d(e,"a",(function(){return d}));var i=a("6b75");function r(t){if(Array.isArray(t))return Object(i["a"])(t)}a("a4d3"),a("e01a"),a("d28b"),a("a630"),a("d3b7"),a("3ca3"),a("ddb0");function n(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}var s=a("06c5");function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to b