From 11f4c3fe257bd80b3287f0ca569fd3e8efca15bf Mon Sep 17 00:00:00 2001 From: guoyue Date: Wed, 21 Sep 2022 15:43:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8--=E5=8D=95=E5=85=B5?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=92=8C=E6=97=A0=E4=BA=BA=E6=9C=BA=EF=BC=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8/=E7=94=B3=E8=AF=B7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/api/home.js | 16 + front/src/views/home/apply.vue | 254 +- front/src/views/home/infrastructurePage.vue | 3540 +++++++++---------- 3 files changed, 1835 insertions(+), 1975 deletions(-) diff --git a/front/src/api/home.js b/front/src/api/home.js index fd8c10fe..52ddff8c 100644 --- a/front/src/api/home.js +++ b/front/src/api/home.js @@ -444,3 +444,19 @@ export function selectAppList(params) { params, }) } +// 西海岸-获取无人机和单兵设备列表 +export function getSoldierList(params) { + return request({ + url: '/device/page', + method: 'get', + params, + }) +} +// 西海岸-无人机和单兵设备提交申请 +export function soldierApply(data) { + return request({ + url: '/deviceApply', + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 7d94b15d..d5d992e4 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -126,7 +126,7 @@ import mybus from '@/myplugins/mybus' import { sgcDel, getApplyForm } from '@/api/personalCenter' import { pageWithAttrs, updateIntegrationServices } from '@/api/home' import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js' -import { getIntegrationDetail } from '@/api/home' +import { getIntegrationDetail, soldierApply } from '@/api/home' export default { name: '', @@ -140,7 +140,6 @@ export default { const disabled = ref(false) const flag = ref(false) const list = ref(JSON.parse(localStorage.getItem('applyList'))) - const deptNameAll = ref([]) //所有部门名称 const deptFlage = ref(true) //判断是否存在默认部门名称 const applyAll = router.currentRoute.value.query.applyAll; @@ -148,17 +147,15 @@ export default { const integrationServicesId = router.currentRoute.value.query.integrationServicesId; // 融合服务详情 const integrationServicesItemInfo = ref(null) - const num = ref(0) + if (!applyAll) { list.value.map((item) => { item.arr.map((val) => { - console.log(item, '组件===========================') let obj = item.children ? item.children.filter((type) => type.id == val.id)[0] : val.type !== '应用资源' if (obj) { - console.log('11111111111111111111111111111', obj, flag.value) if (obj.type !== '应用资源') { flag.value = true } @@ -174,11 +171,13 @@ export default { const baseURL = window.SITE_CONFIG.apiURL let record = ref('1') const text = ref('') + // 西海岸-特殊处理 todo + let wrjAndDbText = ['单兵设备', '无人机'] const formName = reactive({ title: applyAll ? '全部应用资源申请' - : list.value[0].arr && list.value[0].arr[0].type == '单兵设备' - ? '单兵设备申请' + : wrjAndDbText.includes(list.value[0].arr && list.value[0].arr[0] && list.value[0].arr[0].type) + ? list.value[0].arr[0].type + '申请' : list.value[0].children ? '申请' + list.value[0].children @@ -262,9 +261,7 @@ export default { label: val.dictLabel, }) }) - // console.log('字典值========>', applicationSceneOpthion.value) }) - // console.log(formName.system) const formRef = ref() const applySuccess = ref(true) const dataForm = { @@ -293,6 +290,7 @@ export default { }) } + // 提交申请 const processStartHandle = () => { formRef.value.validate().then(() => { if (!formUrl) { @@ -301,6 +299,7 @@ export default { if (!formName) { return message.error('请设置表单名称') } + if (id) { endProcess({ instanceId: taskId }).then((end) => { if (end.data.code == 0) { @@ -421,125 +420,119 @@ export default { }) } else { if (!applyAll) { - console.log(list.value[0].arr[0]) - // 单兵设备为了演示 添加 不做处理 - if (list.value[0].arr[0].type == '单兵设备') { - message.success('单兵设备申请提交成功!') - jumpToDetailsPageconetent() - } else { - let ids = [] - let falgNum = 0 - let sxt = true - formName.system = [] - console.log('list==================', list.value) - list.value.map((val) => { - val.arr.map((item) => { - if (item.type !== '基础设施') { - falgNum++ - } - }) - }) - list.value.map((val) => { - val.arr.map((item) => { - if (item.type !== '基础设施') { - formName.system.push({ - resourceId: item.resourceId, - resourceName: item.resourceName, - }) - falgNum++ - console.log(item.id) - if (item.id) { - 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() - } - }) - } - }) - }) - console.log( - '提交数据==========================>', - formName, - ids - ) - if (formName.system.length !== 0) { - if (formName.applicationSystem.length == 0) { - formName.applicationSystem = '' + let ids = [] + let falgNum = 0 + let sxt = true + formName.system = [] + console.log('list==================', list.value) + list.value.map((val) => { + val.arr.map((item) => { + if (item.type !== '基础设施') { + falgNum++ } - submitApply(formName).then((res) => { - // applySuccess.value = false - message.success('申请提交成功,请到消息中心查看!') - console.log('能力申请================>', res) - if (res.data.code == 0) { - if (ids && ids.length > 0) { - sgcDel({ ids: ids }).then((res) => { - if (res.data.msg === 'success') { + }) + }) + list.value.map((val) => { + val.arr.map((item) => { + if (item.type !== '基础设施') { + formName.system.push({ + resourceId: item.resourceId, + resourceName: item.resourceName, + }) + falgNum++ + console.log(item.id) + if (item.id) { + 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 (integrationServicesId) { - getIntegrationServicesDeatil(integrationServicesId).then(res => { - updateIntegrationServiceAction() - }) + if ( + res.data.msg === 'success' && + falgNum == 0 && + sxt + ) { + message.success('申请提交成功,请到消息中心查看!') + sxt = false } jumpToDetailsPageconetent() } - } else { - message.error('申请失败!') - } - }) + }) + } + }) + }) + console.log('formName--ids-提交数据--------->', formName, ids); + if (formName.system.length !== 0) { + 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) { + if (ids && ids.length > 0) { + sgcDel({ ids: ids }).then((res) => { + if (res.data.msg === 'success') { + mybus.emit('getSgcNum') + jumpToDetailsPageconetent() + } + }) + } else { + // 融合服务 + if (integrationServicesId) { + getIntegrationServicesDeatil(integrationServicesId).then(res => { + updateIntegrationServiceAction() + }) + } + jumpToDetailsPageconetent() + } + } else { + message.error('申请失败!') + } + }) } } else { formName.applicationSystem = '' @@ -737,7 +730,32 @@ export default { } ) }) + } + // 西海岸:单兵设备、无人机提交申请 todo + const handleWrjApply = (formName) => { + let _data = { + deviceId: formName.system && formName.system[0] && formName.system[0].resourceId, + title: formName.title, + name: formName.user, + phone: formName.phone, + dept: formName.unit, // 单位 + system: formName.applicationSystem, // 应用系统 + area: formName.applicationScene, // 应用领域 + demand: formName.applicationBackground, // 需求依据 + } + console.log('_data-----提交申请------->', _data); + soldierApply(_data).then(res => { + console.log('res----提交申请-------->', res); + if (res.data.code == 0) { + message.success(res.data.msg) + jumpToDetailsPageconetent() + } else { + message.error('申请失败!') + } + }).catch(err => { + message.error(err) + }) } return { diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index 785e15c0..79fc1397 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -5,24 +5,15 @@
{{ item.title }} - + 清空 - + {{ itemContent.labelName || itemContent }}
@@ -30,35 +21,19 @@
-
+
会议室预约
-
+
预约结果
会议室搜索
- - + + 重置
@@ -69,40 +44,23 @@
可用时间查询 - - - + + +
- +
{{ item.name }}
@@ -115,54 +73,39 @@ {{ item.description }}
- + " @click="appointment(item)"> 预约
- +
- + - +
- +
预约结果
-
-
+ ">
+
审核结果:{{ - lookData.state == 2 - ? '通过' - : lookData.state == 1 - ? '审核中' - : '不通过' + lookData.state == 2 + ? '通过' + : lookData.state == 1 + ? '审核中' + : '不通过' }} @@ -217,29 +142,24 @@
预约信息
-
+ ">
预约时段:{{ lookData.bookDate }} {{ lookData.startTime }}-{{ - lookData.endTime + lookData.endTime }}
-
+ "> 预约人:{{ lookData.name }} 联系方式:{{ lookData.phone }} 预约部门:{{ lookData.dept }} @@ -249,43 +169,18 @@ 使用事项:{{ lookData.matter }}
- - + + - - + + -
+
当日会议室可用时段:{{ roomDateList[0] }} @@ -293,89 +188,47 @@
- - + + - + - + - + - + - + - - + + 选择上传附件 @@ -386,16 +239,9 @@ - + 取消 - + 提交 @@ -427,38 +273,19 @@
- - + + 重置
- + 批量预览 - + 批量预览 @@ -473,48 +300,33 @@
- + }">