text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c69010a","chunk-2d208319"],{a46f:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=this,a=e.$createElement,n=e._self._c||a;return n("a-modal",{attrs:{title:"编辑表单",width:"40%",visible:e.visible,confirmLoading:e.confirmLoading},on:{ok:e.handleSubmit,cancel:function(){t.visible=!1}}},[n("a-spin",{attrs:{spinning:e.confirmLoading}},[n("a-form-model",e._b({ref:"form",attrs:{model:e.entity,rules:e.rules}},"a-form-model",e.layout,!1),[n("a-form-model-item",{attrs:{label:"部门名",prop:"Name"}},[n("a-input",{attrs:{autocomplete:"off"},model:{value:e.entity.Name,callback:function(t){e.$set(e.entity,"Name",t)},expression:"entity.Name"}})],1),n("a-form-model-item",{attrs:{label:"上级部门",prop:"ParentId"}},[n("a-tree-select",{attrs:{allowClear:"",treeData:e.ParentIdTreeData,placeholder:"请选择上级部门",treeDefaultExpandAll:""},model:{value:e.entity.ParentId,callback:function(t){e.$set(e.entity,"ParentId",t)},expression:"entity.ParentId"}})],1)],1)],1)],1)},i=[],o={props:{afterSubmit:{type:Function,default:null}},data:function(){return{layout:{labelCol:{span:5},wrapperCol:{span:18}},visible:!1,confirmLoading:!1,entity:{},ParentIdTreeData:[],rules:{Name:[{required:!0,message:"必填"}]}}},methods:{init:function(){var t=this;this.visible=!0,this.entity={},this.$nextTick(function(){t.$refs["form"].clearValidate()}),this.$http.post("/Base_Manage/Base_Department/GetTreeDataList",{}).then(function(e){e.Success&&(t.ParentIdTreeData=e.Data)})},openForm:function(t){var e=this;this.init(),t&&this.$http.post("/Base_Manage/Base_Department/GetTheData",{id:t}).then(function(t){e.entity=t.Data})},handleSubmit:function(){var t=this;this.$refs["form"].validate(function(e){e&&(t.confirmLoading=!0,t.$http.post("/Base_Manage/Base_Department/SaveData",t.entity).then(function(e){t.confirmLoading=!1,e.Success?(t.$message.success("操作成功!"),t.afterSubmit(),t.visible=!1):t.$message.error(e.Msg)}))})}}},s=o,r=a("2877"),l=Object(r["a"])(s,n,i,!1,null,null,null);e["default"]=l.exports},d504:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"table-operator"},[a("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(e){return t.hanldleAdd()}}},[t._v("新建")]),a("a-button",{attrs:{type:"primary",icon:"minus",disabled:!t.hasSelected(),loading:t.loading},on:{click:function(e){return t.handleDelete(t.selectedRowKeys)}}},[t._v("删除")]),a("a-button",{attrs:{type:"primary",icon:"redo"},on:{click:function(e){return t.getDataList()}}},[t._v("刷新")])],1),t.data&&t.data.length?a("a-table",{ref:"table",attrs:{columns:t.columns,rowKey:function(t){return t.Id},dataSource:t.data,loading:t.loading,pagination:!1,rowSelection:{selectedRowKeys:t.selectedRowKeys,onChange:t.onSelectChange},bordered:!0,defaultExpandAllRows:!0,size:"small"},on:{change:t.handleTableChange},scopedSlots:t._u([{key:"action",fn:function(e,n){return a("span",{},[[a("a",{on:{click:function(e){return t.handleEdit(n.Id)}}},[t._v("编辑")]),a("a-divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.handleDelete([n.Id])}}},[t._v("删除")])]],2)}}],null,!1,2699708514)}):t._e(),a("edit-form",{ref:"editForm",attrs:{afterSubmit:t.getDataList}})],1)},i=[],o=a("cebc"),s=a("a46f"),r=[{title:"部门名",dataIndex:"Text",width:"20%"},{title:"操作",dataIndex:"action",scopedSlots:{customRender:"action"}}],l={components:{EditForm:s["default"]},mounted:function(){this.getDataList()},data:function(){return{data:[],pagination:{current:1,pageSize:10,showTotal:function(t,e){return"总数:".concat(t," 当前:").concat(e[0],"-").concat(e[1])}},filters:{},sorter:{field:"Id",order:"asc"},loading:!1,columns:r,queryParam:{},visible:!1,selectedRowKeys:[]}},methods:{handleTableChange:function(t,e,a){this.pagination=Object(o["a"])({},t),this.filters=Object(o["a"])({},e),this.sorter=Object(o["a"])({},a),this.getDataList()},getDataList:function(){var t=this;this.selectedRowKeys=[],this.loading=!0,this.$http.post("/Base_Manage/Base_Department/GetTreeDataList",Object(o["a"])({PageIndex:this.pagination.current,PageRows:this.pagination.pageSize,SortField:this.sorter.field||"Id",SortType:this.sorter.order},this.filters)).then(function(e){t.loading=!1,t.data=e.Data;var a=Object(o["a"])({},t.pagination);a.total=e.Total,t.pagination=a})},onSelectChange:function(t){this.selectedRowKeys=t},hasSelected:function(){return this.selectedRowKeys.length>0},hanldleAdd:function(){this.$refs.editForm.openForm()},handleEdit:function(t){this.$refs.editForm.openForm(t)},handleDelete:function(t){var e=this;this.$confirm({title:"确认删除吗?",onOk:function(){return new Promise(function(a,n){e.submitDelete(t,a,n)})}})},submitDelete:function(t,e,a){var n=this;this.$http.post("/Base_Manage/Base_Department/DeleteData",t).then(function(t){e(),t.Success?(n.$message.success("操作成功!"),n.getDataList()):n.$message.error(t.Msg)})}}},c=l,d=a("2877"),u=Object(d["a"])(c,n,i,!1,null,null,null);e["default"]=u.exports}}]);