diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 8d0102bc..29ff3398 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -359,72 +359,15 @@ export default { ids.push(item.id) } } else { - let obj = {} - // todo - console.log('formName---摄像头--------->', formName); - obj.system = [] - item.note1 = JSON.parse(item.note1) - item.note1.map((sxt) => { - obj.system.push({ - resourceId: sxt.idtCameraChannel + '', - resourceName: sxt.channelName, - cameraId: sxt.channelId, // 改接口后删除 - channelCode: sxt.channelCode, - channelId: sxt.channelId, - channelName: sxt.channelName, - checkStatus: sxt.checkStatus + '', - gpsX: sxt.gpsX, - gpsY: sxt.gpsY, - idtCameraChannel: sxt.idtCameraChannel + '', - nodeName: sxt.nodeName, - parentId: sxt.parentId, - status: sxt.status + '', - }) - }) - console.log('obj----摄像头申请-------->', obj); - return; - submitApply(obj).then((res) => { - // applySuccess.value = false - console.log('摄像头申请================>', res) - if (item.id) { - sgcDel({ ids: [item.id] }).then((res1) => { - if (res1.data.msg === 'success') { - if (falgNum == 0 && sxt) { - message.success( - '申请提交成功,请到消息中心查看!' - ) - sxt = false - } - mybus.emit('getSgcNum') - jumpToDetailsPageconetent() - } - }) - } else { - if ( - res.data.msg === 'success' && - falgNum == 0 && - sxt - ) { - message.success('申请提交成功,请到消息中心查看!') - sxt = false - } - jumpToDetailsPageconetent() - } - }) + infrastructureConfirm(item) } }) }) - console.log( - '提交数据============submitApply==============>', - formName, - ids - ) if (formName.system.length !== 0) { if (formName.applicationSystem.length == 0) { formName.applicationSystem = '' } submitApply(formName).then((res) => { - // applySuccess.value = false message.success('申请提交成功,请到消息中心查看!') console.log('能力申请================>', res) if (res.data.code == 0) { @@ -478,56 +421,7 @@ export default { ids.push(item.id) } } else { - let obj = {} - Object.assign(obj, formName) - console.log('摄像头===============>', obj, item) - obj.system = [] - item.note1 = JSON.parse(item.note1) - item.note1.map((sxt) => { - obj.system.push({ - resourceId: sxt.idtCameraChannel + '', - resourceName: sxt.channelName, - cameraId: sxt.channelId, // 改接口后删除 - channelCode: sxt.channelCode, - channelId: sxt.channelId, - channelName: sxt.channelName, - checkStatus: sxt.checkStatus + '', - gpsX: sxt.gpsX, - gpsY: sxt.gpsY, - idtCameraChannel: sxt.idtCameraChannel + '', - nodeName: sxt.nodeName, - parentId: sxt.parentId, - status: sxt.status + '', - }) - }) - submitApply(obj).then((res) => { - // applySuccess.value = false - console.log('摄像头申请================>', res) - if (item.id) { - sgcDel({ ids: [item.id] }).then((res1) => { - if (res1.data.msg === 'success') { - if (falgNum == 0 && sxt) { - message.success( - '申请提交成功,请到消息中心查看!' - ) - sxt = false - } - mybus.emit('getSgcNum') - jumpToDetailsPageconetent() - } - }) - } else { - if ( - res.data.msg === 'success' && - falgNum == 0 && - sxt - ) { - message.success('申请提交成功,请到消息中心查看!') - sxt = false - } - jumpToDetailsPageconetent() - } - }) + infrastructureConfirm(item) } }) }) @@ -536,13 +430,12 @@ export default { if (formName.applicationSystem.length == 0) { formName.applicationSystem = '' } - // todo 西海岸:单兵设备、无人机单独调取其他接口 + // 西海岸:单兵设备、无人机单独调取其他接口 if (wrjAndDbText.includes(list.value[0].arr[0].type)) { handleWrjApply(formName) return; } submitApply(formName).then((res) => { - // applySuccess.value = false message.success('申请提交成功,请到消息中心查看!') console.log('能力申请================>', res) if (res.data.code == 0) { @@ -581,6 +474,67 @@ export default { } }) } + + // 基础设施--数据下发 + const infrastructureConfirm = (item) => { + let obj = {} + Object.assign(obj, formName) + console.log('摄像头===============>', obj, item) + obj.system = [] + item.note1 = JSON.parse(item.note1) + item.note1.map((sxt) => { + let _itemData = { + resourceId: sxt.idtCameraChannel + '', + resourceName: sxt.channelName, + cameraId: sxt.channelId, // 改接口后删除 + channelCode: sxt.channelCode, + channelId: sxt.channelId, + channelName: sxt.channelName, + checkStatus: sxt.checkStatus + '', + gpsX: sxt.gpsX, + gpsY: sxt.gpsY, + idtCameraChannel: sxt.idtCameraChannel + '', + nodeName: sxt.nodeName, + parentId: sxt.parentId, + status: sxt.status + '', + } + // 西海岸 + if (isXiHaiAn) { + _itemData.managementUnitName = sxt.managementUnitName; + _itemData.cameraPointTypeName = sxt.cameraPointTypeName; + } + obj.system.push(_itemData) + }) + submitApply(obj).then((res) => { + // applySuccess.value = false + console.log('摄像头申请================>', res) + if (item.id) { + sgcDel({ ids: [item.id] }).then((res1) => { + if (res1.data.msg === 'success') { + if (falgNum == 0 && sxt) { + message.success( + '申请提交成功,请到消息中心查看!' + ) + sxt = false + } + mybus.emit('getSgcNum') + jumpToDetailsPageconetent() + } + }) + } else { + if ( + res.data.msg === 'success' && + falgNum == 0 && + sxt + ) { + message.success('申请提交成功,请到消息中心查看!') + sxt = false + } + jumpToDetailsPageconetent() + } + }) + } + // 启动流程 const startProcess = (processDefinitionKey, businessKey, formData) => { var data = {