提交 0ccdac09 authored 作者: 龙菲's avatar 龙菲

修改文物和展览的筛选字典为有数据的才显示

上级 56c5b03a
......@@ -41,3 +41,13 @@ export function getRecommendCr(params) {
params
})
}
// 获取存在文物的字典
export function getCrExistDict(params) {
return request({
url: '/bizCulturalRelic/existDict',
method: 'get',
params
})
}
......@@ -22,4 +22,12 @@ export function getRecommendDisplay(params){
method: 'get',
params
})
}
\ No newline at end of file
}
export function getDisplayExistDict(params){
return request({
url: '/bizExhibition/existDict',
method: 'get',
params
})
}
......@@ -6,11 +6,11 @@
</div>
<div class="text">{{ title }}</div>
</div> -->
<div class="total" >
<div class="total-title">{{title}}</div>
<div class="total">
<div class="total-title">{{ title }}</div>
<div class="amount">
<span class="num">{{num}}</span>
<span class="unit">{{unit}}</span>
<span class="num">{{ num }}</span>
<span class="unit">{{ unit }}</span>
</div>
</div>
<!-- <div class="banner-1">
......@@ -30,11 +30,11 @@ export default {
type: String,
default: "标题",
},
num:{
type: String,
num: {
type: [String, Number],
default: '0',
},
unit:{
unit: {
type: String,
default: '个',
},
......@@ -47,11 +47,12 @@ export default {
width: 100%;
height: 360px;
position: relative;
background-image: linear-gradient(to right,$themeColor,rgba($themeColor, 0.9),$themeColor);
background-image: linear-gradient(to right, $themeColor, rgba($themeColor, 0.9), $themeColor);
padding: 0 13%;
display: flex;
align-items: center;
justify-content: space-between;
// height: 222px;
// background-image: url("@/assets/imgs/list/banner2.png");
// background-size:100% 100%;
......@@ -71,18 +72,22 @@ export default {
.total-title {
font-size: 28px;
}
.amount {
font-weight: bold;
.num{
.num {
font-size: 56px;
font-family: $puHuiTi;
}
.unit{
.unit {
font-size: $font-size-base;
}
}
}
// .banner-1 {
// position: absolute;
// left: 620px;
......@@ -100,25 +105,30 @@ export default {
// top: 54%;
margin-top: 30px;
width: 520px;
img {
width: 100%;
height: 100%;
}
}
.title {
padding: 0 13%;
display: flex;
align-items: flex-end;
.img-container {
width: 58px;
height: 58px;
margin-right: 26px;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
.text {
font-size: 28px;
font-weight: 400;
......
<template>
<div class="cultural-relic">
<ListBanner title="文物展" unit="件/套" :num="list.total" />
<ListBanner title="共计文物" unit="件/套" :num="list.total" />
<div class="search-bar wow animate__animated animate__fadeIn">
<div class="search-wrapper">
<div class="search-item" @click="handleClickSearchBar('type')">
......@@ -160,7 +160,7 @@
<script>
import ListBanner from "@/components/ListBanner";
import { getCulturalRelicList } from "@/api/culturalRelic";
import { getCulturalRelicList, getCrExistDict } from "@/api/culturalRelic";
import { mapGetters } from "vuex";
export default {
name: "CulturalRelic",
......@@ -209,46 +209,51 @@ export default {
value: "",
}
];
await this.$store.dispatch("dict/getDictList", ["culturalRelicType"]);
for (const key in this.dicts.culturalRelicType) {
let res = await getCrExistDict()
let resTypeList = res.data.typeList
let resYearList = res.data.yearDictList
resTypeList.map(item=>{
typeList.push({
label: this.dicts.culturalRelicType[key],
value: key,
});
}
label:item.label,
value:item.value
})
})
resYearList.map(item=>{
yearList.push({
label:item.label,
value:item.value
})
})
this.typeList = typeList;
let res = await this.$store.dispatch("dict/getDictTree", [
"culturalRelicYears",
]);
this.culturalRelicYears = res.culturalRelicYears;
traveseYears(this.culturalRelicYears);
this.yearList = yearList;
// 获取叶子节点
function traveseYears(arr) {
if (arr && arr.length > 0) {
arr.map((item) => {
if (item.children && item.children.length > 0) {
traveseYears(item.children);
} else {
yearList.push({
value: item.value,
label: item.label,
});
}
});
}
}
// 删除无children的节点
// function traveseYears(arr) {
// if (arr && arr.length > 0) {
// arr.map((item) => {
// if (item.children && item.children.length == 0) {
// delete item.children;
// } else {
// traveseYears(item.children);
// }
// await this.$store.dispatch("dict/getDictList", ["culturalRelicType"]);
// for (const key in this.dicts.culturalRelicType) {
// typeList.push({
// label: this.dicts.culturalRelicType[key],
// value: key,
// });
// }
// }
// let res = await this.$store.dispatch("dict/getDictTree", [
// "culturalRelicYears",
// ]);
// this.culturalRelicYears = res.culturalRelicYears;
// traveseYears(this.culturalRelicYears);
// // 获取叶子节点
// function traveseYears(arr) {
// if (arr && arr.length > 0) {
// arr.map((item) => {
// if (item.children && item.children.length > 0) {
// traveseYears(item.children);
// } else {
// yearList.push({
// value: item.value,
// label: item.label,
// });
// }
// });
// }
// }
},
mounted() {
......@@ -524,7 +529,7 @@ $text-indent: 16px;
.search-panel {
min-height: 100px;
max-height: 138px;
background: rgb(#8ac7ff, 1) url("@/assets/imgs/home/panel-bg.png");
background: rgb($themeColor, 0.15) url("@/assets/imgs/home/panel-bg.png");
width: 100%;
display: flex;
justify-content: center;
......
......@@ -43,7 +43,6 @@
<i class="el-icon-phone"></i>
<span>{{ museumDetail.phone }}</span>
</div>
<div v-if="!museumDetail.phone">暂无联系方式</div>
</div>
</div>
......@@ -81,7 +80,7 @@ export default {
tabbars: [
'简介', '入园方式', '联系方式',
],
currentTab: ''
currentTab: '简介'
};
},
mounted() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论