明细数据展示
This commit is contained in:
parent
b73ef8e8a5
commit
7838ced7cb
|
|
@ -40,4 +40,14 @@ export const exportExcel = (dataKey) => {
|
|||
return WeaTools.callApi('/api/ec/dev/table/export', 'POST', {
|
||||
dataKey: dataKey
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const getDetailTable = (params) => {
|
||||
return WeaTools.callApi('/api/gainway/basicResource/linkTable', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
export const exportDetailExcel = (params) => {
|
||||
return WeaTools.callApi('/api/ec/dev/table/export', 'POST', params)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,10 @@ class BasicConditionAnalysis extends React.Component {
|
|||
winWidth={winWidth}
|
||||
setGap={val => hrmPerStatusReport.setGap(val)}
|
||||
getData={tag => hrmPerStatusReport.getData(tag)}
|
||||
showDialog = {() => hrmPerStatusReport.setDialogVisible(true)}
|
||||
showDialog = {name => {
|
||||
hrmPerStatusReport.name = name;
|
||||
hrmPerStatusReport.setDialogVisible(true);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
@ -278,7 +281,8 @@ class BasicConditionAnalysis extends React.Component {
|
|||
isApiOneFinished,
|
||||
isApiTwoFinished,
|
||||
authorityStore,
|
||||
dialogVisible
|
||||
dialogVisible,
|
||||
name
|
||||
} = hrmPerStatusReport
|
||||
|
||||
const btn = [
|
||||
|
|
@ -424,11 +428,10 @@ class BasicConditionAnalysis extends React.Component {
|
|||
|
||||
<WeaDialog
|
||||
onCancel={() =>hrmPerStatusReport.setDialogVisible(false)}
|
||||
title={'明细数据'}
|
||||
title={`明细数据(${name})`}
|
||||
visible={dialogVisible}
|
||||
style={{ width: 800, height: 500 }}
|
||||
hasScroll
|
||||
buttons={<Button type="primary">导出明细</Button>}
|
||||
style={{ width: 1200, height: 450 }}
|
||||
buttons={<Button type="primary" onClick={() => hrmPerStatusReport.exportExcel()}>导出明细</Button>}
|
||||
>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
|
||||
comsWeaTableStore={tableStore}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ class ReportChart extends React.Component {
|
|||
if (pathname !== 'basicConditionAnalysis') return false;
|
||||
if (cmd == 'AgeRp' || cmd == 'SexRp' || cmd == 'SeniorityRp' || cmd == 'EduRp') {
|
||||
console.log("params", params);
|
||||
showDialog();
|
||||
showDialog(params.name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,10 @@ import {
|
|||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
import * as Util from '../util/index';
|
||||
import {
|
||||
WeaLocaleProvider
|
||||
WeaLocaleProvider,
|
||||
WeaLoadingGlobal
|
||||
} from 'ecCom';
|
||||
import AuthorityStore from './domain/authority.js';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -548,11 +550,67 @@ export class HrmPerStatusReport {
|
|||
/**************** #QC3421143# 基本状况分析明细数据**************************/
|
||||
@observable dialogVisible = false;
|
||||
@observable tableStore = new TableStore();
|
||||
@observable name = '';
|
||||
@observable dataKey = '';
|
||||
|
||||
setDialogVisible(bool) {
|
||||
bool && this.getDetailTable();
|
||||
this.dialogVisible = bool;
|
||||
}
|
||||
|
||||
@action getDetailTable = () => {
|
||||
this.tableStore = new TableStore();
|
||||
let cmd = this.getWholeCmd(this.pathname, this.tabKey);
|
||||
|
||||
let p = {
|
||||
cmd: cmd,
|
||||
name: this.name,
|
||||
...this.params
|
||||
};
|
||||
|
||||
if (this.searchCondition) {
|
||||
p.keyword = this.searchCondition;
|
||||
this.objToStr({ ...this.params,
|
||||
keyword: this.searchCondition
|
||||
});
|
||||
}
|
||||
|
||||
if (this.pathname == 'basicConditionAnalysis' && (this.tabKey == '1' || this.tabKey == '3' || this.tabKey == '7') && !this.nonZeroVerification()) {
|
||||
p.agearea = this.interval;
|
||||
}
|
||||
this.objToStr(this.params);
|
||||
Api.getDetailTable(p).then((res) => {
|
||||
this.dataKey = res.datas.datas;
|
||||
this.tableStore.getDatas(res.datas.datas,1)
|
||||
});
|
||||
}
|
||||
|
||||
@action exportExcel = () => {
|
||||
if (!this.dataKey) {
|
||||
return false;
|
||||
}
|
||||
const child = (
|
||||
<img style={{ height: 5 }} src="/images/loading_wev8.gif" alt="" />
|
||||
);
|
||||
WeaLoadingGlobal.start({
|
||||
indicator: child,
|
||||
tip: '正在导出请稍候...'
|
||||
});
|
||||
const title = this.getTabName();
|
||||
const params = {
|
||||
dataKey:this.dataKey,
|
||||
filename:`${title}(${this.name})`
|
||||
}
|
||||
Api.exportDetailExcel(params).then(data => {
|
||||
if (data.url) {
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
window.location.href = Util.addContentPath(data.url);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**************** #QC3421143# 基本状况分析明细数据**************************/
|
||||
|
||||
setIntervalShow(bool) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue