Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
wuhongjian 2022-06-27 18:54:20 +08:00
commit 019da30ff5
1 changed files with 61 additions and 21 deletions

View File

@ -5,6 +5,7 @@
<div class="infrastructrue-tab"> <div class="infrastructrue-tab">
<div v-for="(item, index) in tabList" :key="index" class="tabBox"> <div v-for="(item, index) in tabList" :key="index" class="tabBox">
<b class="leftType">{{ item.title }}</b> <b class="leftType">{{ item.title }}</b>
<button @click="nullClick" v-if="item.title == '视频细分'">清空</button>
<span <span
v-for="itemContent in item.content" v-for="itemContent in item.content"
:key="itemContent" :key="itemContent"
@ -88,8 +89,13 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'
import VideoSurveillance from '@/views/home/videoSurveillance' import VideoSurveillance from '@/views/home/videoSurveillance'
import { getCategoryTreePage } from '@/api/personalCenter'
import { dataType } from 'element-plus/es/components/table-v2/src/common'
import { ref, onMounted } from 'vue'
onMounted(() => {
tabClick(0, '视频资源')
})
const tabList = ref([ const tabList = ref([
{ {
title: '设施类型', title: '设施类型',
@ -97,18 +103,19 @@
}, },
{ {
title: '视频细分', title: '视频细分',
content: [ content: [],
'云主机',
'算力主机',
'对象存储',
'堡垒机',
'防火墙',
'网闸',
'负载均衡',
'公网IP',
],
}, },
]) // ])
// const dataTypeList = () => {
// if (tabList.value[0].content.indexOf('') != -1) {
// tabList.value[1].content = ['123344', '213124']
// }else if(tabList.value[0].content.indexOf('') != -1){
// tabList.value[1].content = ['5555', '666']
// }
// }
// dataTypeList()
//
const init = () => { const init = () => {
tabList.value.map((item) => { tabList.value.map((item) => {
let params = { let params = {
@ -123,13 +130,13 @@
// //
let tableHeight = ref('600') let tableHeight = ref('600')
//tab //tab
const tabClick = (indexFather, name, fatherName) => { const tabClick = (indexFather, name) => {
if (clickList.value[indexFather].content.indexOf(name) != -1) { if (clickList.value[indexFather].content.indexOf(name) != -1) {
if (fatherName == '视频资源') { if (name == '视频资源') {
tableHeight.value = 330 tableHeight.value = 330
} else if (fatherName == '云资源') { } else if (name == '云资源') {
tableHeight.value = 600 tableHeight.value = 600
} else if (fatherName == '感知资源') { } else if (name == '感知资源') {
tableHeight.value = 330 tableHeight.value = 330
} }
clickList.value[indexFather].content.splice( clickList.value[indexFather].content.splice(
@ -137,17 +144,51 @@
1 1
) )
} else { } else {
if (fatherName == '视频资源') { if (name == '视频资源') {
tableHeight.value = 330 tableHeight.value = 330
} else if (fatherName == '云资源') { tabList.value[1].content = []
clickList.value[1].content = []
clickList.value[indexFather].content[0] = name
const params = {
page: 1,
limit: 50,
dictTypeId: '1541336217898848257',
}
getCategoryTreePage(params).then((res) => {
res.data.data.list.forEach((val) => {
tabList.value[1].content.push(val.dictLabel)
})
})
} else if (name == '云资源') {
tableHeight.value = 600 tableHeight.value = 600
} else if (fatherName == '感知资源') { clickList.value[1].content = []
clickList.value[indexFather].content[0] = name
tabList.value[1].content = [
'云主机',
'算力主机',
'对象存储',
'堡垒机',
'防火墙',
'网闸',
'负载均衡',
'公网IP',
]
} else if (name == '感知资源') {
tableHeight.value = 330 tableHeight.value = 330
clickList.value[1].content = []
clickList.value[indexFather].content[0] = name
tabList.value[1].content = ['333333', '213124']
} else {
clickList.value[indexFather].content.push(name)
} }
clickList.value[indexFather].content[0] = name
} }
console.log('clickList.value', clickList.value) console.log('clickList.value', clickList.value)
} }
//
const nullClick = () => {
clickList.value[1].content = []
console.log('hhhhhhhh')
}
const name = ref('') const name = ref('')
// //
const onSearch = (name) => { const onSearch = (name) => {
@ -333,7 +374,6 @@
color: #ffffff; color: #ffffff;
} }
.tabBox { .tabBox {
height: 0.3rem;
margin-bottom: 0.16rem; margin-bottom: 0.16rem;
} }
.tabBox:last-of-type { .tabBox:last-of-type {