From 787ceeef3f451fdb8740e643ed8ea8b935c31f80 Mon Sep 17 00:00:00 2001 From: guoyue Date: Tue, 27 Sep 2022 18:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=EF=BC=9A=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=AE=BE=E6=96=BD--=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E8=AF=B7--=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/apply.vue | 174 ++++++++++++--------------------- 1 file changed, 64 insertions(+), 110 deletions(-) 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 = {