应用资源

This commit is contained in:
gaoyuanwei 2022-07-06 13:07:12 +08:00
parent 8a686cfca6
commit 5035cc074a
2 changed files with 160 additions and 147 deletions

View File

@ -2,17 +2,10 @@
<template> <template>
<div class="application-deployment-and-security"> <div class="application-deployment-and-security">
<div class="title"> <div class="title">
<DetalsTitle <DetalsTitle :title="dataFrom.title" :type="dataFrom.englishTitle"></DetalsTitle>
:title="dataFrom.title"
:type="dataFrom.englishTitle"
></DetalsTitle>
</div> </div>
<div class="content"> <div class="content">
<div <div v-for="(item, index) in dataFrom.content" :key="index" class="content-card">
v-for="(item, index) in dataFrom.content"
:key="index"
class="content-card"
>
<div class="card-title">{{ item.childrenTitle }}</div> <div class="card-title">{{ item.childrenTitle }}</div>
<div class="card-content"> <div class="card-content">
<div v-for="carditem in item.childrenContent" :key="carditem"> <div v-for="carditem in item.childrenContent" :key="carditem">
@ -29,10 +22,10 @@
</template> </template>
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({ let dataFrom = ref({
title: '部署与安全', title: '部署与安全',
englishTitle: 'DEPLOY&SAFE', englishTitle: 'DEPLOY&SAFE',
content: [ content: [
@ -45,12 +38,17 @@
childrenContent: [], childrenContent: [],
}, },
], ],
}) })
// let objUrl = {
const props = defineProps({ attrType: '访问地址',
attrValue: '' || '------',
}
dataFrom.value.content[0].childrenContent.push(objUrl)
//
const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
}) })
if (props.dataList.infoList) { if (props.dataList.infoList) {
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if ( if (
item.attrType === '部署区域' || item.attrType === '部署区域' ||
@ -63,6 +61,8 @@
item.attrType === '等保定级' item.attrType === '等保定级'
) { ) {
dataFrom.value.content[1].childrenContent.push(item) dataFrom.value.content[1].childrenContent.push(item)
} else if (item.attrType === '访问地址') {
objUrl.value = item.value
} }
}) })
if (dataFrom.value.content[1].childrenContent.length <= 0) { if (dataFrom.value.content[1].childrenContent.length <= 0) {
@ -80,17 +80,16 @@
dataFrom.value.content[1].childrenContent.push(itemContent) dataFrom.value.content[1].childrenContent.push(itemContent)
}) })
} }
}
watch(
() => props.dataList,
(val) => {
if (val) {
let obj = { let obj = {
attrType: '访问地址', attrType: '访问地址',
attrValue: props.dataList.link || '------', attrValue: props.dataList.link || '------',
} }
dataFrom.value.content[0].childrenContent.push(obj) dataFrom.value.content[0].childrenContent.push(obj)
}
watch(
() => props.dataList,
(val) => {
if (val) {
dataFrom.value.content[0].childrenContent = [] dataFrom.value.content[0].childrenContent = []
dataFrom.value.content[1].childrenContent = [] dataFrom.value.content[1].childrenContent = []
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
@ -105,6 +104,8 @@
item.attrType === '等保定级' item.attrType === '等保定级'
) { ) {
dataFrom.value.content[1].childrenContent.push(item) dataFrom.value.content[1].childrenContent.push(item)
} else if (item.attrType === '访问地址') {
objUrl.value = item.value
} }
}) })
if (dataFrom.value.content[1].childrenContent.length <= 0) { if (dataFrom.value.content[1].childrenContent.length <= 0) {
@ -122,48 +123,46 @@
dataFrom.value.content[1].childrenContent.push(itemContent) dataFrom.value.content[1].childrenContent.push(itemContent)
}) })
} }
let obj = {
attrType: '访问地址',
attrValue: props.dataList.link || '------',
}
dataFrom.value.content[0].childrenContent.push(obj)
} }
} }
) )
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.application-deployment-and-security { .application-deployment-and-security {
padding: 0.8rem 0; padding: 0.8rem 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.title { .title {
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
} }
.content { .content {
display: flex; display: flex;
width: 13rem; width: 13rem;
justify-content: space-between; justify-content: space-between;
.content-card { .content-card {
height: 1.5rem; height: 1.5rem;
width: 6.2rem; width: 6.2rem;
border-radius: 0.2rem; border-radius: 0.2rem;
background: linear-gradient( background: linear-gradient(to right,
to right,
rgba(113, 132, 252, 0.4), rgba(113, 132, 252, 0.4),
rgba(148, 163, 252, 0.4) rgba(148, 163, 252, 0.4));
);
padding: 0 0.3rem; padding: 0 0.3rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
.card-title { .card-title {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 0.26rem; line-height: 0.26rem;
color: #212956; color: #212956;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
} }
.card-content { .card-content {
div { div {
display: inline-block; display: inline-block;
@ -172,19 +171,24 @@
font-size: 0.2rem; font-size: 0.2rem;
line-height: 0.2rem; line-height: 0.2rem;
max-width: 5.84rem; max-width: 5.84rem;
overflow: hidden; /*超出的隐藏*/ overflow: hidden;
/*超出的隐藏*/
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; /*超出的设置为省略号*/ text-overflow: ellipsis;
/*超出的设置为省略号*/
span { span {
display: inline-block; display: inline-block;
max-width: 4rem; max-width: 4rem;
overflow: hidden; /*超出的隐藏*/ overflow: hidden;
/*超出的隐藏*/
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; /*超出的设置为省略号*/ text-overflow: ellipsis;
} /*超出的设置为省略号*/
} }
} }
} }
} }
} }
}
</style> </style>

View File

@ -53,12 +53,12 @@ if (props.dataList.infoList) {
dataFrom.value.content[0].childrenContent[0] = obj dataFrom.value.content[0].childrenContent[0] = obj
let deptContacts = { let deptContacts = {
attrType: '部门联系人', attrType: '部门联系人',
attrValue: props.dataList.deptContacts || '------', attrValue: '',
} }
dataFrom.value.content[0].childrenContent[1] = deptContacts dataFrom.value.content[0].childrenContent[1] = deptContacts
let deptPhone = { let deptPhone = {
attrType: '部门联系电话', attrType: '部门联系电话',
attrValue: props.dataList.deptPhone || '------', attrValue: '',
} }
dataFrom.value.content[0].childrenContent[2] = deptPhone dataFrom.value.content[0].childrenContent[2] = deptPhone
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
@ -87,8 +87,13 @@ if (props.dataList.infoList) {
dataFrom.value.content[1].childrenContent[2].attrValue = '------' dataFrom.value.content[1].childrenContent[2].attrValue = '------'
} }
} }
} else if (item.attrType === '部门联系人') {
deptContacts.attrValue = item.attrValue || '------'
} else if (item.attrType === '部门联系人电话') {
deptPhone.attrValue = item.attrValue || '------'
} }
}) })
console.log('obj', dataFrom.value) console.log('obj', dataFrom.value)
} }
watch( watch(
@ -147,6 +152,10 @@ watch(
'------' '------'
} }
} }
} else if (item.attrType === '部门联系人') {
deptContacts.attrValue = item.attrValue || '------'
} else if (item.attrType === '部门联系人电话') {
deptPhone.attrValue = item.attrValue || '------'
} }
}) })
console.log('obj', dataFrom.value) console.log('obj', dataFrom.value)