应用资源关联组件

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

View File

@ -8,7 +8,12 @@
<template>
<div class="application-navigation" v-if="navList.length > 0">
<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 }}
<span class="line"></span>
</div>
@ -16,29 +21,22 @@
</div>
</template>
<script setup>
import { ref, defineProps, watch } from 'vue'
import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router'
//
const router = useRouter()
const keyId = router.currentRoute.value.query.id
const navList = ref([
import { ref, defineProps, watch } from 'vue'
import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router'
import { queryPartAppByKeyId } from '@/api/home'
//
const router = useRouter()
const keyId = router.currentRoute.value.query.id
const navList = ref([
{
name: '应用展示',
key: 'application-presentation',
},
{
name: '关联组件',
key: 'application-associated-ability',
},
{
name: '功能介绍',
key: 'function-introduction',
},
// {
// name: '',
// key: 'application-associated-components',
// },
{
name: '使用能力',
key: 'ability-to-use',
@ -55,34 +53,38 @@ const navList = ref([
name: '常见问题',
key: 'common-problem',
},
])
const props = defineProps({
])
const props = defineProps({
selectNow: { type: String, default: '' },
dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null },
})
const select = ref('algorithm-display')
const list = ref([])
// id
if (keyId) {
queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
})
const select = ref('application-associated-ability')
const list = ref([])
// id
if (keyId) {
let params = {
keyId: keyId,
type: '组件服务',
}
queryPartAppByKeyId(params).then((res) => {
console.log('ressssssss', res)
if (res.data.data.length > 0) {
if (res.data.data.length != 0) {
//
navList.value.unshift({
name: '关联组件',
key: 'layer-service-associated-ability',
key: 'application-associated-ability',
show: true,
})
list.value.unshift('关联组件')
}
})
}
const selectNav = (key) => {
}
const selectNav = (key) => {
select.value = key
mybus.emit('flyToView', select.value)
}
if (props.dataList.infoList) {
}
if (props.dataList.infoList) {
list.value = []
props.dataList.infoList.map((item) => {
if (
@ -96,32 +98,29 @@ if (props.dataList.infoList) {
list.value.push('应用展示')
}
})
list.value.push('关联组件')
list.value.unshift('关联组件')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
if (
item.name == '关联组件' &&
props.associatedComponents[0].length != 0
) {
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(
(item) => item.name === list.value[0]
(item) => (item.name === '关联组件') | (item.name === list.value[0])
)[0].key
}
}
console.log('11111111111111111111111111', list.value, navList.value)
}
watch(
}
watch(
() => props.selectNow,
(newValue) => {
select.value = newValue
}
)
watch(
)
watch(
() => props.dataList,
(val) => {
if (val) {
@ -138,34 +137,30 @@ watch(
list.value.push('应用展示')
}
})
list.value.push('关联组件')
list.value.unshift('关联组件')
list.value.push('部署与安全')
list.value.push('归属部门与服务商')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
if (
item.name == '关联组件' &&
props.associatedComponents[0].length != 0
) {
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(
(item) => item.name === list.value[0]
(item) =>
(item.name === '关联组件') | (item.name === list.value[0])
)[0].key
}
}
console.log('11111111111111111111111111', list.value, navList.value)
}
}
)
)
</script>
<style lang="less" scoped>
.application-navigation {
.application-navigation {
width: 19.12rem;
height: 0.84rem;
line-height: 0.8rem;
@ -198,5 +193,5 @@ watch(
background: #526aff;
}
}
}
}
</style>