diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..6b4a674 Binary files /dev/null and b/dist.zip differ diff --git a/src/components/drawer/index.jsx b/src/components/drawer/index.jsx index 2cf757f..b997c18 100644 --- a/src/components/drawer/index.jsx +++ b/src/components/drawer/index.jsx @@ -27,7 +27,7 @@ export default class DrawerComponents extends React.Component { open: false, data: [], detailType: 'chart', - rootId: '', + params: {}, dataSource: [], columns: [], spinning: true, @@ -62,11 +62,11 @@ export default class DrawerComponents extends React.Component { } //获取数据 - getDeatilDatas(rootId, type = 'chart', showJob = '1') { + getDeatilDatas(params, type = 'chart', showJob = '1') { this.setState({ spinning: true }); d3.json( '/api/bs/hrmorganization/orgchart/getDepartmentDetail?' + - qs.stringify({ detauleType: type, rootId: rootId, showJob }), + qs.stringify({ detauleType: type, ...params, showJob }), ).then((data) => { // if (type == 'chart') { @@ -298,9 +298,10 @@ export default class DrawerComponents extends React.Component { } }; - showDrawer = (rootId) => { - this.getDeatilDatas(rootId); - this.setState({ open: true, rootId: rootId }); + showDrawer = (params) => { + const showJob = params.fclass == '0' ? '1' : '0'; + this.getDeatilDatas(params, 'chart', showJob); + this.setState({ open: true, params: params }); }; onClose = () => { @@ -308,17 +309,18 @@ export default class DrawerComponents extends React.Component { }; changeDetail = () => { - const { detailType, rootId } = this.state; + const { detailType, params } = this.state; let type = detailType == 'chart' ? 'table' : 'chart'; + const showJob = params.fclass == '0' ? '1' : '0'; this.setState({ detailType: type, }); - this.getDeatilDatas(rootId, type); + this.getDeatilDatas(params, type, showJob); }; render() { const { - rootId, + params, open, data, detailType, @@ -330,7 +332,7 @@ export default class DrawerComponents extends React.Component { let arr = []; if (detailType == 'chart') { arr.push({ label: '导出图片', key: '1' }); - arr.push({ label: '导出PDF', key: '2' }); + //arr.push({ label: '导出PDF', key: '2' }); } else { arr.push({ label: '导出表格', key: '3' }); } @@ -348,23 +350,25 @@ export default class DrawerComponents extends React.Component { }} extra={ - { - this.setState({ - showJob: e.target.checked, - }); - detailType == 'chart' && + {detailType == 'chart' && params && params.fclass == '0' && ( + { + this.setState({ + showJob: e.target.checked, + }); + this.getDeatilDatas( - rootId, + params, detailType, e.target.checked ? '1' : '0', ); - }} - > - 是否显示岗位 - + }} + > + 是否显示岗位 + + )} diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx index cee73cc..3ee4c2e 100644 --- a/src/components/topBar/index.jsx +++ b/src/components/topBar/index.jsx @@ -64,21 +64,29 @@ export class TopBar extends React.Component { return message.error('请填写描述信息'); } this.setState({ confirmLoading: true }); - setTimeout(() => { - this.setState({ open: false, confirmLoading: false, description: '' }); - message.success('版本记录成功,请重新刷新页面'); - }, 2000); - // let api = '/api/bs/hrmorganization/orgchart/synchronousData?flcass='+requestData.fclass+ '&description=' +description; - // fetch(api) - // .then((res) => res.json()) - // .then((data) => { - // if (data.code == 200) { - // this.setState({ open: false, confirmLoading: false,description:'' }); - // message.success('版本记录成功,请重新刷新页面'); - // } else { - // message.error('版本记录失败,请联系相关人员处理数据'); - // } - // }); + // setTimeout(() => { + // this.setState({ open: false, confirmLoading: false, description: '' }); + // message.success('版本记录成功,请重新刷新页面'); + // }, 2000); + let api = + '/api/bs/hrmorganization/orgchart/versionRecord?fclass=' + + requestData.fclass + + '&description=' + + description; + fetch(api) + .then((res) => res.json()) + .then((data) => { + if (data.api_status) { + this.setState({ + open: false, + confirmLoading: false, + description: '', + }); + message.success('版本记录成功,请重新刷新页面', 2, 3); + } else { + message.error('版本记录失败,请联系相关人员处理数据', 2, 3); + } + }); }; handleExportMenuClick(e) { @@ -166,10 +174,10 @@ export class TopBar extends React.Component { label: '导出图片', key: '1', }, - { - label: '导出PDF', - key: '2', - }, + // { + // label: '导出PDF', + // key: '2', + // }, ]} /> ); @@ -191,7 +199,7 @@ export class TopBar extends React.Component { const requestData = { fclass: value, root: undefined, - level: '3', + level: '2', fisvitual: '0', }; this.handleFormChange(requestData); @@ -214,7 +222,7 @@ export class TopBar extends React.Component { this.setState({ open: false })} >

- 提示:版本操作耗时较长,请谨慎操作(版本仅记录当前维度的数据) + 提示:版本记录耗时较长,请谨慎操作(仅记录当前维度的数据版本)

主题: