|
|
@@ -6,13 +6,13 @@ import { converter } from './converter.js';
|
|
|
import URL from '../constants/url.dev.json';
|
|
|
import 'whatwg-fetch';
|
|
|
|
|
|
-import tempdata from '../data/BarTable.json';
|
|
|
+import tempdata from '../data/bug.json';
|
|
|
|
|
|
class Factory extends React.Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.dev = 'local';
|
|
|
+ this.dev = 'local ';
|
|
|
this.index = 0;
|
|
|
this.state = {
|
|
|
titleHeight: 0,
|
|
|
@@ -21,9 +21,9 @@ class Factory extends React.Component {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- getModelConfig(mid) {
|
|
|
+ getModelConfig(url) {
|
|
|
let me = this;
|
|
|
- fetch(URL.path + mid, {
|
|
|
+ fetch(url, {
|
|
|
method: 'POST',
|
|
|
credentials: 'include'
|
|
|
}).then(function (response) {
|
|
|
@@ -93,7 +93,8 @@ class Factory extends React.Component {
|
|
|
} else {
|
|
|
this.index++;
|
|
|
}
|
|
|
- this.getModelConfig(this.props.code[0] + '?kanbanCode=' + codes[this.index]);
|
|
|
+ let reg = /(.*){code}(.*){index}(.*){kanbanCode}(.*)/g;
|
|
|
+ this.getModelConfig(URL.completelyPath.replace(reg, '$1' + this.props.code + '$2' + this.props.index + '$3' + codes[this.index]));
|
|
|
}.bind(this), refresh.current.interval * 1000 || 10000)
|
|
|
}
|
|
|
}
|
|
|
@@ -107,7 +108,7 @@ class Factory extends React.Component {
|
|
|
}
|
|
|
|
|
|
componentWillMount() {
|
|
|
- let { code } = this.props;
|
|
|
+ let { code, index } = this.props;
|
|
|
if(this.dev == 'local') {
|
|
|
this.setState({
|
|
|
model: converter(tempdata.data[0]),
|
|
|
@@ -123,7 +124,8 @@ class Factory extends React.Component {
|
|
|
});
|
|
|
}.bind(this), 7000)
|
|
|
}else {
|
|
|
- this.getModelConfig(code[0]);
|
|
|
+ let reg = /(.*){code}(.*){index}(.*)/g;
|
|
|
+ this.getModelConfig(URL.defaultPath.replace(reg, '$1' + code + '$2' + index));
|
|
|
}
|
|
|
}
|
|
|
|