135 lines
3.0 KiB
Vue

<template>
<Card title="项目信息">
<div class="container">
<vue-scroll style="height: 100%;">
<div class="list">
<div class="list-item" v-for="(item, key) in list" :key="key">
<span class="label">{{ item.label }}</span>
<span class="value">{{ item.value }}</span>
</div>
</div>
</vue-scroll>
</div>
</Card>
</template>
<script>
import Card from '../components/Card'
import { listProjectInfo } from '@/assets/js/api/zhongjianFourth'
import { mapState } from 'vuex'
export default {
components: { Card },
data: () => ({
// 项目信息列表
list: {
projectAddress: { label: '项目位置', value: undefined },
projectAcreage: { label: '用地面积', value: undefined },
constructionUnit: { label: '建设单位', value: undefined },
designUnit: { label: '设计单位', value: undefined },
exploreUnit: { label: '勘察单位', value: undefined },
supervisorUnit: { label: '监理单位', value: undefined },
},
}),
created() {
this.getList()
},
computed: {
...mapState(['projectSn']),
},
methods: {
/** 查询列表 */
getList() {
listProjectInfo({ projectSn: this.projectSn }).then(res => {
console.log('项目信息: ', res);
const list = this.list;
Object.keys(list).forEach(key => {
list[key].value = res.result[key];
})
})
},
},
}
</script>
<style lang="less" scoped>
.container {
box-sizing: border-box;
padding: 16px;
padding-bottom: 0;
width: 100%;
height: 100%;
.list {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
color: #fff;
// overflow-y: scroll;
.list-item {
flex: 1;
position: relative;
display: flex;
box-sizing: border-box;
border-left: 4px solid #66d3d8;
margin-bottom: 3px;
padding: 9px 0;
width: 100%;
background-image: linear-gradient(to right, #3b7589, #182337);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s;
white-space: nowrap;
&:hover {
margin-top: 2px;
margin-bottom: 5px;
padding: 20px 0;
&::before {
content: '';
position: absolute;
top: 50%;
left: 6px;
display: inline-block;
transform: translate(0, -50%);
width: 8px;
height: 14px;
background-image: url('../assets/images/command-center/triangle.png');
background-size: 100% 100%;
transition: all .3s;
}
}
&:hover .value {
color: #c2805f;
}
&:last-child {
margin-bottom: 0;
}
.label,
.value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.label {
box-sizing: border-box;
width: 25%;
padding-left: 20px;
}
.value {
width: 75%;
}
}
}
}
</style>