Commit 858ea212 authored by taabe's avatar taabe

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

parent cf02086a
......@@ -12,7 +12,9 @@ const completePrefix = endConf.completePrefix;
*/
export const ruleAction = (content,confirm) => {
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}`);
return commonPut(requestUrl, {});
};
......
......@@ -17,17 +17,17 @@ class TopView extends Component {
showContent: this.props.planStarted === true ? '' : 'none',
content: '',
timeCount: 0,
batchNo:'',
contingencyPlanId:''
batchNo: '',
contingencyPlanId: ''
};
this.timer = null;
}
componentDidMount() {
this.props.subscribe(eventTopics.top_ae_msg, (topic, data) => {
const { content, batchNo, contingencyPlanId} = data;
const { content, batchNo, contingencyPlanId } = data;
this.props.planStart(data);
this.setState( { content, showContent: 'block', batchNo, contingencyPlanId} );
this.setState( { content, showContent: 'block', batchNo, contingencyPlanId } );
let { planStart } = this.props;
this.prepareChangeTimeText(planStart);
});
......@@ -50,14 +50,13 @@ class TopView extends Component {
// 执行删除逻辑
tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false } });
_this.props.planQuit();
let content = {batchNo: _this.state.batchNo,
let content = { batchNo: _this.state.batchNo,
stepCode: 0,
code: "FIRE_CANCEL",
requestUrl: "api/timeline/fire",
code: 'FIRE_CANCEL',
requestUrl: '/api/timeline/fire',
contingencyPlanId: _this.state.contingencyPlanId,
stepState: 'B'};
ruleAction(content,"CONFIRM").then(e=>{
stepState: 'B' };
ruleAction(content, 'CONFIRM').then(e=>{
});
},
onCancel() {}
......@@ -119,7 +118,8 @@ class TopView extends Component {
TopView.propTypes = {
subscribe: PropTypes.func,
planStart: PropTypes.func,
planQuit: PropTypes.fucn
planQuit: PropTypes.fucn,
planStarted: PropTypes.bool
};
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