基础设施

This commit is contained in:
851673013@qq.com 2022-06-25 15:08:19 +08:00
parent a357f1a1b0
commit e309dbbb90
1 changed files with 144 additions and 116 deletions

View File

@ -8,7 +8,7 @@
<span <span
v-for="itemContent in item.content" v-for="itemContent in item.content"
:key="itemContent" :key="itemContent"
@click="tabClick(index, itemContent)" @click="tabClick(index, itemContent, itemContent)"
:class=" :class="
clickList[index].content.indexOf(itemContent) != -1 ? 'down' : '' clickList[index].content.indexOf(itemContent) != -1 ? 'down' : ''
" "
@ -69,7 +69,7 @@
class="ant-table-striped" class="ant-table-striped"
:dataSource="dataSource" :dataSource="dataSource"
:columns="columns" :columns="columns"
:scroll="{ y: 600 }" :scroll="{ y: tableHeight }"
:rowClassName=" :rowClassName="
(record, index) => (index % 2 === 1 ? 'table-striped' : null) (record, index) => (index % 2 === 1 ? 'table-striped' : null)
" "
@ -79,7 +79,12 @@
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, onChange: onSelectChange,
}" }"
/> >
<template slot="status" slot-scope="text, record, index">
<span>正常</span>
<span>失效</span>
</template>
</a-table>
</div> </div>
</div> </div>
</template> </template>
@ -115,20 +120,41 @@
} }
let clickList = ref([]) //tab let clickList = ref([]) //tab
init() init()
//
let tableHeight = ref('600')
//tab //tab
const tabClick = (indexFather, name) => { const tabClick = (indexFather, name, fatherName) => {
if (clickList.value[indexFather].content.indexOf(name) != -1) { if (clickList.value[indexFather].content.indexOf(name) != -1) {
// debugger debugger
if (fatherName == '视频资源') {
debugger
tableHeight.value = 330
} else if (fatherName == '云资源') {
debugger
tableHeight.value = 600
} else if (fatherName == '感知资源') {
debugger
tableHeight.value = 330
}
clickList.value[indexFather].content.splice( clickList.value[indexFather].content.splice(
clickList.value[indexFather].content.indexOf(name), clickList.value[indexFather].content.indexOf(name),
1 1
) )
} else { } else {
// debugger debugger
if (fatherName == '视频资源') {
debugger
tableHeight.value = 330
} else if (fatherName == '云资源') {
debugger
tableHeight.value = 600
} else if (fatherName == '感知资源') {
debugger
tableHeight.value = 330
}
clickList.value[indexFather].content[0] = name clickList.value[indexFather].content[0] = name
} }
console.log('clickList.value', clickList.value) console.log('clickList.value', clickList.value)
// debugger
} }
const name = ref('') const name = ref('')
// //
@ -305,8 +331,9 @@
span { span {
display: inline-block; display: inline-block;
height: 0.24rem; height: 0.24rem;
font-size: 0.14rem;
line-height: 0.24rem; line-height: 0.24rem;
border: 0.01rem solid #cccccc; border: 0;
border-radius: 0.12rem; border-radius: 0.12rem;
margin-left: 0.1rem; margin-left: 0.1rem;
text-align: center; text-align: center;
@ -318,10 +345,11 @@
margin: 0.1rem 0; margin: 0.1rem 0;
} }
.down { .down {
border: 0.01rem solid #0087ff; background: #0087ff;
color: #0087ff; color: #ffffff;
} }
.tabBox { .tabBox {
height: 0.3rem;
margin-bottom: 0.16rem; margin-bottom: 0.16rem;
} }
.tabBox:last-of-type { .tabBox:last-of-type {