Commit 858ea212 authored by taabe's avatar taabe

修复结束预案调用接口地址错误

parent cf02086a
...@@ -12,7 +12,9 @@ const completePrefix = endConf.completePrefix; ...@@ -12,7 +12,9 @@ const completePrefix = endConf.completePrefix;
*/ */
export const ruleAction = (content,confirm) => { export const ruleAction = (content,confirm) => {
let rUrl = content.requestUrl; let rUrl = content.requestUrl;
rUrl = rUrl.substring(1); if (rUrl.indexOf('/') === 0) {
rUrl = rUrl.substring(1);
}
let requestUrl = completePrefix(ConvertorURI,`${rUrl}?batchNo=${content.batchNo}&stepCode=${content.stepCode}&buttonCode=${content.code}&confirm=${confirm}&contingencyPlanId=${content.contingencyPlanId}&stepState=${content.stepState}`); let requestUrl = completePrefix(ConvertorURI,`${rUrl}?batchNo=${content.batchNo}&stepCode=${content.stepCode}&buttonCode=${content.code}&confirm=${confirm}&contingencyPlanId=${content.contingencyPlanId}&stepState=${content.stepState}`);
return commonPut(requestUrl, {}); return commonPut(requestUrl, {});
}; };
......
...@@ -17,17 +17,17 @@ class TopView extends Component { ...@@ -17,17 +17,17 @@ class TopView extends Component {
showContent: this.props.planStarted === true ? '' : 'none', showContent: this.props.planStarted === true ? '' : 'none',
content: '', content: '',
timeCount: 0, timeCount: 0,
batchNo:'', batchNo: '',
contingencyPlanId:'' contingencyPlanId: ''
}; };
this.timer = null; this.timer = null;
} }
componentDidMount() { componentDidMount() {
this.props.subscribe(eventTopics.top_ae_msg, (topic, data) => { this.props.subscribe(eventTopics.top_ae_msg, (topic, data) => {
const { content, batchNo, contingencyPlanId} = data; const { content, batchNo, contingencyPlanId } = data;
this.props.planStart(data); this.props.planStart(data);
this.setState( { content, showContent: 'block', batchNo, contingencyPlanId} ); this.setState( { content, showContent: 'block', batchNo, contingencyPlanId } );
let { planStart } = this.props; let { planStart } = this.props;
this.prepareChangeTimeText(planStart); this.prepareChangeTimeText(planStart);
}); });
...@@ -50,14 +50,13 @@ class TopView extends Component { ...@@ -50,14 +50,13 @@ class TopView extends Component {
// 执行删除逻辑 // 执行删除逻辑
tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false } }); tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false } });
_this.props.planQuit(); _this.props.planQuit();
let content = {batchNo: _this.state.batchNo, let content = { batchNo: _this.state.batchNo,
stepCode: 0, stepCode: 0,
code: "FIRE_CANCEL", code: 'FIRE_CANCEL',
requestUrl: "api/timeline/fire", requestUrl: '/api/timeline/fire',
contingencyPlanId: _this.state.contingencyPlanId, contingencyPlanId: _this.state.contingencyPlanId,
stepState: 'B'}; stepState: 'B' };
ruleAction(content,"CONFIRM").then(e=>{ ruleAction(content, 'CONFIRM').then(e=>{
}); });
}, },
onCancel() {} onCancel() {}
...@@ -119,7 +118,8 @@ class TopView extends Component { ...@@ -119,7 +118,8 @@ class TopView extends Component {
TopView.propTypes = { TopView.propTypes = {
subscribe: PropTypes.func, subscribe: PropTypes.func,
planStart: PropTypes.func, planStart: PropTypes.func,
planQuit: PropTypes.fucn planQuit: PropTypes.fucn,
planStarted: PropTypes.bool
}; };
export default TopView; export default TopView;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment