|
@@ -6,18 +6,20 @@ import DateFormatter from '../utils/DateTimeUtils.js';
|
|
|
import {converter} from '../component/converter.js';
|
|
import {converter} from '../component/converter.js';
|
|
|
import RenderUtils from '../utils/RenderUtils.js';
|
|
import RenderUtils from '../utils/RenderUtils.js';
|
|
|
import config from '../data/cc.json';
|
|
import config from '../data/cc.json';
|
|
|
|
|
+import URL from '../constants/url.json';
|
|
|
|
|
|
|
|
class Factory extends React.Component {
|
|
class Factory extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
+ this.index = 0;
|
|
|
this.state = {
|
|
this.state = {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getModelConfig(mid) {
|
|
getModelConfig(mid) {
|
|
|
let me = this;
|
|
let me = this;
|
|
|
- fetch('http://10.10.100.191:8082/kanbanInstance/parseData/4F75DDBB413', {
|
|
|
|
|
|
|
+ fetch(URL.path+mid, {
|
|
|
method: 'GET'
|
|
method: 'GET'
|
|
|
}).then(function (response) {
|
|
}).then(function (response) {
|
|
|
return (response.json())
|
|
return (response.json())
|
|
@@ -35,14 +37,18 @@ class Factory extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentWillMount() {
|
|
componentWillMount() {
|
|
|
- this.getModelConfig();
|
|
|
|
|
|
|
+ let {code} = this.props;
|
|
|
|
|
+ this.getModelConfig(code[0]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
|
- let { refresh } = this.props;
|
|
|
|
|
|
|
+ let {code, refresh} = this.props;
|
|
|
if (refresh.interval) {
|
|
if (refresh.interval) {
|
|
|
setInterval(function () {
|
|
setInterval(function () {
|
|
|
- this.getModelConfig();
|
|
|
|
|
|
|
+ if(this.index == code.length) {
|
|
|
|
|
+ this.index = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getModelConfig(code[this.index++]);
|
|
|
|
|
|
|
|
}.bind(this), refresh.interval || 3000)
|
|
}.bind(this), refresh.interval || 3000)
|
|
|
}
|
|
}
|