首页展示数据

This commit is contained in:
宋伟佳
2021-09-16 16:17:15 +08:00
parent 36861d93d2
commit c529e1b77f
2 changed files with 66 additions and 82 deletions
+65 -81
View File
@@ -3,102 +3,86 @@
<div class="release"> <div class="release">
<ul> <ul>
<li v-for="item in standardReleaseList" :key="item.id" class="time-title" > <li v-for="item in standardReleaseList" :key="item.id" class="time-title" >
<div style="height: 18px;"> <div style="height: 18px;">
<a @click="handlePreview(item)" class="table-jump">{{ item.standName }}</a> <a @click="handlePreview(item)" class="table-jump">{{ item.standName }}</a>
<span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span> <span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Release', name: 'Release',
components: {}, components: {},
mixins: [], mixins: [],
data() { data() {
return { return {
putTime: '', putTime: '',
standardReleaseList: [], //标准发布数据 standardReleaseList: [], //标准发布数据
updateTime:"" }
} },
}, computed: {},
computed: {}, watch: {},
watch: {}, mounted() {
mounted() { this.getDate()
this.getDate() this.getAdvice()
this.getAdvice() this.addDate()
this.addDate() },
}, methods: {
methods: { // 点击查看
//获取当前年月日 handlePreview (item) {
addDate(){ let routeUrl = this.$router.resolve({
const nowDate = new Date(); name: 'OtherStandardDetails',
const date = { params: {
year: nowDate.getFullYear(), id: item.id,
month: nowDate.getMonth() + 1, pageType: item.standType + '_STAND'
date: nowDate.getDate(),
} }
const newmonth = date.month>10?date.month:'0'+date.month })
const day = date.date>10?date.date:'0'+date.date window.open(routeUrl.href, '_blank')
this.updateTime = date.year + '-' + newmonth + '-' + day },
console.log("当前时间"+this.updateTime) //截取时间
}, getDate (date) {
// 点击查看 return date != null ? date.substring(0, date.indexOf(' ')) : ''
handlePreview (item) { },
let routeUrl = this.$router.resolve({ //获取数据
name: 'OtherStandardDetails', getAdvice() {
params: { let obj = {}
id: item.id, obj.limit = 10
pageType: item.standType + '_STAND' this.$http.get('sarStandardsInfo/sar-standards-info/getStandInfoByList', obj, {
_this: this
}, res => {
let arr = res.data
arr.forEach(item => {
if(item.standName !== ""){
this.standardReleaseList.push(item)
} }
}) })
window.open(routeUrl.href, '_blank') }, e => {
}, })
//截取时间
getDate (date) {
return date != null ? date.substring(0, date.indexOf(' ')) : ''
},
//获取数据
getAdvice() {
let obj = {}
obj.limit = 8
this.$http.get('sarStandardsInfo/sar-standards-info/getStandInfoByList', obj, {
_this: this
}, res => {
this.standardReleaseList = res.data
let arr = res.data
arr.forEach(item => {
if(item.standName !== ""){
this.standardReleaseList.push(item)
}
})
}, e => {
})
},
}, },
},
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.release { .release {
.time-title { .time-title {
margin: 15px; margin: 15px;
.time { .time {
float: right; float: right;
color:#FFFFFF; color:#FFFFFF;
} }
a { a {
color: #ffffff; color: #ffffff;
&:hover { &:hover {
color: #e9c851; color: #e9c851;
cursor:pointer; cursor:pointer;
text-decoration: underline; text-decoration: underline;
}
} }
} }
} }
}
</style> </style>
@@ -40,7 +40,7 @@ export default {
getAdvice() { getAdvice() {
this.$http.get("slrs/sar-public-idea/SelectAllPage", { this.$http.get("slrs/sar-public-idea/SelectAllPage", {
page: 1, page: 1,
size: 1000 size: 10
}, { }, {
_this: this _this: this
}, res => { }, res => {