1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1be68f41","chunk-0568f6a4","chunk-d56e4812","chunk-2d0cfe94","chunk-2d0df437"],{1533:function(e,t,a){"use strict";a("da4a")},"1be7":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[this.departId?[t("a-form",[t("a-form-item",{attrs:{label:"所拥有的权限"}},[t("a-tree",{staticStyle:{height:"500px",overflow:"auto"},attrs:{checkable:"",checkedKeys:e.checkedKeys,treeData:e.treeData,selectedKeys:e.selectedKeys,expandedKeys:e.expandedKeysss,checkStrictly:e.checkStrictly},on:{check:e.onCheck,expand:e.onExpand,select:e.onTreeNodeSelect},scopedSlots:e._u([{key:"hasDatarule",fn:function(a){var r=a.slotTitle,o=a.ruleFlag;return t("span",{},[e._v("\n "+e._s(r)+"\n "),o?t("a-icon",{staticStyle:{"margin-left":"5px",color:"red"},attrs:{type:"align-left"}}):e._e()],1)}}],null,!1,239970838)})],1)],1),t("div",{staticClass:"anty-form-btn"},[t("a-dropdown",{staticStyle:{float:"left"},attrs:{trigger:["click"],placement:"topCenter"}},[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"3",on:{click:e.checkALL}},[e._v("全部勾选")]),t("a-menu-item",{key:"4",on:{click:e.cancelCheckALL}},[e._v("取消全选")]),t("a-menu-item",{key:"5",on:{click:e.expandAll}},[e._v("展开所有")]),t("a-menu-item",{key:"6",on:{click:e.closeAll}},[e._v("合并所有")])],1),t("a-button",[e._v("\n 树操作 "),t("a-icon",{attrs:{type:"up"}})],1)],1),t("a-button",{staticStyle:{float:"right"},attrs:{type:"primary",htmlType:"button",icon:"form"},on:{click:e.handleSubmit}},[e._v("保存")])],1)]:t("a-card",{staticStyle:{height:"200px"},attrs:{bordered:!1}},[t("a-empty",[t("span",{attrs:{slot:"description"},slot:"description"},[e._v(" 请先选择一个部门! ")])])],1),t("depart-datarule-modal",{ref:"datarule"})],2)},o=[],i=a("4ec3"),l=a("6675");function n(e,t){var a="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=d(e))||t&&e&&"number"===typeof e.length){a&&(e=a);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,n=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return l=e.done,e},e:function(e){n=!0,i=e},f:function(){try{l||null==a.return||a.return()}finally{if(n)throw i}}}}function s(e){return h(e)||u(e)||d(e)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){if(e){if("string"===typeof e)return p(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?p(e,t):void 0}}function u(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e){if(Array.isArray(e))return p(e)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var f={name:"DepartAuthModal",components:{DepartDataruleModal:l["default"]},data:function(){return{departId:"",treeData:[],defaultCheckedKeys:[],checkedKeys:[],halfCheckedKeys:[],expandedKeysss:[],allTreeKeys:[],autoExpandParent:!0,checkStrictly:!1,title:"部门权限配置",visible:!1,loading:!1,selectedKeys:[]}},methods:{onTreeNodeSelect:function(e){e&&e.length>0&&(this.selectedKeys=e),this.$refs.datarule.show(this.selectedKeys[0],this.departId)},onCheck:function(e,t){var a=t.halfCheckedKeys;this.checkedKeys=e,this.halfCheckedKeys=a},show:function(e){this.departId=e,this.loadData()},close:function(){this.reset(),this.$emit("close"),this.visible=!1},onExpand:function(e){this.expandedKeysss=e,this.autoExpandParent=!1},reset:function(){this.expandedKeysss=[],this.checkedKeys=[],this.defaultCheckedKeys=[],this.loading=!1},expandAll:function(){this.expandedKeysss=this.allTreeKeys},closeAll:function(){this.expandedKeysss=[]},checkALL:function(){this.checkedKeys=this.allTreeKeys},cancelCheckALL:function(){this.checkedKeys=[]},handleCancel:function(){this.close()},handleSubmit:function(){var e=this;e.departId||this.$message.warning("请点击选择一个部门!");var t=[].concat(s(e.checkedKeys),s(e.halfCheckedKeys)),a=t.join(","),r={departId:e.departId,permissionIds:a,lastpermissionIds:e.defaultCheckedKeys.join(",")};e.loading=!0,Object(i["Q"])(r).then((function(t){t.success?(e.$message.success(t.message),e.loading=!1,e.loadData()):(e.$message.error(t.message),e.loading=!1)}))},convertTreeListToKeyLeafPairs:function(e){var t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=n(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.key,l=o.isLeaf,s=o.children;a.push({key:i,isLeaf:l}),s&&s.length>0&&this.convertTreeListToKeyLeafPairs(s,a)}}catch(c){r.e(c)}finally{r.f()}return a},emptyCurrForm:function(){this.form.resetFields()},loadData:function(){var e=this;Object(i["M"])().then((function(t){e.treeData=t.result.treeList,e.allTreeKeys=t.result.ids;var a=e.convertTreeListToKeyLeafPairs(e.treeData);Object(i["C"])({departId:e.departId}).then((function(t){var r=s(t.result).filter((function(e){var t=a.filter((function(t){return t.key===e}))[0];return t&&t.isLeaf})),o=s(t.result).filter((function(e){var t=a.filter((function(t){return t.key===e}))[0];return t&&!t.isLeaf}));e.checkedKeys=s(r),e.halfCheckedKeys=s(o),e.defaultCheckedKeys=[].concat(s(o),s(r)),e.expandedKeysss=e.allTreeKeys}))}))}}},m=f,y=a("2877"),g=Object(y["a"])(m,r,o,!1,null,"725d1288",null);t["default"]=g.exports},6675:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{title:"数据规则/按钮权限配置",width:"365",closable:!1,visible:e.visible},on:{close:e.onClose}},[t("a-tabs",{attrs:{defaultActiveKey:"1"}},[t("a-tab-pane",{key:"1",attrs:{tab:"数据规则"}},[e.dataruleList.length>0?t("a-checkbox-group",{model:{value:e.dataruleChecked,callback:function(t){e.dataruleChecked=t},expression:"dataruleChecked"}},[t("a-row",[e._l(e.dataruleList,(function(a,r){return t("a-col",{key:"dr"+r,attrs:{span:24}},[t("a-checkbox",{attrs:{value:a.id}},[e._v(e._s(a.ruleName))])],1)})),t("a-col",{attrs:{span:24}},[t("div",{staticStyle:{width:"100%","margin-top":"15px"}},[t("a-button",{attrs:{type:"primary",size:"small",icon:"save"},on:{click:e.saveDataruleForRole}},[e._v("点击保存")])],1)])],2)],1):t("div",[t("h3",[e._v("无配置信息!")])])],1)],1)],1)},o=[],i=a("290c"),l=a("da05"),n=a("0fea"),s={name:"DepartDataruleModal",components:{ACol:l["b"],ARow:i["a"]},data:function(){return{functionId:"",departId:"",visible:!1,tabList:[{key:"1",tab:"数据规则"},{key:"2",tab:"按钮权限"}],activeTabKey:"1",url:{datarule:"/sys/sysDepartPermission/datarule"},dataruleList:[],dataruleChecked:[]}},methods:{loadData:function(){var e=this;Object(n["c"])("".concat(this.url.datarule,"/").concat(this.functionId,"/").concat(this.departId)).then((function(t){if(t.success){e.dataruleList=t.result.datarule;var a=t.result.drChecked;a&&(e.dataruleChecked=a.split(","))}}))},saveDataruleForRole:function(){var e=this;this.dataruleChecked&&0!=this.dataruleChecked.length||this.$message.warning("请注意,现未勾选任何数据权限!");var t={permissionId:this.functionId,departId:this.departId,dataRuleIds:this.dataruleChecked.join(",")};Object(n["j"])(this.url.datarule,t).then((function(t){t.success?e.$message.success(t.message):e.$message.error(t.message)}))},show:function(e,t){this.onReset(),this.functionId=e,this.departId=t,this.visible=!0,this.loadData()},onClose:function(){this.visible=!1,this.onReset()},onTabChange:function(e){this.activeTabKey=e},onReset:function(){this.functionId="",this.departId="",this.dataruleList=[],this.dataruleChecked=[]}}},c=s,d=a("2877"),u=Object(d["a"])(c,r,o,!1,null,"73771a6a",null);t["default"]=u.exports},"88bc":function(e,t,a){(function(t){var a=1/0,r=9007199254740991,o="[object Arguments]",i="[object Function]",l="[object GeneratorFunction]",n="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,d=s||c||Function("return this")();function u(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function h(e,t){var a=-1,r=e?e.length:0,o=Array(r);while(++a<r)o[a]=t(e[a],a,e);return o}function p(e,t){var a=-1,r=t.length,o=e.length;while(++a<r)e[o+a]=t[a];return e}var f=Object.prototype,m=f.hasOwnProperty,y=f.toString,g=d.Symbol,v=f.propertyIsEnumerable,b=g?g.isConcatSpreadable:void 0,C=Math.max;function k(e,t,a,r,o){var i=-1,l=e.length;a||(a=K),o||(o=[]);while(++i<l){var n=e[i];t>0&&a(n)?t>1?k(n,t-1,a,r,o):p(o,n):r||(o[o.length]=n)}return o}function w(e,t){return e=Object(e),x(e,t,(function(t,a){return a in e}))}function x(e,t,a){var r=-1,o=t.length,i={};while(++r<o){var l=t[r],n=e[l];a(n,l)&&(i[l]=n)}return i}function S(e,t){return t=C(void 0===t?e.length-1:t,0),function(){var a=arguments,r=-1,o=C(a.length-t,0),i=Array(o);while(++r<o)i[r]=a[t+r];r=-1;var l=Array(t+1);while(++r<t)l[r]=a[r];return l[t]=i,u(e,this,l)}}function K(e){return I(e)||D(e)||!!(b&&e&&e[b])}function T(e){if("string"==typeof e||N(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function D(e){return A(e)&&m.call(e,"callee")&&(!v.call(e,"callee")||y.call(e)==o)}var I=Array.isArray;function _(e){return null!=e&&$(e.length)&&!O(e)}function A(e){return L(e)&&_(e)}function O(e){var t=j(e)?y.call(e):"";return t==i||t==l}function $(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function j(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function L(e){return!!e&&"object"==typeof e}function N(e){return"symbol"==typeof e||L(e)&&y.call(e)==n}var F=S((function(e,t){return null==e?{}:w(e,h(k(t,1),T))}));e.exports=F}).call(this,a("c8ba"))},c1af:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:800,ok:!1,visible:e.visible,confirmLoading:e.confirmLoading,okButtonProps:{props:{disabled:e.disableSubmit}},cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"机构名称",hidden:!1,hasFeedback:""}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["departName",e.validatorRules.departName],expression:"['departName', validatorRules.departName ]"}],attrs:{id:"departName",placeholder:"请输入机构/部门名称"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,hidden:e.seen,label:"上级部门",hasFeedback:""}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{dropdownStyle:{maxHeight:"200px",overflow:"auto"},treeData:e.departTree,placeholder:"请选择上级部门",disabled:e.condition},model:{value:e.model.parentId,callback:function(t){e.$set(e.model,"parentId",t)},expression:"model.parentId"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"机构类型"}},[e.seen?[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["orgCategory",e.validatorRules.orgCategory],expression:"['orgCategory',validatorRules.orgCategory]"}],attrs:{placeholder:"请选择机构类型"}},[t("a-radio",{attrs:{value:"1"}},[e._v("\n 公司\n ")])],1)]:[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["orgCategory",e.validatorRules.orgCategory],expression:"['orgCategory',validatorRules.orgCategory]"}],attrs:{placeholder:"请选择机构类型"}},[t("a-radio",{attrs:{value:"2"}},[e._v("\n 部门\n ")]),t("a-radio",{attrs:{value:"3"}},[e._v("\n 岗位\n ")])],1)]],2),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"电话"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["mobile",e.validatorRules.mobile],expression:"['mobile',validatorRules.mobile]"}],attrs:{placeholder:"请输入电话"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"传真"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["fax",{}],expression:"['fax', {}]"}],attrs:{placeholder:"请输入传真"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"地址"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["address",{}],expression:"['address', {}]"}],attrs:{placeholder:"请输入地址"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"排序"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["departOrder",{initialValue:0}],expression:"[ 'departOrder',{'initialValue':0}]"}]})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"备注"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["memo",{}],expression:"['memo', {}]"}],attrs:{placeholder:"请输入备注"}})],1)],1)],1)],1)},o=[],i=a("0fea"),l=a("4ec3"),n=a("88bc"),s=a.n(n),c=a("261e"),d={name:"SysDepartModal",components:{ATextarea:c["a"]},data:function(){return{departTree:[],orgTypeData:[],phoneWarning:"",departName:"",title:"操作",seen:!1,visible:!1,condition:!0,disableSubmit:!1,model:{},menuhidden:!1,menuusing:!0,labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{departName:{rules:[{required:!0,message:"请输入机构/部门名称!"}]},orgCode:{rules:[{required:!0,message:"请输入机构编码!"}]},mobile:{rules:[{validator:this.validateMobile}]}},url:{add:"/sys/sysDepart/add"},dictDisabled:!0}},created:function(){},methods:{loadTreeData:function(){var e=this;Object(l["F"])().then((function(t){if(t.success){e.departTree=[];for(var a=0;a<t.result.length;a++){var r=t.result[a];e.departTree.push(r)}}}))},add:function(e){e?(this.seen=!1,this.dictDisabled=!1):(this.seen=!0,this.dictDisabled=!0),this.edit(e)},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},{}),this.visible=!0,this.loadTreeData(),this.model.parentId=null!=e?e.toString():null,this.seen?this.model.orgCategory="1":this.model.orgCategory="2",this.$nextTick((function(){t.form.setFieldsValue(s()(t.model,"orgCategory","departName","departNameEn","departNameAbbr","departOrder","description","orgType","orgCode","mobile","fax","address","memo","status","delFlag"))}))},close:function(){this.$emit("close"),this.disableSubmit=!1,this.visible=!1},handleOk:function(){var e=this,t=this;this.form.validateFields((function(a,r){if(!a){t.confirmLoading=!0;var o=Object.assign(e.model,r);Object(i["i"])(e.url.add,o,"post").then((function(e){e.success?(t.$message.success(e.message),t.loadTreeData(),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},handleCancel:function(){this.close()},validateMobile:function(e,t,a){!t||new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(t)?a():a("您的手机号码格式不正确!")}}},u=d,h=a("2877"),p=Object(h["a"])(u,r,o,!1,null,"01fa5ee3",null);t["default"]=p.exports},c9c2:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-row",{attrs:{gutter:10}},[t("a-col",{attrs:{md:12,sm:24}},[t("a-card",{attrs:{bordered:!1}},[t("a-row",{staticStyle:{"margin-left":"14px"}},[t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleAdd(1)}}},[e._v("添加部门")]),t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleAdd(2)}}},[e._v("添加下级")]),t("a-button",{attrs:{type:"primary",icon:"download"},on:{click:function(t){return e.handleExportXls("部门信息")}}},[e._v("导出")]),t("a-upload",{attrs:{name:"file",showUploadList:!1,multiple:!1,headers:e.tokenHeader,action:e.importExcelUrl},on:{change:e.handleImportExcel}},[t("a-button",{attrs:{type:"primary",icon:"import"}},[e._v("导入")])],1),t("a-button",{attrs:{title:"删除多条数据",type:"default"},on:{click:e.batchDel}},[e._v("批量删除")])],1),t("div",{staticStyle:{background:"#fff","padding-left":"16px",height:"100%","margin-top":"5px"}},[t("a-alert",{attrs:{type:"info",showIcon:!0}},[t("div",{attrs:{slot:"message"},slot:"message"},[e._v("\n 当前选择:"),this.currSelected.title?t("span",[e._v(e._s(e.getCurrSelectedTitle()))]):e._e(),this.currSelected.title?t("a",{staticStyle:{"margin-left":"10px"},on:{click:e.onClearSelected}},[e._v("取消选择")]):e._e()])]),t("a-input-search",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{placeholder:"请输入部门名称"},on:{search:e.onSearch}}),t("a-col",{attrs:{md:10,sm:24}},[[t("a-dropdown",{attrs:{trigger:[this.dropTrigger]},on:{visibleChange:e.dropStatus}},[t("span",{staticStyle:{"user-select":"none"}},[t("a-tree",{attrs:{checkable:"",multiple:"",selectedKeys:e.selectedKeys,checkedKeys:e.checkedKeys,treeData:e.departTree,checkStrictly:e.checkStrictly,expandedKeys:e.iExpandedKeys,autoExpandParent:e.autoExpandParent},on:{select:e.onSelect,check:e.onCheck,rightClick:e.rightHandle,expand:e.onExpand}})],1),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:function(t){return e.handleAdd(3)}}},[e._v("添加")]),t("a-menu-item",{key:"2",on:{click:e.handleDelete}},[e._v("删除")]),t("a-menu-item",{key:"3",on:{click:e.closeDrop}},[e._v("取消")])],1)],1)]],2)],1)],1),t("div",{staticClass:"drawer-bootom-button"},[t("a-dropdown",{attrs:{trigger:["click"],placement:"topCenter"}},[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:function(t){return e.switchCheckStrictly(1)}}},[e._v("父子关联")]),t("a-menu-item",{key:"2",on:{click:function(t){return e.switchCheckStrictly(2)}}},[e._v("取消关联")]),t("a-menu-item",{key:"3",on:{click:e.checkALL}},[e._v("全部勾选")]),t("a-menu-item",{key:"4",on:{click:e.cancelCheckALL}},[e._v("取消全选")]),t("a-menu-item",{key:"5",on:{click:e.expandAll}},[e._v("展开所有")]),t("a-menu-item",{key:"6",on:{click:e.closeAll}},[e._v("合并所有")])],1),t("a-button",[e._v("\n 树操作 "),t("a-icon",{attrs:{type:"up"}})],1)],1)],1)],1),t("a-col",{attrs:{md:12,sm:24}},[t("a-tabs",{attrs:{defaultActiveKey:"1"}},[t("a-tab-pane",{key:"1",attrs:{tab:"基本信息"}},[e.selectedKeys.length>0?t("a-card",{attrs:{bordered:!1}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"机构名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["departName",e.validatorRules.departName],expression:"['departName', validatorRules.departName ]"}],attrs:{placeholder:"请输入机构/部门名称"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"上级部门"}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{dropdownStyle:{maxHeight:"200px",overflow:"auto"},treeData:e.treeData,disabled:e.disable,placeholder:"无"},model:{value:e.model.parentId,callback:function(t){e.$set(e.model,"parentId",t)},expression:"model.parentId"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"机构编码"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["orgCode",e.validatorRules.orgCode],expression:"['orgCode', validatorRules.orgCode ]"}],attrs:{disabled:"",placeholder:"请输入机构编码"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"机构类型"}},[e.orgCategoryDisabled?[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["orgCategory",e.validatorRules.orgCategory],expression:"['orgCategory',validatorRules.orgCategory]"}],attrs:{placeholder:"请选择机构类型"}},[t("a-radio",{attrs:{value:"1"}},[e._v("\n 公司\n ")])],1)]:[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["orgCategory",e.validatorRules.orgCategory],expression:"['orgCategory',validatorRules.orgCategory]"}],attrs:{placeholder:"请选择机构类型"}},[t("a-radio",{attrs:{value:"2"}},[e._v("\n 部门\n ")]),t("a-radio",{attrs:{value:"3"}},[e._v("\n 岗位\n ")])],1)]],2),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"排序"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["departOrder",{initialValue:0}],expression:"[ 'departOrder',{'initialValue':0}]"}]})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"手机号"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["mobile",{initialValue:""}],expression:"['mobile', {'initialValue':''}]"}],attrs:{placeholder:"请输入手机号"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"地址"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["address",{initialValue:""}],expression:"['address', {'initialValue':''}]"}],attrs:{placeholder:"请输入地址"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"备注"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["memo",{initialValue:""}],expression:"['memo', {'initialValue':''}]"}],attrs:{placeholder:"请输入备注"}})],1)],1),t("div",{staticClass:"anty-form-btn"},[t("a-button",{attrs:{type:"default",htmlType:"button",icon:"sync"},on:{click:e.emptyCurrForm}},[e._v("重置")]),t("a-button",{attrs:{type:"primary",htmlType:"button",icon:"form"},on:{click:e.submitCurrForm}},[e._v("保存")])],1)],1):t("a-card",[t("a-empty",[t("span",{attrs:{slot:"description"},slot:"description"},[e._v(" 请先选择一个部门! ")])])],1)],1),t("a-tab-pane",{key:"2",attrs:{tab:"部门权限",forceRender:""}},[t("depart-auth-modal",{ref:"departAuth"})],1)],1)],1),t("depart-modal",{ref:"departModal",on:{ok:e.loadTree}})],1)},o=[],i=a("c1af"),l=a("88bc"),n=a.n(l),s=a("4ec3"),c=a("0fea"),d=a("b65a"),u=a("1be7"),h=[{title:"机构名称",dataIndex:"departName"},{title:"机构类型",align:"center",dataIndex:"orgType"},{title:"机构编码",dataIndex:"orgCode"},{title:"手机号",dataIndex:"mobile"},{title:"传真",dataIndex:"fax"},{title:"地址",dataIndex:"address"},{title:"排序",align:"center",dataIndex:"departOrder"},{title:"操作",align:"center",dataIndex:"action",scopedSlots:{customRender:"action"}}],p={name:"DepartList",mixins:[d["a"]],components:{DepartAuthModal:u["default"],DepartModal:i["default"]},data:function(){return{iExpandedKeys:[],loading:!1,autoExpandParent:!0,currFlowId:"",currFlowName:"",disable:!0,treeData:[],visible:!1,departTree:[],rightClickSelectedKey:"",rightClickSelectedOrgCode:"",hiding:!0,model:{},dropTrigger:"",depart:{},columns:h,disableSubmit:!1,checkedKeys:[],selectedKeys:[],autoIncr:1,currSelected:{},allTreeKeys:[],checkStrictly:!0,form:this.$form.createForm(this),labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},graphDatasource:{nodes:[],edges:[]},validatorRules:{departName:{rules:[{required:!0,message:"请输入机构/部门名称!"}]},orgCode:{rules:[{required:!0,message:"请输入机构编码!"}]},orgCategory:{rules:[{required:!0,message:"请输入机构类型!"}]},mobile:{rules:[{validator:this.validateMobile}]}},url:{delete:"/sys/sysDepart/delete",edit:"/sys/sysDepart/edit",deleteBatch:"/sys/sysDepart/deleteBatch",exportXlsUrl:"sys/sysDepart/exportXls",importExcelUrl:"sys/sysDepart/importExcel"},orgCategoryDisabled:!1}},computed:{importExcelUrl:function(){return"".concat(window._CONFIG["domianURL"],"/").concat(this.url.importExcelUrl)}},methods:{loadData:function(){this.refresh()},loadTree:function(){var e=this,t=this;t.treeData=[],t.departTree=[],Object(s["D"])().then((function(a){if(a.success){e.allTreeKeys=[];for(var r=0;r<a.result.length;r++){var o=a.result[r];t.treeData.push(o),t.departTree.push(o),t.setThisExpandedKeys(o),t.getAllKeys(o)}e.loading=!1}}))},setThisExpandedKeys:function(e){if(e.children&&e.children.length>0){this.iExpandedKeys.push(e.key);for(var t=0;t<e.children.length;t++)this.setThisExpandedKeys(e.children[t])}},refresh:function(){this.loading=!0,this.loadTree()},rightHandle:function(e){this.dropTrigger="contextmenu",this.rightClickSelectedKey=e.node.eventKey,this.rightClickSelectedOrgCode=e.node.dataRef.orgCode},onExpand:function(e){this.iExpandedKeys=e,this.autoExpandParent=!1},backFlowList:function(){this.$router.back(-1)},dropStatus:function(e){0==e&&(this.dropTrigger="")},closeDrop:function(){this.dropTrigger=""},addRootNode:function(){this.$refs.nodeModal.add(this.currFlowId,"")},batchDel:function(){if(this.checkedKeys.length<=0)this.$message.warning("请选择一条记录!");else{for(var e="",t=0;t<this.checkedKeys.length;t++)e+=this.checkedKeys[t]+",";var a=this;this.$confirm({title:"确认删除",content:"确定要删除所选中的 "+this.checkedKeys.length+" 条数据,以及子节点数据吗?",onOk:function(){Object(c["a"])(a.url.deleteBatch,{ids:e}).then((function(e){e.success?(a.$message.success(e.message),a.loadTree(),a.onClearSelected()):a.$message.warning(e.message)}))}})}},onSearch:function(e){var t=this;e?Object(s["T"])({keyWord:e}).then((function(e){if(e.success){t.departTree=[];for(var a=0;a<e.result.length;a++){var r=e.result[a];t.departTree.push(r)}}else t.$message.warning(e.message)})):t.loadTree()},nodeModalOk:function(){this.loadTree()},nodeModalClose:function(){},hide:function(){this.visible=!1},onCheck:function(e,t){this.hiding=!1,this.checkStrictly?this.checkedKeys=e.checked:this.checkedKeys=e},onSelect:function(e,t){this.hiding=!1;var a=t.node.dataRef;this.currSelected=Object.assign({},a),this.model=this.currSelected,this.selectedKeys=[a.key],this.model.parentId=a.parentId,this.setValuesToForm(a),this.$refs.departAuth.show(a.id)},setValuesToForm:function(e){var t=this;"1"==e.orgCategory?this.orgCategoryDisabled=!0:this.orgCategoryDisabled=!1,this.$nextTick((function(){t.form.getFieldDecorator("fax",{initialValue:""}),t.form.setFieldsValue(n()(e,"departName","orgCategory","orgCode","departOrder","mobile","fax","address","memo"))}))},getCurrSelectedTitle:function(){return this.currSelected.title?this.currSelected.title:""},onClearSelected:function(){this.hiding=!0,this.checkedKeys=[],this.currSelected={},this.form.resetFields(),this.selectedKeys=[],this.$refs.departAuth.departId=""},handleNodeTypeChange:function(e){this.currSelected.nodeType=e},notifyTriggerTypeChange:function(e){this.currSelected.notifyTriggerType=e},receiptTriggerTypeChange:function(e){this.currSelected.receiptTriggerType=e},submitCurrForm:function(){var e=this;this.form.validateFields((function(t,a){if(!t){if(!e.currSelected.id)return void e.$message.warning("请点击选择要修改部门!");var r=Object.assign(e.currSelected,a);Object(c["i"])(e.url.edit,r,"put").then((function(t){t.success?(e.$message.success("保存成功!"),e.loadTree()):e.$message.error(t.message)}))}}))},emptyCurrForm:function(){this.form.resetFields()},nodeSettingFormSubmit:function(){this.form.validateFields((function(e,t){}))},openSelect:function(){this.$refs.sysDirectiveModal.show()},handleAdd:function(e){if(1==e)this.$refs.departModal.add(),this.$refs.departModal.title="新增";else if(2==e){var t=this.currSelected.key;if(!t)return this.$message.warning("请先点击选中上级部门!"),!1;this.$refs.departModal.add(this.selectedKeys),this.$refs.departModal.title="新增"}else this.$refs.departModal.add(this.rightClickSelectedKey),this.$refs.departModal.title="新增"},handleDelete:function(){var e=this;this.$confirm({title:"确认删除",content:"确定要删除此部门以及子节点数据吗?",onOk:function(){Object(s["j"])({id:e.rightClickSelectedKey}).then((function(t){if(t.success){e.checkedKeys.splice(e.checkedKeys.findIndex((function(t){return t===e.rightClickSelectedKey})),1),e.$message.success("删除成功!"),e.loadTree();var a=e.form.getFieldValue("orgCode");a&&a===e.rightClickSelectedOrgCode&&e.onClearSelected()}else e.$message.warning("删除失败!")}))}})},selectDirectiveOk:function(e){this.nodeSettingForm.setFieldsValue({directiveCode:e.directiveCode}),this.currSelected.sysCode=e.sysCode},getFlowGraphData:function(e){if(this.graphDatasource.nodes.push({id:e.id,text:e.flowNodeName}),e.children.length>0)for(var t=0;t<e.children.length;t++){var a=e.children[t];this.graphDatasource.edges.push({source:e.id,target:a.id}),this.getFlowGraphData(a)}},expandAll:function(){this.iExpandedKeys=this.allTreeKeys},closeAll:function(){this.iExpandedKeys=[]},checkALL:function(){this.checkStriccheckStrictlytly=!1,this.checkedKeys=this.allTreeKeys},cancelCheckALL:function(){this.checkedKeys=[]},switchCheckStrictly:function(e){1==e?this.checkStrictly=!1:2==e&&(this.checkStrictly=!0)},getAllKeys:function(e){if(this.allTreeKeys.push(e.key),e.children&&e.children.length>0)for(var t=0;t<e.children.length;t++)this.getAllKeys(e.children[t])}},created:function(){this.currFlowId=this.$route.params.id,this.currFlowName=this.$route.params.name}},f=p,m=(a("1533"),a("2877")),y=Object(m["a"])(f,r,o,!1,null,"b0f0ed6c",null);t["default"]=y.exports},da4a:function(e,t,a){}}]);
|