diff --git a/front/src/views/home/AbilityToApplyFor.vue b/front/src/views/home/AbilityToApplyFor.vue index 7a863bd2..fa791bc4 100644 --- a/front/src/views/home/AbilityToApplyFor.vue +++ b/front/src/views/home/AbilityToApplyFor.vue @@ -49,8 +49,8 @@
{{ val.description || - (val.note1 && - JSON.parse(val.note1)[0].channelName + + ((val.note1 || '') && + ( JSON.parse(val.note1)[0].channelName || '--') + '等' + JSON.parse(val.note1).length + '个摄像头') || diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 74cfa2f4..26d1c68a 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -11,150 +11,61 @@
- +
- - + +
- - + + - - + + - - + +
- - + + - - + +
- - + +
- - + +
- - - + + + "> 文件上传 @@ -181,8 +91,7 @@
- + " type="primary" html-type="cancle" @click="resetFields()"> 退出申请 - + " type="primary" html-type="submit" @click="processStartHandle()"> 提交申请
@@ -234,294 +134,268 @@ diff --git a/front/src/views/home/components/searchResultList.vue b/front/src/views/home/components/searchResultList.vue index 531885ad..f755cb77 100644 --- a/front/src/views/home/components/searchResultList.vue +++ b/front/src/views/home/components/searchResultList.vue @@ -588,33 +588,88 @@ export default { } // 融合服务--一键申请 - const handleAKeyApplication = (item) => { - let _applyList = [] - ; (item.fuseResourceList || []).map((v) => { - let resource = v.resource || {} - let obj = { - arr: [ - { - delFlag: resource.delFlag, - description: resource.description, - resourceId: resource.id, - resourceName: resource.name, - time: resource.createDate, - type: resource.type, - }, - ], - deptId: resource.deptId, - deptName: resource.deptName, - } - _applyList.push(obj) - }) - + // 一键申请 + const handleAKeyApplication = (item ) => { + let _applyList = []; + let fuseResourceList = item.fuseResourceList || [] + let jcssArray = fuseResourceList.filter(v => v.type === '基础设施') + let otherArray = fuseResourceList.filter(v => v.type !== '基础设施') + jcssArray = jcssArray.map(v => { + v = Object.assign(v, v.resource) + return v + }) + let jcss = [ + { + arr: [ + { + description: '', + note1: JSON.stringify(jcssArray), + resourceId: '1522550195055828996', + resourceName: '摄像头列表', + type: '基础设施', + }, + ], + deptId: '', + deptName: '', + }, + ] + if (infrastructure) { + jcss[0].deptId = infrastructure.deptId + jcss[0].deptName = infrastructure.deptName + } + otherArray.map((v) => { + let resource = v.resource || {} + console.log('resource------------>', resource); + let obj = { + arr: [ + { + delFlag: resource.delFlag, + description: resource.description, + resourceId: resource.id, + resourceName: resource.name, + time: resource.createDate, + type: resource.type, + }, + ], + deptId: resource.deptId, + deptName: resource.deptName, + } + _applyList.push(obj) + }) + _applyList = jcss.concat(_applyList) localStorage.setItem('applyList', JSON.stringify(_applyList)) router.push({ path: '/apply', }) } + // const handleAKeyApplication = (item) => { + // let _applyList = [] + // ; (item.fuseResourceList || []).map((v) => { + // let resource = v.resource || {} + // let obj = { + // arr: [ + // { + // delFlag: resource.delFlag, + // description: resource.description, + // resourceId: resource.id, + // resourceName: resource.name, + // time: resource.createDate, + // type: resource.type, + // }, + // ], + // deptId: resource.deptId, + // deptName: resource.deptName, + // } + // _applyList.push(obj) + // }) + + // localStorage.setItem('applyList', JSON.stringify(_applyList)) + // router.push({ + // path: '/apply', + // }) + // } + mybus.on('chongzhi', (typeObj) => { console.log('typeObj------------>', typeObj) if (!typeObj) { diff --git a/front/src/views/home/packagingDetails.vue b/front/src/views/home/packagingDetails.vue index 29f6282a..6cf964cc 100644 --- a/front/src/views/home/packagingDetails.vue +++ b/front/src/views/home/packagingDetails.vue @@ -23,13 +23,14 @@
描述:{{ detailInfoObj.description || '--' }}
- + 申请使用 - + @@ -67,6 +68,7 @@ import packageAbilityList from '@/views/home/components/packageAbilityList.vue' import { message } from 'ant-design-vue' import { getIntegrationDetail } from '@/api/home' import HomeHeader from '@/views/home/components/header' +import { scInsert, scDel } from '@/api/personalCenter' const router = useRouter() const id = router.currentRoute.value.query.id @@ -102,6 +104,8 @@ const getIntegrationServicesDeatil = (id) => { return message.error(res.data.msg) } detailInfoObj.value = res.data.data || {} + console.log('detailInfoObj------------>', detailInfoObj); + let fuseResourceList = detailInfoObj.value.fuseResourceList || [] abilityList.value.map(v => { let list = fuseResourceList.filter(x => x.type == v.name) || []; @@ -116,6 +120,104 @@ const getIntegrationServicesDeatil = (id) => { } ) } + +// 一键申请 +const handleAKeyApplication = () => { + let _applyList = []; + let fuseResourceList = detailInfoObj.value.fuseResourceList || [] + let jcssArray = fuseResourceList.filter(v => v.type === '基础设施') + let otherArray = fuseResourceList.filter(v => v.type !== '基础设施') + jcssArray = jcssArray.map(v => { + v = Object.assign(v, v.resource) + return v + }) + let jcss = [ + { + arr: [ + { + description: '', + note1: JSON.stringify(jcssArray), + resourceId: '1522550195055828996', + resourceName: '摄像头列表', + type: '基础设施', + }, + ], + deptId: '', + deptName: '', + }, + ] + if (infrastructure) { + jcss[0].deptId = infrastructure.deptId + jcss[0].deptName = infrastructure.deptName + } + otherArray.map((v) => { + let resource = v.resource || {} + console.log('resource------------>', resource); + let obj = { + arr: [ + { + delFlag: resource.delFlag, + description: resource.description, + resourceId: resource.id, + resourceName: resource.name, + time: resource.createDate, + type: resource.type, + }, + ], + deptId: resource.deptId, + deptName: resource.deptName, + } + _applyList.push(obj) + }) + _applyList = jcss.concat(_applyList) + localStorage.setItem('applyList', JSON.stringify(_applyList)) + router.push({ + path: '/apply', + }) +} + +const dataPosting = ref(true) +const addCollect = () => { + if (dataPosting.value && detailInfoObj.value.id) { + dataPosting.value = false + if (detailInfoObj.value.isCollect == 'true') { + scDel([detailInfoObj.value.id]).then((res) => { + if (res.data.msg === 'success') { + message.success('取消成功') + detailInfoObj.value.isCollect = 'false' + detailInfoObj.value.collectCount-- + dataPosting.value = true + console.log('收藏2===============>', res.data, dataPosting.value) + getIntegrationServicesDeatil(id) + } + }) + .catch(err => { + console.log('err------------>', err); + message.success(err) + }) + } else { + scInsert([ + { + resourceId: detailInfoObj.value.id, + }, + ]).then((res) => { + if (res.data.msg === 'success') { + message.success('添加收藏成功!') + detailInfoObj.value.isCollect = 'true' + detailInfoObj.value.collectCount++ + dataPosting.value = true + console.log('收藏2===============>', res.data, dataPosting.value) + getIntegrationServicesDeatil(id) + } + }) + .catch(err => { + console.log('err------------>', err); + message.success(err) + }) + } + } +} + getIntegrationServicesDeatil(id) @@ -239,4 +341,5 @@ getIntegrationServicesDeatil(id) .list-box { padding: 0.4rem; } +