YM-WMS-WCS/dist/js/chunk-a02cfa52.03428464.js

1 line
9.2 KiB
JavaScript
Raw Permalink Normal View History

2023-04-23 15:58:54 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a02cfa52","chunk-2bec94fe"],{"0abe":function(t,e,a){"use strict";a.r(e);var r=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.dataFormSubmit()}}},[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)},n=[],i=(a("99af"),a("4160"),a("d3b7"),a("3ca3"),a("159b"),a("ddb0"),a("2909")),o=a("5530"),s=a("b047c"),c=a.n(s),d=a("3d7b"),u={mixins:[d["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(o["a"])(Object(o["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:c()((function(){var t=this;this.$refs["dataForm"].validate((function(e){if(!e)return!1;t.dataForm.menuIdList=[].concat(Object(i["a"])(t.$refs.menuListTree.getHalfCheckedKeys()),Object(i["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})}},l=u,m=a("2877"),f=Object(m["a"])(l,r,n,!1,null,null,null);e["default"]=f.exports},2909:function(t,e,a){"use strict";a.d(e,"a",(function(){return c}));var r=a("6b75");function n(t){if(Array.isArray(t))return Object(r["a"])(t)}a("a4d3"),a("e01a"),a("d28b"),a("a630"),a("d3b7"),a("3ca3"),a("ddb0");function i(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}var o=a("06c5");function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iter