应用资源关联组件

This commit is contained in:
851673013@qq.com 2022-07-06 12:48:00 +08:00
parent d93cfa543c
commit 8a686cfca6
2 changed files with 197 additions and 167 deletions

View File

@ -168,6 +168,7 @@
} }
}) })
} else { } else {
callTheTrendData.value.snum = ['0', '0', '0', '0', '0', '0', '0']
callTheTrend(callTheTrendData.value) callTheTrend(callTheTrendData.value)
} }
} else { } else {
@ -202,6 +203,39 @@
} }
}) })
} else { } else {
callTheTrendData.value.snum = [
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
]
callTheTrend(callTheTrendData.value) callTheTrend(callTheTrendData.value)
} }
} }
@ -253,6 +287,7 @@
], ],
yAxis: [ yAxis: [
{ {
minInterval: 1,
name: '个', name: '个',
type: 'value', type: 'value',
axisTick: { axisTick: {

View File

@ -8,7 +8,12 @@
<template> <template>
<div class="application-navigation" v-if="navList.length > 0"> <div class="application-navigation" v-if="navList.length > 0">
<template v-for="nav in navList" :key="nav.key"> <template v-for="nav in navList" :key="nav.key">
<div class="nav" :class="{ select: nav.key == select }" v-if="nav.show" @click="selectNav(nav.key)"> <div
class="nav"
:class="{ select: nav.key == select }"
v-if="nav.show"
@click="selectNav(nav.key)"
>
{{ nav.name }} {{ nav.name }}
<span class="line"></span> <span class="line"></span>
</div> </div>
@ -19,6 +24,7 @@
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { queryPartAppByKeyId } from '@/api/home'
// //
const router = useRouter() const router = useRouter()
const keyId = router.currentRoute.value.query.id const keyId = router.currentRoute.value.query.id
@ -27,18 +33,10 @@ const navList = ref([
name: '应用展示', name: '应用展示',
key: 'application-presentation', key: 'application-presentation',
}, },
{
name: '关联组件',
key: 'application-associated-ability',
},
{ {
name: '功能介绍', name: '功能介绍',
key: 'function-introduction', key: 'function-introduction',
}, },
// {
// name: '',
// key: 'application-associated-components',
// },
{ {
name: '使用能力', name: '使用能力',
key: 'ability-to-use', key: 'ability-to-use',
@ -61,17 +59,21 @@ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null }, associatedComponents: { type: Array, default: null },
}) })
const select = ref('algorithm-display') const select = ref('application-associated-ability')
const list = ref([]) const list = ref([])
// id // id
if (keyId) { if (keyId) {
queryPartAppByKeyId2({ keyId: keyId }).then((res) => { let params = {
keyId: keyId,
type: '组件服务',
}
queryPartAppByKeyId(params).then((res) => {
console.log('ressssssss', res) console.log('ressssssss', res)
if (res.data.data.length > 0) { if (res.data.data.length != 0) {
// //
navList.value.unshift({ navList.value.unshift({
name: '关联组件', name: '关联组件',
key: 'layer-service-associated-ability', key: 'application-associated-ability',
show: true, show: true,
}) })
list.value.unshift('关联组件') list.value.unshift('关联组件')
@ -96,23 +98,20 @@ if (props.dataList.infoList) {
list.value.push('应用展示') list.value.push('应用展示')
} }
}) })
list.value.push('关联组件') list.value.unshift('关联组件')
navList.value.forEach((item) => { navList.value.forEach((item) => {
console.log(item) console.log(item)
if (list.value.indexOf(item.name) > -1) { if (list.value.indexOf(item.name) > -1) {
if (
item.name == '关联组件' &&
props.associatedComponents[0].length != 0
) {
item.show = true item.show = true
} else {
item.show = true
}
} }
}) })
if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter( select.value = navList.value.filter(
(item) => item.name === list.value[0] (item) => (item.name === '关联组件') | (item.name === list.value[0])
)[0].key )[0].key
}
}
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }
watch( watch(
@ -138,27 +137,23 @@ watch(
list.value.push('应用展示') list.value.push('应用展示')
} }
}) })
list.value.push('关联组件') list.value.unshift('关联组件')
list.value.push('部署与安全') list.value.push('部署与安全')
list.value.push('归属部门与服务商') list.value.push('归属部门与服务商')
navList.value.forEach((item) => { navList.value.forEach((item) => {
console.log(item) console.log(item)
if (list.value.indexOf(item.name) > -1) { if (list.value.indexOf(item.name) > -1) {
if (
item.name == '关联组件' &&
props.associatedComponents[0].length != 0
) {
item.show = true item.show = true
} else {
item.show = true
}
} }
}) })
if (list.value.length > 0) { if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter( select.value = navList.value.filter(
(item) => item.name === list.value[0] (item) =>
(item.name === '关联组件') | (item.name === list.value[0])
)[0].key )[0].key
} }
}
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }
} }