diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index ca1407c..a98ec59 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -46,16 +46,19 @@ export const version = (params) => { } -export const exportData = (ids) => { - fetch('/api/bs/hrmorganization/common/department/export').then(res => res.blob().then(blob => { - var filename=`部门档案.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) +export const exportData = () => { + return new Promise(resolve => { + fetch('/api/bs/hrmorganization/common/department/export').then(res => res.blob().then(blob => { + resolve(); + var filename=`部门档案.xlsx` + var a = document.createElement('a'); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })) + }); } export const selectVersions = (params) => { diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index d8a8aeb..3d5c366 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -49,15 +49,18 @@ export const version = (params) => { } export const exportResource = (ids) => { - fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { - var filename=`人员档案.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) + return new Promise(resolve => { + fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { + resolve(); + var filename=`人员档案.xlsx` + var a = document.createElement('a'); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })) + }); } diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 8941a94..055a99f 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -622,7 +622,7 @@ export default class Department extends React.Component { isPanelShow, departmentName, conditionNum, visible, condition, form, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, form1, isEdit, newVisible, jobDataSource, jobColumns, selectedRowKeys, total, current, pageSize, init, - defaultShowLeft, confirmVisible, confirmLoading, postionDataSource, postionColumns, isMerge, hasRight + defaultShowLeft, confirmVisible, confirmLoading, postionDataSource, postionColumns, isMerge, hasRight,exSpinning } = department; if (hasRight === false) { @@ -690,6 +690,7 @@ export default class Department extends React.Component { }} onSearchChange={val => this.onSearchChange(val)} /> + { init ?
diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index d20a5f6..e20dff3 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -43,8 +43,6 @@ import SearchCustomDialog from './SearchCustomDialog'; import NewWeaTableEditDialog from '../NewWeaTableEditDialog'; import GroupList from './GroupList'; - - const toJS = mobx.toJS; const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; @@ -506,7 +504,7 @@ export default class Resource extends React.Component { } = this.props; const { isPanelShow, form2, lastName, conditionNum, tableStore, nEdialogTitle, visible, condition, - form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,enable + form, dialogLoading, isEdit, date, hasRight, defaultShowLeft,enable,exSpinning } = store; if (hasRight === false) { @@ -544,6 +542,7 @@ export default class Resource extends React.Component { onSearch={() => {store.hideRadioGroup();store.getTableInfo();}} onSearchChange={val => this.onSearchChange(val)} /> + {enable && } { - }, error => { - message.warning(error.msg); - }) + @action("全部导出") async exportData() { + this.exSpinning = true; + await Api.exportData(); + this.exSpinning = false; } diff --git a/pc4mobx/organization/stores/resource.js b/pc4mobx/organization/stores/resource.js index 681bddf..93ed693 100644 --- a/pc4mobx/organization/stores/resource.js +++ b/pc4mobx/organization/stores/resource.js @@ -52,6 +52,7 @@ export class ResourceStore { @observable dialogLoading = true; @observable userId = ''; @observable date = ''; + @observable exSpinning = false; @observable defaultShowLeft = true; @observable companysId = 1 @@ -60,7 +61,7 @@ export class ResourceStore { @observable selectTreeNodeInfo; @observable enable = false; - @observable _showRadioGroup = true; + @observable _showRadioGroup = false; @computed get showRadioGroup() { return this._showRadioGroup } set showRadioGroup(v) { this._showRadioGroup = v; @@ -246,12 +247,15 @@ export class ResourceStore { }) } - @action("导出") export() { + @action("导出") async export() { const params = { ...this.form.getFormParams() } - Api.exportResource(toJS(this.tableStore.selectedRowKeys).toString()); + this.exSpinning = true; + await Api.exportResource(toJS(this.tableStore.selectedRowKeys).toString()); + this.exSpinning = false; this.tableStore.selectedRowKeys = []; + } @action("另存为版本") version(id) { diff --git a/pc4mobx/organization/style/common.less b/pc4mobx/organization/style/common.less index 2ab8156..ec578eb 100644 --- a/pc4mobx/organization/style/common.less +++ b/pc4mobx/organization/style/common.less @@ -5,6 +5,7 @@ left: 50%; margin-left: -8px; margin-top: -8px; + z-index: 999; } @@ -141,4 +142,9 @@ max-width: 200px; } + //weaLeftTree +.wea-left-tree-antd.ant-tree .wea-tree-wrap>span.ant-tree-switcher { + width: 13px !important; +} + \ No newline at end of file