From 5af7b5f7e86b6e263aa662bebce3252ec9de0344 Mon Sep 17 00:00:00 2001 From: a0049873 <79py69t9wb@privaterelay.appleid.com> Date: Mon, 18 Jul 2022 17:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=BA=94=E7=94=A8=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/api/home.js | 18 +- front/src/views/home/DetailsPageconetent.vue | 31 +++- front/src/views/home/apply.vue | 173 ++++++++++-------- .../home/components/searchResultList.vue | 6 +- .../components/AbilityApplication.vue | 18 +- 5 files changed, 154 insertions(+), 92 deletions(-) diff --git a/front/src/api/home.js b/front/src/api/home.js index de19b712..417b6e6e 100644 --- a/front/src/api/home.js +++ b/front/src/api/home.js @@ -1,8 +1,8 @@ /* * @Author: hisense.wuhongjian * @Date: 2022-04-01 19:19:40 - * @LastEditors: hisense.wuhongjian - * @LastEditTime: 2022-06-30 19:36:48 + * @LastEditors: hisense.liangjunhua + * @LastEditTime: 2022-07-18 16:24:44 * @Description: 告诉大家这是什么 */ import request from '@/utils/request' @@ -119,6 +119,14 @@ export function submitApply(data) { data, }) } +// 提交申请 +export function applyAllApplication(data) { + return request({ + url: '/ability/center/v2/applyAllApplication', + method: 'post', + data, + }) +} export function tabilityapplication(data) { return request({ url: '/processForm/tabilityapplication', @@ -342,7 +350,7 @@ export function getIntegrationServicesList(params) { return request({ url: '/fuse/page', method: 'get', - params + params, }) } @@ -359,6 +367,6 @@ export function getDevelopDocTree(params) { return request({ url: '/resource/selectDevelopDoc', method: 'get', - params + params, }) -} \ No newline at end of file +} diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue index 052165db..c44b5692 100644 --- a/front/src/views/home/DetailsPageconetent.vue +++ b/front/src/views/home/DetailsPageconetent.vue @@ -39,6 +39,14 @@ class="resultListSearchInput" /> +
@@ -96,7 +104,7 @@ /> -
@@ -119,7 +127,7 @@
- + --> @@ -316,7 +324,7 @@ /> -
+
@@ -514,7 +522,7 @@ /> -
+
@@ -1095,7 +1103,15 @@ getAppResources() } }) - + // 全部申请 + const applyAll = () => { + router.push({ + path: '/apply', + query: { + applyAll: true, + }, + }) + } // 分页 const onShowSizeChange = (current, pageSize) => { currentPage.value = current @@ -1193,6 +1209,7 @@ loading, getShoppingCartList, whoShow1, + applyAll, } }, components: { diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 41a6efb7..f0d1aadf 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -6,7 +6,7 @@ -->
-
+
@@ -243,6 +243,7 @@ startOfBusinessKey, updateInstanceId, submitApply, + applyAllApplication, getUser, getUserInfo, relaunch, @@ -269,25 +270,28 @@ const disabled = ref(false) const flag = ref(false) const list = ref(JSON.parse(localStorage.getItem('applyList'))) - const num = ref(0) - 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 + const applyAll = router.currentRoute.value.query.applyAll + 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 + } } + }) + if (item.checkedList) { + console.log(item) + num.value += Number(item.checkedList.length) } }) - if (item.checkedList) { - console.log(item) - num.value += Number(item.checkedList.length) - } - }) + } + const num = ref(0) console.log( 'list', list.value @@ -299,7 +303,9 @@ let record = ref('1') const text = ref('') const formName = reactive({ - title: list.value[0].children + title: applyAll + ? '全部应用资源申请' + : list.value[0].children ? list.value[0].children .filter((val) => val.id == list.value[0].checkedList[0])[0] .resourceName.concat( @@ -412,73 +418,89 @@ if (!formName) { return message.error('请设置表单名称') } - let ids = [] - formName.system = [] - console.log('list==================', list.value) - list.value.map((val) => { - val.arr.map((item) => { - if (item.type !== '基础设施') { - formName.system.push({ - resourceId: item.resourceId, - resourceName: item.resourceName, - }) - 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, + if (!applyAll) { + let ids = [] + formName.system = [] + console.log('list==================', list.value) + list.value.map((val) => { + val.arr.map((item) => { + if (item.type !== '基础设施') { + formName.system.push({ + resourceId: item.resourceId, + resourceName: item.resourceName, }) - }) - submitApply(obj).then((res) => { - applySuccess.value = false - console.log('摄像头申请================>', res) + console.log(item.id) if (item.id) { - sgcDel({ ids: [item.id] }).then((res) => { - if (res.data.msg === 'success') { - mybus.emit('getSgcNum') - } - }) + 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, + }) + }) + submitApply(obj).then((res) => { + applySuccess.value = false + console.log('摄像头申请================>', res) + if (item.id) { + sgcDel({ ids: [item.id] }).then((res) => { + if (res.data.msg === 'success') { + mybus.emit('getSgcNum') + } + }) + } + }) + } + }) }) - }) - console.log('提交数据==========================>', formName, ids) - if (formName.system.length !== 0) { - submitApply(formName).then((res) => { - applySuccess.value = false - message.success('操作成功!') - console.log('能力申请================>', res) - if (ids && ids.length > 0) { - sgcDel({ ids: ids }).then((res) => { - if (res.data.msg === 'success') { - mybus.emit('getSgcNum') - - router.push({ - path: '/DetailsPageconetent', - query: { - select: '组件服务', - }, - }) - } - }) - } else { + console.log('提交数据==========================>', formName, ids) + if (formName.system.length !== 0) { + submitApply(formName).then((res) => { + // applySuccess.value = false + message.success('申请提交成功,请到消息中心查看!') + console.log('能力申请================>', res) + if (ids && ids.length > 0) { + sgcDel({ ids: ids }).then((res) => { + if (res.data.msg === 'success') { + mybus.emit('getSgcNum') + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + }) + } else { + router.push({ + path: '/DetailsPageconetent', + query: { + select: '组件服务', + }, + }) + } + }) + } + } else { + formName.applicationSystem = '' + applyAllApplication(formName).then((res) => { + if (res.data.code == 0) { + message.success('申请提交成功,请到消息中心查看!') router.push({ path: '/DetailsPageconetent', query: { select: '组件服务', }, }) + } else { + message.error('申请失败!') } }) } @@ -668,6 +690,7 @@ systemOptions, applicationSceneOpthion, flag, + applyAll, } }, } diff --git a/front/src/views/home/components/searchResultList.vue b/front/src/views/home/components/searchResultList.vue index 973483c4..1d3fdc97 100644 --- a/front/src/views/home/components/searchResultList.vue +++ b/front/src/views/home/components/searchResultList.vue @@ -289,7 +289,7 @@ " > {{ - item.shareCondition == '免批申请' ? '免批申请' : '立即申请' + item.shareCondition == '免批申请' ? '立即申请' : '立即申请' }}
@@ -548,8 +548,8 @@ type: item.type, componentType: (item.infoList.filter( - (val) => (val.attrType == '组件类型')[0] - ) && + (val) => val.attrType == '组件类型' + )[0] && item.infoList.filter( (val) => val.attrType == '组件类型' )[0].attrValue) || diff --git a/front/src/views/personalCenter/components/AbilityApplication.vue b/front/src/views/personalCenter/components/AbilityApplication.vue index 2afbf921..9fed0ba6 100644 --- a/front/src/views/personalCenter/components/AbilityApplication.vue +++ b/front/src/views/personalCenter/components/AbilityApplication.vue @@ -2,7 +2,7 @@ * @Author: hisense.liangjunhua * @Date: 2022-07-12 09:42:44 * @LastEditors: hisense.liangjunhua - * @LastEditTime: 2022-07-13 15:56:51 + * @LastEditTime: 2022-07-18 17:25:03 * @Description:我的申请 能力申请 查看详情 -->