You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.4 KiB
1 lines
8.4 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b64c464a"],{"33b8":function(e,t,r){"use strict";var i=r("a7ee"),s=r.n(i);s.a},"5efd":function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"org"},[r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{sm:12,xs:24}},[r("div",{staticClass:"app-container"},[r("div",{staticClass:"filter-container"},[r("el-input",{staticClass:"filter-item search-item",attrs:{placeholder:e.$t("table.org.label")},model:{value:e.label,callback:function(t){e.label=t},expression:"label"}}),r("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"primary"},on:{click:e.search}},[e._v(e._s(e.$t("table.search")))]),r("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"warning"},on:{click:e.reset}},[e._v(e._s(e.$t("table.reset")))]),r("el-button",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["org:add"],expression:"['org:add']"}],staticClass:"filter-item",attrs:{plain:"",type:"danger"},on:{click:e.add}},[e._v(e._s(e.$t("table.add"))+" ")]),r("el-dropdown",{directives:[{name:"has-any-permission",rawName:"v-has-any-permission",value:["org:delete","org:export","org:import"],expression:"['org:delete','org:export', 'org:import']"}],staticClass:"filter-item",attrs:{trigger:"click"}},[r("el-button",[e._v(" "+e._s(e.$t("table.more"))+" "),r("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),r("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[r("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["org:delete"],expression:"['org:delete']"}],nativeOn:{click:function(t){return e.deleteOrg(t)}}},[e._v(e._s(e.$t("table.delete"))+" ")]),r("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["org:export"],expression:"['org:export']"}],nativeOn:{click:function(t){return e.exportExcel(t)}}},[e._v(" "+e._s(e.$t("table.export"))+" ")]),r("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["org:export"],expression:"['org:export']"}],nativeOn:{click:function(t){return e.exportExcelPreview(t)}}},[e._v(" "+e._s(e.$t("table.exportPreview"))+" ")]),r("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["org:import"],expression:"['org:import']"}],nativeOn:{click:function(t){return e.importExcel(t)}}},[e._v(" "+e._s(e.$t("table.import"))+" ")])],1)],1)],1),r("el-tree",{ref:"orgTree",attrs:{"check-strictly":!0,data:e.orgTree,"filter-node-method":e.filterNode,"default-expand-all":"","highlight-current":"","node-key":"id","show-checkbox":""},on:{"node-click":e.nodeClick}})],1)]),r("el-col",{attrs:{sm:12,xs:24}},[r("el-card",{staticClass:"box-card"},[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[e._v(e._s(""===e.org.id?this.$t("common.add"):this.$t("common.edit")))])]),r("div",[r("el-form",{ref:"form",attrs:{model:e.org,rules:e.rules,"label-position":"right","label-width":"100px"}},[r("el-form-item",{attrs:{label:e.$t("table.org.parentId"),prop:"parentId"}},[r("el-tooltip",{staticClass:"item",attrs:{content:e.$t("tips.topId"),effect:"dark",placement:"top-start"}},[r("el-input",{attrs:{readonly:""},model:{value:e.org.parentId,callback:function(t){e.$set(e.org,"parentId",t)},expression:"org.parentId"}})],1)],1),r("el-form-item",{attrs:{label:e.$t("table.org.label"),prop:"label"}},[r("el-input",{model:{value:e.org.label,callback:function(t){e.$set(e.org,"label",t)},expression:"org.label"}})],1),r("el-form-item",{attrs:{label:e.$t("table.org.abbreviation"),prop:"abbreviation"}},[r("el-input",{model:{value:e.org.abbreviation,callback:function(t){e.$set(e.org,"abbreviation",t)},expression:"org.abbreviation"}})],1),r("el-form-item",{attrs:{label:e.$t("table.org.describe"),prop:"describe"}},[r("el-input",{model:{value:e.org.describe,callback:function(t){e.$set(e.org,"describe",t)},expression:"org.describe"}})],1),r("el-form-item",{attrs:{label:e.$t("table.org.status"),prop:"status"}},[r("el-radio-group",{model:{value:e.org.status,callback:function(t){e.$set(e.org,"status",t)},expression:"org.status"}},[r("el-radio",{attrs:{label:!0}},[e._v(e._s(e.$t("common.status.valid")))]),r("el-radio",{attrs:{label:!1}},[e._v(e._s(e.$t("common.status.invalid")))])],1)],1),r("el-form-item",{attrs:{label:e.$t("table.org.sortValue"),prop:"sortValue"}},[r("el-input-number",{attrs:{max:100,min:0},on:{change:e.handleNumChange},model:{value:e.org.sortValue,callback:function(t){e.$set(e.org,"sortValue",t)},expression:"org.sortValue"}})],1)],1)],1)]),r("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"-2rem"}},[r("el-row",[r("el-col",{staticStyle:{"text-align":"right"},attrs:{span:24}},[r("el-button",{attrs:{plain:"",type:"primary"},on:{click:e.submit}},[e._v(e._s(""===e.org.id?this.$t("common.add"):this.$t("common.edit"))+" ")])],1)],1)],1)],1)],1),r("file-import",{ref:"import",attrs:{"dialog-visible":e.fileImport.isVisible,type:e.fileImport.type,action:e.fileImport.action,accept:".xls,.xlsx"},on:{close:e.importClose,success:e.importSuccess}}),r("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!0,title:"预览",width:"80%",top:"50px",visible:e.preview.isVisible},on:{"update:visible":function(t){return e.$set(e.preview,"isVisible",t)}}},[r("el-scrollbar",[r("div",{domProps:{innerHTML:e._s(e.preview.context)}})])],1)],1)},s=[],a=(r("4de4"),r("c975"),r("5530")),o=r("c38b"),l=r("a888"),n=r("6188"),c=r("1771"),p={name:"OrgManager",directives:{elDragDialog:l["a"]},components:{FileImport:n["a"]},data:function(){return{label:"",orgTree:[],org:this.initOrg(),preview:{isVisible:!1,context:""},fileImport:{isVisible:!1,type:"import",action:"".concat("https://pos.admin.api.lotus-wallet.com","/org/import")},rules:{label:[{required:!0,message:this.$t("rules.require"),trigger:"blur"},{min:1,max:255,message:this.$t("rules.range3to10"),trigger:"blur"}]}}},mounted:function(){this.initOrgTree()},methods:{initOrg:function(){return{id:"",abbreviation:"",label:"",parentId:0,status:!0,describe:"",sortValue:0}},initOrgTree:function(){var e=this;o["a"].allTree({}).then((function(t){var r=t.data;e.orgTree=r.data}))},exportExcelPreview:function(){var e=this,t={model:{},map:{fileName:"导出组织数据"},size:1e4};o["a"].preview(t).then((function(t){var r=t.data;e.preview.isVisible=!0,e.preview.context=r.data}))},exportExcel:function(){var e={model:{},map:{fileName:"导出组织数据"},size:1e4};o["a"].export(e).then((function(e){Object(c["a"])(e)}))},importExcel:function(){this.fileImport.type="upload",this.fileImport.isVisible=!0,this.$refs.import.setModel(!1)},importSuccess:function(){this.initOrgTree()},importClose:function(){this.fileImport.isVisible=!1},handleNumChange:function(e){this.org.sortValue=e},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},nodeClick:function(e){this.org=Object(a["a"])({},e),this.$refs.form.clearValidate()},add:function(){this.resetForm();var e=this.$refs.orgTree.getCheckedKeys();e.length>1?this.$message({message:this.$t("tips.onlyChooseOne"),type:"warning"}):e.length>0?this.org.parentId=e[0]:this.org.parentId=0},deleteOrg:function(){var e=this,t=this.$refs.orgTree.getCheckedKeys();0===t.length?this.$message({message:this.$t("tips.noNodeSelected"),type:"warning"}):this.$confirm(this.$t("tips.confirmDeleteNode"),this.$t("common.tips"),{confirmButtonText:this.$t("common.confirm"),cancelButtonText:this.$t("common.cancel"),type:"warning"}).then((function(){o["a"].delete({ids:t}).then((function(t){var r=t.data;r.isSuccess&&e.$message({message:e.$t("tips.deleteSuccess"),type:"success"}),e.reset()}))})).catch((function(){e.$refs.orgTree.setCheckedKeys([])}))},search:function(){this.$refs.orgTree.filter(this.label)},reset:function(){this.initOrgTree(),this.label="",this.resetForm()},submit:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.org.id?e.update():e.save()}))},save:function(){var e=this;o["a"].save(Object(a["a"])({},this.org)).then((function(t){var r=t.data;r.isSuccess&&e.$message({message:e.$t("tips.createSuccess"),type:"success"}),e.reset()}))},update:function(){var e=this;o["a"].update(Object(a["a"])({},this.org)).then((function(t){var r=t.data;r.isSuccess&&e.$message({message:e.$t("tips.updateSuccess"),type:"success"}),e.reset()}))},resetForm:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.org=this.initOrg()}}},d=p,m=(r("33b8"),r("2877")),u=Object(m["a"])(d,i,s,!1,null,"19a67061",null);t["default"]=u.exports},a7ee:function(e,t,r){}}]); |