融合服务,一键申请--基础设施更改

This commit is contained in:
guoyue 2022-08-01 16:16:16 +08:00
parent 1d5a81d091
commit 1ccd81cd66
4 changed files with 799 additions and 715 deletions

View File

@ -49,8 +49,8 @@
<div class="description">
{{
val.description ||
(val.note1 &&
JSON.parse(val.note1)[0].channelName +
((val.note1 || '') &&
( JSON.parse(val.note1)[0].channelName || '--') +
'等' +
JSON.parse(val.note1).length +
'个摄像头') ||

File diff suppressed because it is too large Load Diff

View File

@ -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) {

View File

@ -23,13 +23,14 @@
<div class="desc">描述{{ detailInfoObj.description || '--' }}</div>
</div>
<div class="btn-box">
<a-button size="big" class="btn-text" type="primary" @click="toView()">
<a-button size="big" class="btn-text" type="primary" @click="handleAKeyApplication()">
<template #icon>
<form-outlined />
</template>
申请使用
</a-button>
<a-button size="big" class="btn-text" type="primary" @click="toView()">
<a-button size="big" class="btn-text" :type="detailInfoObj.isCollect == 'true' ? 'primary' : ''"
@click="addCollect()">
<template #icon>
<form-outlined />
</template>
@ -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;
}
</style>