|
|
@@ -15,18 +15,18 @@ import {
|
|
|
isObjEmpty
|
|
|
} from '@/utils/common'
|
|
|
|
|
|
-let DEPART, USERCOUNT,dataLength;
|
|
|
+let DEPART, USERCOUNT, dataLength;
|
|
|
let DURATIONLIST = [];
|
|
|
let DAILYCOUNT = [];
|
|
|
let columnWidth = 300;
|
|
|
-let mBaseUrl = window.location.origin+'/office';
|
|
|
+let mBaseUrl = window.location.origin + '/office';
|
|
|
|
|
|
|
|
|
export default class Basic extends Component {
|
|
|
constructor() {
|
|
|
super()
|
|
|
|
|
|
- this.state = {
|
|
|
+ this.state = {
|
|
|
loading: true //更改
|
|
|
}
|
|
|
}
|
|
|
@@ -51,7 +51,7 @@ export default class Basic extends Component {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
getData = (instanceId) => {
|
|
|
fetchPost(mBaseUrl+'/api/analysis/getAnalysisByWeek', {
|
|
|
'instanceid': instanceId,
|
|
|
@@ -59,16 +59,16 @@ export default class Basic extends Component {
|
|
|
// 'Cookie': 'JSESSIONID=' + mSessionId,
|
|
|
// "Content-Type": "application/json; charset=UTF-8"
|
|
|
}).then((response) => {
|
|
|
- if(response.success){
|
|
|
+ if (response.success) {
|
|
|
let dataSource = response.data[0];
|
|
|
DEPART = dataSource.DEPART;
|
|
|
USERCOUNT = dataSource.USERCOUNT;
|
|
|
DURATIONLIST = dataSource.DURATIONLIST;
|
|
|
DAILYCOUNT = dataSource.DAILYCOUNT;
|
|
|
dataLength = DURATIONLIST.length;
|
|
|
- if(dataLength>0){
|
|
|
- columnWidth = dataLength*55;
|
|
|
- }else{
|
|
|
+ if (dataLength > 0) {
|
|
|
+ columnWidth = dataLength * 55;
|
|
|
+ } else {
|
|
|
columnWidth = 300
|
|
|
}
|
|
|
this.setState({
|
|
|
@@ -120,25 +120,27 @@ export default class Basic extends Component {
|
|
|
</Spin>
|
|
|
<div style={{ display: loading ? 'none' : 'flex' }} className='content'>
|
|
|
<div className='branch'>{DEPART}</div>
|
|
|
+ <div className='useNum'>使用人数{USERCOUNT}人</div>
|
|
|
<div className='lineCharts'>
|
|
|
- <div className='useNum'>使用人数{USERCOUNT}人</div>
|
|
|
- <Chart padding={['12%','10%','12%','auto']} height={300} data={DAILYCOUNT} scale={cols} forceFit>
|
|
|
+ <div className='useAnaly'>成员使用分析</div>
|
|
|
+ <Chart padding={['12%', '10%', '12%', '8%']} height={200} data={DAILYCOUNT} scale={cols} forceFit>
|
|
|
<Axis
|
|
|
name="DATE_TIME"
|
|
|
label={{
|
|
|
- offset: 12,
|
|
|
+ offset: 18,
|
|
|
textStyle: {
|
|
|
- fontSize: '16',
|
|
|
+ fontSize: '14',
|
|
|
fill: '#959595'
|
|
|
}
|
|
|
}} />
|
|
|
<Axis
|
|
|
name="EMCOUNT"
|
|
|
position="right"
|
|
|
+ grid={null}
|
|
|
label={{
|
|
|
offset: 10,
|
|
|
textStyle: {
|
|
|
- fontSize: '16',
|
|
|
+ fontSize: '14',
|
|
|
fill: '#959595'
|
|
|
}
|
|
|
}}
|
|
|
@@ -148,7 +150,10 @@ export default class Basic extends Component {
|
|
|
type: "y"
|
|
|
}}
|
|
|
/>
|
|
|
- <Geom type="line" position="DATE_TIME*EMCOUNT" size={2} />
|
|
|
+ <Geom
|
|
|
+ color="l (270) 0:rgba(100,149,237,1) .5:rgba(135,206,250, 1) 1:rgba(0,191,255, 1)"
|
|
|
+ shape="smooth" type="line" position="DATE_TIME*EMCOUNT" size={2}
|
|
|
+ />
|
|
|
<Geom
|
|
|
type="point"
|
|
|
position="DATE_TIME*EMCOUNT"
|
|
|
@@ -165,7 +170,7 @@ export default class Basic extends Component {
|
|
|
<div className='useTime'>成员使用时间(分钟)</div>
|
|
|
<Chart
|
|
|
onPlotClick={this.handleClick}
|
|
|
- padding={['auto','12%','auto','auto']}
|
|
|
+ padding={['auto', '12%', 'auto', '20%']}
|
|
|
height={columnWidth}
|
|
|
data={dv}
|
|
|
forceFit
|
|
|
@@ -176,12 +181,12 @@ export default class Basic extends Component {
|
|
|
label={{
|
|
|
offset: 10,
|
|
|
textStyle: {
|
|
|
- fontSize: '16',
|
|
|
+ fontSize: '14',
|
|
|
fill: '#000'
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
- <Axis name="DURATION" label={null} />
|
|
|
+ <Axis grid={null} name="DURATION" label={null} />
|
|
|
<Tooltip />
|
|
|
<Geom type="interval" position="EMNAME*DURATION" >
|
|
|
<Label
|
|
|
@@ -189,7 +194,7 @@ export default class Basic extends Component {
|
|
|
content="DURATION"
|
|
|
textStyle={{
|
|
|
fill: '#000', // 文本的颜色
|
|
|
- fontSize: '16', // 文本大小
|
|
|
+ fontSize: '14', // 文本大小
|
|
|
}} />
|
|
|
</Geom>
|
|
|
</Chart>
|