| | |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, _config.setting.delay || 0) |
| | | } else if ((!_sync || _config.wrap.priKeyType === 'static') && selected !== 'false') { |
| | | } else if (!_sync && selected !== 'false') { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | }, 200) |
| | |
| | | _data.$$uuid = _data[config.setting.primaryKey] || '' |
| | | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | if (config.wrap.priKeyType !== 'static' && selected !== 'false') { |
| | | if (selected !== 'false') { |
| | | setTimeout(() => { |
| | | this.checkTopLine() |
| | | }, 200) |
| | |
| | | data: _data, |
| | | loading: false |
| | | }, () => { |
| | | if (config.wrap.priKeyType !== 'static' && selected !== 'false') { |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | } |
| | | }) |
| | |
| | | return |
| | | } |
| | | |
| | | // if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { |
| | | // this.getExpress() |
| | | // return |
| | | // } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | getExpress = () => { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.wxNginxRequest(`express/yuantong/YT6590674317601`, 'get').then(res => { |
| | | if (!res || typeof(res) !== 'string') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: '未获取到快递信息', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | let data = res.split(/\n/).filter(Boolean) |
| | | |
| | | data = data.map((item, i) => { |
| | | return { |
| | | $Index: i, |
| | | date: item.substr(0, 19), |
| | | content: item.substr(20) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | data: data, |
| | | loading: false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getnodes = (data) => { |
| | | const { config, card } = this.state |
| | | |