hi-ucs/front/src/views/demandCenter/index.vue

296 lines
7.7 KiB
Vue
Raw Normal View History

2022-06-14 09:32:49 +08:00
<template>
<home-header></home-header>
<div class="main-cont">
<div class="main">
<div class="left">
<a-layout-sider>
<a-menu
v-model:selectedKeys="selectedKeys"
mode="inline"
@click="handleClick"
>
<a-menu-item v-for="item in menuList" :key="item.key">
<img :src="item.img" alt="" style="margin-right: 10px" />
<span>{{ item.title }}</span>
</a-menu-item>
</a-menu>
</a-layout-sider>
</div>
<div class="right">
2022-07-18 13:35:11 +08:00
<!-- <div class="title">数据需求</div> -->
2022-06-14 09:32:49 +08:00
<a-list
class="demo-loadmore-list"
:loading="initLoading"
item-layout="horizontal"
:data-source="list"
:key="showKey"
>
<template #renderItem="{ item }">
<a-list-item>
<a-skeleton
avatar
:title="false"
:loading="!!item.loading"
active
>
<a-tooltip
placement="topLeft"
2022-07-14 17:04:17 +08:00
:title="item.demandDetails || '--'"
2022-06-14 09:32:49 +08:00
arrow-point-at-center
mouseEnterDelay="1"
>
<a-list-item-meta
:description="'描述:' + (item.demandDetails || '--')"
>
<template #title>
<span
@click="showDetail(item)"
style="cursor: pointer"
class="name"
>
{{ item.demandSubject }}
</span>
<span class="time">{{ item.createDate }}</span>
</template>
</a-list-item-meta>
</a-tooltip>
</a-skeleton>
</a-list-item>
</template>
</a-list>
<a-pagination
v-model:current="pageNum"
v-model:page-size="pageSize"
:total="total"
@change="pageChange"
:key="showKey"
>
<template #buildOptionText="props">
<span>{{ props.value }}/</span>
</template>
</a-pagination>
</div>
</div>
</div>
</template>
<script setup>
import HomeHeader from '@/views/home/components/header'
import { demandApplyListPage } from '@/api/personalCenter'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
// import { useStore } from 'vuex'
const router = useRouter()
// const store = useStore()
const list = ref([])
const pageNum = ref(1)
const pageSize = ref(8)
const total = ref()
const showKey = ref(0)
2022-07-18 13:56:27 +08:00
const whoShow1 = ref(whoShow)
2022-06-14 09:32:49 +08:00
const menuList = [
{
key: '1',
title: '基础设施',
num: '0',
img: require('@/assets/home/menujcss.png'),
},
{
key: '2',
title: '数据资源',
num: '0',
img: require('@/assets/home/menusjzy.png'),
},
{
key: '3',
title: '组件服务',
num: '0',
img: require('@/assets/home/menuzjfw.png'),
},
{
key: '4',
title: '应用资源',
num: '0',
img: require('@/assets/home/menuyyzy.png'),
},
{
key: '5',
title: '知识库',
num: '0',
img: require('@/assets/home/menuyyzy.png'),
},
]
const detailsType = ref('')
const handleClick = (item) => {
if (item.key === '1') {
detailsType.value = '基础设施'
} else if (item.key === '2') {
detailsType.value = '数据资源'
} else if (item.key === '3') {
detailsType.value = '组件服务'
} else if (item.key === '4') {
detailsType.value = '应用资源'
} else if (item.key === '5') {
detailsType.value = '知识库'
}
pageNum.value = 1
getApplyList()
}
const pageChange = (val) => {
console.log(val)
pageNum.value = val
getApplyList()
}
const getApplyList = () => {
const params = {
page: pageNum.value,
limit: pageSize.value,
flag: 3,
}
if (detailsType.value) {
params.detailsType = detailsType.value
}
demandApplyListPage(params).then((res) => {
list.value = res.data.data.list
total.value = res.data.data.total
})
}
const showDetail = (item) => {
// console.log('demandDetails', item)
// store.commit('home/demandDetailsData', item)
router.push({
path: '/demandDetails',
query: {
id: item.id,
},
})
}
onMounted(() => {
const params = {
page: pageNum.value,
limit: pageSize.value,
flag: 3,
}
demandApplyListPage(params).then((res) => {
list.value = res.data.data.list
total.value = res.data.data.total
})
})
</script>
<style lang="less" scoped>
.main-cont {
margin-top: 64px;
width: 100%;
height: calc(100%-90px);
background: url('~@/assets/demandCenter/bj.png') no-repeat;
background-position-x: center;
display: flex;
justify-content: center;
.main {
width: 1200px;
height: 100%;
padding-top: 30px;
display: flex;
.left {
width: 15%;
.ant-card {
background: transparent;
border: none;
.ant-card-grid {
height: 50px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
border: 1px solid #fff;
background-color: #fff;
cursor: pointer;
}
}
.ant-layout-sider {
background-color: transparent;
:deep(.ant-menu-item) {
height: 100px;
font-size: 18px;
color: #333333;
border: 1px solid #dee8f5;
margin: 0;
&::after {
margin-top: 30px;
height: 40px;
width: 4px;
background-color: #0087ff;
}
}
:deep(.ant-menu-item-selected) {
background-color: #e9f4ff;
}
}
2022-07-18 13:56:27 +08:00
}
2022-06-14 09:32:49 +08:00
.right {
flex: 1;
margin-left: 30px;
height: 850px;
background-color: #ffffff;
box-shadow: 10px 8px 10px 3px #9dc6ea;
padding: 20px;
.title {
font-size: 22px;
font-weight: 500;
color: #1492ff;
}
.ant-list {
height: 730px;
overflow-y: scroll;
:deep(.ant-list-item-meta-title) {
display: flex;
justify-content: space-between;
.name {
width: 800px;
font-size: 18px;
color: #1492ff;
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 1;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
}
}
:deep(.ant-list-item-meta-description) {
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 2;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
}
}
// 隐藏滚动条
.ant-list::-webkit-scrollbar {
display: none;
}
.ant-pagination {
margin-top: 10px;
}
2022-07-18 13:56:27 +08:00
}
2022-06-14 09:32:49 +08:00
}
}
</style>
<style>
body,
html {
height: unset;
}
</style>