cuikaidong
2025-08-08 c495c1ae53473d54af136ea00da84bf51c50d521
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-02932554"],{c15f:function(e,t,s){},c63e:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-modal",{attrs:{width:e.modalWidth,visible:e.visible,title:"部门搜索",confirmLoading:e.confirmLoading,cancelText:"关闭",wrapClassName:"ant-modal-cust-warp"},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[[s("a-form",{attrs:{form:e.form}},[s("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"上级部门"}},[s("a-tree",{attrs:{multiple:"",treeCheckable:"tree",checkable:"",expandedKeys:e.expandedKeysss,checkedKeys:e.checkedKeys,allowClear:"true",checkStrictly:!0,dropdownStyle:{maxHeight:"200px",overflow:"auto"},treeData:e.departTree,placeholder:"请选择上级部门"},on:{expand:e.onExpand,check:e.onCheck}})],1)],1)]],2)},i=[],r=s("88bc"),n=s.n(r),d=s("0fea"),c=s("4ec3"),o={name:"DepartWindow",components:{},data:function(){return{checkedKeys:[],expandedKeysss:[],userId:"",model:{},userDepartModel:{userId:"",departIdList:[]},departList:[],modalWidth:400,departTree:[],title:"操作",visible:!1,labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,headers:{},form:this.$form.createForm(this),url:{userId:"/sys/user/generateUserId"}}},methods:{add:function(e,t){this.checkedKeys=e,this.userId=t,this.edit({})},edit:function(e){var t=this;this.departList=[],this.queryDepartTree(),this.form.resetFields(),this.visible=!0,this.model=Object.assign({},e);var s=n()(this.model,"id","userId","departIdList");this.$nextTick((function(){t.form.setFieldsValue(s)}))},close:function(){this.$emit("close"),this.visible=!1,this.departList=[],this.checkedKeys=[]},handleSubmit:function(){var e=this,t=this;this.form.validateFields((function(s){if(!s)if(t.confirmLoading=!0,null==e.userId)Object(d["c"])(e.url.userId).then((function(s){if(s.success){var a={userId:s.result,departIdList:e.departList};t.$emit("ok",a)}})).finally((function(){t.departList=[],t.confirmLoading=!1,t.close()}));else{var a={userId:e.userId,departIdList:e.departList};t.departList=[],t.$emit("ok",a),t.confirmLoading=!1,t.close()}}))},handleCancel:function(){this.close()},onCheck:function(e,t){this.departList=[],this.checkedKeys=e.checked;for(var s=t.checkedNodes,a=0;a<s.length;a++){var i=s[a].data.props,r={key:"",value:"",title:""};r.key=i.value,r.value=i.value,r.title=i.title,this.departList.push(r)}},queryDepartTree:function(){var e=this;Object(c["I"])().then((function(t){if(t.success&&(e.departTree=t.result,e.checkedKeys&&e.checkedKeys.length>0)){var s=[],a=t.result;a&&a.length>0&&(a.forEach((function(e){s.push(e.key)})),e.expandedKeysss=s)}}))},onExpand:function(e){this.expandedKeysss=e},modalFormOk:function(){}}},l=o,h=(s("da4f"),s("2877")),u=Object(h["a"])(l,a,i,!1,null,"d142d550",null);t["default"]=u.exports},da4f:function(e,t,s){"use strict";var a=s("c15f"),i=s.n(a);i.a}}]);