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

423 lines
10 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>
2022-11-30 17:04:25 +08:00
<a-menu
v-model:selectedKeys="selectedKeys"
mode="inline"
@click="handleClick"
>
2022-06-14 09:32:49 +08:00
<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-11-30 17:04:25 +08:00
<a-list
class="demo-loadmore-list"
:loading="initLoading"
item-layout="horizontal"
:data-source="list"
:key="showKey"
>
2022-06-14 09:32:49 +08:00
<template #renderItem="{ item }">
<a-list-item>
2022-11-30 17:04:25 +08:00
<div class="toptitle">
2022-12-02 16:05:46 +08:00
<a-tooltip placement="topLeft" v-if="item.demandSubject.length>20">
<template #title>{{ item.demandSubject}}</template>
2022-11-30 17:04:25 +08:00
<span
@click="showDetail(item)"
style="cursor: pointer"
class="name"
>
{{ item.demandSubject }}
</span>
2022-06-14 09:32:49 +08:00
</a-tooltip>
2022-12-08 15:08:59 +08:00
<span v-else @click="showDetail(item)">
2022-12-02 16:05:46 +08:00
{{ item.demandSubject }}
</span>
2022-11-30 17:04:25 +08:00
<span class="time">{{ item.createDate }}</span>
</div>
2022-12-02 16:05:46 +08:00
<div class="bottomdesc" v-if="item.demandDetails.length<100">
2022-11-30 17:04:25 +08:00
描述 {{ item.demandDetails || '--' }}
</div>
2022-12-02 16:05:46 +08:00
<div class="bottomdesc" v-else>
描述 {{ item.demandDetails.slice(0,100) }}...<span style="cursor:pointer;color:#1492ff" @click="showDetail(item)">查看更多>></span>
</div>
2022-06-14 09:32:49 +08:00
</a-list-item>
</template>
</a-list>
2022-11-30 17:04:25 +08:00
<a-pagination
v-model:current="pageNum"
v-model:page-size="pageSize"
:total="total"
@change="pageChange"
:key="showKey"
>
2022-06-14 09:32:49 +08:00
<template #buildOptionText="props">
<span>{{ props.value }}/</span>
</template>
</a-pagination>
</div>
2022-08-23 17:47:24 +08:00
<!-- 需求申请 -->
<div class="fixedmount">
<div @click="toView()">
<p></p>
2022-08-23 18:02:00 +08:00
<p>新需求</p>
2022-08-23 17:47:24 +08:00
</div>
</div>
2022-06-14 09:32:49 +08:00
</div>
</div>
</template>
<script setup>
2022-11-04 14:09:53 +08:00
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'
2022-06-14 09:32:49 +08:00
2022-11-04 14:09:53 +08:00
const router = useRouter()
// const store = useStore()
const list = ref([])
const pageNum = ref(1)
const pageSize = ref(8)
const total = ref()
const showKey = ref(0)
const whoShow1 = ref(whoShow)
2022-11-30 14:37:26 +08:00
const selectedKeys = ref(['0'])
2022-11-04 14:09:53 +08:00
const menuList = [
2022-11-30 17:04:25 +08:00
{
2022-11-30 14:37:26 +08:00
key: '0',
title: '全部需求',
num: '0',
img: require('@/assets/home/menuall.png'),
},
2022-11-04 14:09:53 +08:00
{
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',
2022-11-30 14:37:26 +08:00
img: require('@/assets/home/menuzsk.png'),
2022-11-04 14:09:53 +08:00
},
]
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 = '知识库'
2022-11-30 17:04:25 +08:00
} else {
2022-11-30 14:37:26 +08:00
detailsType.value = ''
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
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,
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
if (detailsType.value) {
params.detailsType = detailsType.value
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
demandApplyListPage(params).then((res) => {
list.value = res.data.data.list
total.value = res.data.data.total
})
}
2022-06-14 09:32:49 +08:00
2022-11-04 14:09:53 +08:00
const showDetail = (item) => {
router.push({
path: '/demandDetails',
query: {
id: item.id,
2022-12-26 18:05:49 +08:00
showKey:selectedKeys.value,
2022-11-04 14:09:53 +08:00
},
2022-08-23 17:47:24 +08:00
})
2022-11-04 14:09:53 +08:00
}
const newpage = router.resolve({
path: '/addApplication', // 跳转的页面路由
})
const toView = () => {
window.open(newpage.href, '_blank')
}
2022-06-14 09:32:49 +08:00
2022-11-04 14:09:53 +08:00
onMounted(() => {
2022-12-28 15:32:12 +08:00
const toShowKey = router.currentRoute.value.query.toShowKey
if(toShowKey){
selectedKeys.value=toShowKey
}
2022-11-04 14:09:53 +08:00
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
2022-06-14 09:32:49 +08:00
})
2022-11-04 14:09:53 +08:00
})
2022-06-14 09:32:49 +08:00
</script>
<style lang="less" scoped>
2022-12-02 16:05:46 +08:00
2022-11-04 14:09:53 +08:00
.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;
2022-06-14 09:32:49 +08:00
display: flex;
2022-11-04 14:09:53 +08:00
.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;
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
}
.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;
2022-06-14 09:32:49 +08:00
}
}
2022-11-04 14:09:53 +08:00
:deep(.ant-menu-item-selected) {
background-color: #e9f4ff;
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
}
}
.right {
flex: 1;
margin-left: 30px;
height: 850px;
background-color: #ffffff;
box-shadow: 10px 8px 10px 3px #9dc6ea;
padding: 20px;
2022-11-30 17:04:25 +08:00
.toptitle {
2022-12-02 16:05:46 +08:00
cursor: pointer;
2022-11-30 17:04:25 +08:00
margin-bottom: 10px;
& > span:first-child {
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 1;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
width: 600px;
font-size: 14px;
color: #1492ff;
font-size: 18px;
}
& > span:first-child:hover {
color: #0b5392;
}
& > span:last-child {
float: right;
}
}
.bottomdesc {
display: -webkit-box;
/*设置为弹性盒子*/
2022-12-02 16:05:46 +08:00
-webkit-line-clamp: 2;
2022-11-30 17:04:25 +08:00
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
width: 800px;
font-size: 14px;
}
2022-11-04 14:09:53 +08:00
.title {
font-size: 22px;
font-weight: 500;
color: #1492ff;
}
.ant-list {
height: 730px;
overflow-y: scroll;
2022-11-30 17:04:25 +08:00
.ant-list-item {
display: list-item;
2022-06-14 09:32:49 +08:00
}
2022-11-30 17:04:25 +08:00
// :deep(.ant-list-item-meta-title) {
// // display: flex;
// justify-content: space-between;
2022-11-04 14:09:53 +08:00
2022-11-30 17:04:25 +08:00
// .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;
// }
2022-07-18 13:56:27 +08:00
}
2022-11-04 14:09:53 +08:00
// 隐藏滚动条
.ant-list::-webkit-scrollbar {
display: none;
2022-08-23 17:47:24 +08:00
}
2022-11-04 14:09:53 +08:00
.ant-pagination {
margin-top: 10px;
2022-08-23 17:47:24 +08:00
}
2022-11-04 14:09:53 +08:00
}
.fixedmount {
height: 1.5rem;
display: flex;
position: fixed;
right: 2.6rem;
z-index: 10;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.fixedmount div {
width: 0.7rem;
height: 0.7rem;
border-radius: 0.04rem;
border: 0.01rem #94aac9 solid;
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
padding-top: 0.13rem;
position: relative;
cursor: pointer;
background: #e3edfc;
p {
margin: 0;
2022-08-23 17:47:24 +08:00
}
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
.fixedmount div p:nth-child(1) {
height: 0.24rem;
width: 0.24rem;
background: url('~@/assets/home/shenqing.png') no-repeat;
background-size: contain;
background-position: center;
}
2022-06-14 09:32:49 +08:00
}
2022-11-04 14:09:53 +08:00
}
2022-06-14 09:32:49 +08:00
</style>
<style>
2022-11-04 14:09:53 +08:00
body,
html {
height: unset;
}
.demandCenter-tooltip-card {
2022-11-04 14:09:53 +08:00
max-width: 900px !important;
min-width: 600px !important;
max-height: 600px !important;
overflow-y: auto;
}
2022-06-14 09:32:49 +08:00
</style>