Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-113afb26.2b30f734.js

1 line
6.9 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-113afb26","chunk-6e5376f8"],{"22e1":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-card",{staticClass:"aui-card--fill",attrs:{shadow:"never"}},[a("div",{staticClass:"mod-sys__dept"},[a("el-form",{attrs:{inline:!0,model:e.dataForm},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getDataList()}}},[a("el-form-item",[e.$hasPermission("sys:dept:save")?a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.addOrUpdateHandle()}}},[e._v(e._s(e.$t("add")))]):e._e()],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:e.dataList,"row-key":"id",border:""}},[a("el-table-column",{attrs:{prop:"name",label:e.$t("dept.name"),"header-align":"center","min-width":"150"}}),a("el-table-column",{attrs:{prop:"parentName",label:e.$t("dept.parentName"),"header-align":"center",align:"center"}}),a("el-table-column",{attrs:{prop:"sort",label:e.$t("dept.sort"),"header-align":"center",align:"center",width:"80"}}),a("el-table-column",{attrs:{label:e.$t("handle"),fixed:"right","header-align":"center",align:"center",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.$hasPermission("sys:dept:update")?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.addOrUpdateHandle(t.row.id)}}},[e._v(e._s(e.$t("update")))]):e._e(),e.$hasPermission("sys:dept:delete")?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.deleteHandle(t.row.id)}}},[e._v(e._s(e.$t("delete")))]):e._e()]}}])})],1),e.addOrUpdateVisible?a("add-or-update",{ref:"addOrUpdate",on:{refreshDataList:e.getDataList}}):e._e()],1)])},n=[],i=a("e1a5"),s=a("5494"),o={mixins:[i["a"]],data:function(){return{mixinViewModuleOptions:{getDataListURL:"/sys/dept/list",deleteURL:"/sys/dept"}}},components:{AddOrUpdate:s["default"]}},d=o,l=a("2877"),c=Object(l["a"])(d,r,n,!1,null,null,null);t["default"]=c.exports},5494:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{visible:e.visible,title:e.dataForm.id?e.$t("update"):e.$t("add"),"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"120px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.dataFormSubmitHandle()}}},[a("el-form-item",{attrs:{prop:"name",label:e.$t("dept.name")}},[a("el-input",{attrs:{placeholder:e.$t("dept.name")},model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name",t)},expression:"dataForm.name"}})],1),a("el-form-item",{staticClass:"dept-list",attrs:{prop:"parentName",label:e.$t("dept.parentName")}},[a("el-popover",{ref:"deptListPopover",attrs:{placement:"bottom-start",trigger:"click"},model:{value:e.deptListVisible,callback:function(t){e.deptListVisible=t},expression:"deptListVisible"}},[a("el-tree",{ref:"deptListTree",attrs:{data:e.deptList,props:{label:"name",children:"children"},"node-key":"id","highlight-current":!0,"expand-on-click-node":!1,accordion:""},on:{"current-change":e.deptListTreeCurrentChangeHandle}})],1),a("el-input",{directives:[{name:"popover",rawName:"v-popover:deptListPopover",arg:"deptListPopover"}],attrs:{readonly:!0,placeholder:e.$t("dept.parentName")},model:{value:e.dataForm.parentName,callback:function(t){e.$set(e.dataForm,"parentName",t)},expression:"dataForm.parentName"}},[1===e.$store.state.user.superAdmin&&"0"!==e.dataForm.pid?a("i",{staticClass:"el-icon-circle-close el-input__icon",attrs:{slot:"suffix"},on:{click:function(t){return t.stopPropagation(),e.deptListTreeSetDefaultHandle()}},slot:"suffix"}):e._e()])],1),a("el-form-item",{attrs:{prop:"sort",label:e.$t("dept.sort")}},[a("el-input-number",{attrs:{"controls-position":"right",min:0,label:e.$t("dept.sort")},model:{value:e.dataForm.sort,callback:function(t){e.$set(e.dataForm,"sort",t)},expression:"dataForm.sort"}})],1)],1),a("template",{slot:"footer"},[a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v(e._s(e.$t("cancel")))]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.dataFormSubmitHandle()}}},[e._v(e._s(e.$t("confirm")))])],1)],2)},n=[],i=(a("8e6e"),a("ac6a"),a("456d"),a("7f7f"),a("ade3")),s=a("b047"),o=a.n(s);function d(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?d(Object(a),!0).forEach((function(t){Object(i["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var c={data:function(){return{visible:!1,deptList:[],deptListVisible:!1,dataForm:{id:"",name:"",pid:"",parentName:"",sort:0}}},computed:{dataRule:function(){return{name:[{required:!0,message:this.$t("validate.required"),trigger:"blur"}],parentName:[{required:!0,message:this.$t("validate.required"),trigger:"change"}]}}},methods:{init:function(){var e=this;this.visible=!0,this.$nextTick((function(){e.$refs["dataForm"].resetFields(),e.getDeptList().then((function(){e.dataForm.id?e.getInfo():1===e.$store.state.user.superAdmin&&e.deptListTreeSetDefaultHandle()}))}))},getDeptList:function(){var e=this;return this.$http.get("/sys/dept/list").then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.deptList=a.data})).catch((function(){}))},getInfo:function(){var e=this;this.$http.get("/sys/dept/".concat(this.dataForm.id)).then((function(t){var a=t.data;return 0!==a.code?e.$message.error(a.msg):(e.dataForm=l(l({},e.dataForm),a.data),"0"===e.dataForm.pid?e.deptListTreeSetDefaultHandle():void e.$refs.deptListTree.setCurrentKey(e.dataForm.pid))})).catch((function(){}))},deptListTreeSetDefaultHandle:function(){this.dataForm.pid="0",this.dataForm.parentName=this.$t("dept.parentNameDefault")},deptListTreeCurrentChangeHandle:function(e){this.dataForm.pid=e.id,this.dataForm.parentName=e.name,this.deptListVisible=!1},dataFormSubmitHandle:o()((function(){var e=this;this.$refs["dataForm"].validate((function(t){if(!t)return!1;e.$http[e.dataForm.id?"put":"post"]("/sys/dept",e.dataForm).then((function(t){var a=t.data;if(0!==a.code)return e.$message.error(a.msg);e.$message({message:e.$t("prompt.success"),type:"success",duration:500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}})})).catch((function(){}))}))}),1e3,{leading:!0,trailing:!1})}},p=c,u=(a("9550"),a("2877")),m=Object(u["a"])(p,r,n,!1,null,null,null);t["default"]=m.exports},9550:function(e,t,a){"use strict";a("9d0e")},"9d0e":function(e,t,a){}}]);