123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- <template>
- <div id="index">
- <el-row>
- <el-col :span="24" class="main animate__animated animate__backInRight">
- <el-col :span="24" class="idemand">
- <el-image class="image" :src="demand" fit="fill" />
- </el-col>
- <div class="w_1200">
- <el-col :span="24" class="one">
- <el-row class="one_1" v-for="(val, indexs) in searchList" :key="indexs">
- <el-col :span="3" class="left">{{ val.title }}</el-col>
- <el-col :span="21" class="right">
- <a-button
- class="title"
- v-for="(item, index) in val.list"
- :key="index"
- type="link"
- size="samll"
- >
- {{ item.label }}
- </a-button>
- </el-col>
- </el-row>
- </el-col>
- <el-col :span="24" class="two">
- <a-list :loading="loading" :grid="{ gutter: 14, column: 4 }" :data-source="list">
- <template #renderItem="{ item }">
- <el-col :span="24" class="list">
- <el-col :span="24" class="name textOver">
- <el-tooltip effect="dark" :content="item.name" placement="top">
- {{ item.name || '暂无名称' }}
- </el-tooltip>
- </el-col>
- <el-col :span="24" class="two_1">
- <span>服务机构: </span>{{ item.unit || '暂无服务机构' }}
- </el-col>
- <el-col :span="24" class="two_1">
- <span>项目编号: </span>{{ item.no || '暂无项目编号' }}
- </el-col>
- <el-col :span="24" class="two_1">
- <span>发布日期: </span>{{ item.notice_time || '暂无发布日期' }}
- </el-col>
- <el-col :span="24" class="bottom">
- <div class="status">挂牌公告</div>
- <div class="button" @click="toView">查看详情</div>
- </el-col>
- </el-col>
- </template>
- </a-list>
- </el-col>
- <el-col :span="24" class="thr">
- <el-pagination
- background
- layout="total, prev, pager, next"
- :page-sizes="[10, 20, 50, 100, 200]"
- :total="total"
- :page-size="limit"
- v-model:current-page="currentPage"
- @current-change="changePage"
- @size-change="sizeChange"
- >
- </el-pagination>
- </el-col>
- </div>
- </el-col>
- </el-row>
- </div>
- </template>
- <script setup>
- const $checkRes = inject('$checkRes')
- import { get } from 'lodash-es'
- // 接口
- import { ProjectStore } from '@/store/api/platform/project'
- import { DictDataStore } from '@/store/api/system/dictData'
- const store = ProjectStore()
- const dictDataStore = DictDataStore()
- // 图片引入
- import demand from '@/assets/innovation.png'
- // 路由
- const router = useRouter()
- // 加载中
- const loading = ref(false)
- const searchForm = ref({})
- // 列表
- const list = ref([])
- let skip = 0
- let limit = inject('limit')
- const total = ref(20)
- // 字典表
- const fieldList = ref([])
- const searchList = ref([
- {
- title: '技术领域',
- list: [
- { value: '0', label: '全部' },
- { value: '1', label: '先进制造' },
- { value: '2', label: '地球、空间与海洋' },
- { value: '3', label: '新材料' },
- { value: '4', label: '新能源与节能' },
- { value: '5', label: '核应用技术' },
- { value: '6', label: '环境保护' },
- { value: '7', label: '现代交通' },
- { value: '8', label: '现代农业' },
- { value: '9', label: '生物医药与医疗器械' },
- { value: '10', label: '电子信息' },
- { value: '11', label: '航空航天' }
- ]
- },
- {
- title: '合作方式',
- list: [
- { value: '0', label: '全部' },
- { value: '1', label: '技术开发' },
- { value: '2', label: '技术咨询' },
- { value: '3', label: '技术服务' },
- { value: '4', label: '许可转让' },
- { value: '4', label: '完全转让' },
- { value: '4', label: '技术入股' },
- { value: '4', label: '合作开发' },
- { value: '4', label: '其他' }
- ]
- },
- {
- title: '需求地区',
- list: [
- { value: '0', label: '北京市' },
- { value: '1', label: '天津市' },
- { value: '2', label: '河北省' },
- { value: '3', label: '山西省' },
- { value: '4', label: '内蒙古自治区' },
- { value: '5', label: '辽宁省' },
- { value: '6', label: '吉林省' },
- { value: '7', label: '上海市' },
- { value: '8', label: '江苏省' },
- { value: '9', label: '浙江省' },
- { value: '10', label: '安徽省' },
- { value: '11', label: '福建省' },
- { value: '0', label: '江西省' },
- { value: '1', label: '山东省' },
- { value: '2', label: '河南省' },
- { value: '3', label: '湖北省' },
- { value: '4', label: '湖南省' },
- { value: '5', label: '广东省' },
- { value: '6', label: '广西壮族自治区' },
- { value: '7', label: '海南省' },
- { value: '8', label: '重庆市' },
- { value: '9', label: '四川省' },
- { value: '10', label: '贵州省' },
- { value: '11', label: '云南省' }
- ]
- },
- {
- title: '需求状态',
- list: [
- { value: '0', label: '全部' },
- { value: '1', label: '洽谈中' },
- { value: '2', label: '已结束' }
- ]
- }
- ])
- // 查看
- const toView = (item) => {
- router.push({ path: '/demand/detail', query: { id: item.id || item._id } })
- }
- // 请求
- onMounted(async () => {
- loading.value = true
- await searchOther()
- await search({ skip, limit })
- loading.value = false
- })
- const searchOther = async () => {
- let result
- // 技术领域
- result = await dictDataStore.query({ code: 'field', is_use: '0' })
- if ($checkRes(result)) fieldList.value = result.data
- }
- const search = async (query = { skip: 0, limit }) => {
- const info = {
- skip: query.skip,
- limit: query.limit,
- ...searchForm.value,
- is_use: '0',
- status: '1'
- }
- const res = await store.query(info)
- if (res.errcode == '0') {
- list.value = res.data
- total.value = res.total
- }
- }
- // 字典数据转换
- const getDict = (data, model) => {
- let res
- if (model == 'field') res = fieldList.value.find((f) => f.value == data)
- return get(res, 'label')
- }
- // 地区显示
- const getArea = (data) => {
- if (data) return data.join(',')
- }
- const currentPage = ref(1)
- // 分页
- const changePage = (page = currentPage.value) => {
- search({ skip: (page - 1) * limit, limit: limit })
- }
- const sizeChange = (limits) => {
- limit = limits
- currentPage.value = 1
- search({ skip: 0, limit: limit })
- }
- </script>
- <style lang="scss" scoped>
- .main {
- background: rgb(248, 248, 248);
- .idemand {
- .image {
- width: 100%;
- height: 200px;
- }
- }
- .one {
- background: #ffffff;
- border-radius: 10px;
- padding: 15px;
- margin: 10px 0 0 0;
- .one_1 {
- display: flex;
- align-items: center;
- padding: 10px 0;
- border-bottom: #9d9898 1px dashed;
- .left {
- background: #778cb3;
- border-radius: 15px;
- line-height: 26px;
- color: #fff;
- text-align: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-family: PingFangSC-Medium;
- }
- .right {
- .title {
- color: #666;
- font-size: 14px;
- line-height: 15px;
- margin: 0 10px;
- display: inline-block;
- overflow: hidden;
- text-decoration: none;
- }
- .title:hover {
- color: #2374ff;
- }
- }
- }
- }
- .two {
- margin: 15px;
- .list {
- background: #fff;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
- border-radius: 2px;
- width: 285px;
- height: 195px;
- margin-bottom: 15px;
- cursor: pointer;
- transition: all 0.3s;
- padding: 20px;
- .name {
- font-size: 16px;
- color: #121834;
- height: 16px;
- line-height: 13px;
- font-weight: 500;
- margin: 10px 0;
- }
- .name:hover {
- color: #2374ff;
- }
- .two_1 {
- font-size: 12px;
- text-align: justify;
- line-height: 12px;
- font-weight: 400;
- letter-spacing: 0;
- color: #8f97a3;
- margin-top: 15px;
- span:last-child {
- color: #525a68;
- }
- }
- .bottom {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 20px;
- .status {
- padding: 5px 12px;
- font-size: 12px;
- color: #2374ff;
- line-height: 12px;
- font-weight: 400;
- background: rgba(35, 116, 255, 0.05);
- border-radius: 16px;
- }
- .button {
- font-size: 12px;
- color: #fff;
- text-align: center;
- line-height: 12px;
- font-weight: 500;
- padding: 5px 12px;
- background: #2374ff;
- box-shadow: 0 3px 6px 0 rgba(35, 116, 255, 0.1);
- border-radius: 2px;
- }
- }
- }
- .list:hover {
- background: #f0f7ff;
- box-shadow: 0 0 16px rgba(205, 205, 205, 0.6);
- }
- }
- .thr {
- display: flex;
- flex-direction: row-reverse;
- padding: 20px;
- }
- }
- </style>
|