Files
foton-laws-system-front/src/pages/phone/standDynamics/components/UnderResearchStandards.vue
T
2023-11-29 13:43:22 +08:00

168 lines
3.7 KiB
Vue

<template>
<PhoneScroll
height="calc(100vh - 101px)"
:data="list"
:page="searchQuery.page"
:pageSize="searchQuery.pageSize"
:total="total"
:loading="loading"
pullUpLoad
pullDownRefresh
:getDataHandler="getData">
<div style="padding-top: 10px">
<div class="card-content" v-for="item in list" :key="item.id" @click="jumpDetails(item)">
<div class="standTitle">
<div class="title">{{ item.standard }}</div>
</div>
<div class="standContent">
<div class="standState">{{ item.standardName }}</div>
<div class="standState">
标准状态: <span style="color: #35720B; padding-left: 5px;">{{textStateMap[item.textState] || '-' }}</span>
</div>
</div>
<div class="timeFooter">
<div style="width: 50%">发布日期: <span style="padding-left: 5px;">{{ item.releaseDate || '-' }}</span></div>
<div style="width: 50%">实施日期: <span style="padding-left: 5px;">{{ $moment(item.renewTime).format('YYYY-MM-DD') }}</span></div>
</div>
</div>
</div>
</PhoneScroll>
</template>
<script>
import PhoneScroll from "@/components/hzwlComponents/phone/PhoneScroll";
export default {
name: "UnderResearchStandards",
components: {
PhoneScroll
},
data() {
return {
searchQuery: {
page: 1,
pageSize: 10,
messageType: 'ZYBZFG'
},
total: 0,
list: [],
loading: false,
dict: {},
textStateMap: {}
}
},
created() {
this.getDicTypeListCode()
this.getData()
},
methods: {
getData (page) {
return new Promise((resolve, reject) => {
const config = {
_this: this,
loading: 'loading'
}
if (page) {
this.searchQuery.page = page
}
this.$http._getData("lawss/NewsFeed/getNewsFeed", this.searchQuery, config).then(res => {
if (res.ok) {
this.total = res.data.total
if (this.searchQuery.page === 1) {
this.list = res.data.records
} else {
this.list = [...this.list, ...res.data.records]
}
}
}).finally(() => {
resolve()
})
})
},
getDicTypeListCode () {
this.$http._getData('sys/dictype/getDicTypeListCode').then(res => {
this.dict = {...res.data}
this.setMap(this.dict.WBZTCLASS, 'textStateMap')
})
},
setMap(data, key) {
data.forEach(item => {
this.$set(this[key], item.value, item.label);
});
},
jumpDetails(item) {
this.$router.push({
name: "domesticDetails",
query: {
id: item.standardId,
pageType: "INLAND_STAND"
}
});
}
}
}
</script>
<style scoped lang="less">
.root {
height: 100%;
}
.scroll-wrapper {
height: calc(100vh - 131px);
overflow: hidden;
position: relative;
}
.card-content {
width: 95%;
height: auto;
margin: 10px;
background-color: #FFFFFF;
border-radius: 5px;
box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.1);
.standTitle {
.title {
font-size: 3.4vw;
color: #333333;
font-weight: 600;
height: auto;
line-height: 20px;
padding: 5px 10px;
text-align: left;
border-bottom: 1px solid #cccccc;
}
}
.standContent {
font-size: 3.4vw;
color: #555555;
font-weight: 450;
margin-top: 5px;
.standState {
padding-left: 10px;
//height: 35px;
line-height: 25px;
}
}
.timeFooter {
font-size: 3.4vw;
padding: 0 10px;
height: 35px;
line-height: 35px;
border-top: 1px solid #cccccc;
display: flex;
}
}
.card-content:first-child {
margin-top: 0;
}
</style>