feat: 手机端-标准化动态添加字段

This commit is contained in:
zyn
2023-11-28 11:14:18 +08:00
parent 431de4dc05
commit a6c638526f
3 changed files with 101 additions and 66 deletions
@@ -9,22 +9,20 @@
:total="total"
:loading="loading"
:pullingUpHandler="pullingUpHandler">
<div class="card-content" v-for="item in list" :key="item.id" @click="jumpDetails(item)">
<div class="standTitle">
<div class="title">
{{ item.dataTitle && item.dataTitle.length > 40 ? item.dataTitle.slice(0, 39) + "..." : item.dataTitle }}
<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.dataTitle || '-' }}</div>
</div>
</div>
<div class="standContent">
<div class="standState">类型:
<span style="color: #35720B; padding-left: 5px;">
{{ item.dataType && item.dataType.length > 30 ? item.dataType.slice(0, 29) + "..." : item.dataType }}
</span>
<div class="standContent">
<div class="standState">
类型: <span style="color: #35720B; padding-left: 5px;">{{ item.dataType || '-' }}</span>
</div>
</div>
<div class="standSubTime">上传时间:
<span style="padding-left: 5px;">
{{ $moment(item.dataUploadTime).format("YYYY-MM-DD HH:mm:ss") }}
</span>
<div class="timeFooter">
上传时间: <span style="padding-left: 5px;">{{ $moment(item.dataUploadTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
</div>
</div>
</div>
@@ -141,16 +139,19 @@ export default {
.standState {
padding-left: 10px;
height: 35px;
line-height: 35px;
line-height: 25px;
}
.standSubTime {
font-size: 3.4vw;
padding-left: 10px;
height: 35px;
line-height: 35px;
}
}
.timeFooter {
font-size: 3.4vw;
padding: 0 10px;
height: 35px;
line-height: 35px;
//border-top: 1px solid #cccccc;
}
}
.card-content:first-child {
margin-top: 0;
}
</style>
@@ -1,22 +1,27 @@
<template>
<PhoneScroll
height="calc(100vh - 131px)"
height="calc(100vh - 101px)"
:data="list"
:total="total"
:loading="loading"
:pullingUpHandler="pullingUpHandler">
<div class="card-content" v-for="item in list" :key="item.id" @click="jumpDetails(item)">
<div class="standTitle">
<div class="title">{{ item.standardName }}</div>
</div>
<div class="standContent">
<div class="standState">标准状态:
<span style="color: #35720B; padding-left: 5px;">
{{ dict.WBZTCLASS && dict.WBZTCLASS.find(i => i.value === item.textState).label || '-' }}
</span>
<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="standSubTime">发布日期:
<span style="padding-left: 5px;">{{ item.releaseDate }}</span>
<div class="standContent">
<div class="standState">{{ item.standardName }}</div>
<div class="standState">
<!--标准状态: <span style="color: #35720B; padding-left: 5px;">{{ dict.WBZTCLASS && dict.WBZTCLASS.find(i => i.value === item.textState).label || '-' }}</span>-->
标准状态: <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>
@@ -36,12 +41,13 @@ export default {
searchQuery: {
page: 1,
pageSize: 10,
messageType: 'GNWBZFG'
messageType: 'GNBZFG'
},
total: 0,
list: [],
loading: false,
dict: {}
dict: {},
textStateMap: {}
}
},
created() {
@@ -75,8 +81,14 @@ export default {
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",
@@ -130,16 +142,21 @@ export default {
.standState {
padding-left: 10px;
height: 35px;
line-height: 35px;
//height: 35px;
line-height: 25px;
}
.standSubTime {
font-size: 3.4vw;
padding-left: 10px;
height: 35px;
line-height: 35px;
}
}
.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>
@@ -1,22 +1,26 @@
<template>
<PhoneScroll
height="calc(100vh - 131px)"
height="calc(100vh - 101px)"
:data="list"
:total="total"
:loading="loading"
:pullingUpHandler="pullingUpHandler">
<div class="card-content" v-for="item in list" :key="item.id" @click="jumpDetails(item)">
<div class="standTitle">
<div class="title">{{ item.standardName }}</div>
</div>
<div class="standContent">
<div class="standState">标准状态:
<span style="color: #35720B; padding-left: 5px;">
{{ dict.WBZTCLASS && dict.WBZTCLASS.find(i => i.value === item.textState).label || '-' }}
</span>
<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="standSubTime">发布日期:
<span style="padding-left: 5px;">{{ item.releaseDate }}</span>
<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>
@@ -41,7 +45,8 @@ export default {
total: 0,
list: [],
loading: false,
dict: {}
dict: {},
textStateMap: {}
}
},
created() {
@@ -75,8 +80,14 @@ export default {
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",
@@ -130,16 +141,22 @@ export default {
.standState {
padding-left: 10px;
height: 35px;
line-height: 35px;
}
.standSubTime {
font-size: 3.4vw;
padding-left: 10px;
height: 35px;
line-height: 35px;
//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>