This commit is contained in:
zhutianqi
2021-09-16 10:58:14 +08:00
parent c1e16233c4
commit 005f7dbf2d
+84 -65
View File
@@ -2,87 +2,106 @@
<template>
<div class="release">
<ul>
<li v-for="item in standardReleaseList" :key="item.id" class="time-title" v-if="updateTime>=item.issueTime">
<a @click="handlePreview(item)" class="table-jump">{{ item.standName }}</a>
<span class="time">{{item.issueTime }}</span>
<li v-for="item in standardReleaseList" :key="item.id" class="time-title" >
<div style="height: 18px;">
<a @click="handlePreview(item)" class="table-jump">{{ item.standName }}</a>
<span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span>
</div>
<div style="height: 18px;">
<a @click="handlePreview(item)" class="table-jump">{{ item.standName }}</a>
<span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span>
</div>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'Release',
components: {},
mixins: [],
data() {
return {
putTime: '',
standardReleaseList: [], //标准发布数据
}
},
computed: {},
watch: {},
mounted() {
this.getDate()
this.getAdvice()
this.addDate()
},
methods: {
// 点击查看
handlePreview (item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: item.standType + '_STAND'
export default {
name: 'Release',
components: {},
mixins: [],
data() {
return {
putTime: '',
standardReleaseList: [], //标准发布数据
updateTime:""
}
},
computed: {},
watch: {},
mounted() {
this.getDate()
this.getAdvice()
this.addDate()
},
methods: {
//获取当前年月日
addDate(){
const nowDate = new Date();
const date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
date: nowDate.getDate(),
}
})
window.open(routeUrl.href, '_blank')
},
//截取时间
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 => {
let arr = res.data
arr.forEach(item => {
if(item.standName !== ""){
this.standardReleaseList.push(item)
const newmonth = date.month>10?date.month:'0'+date.month
const day = date.date>10?date.date:'0'+date.date
this.updateTime = date.year + '-' + newmonth + '-' + day
console.log("当前时间"+this.updateTime)
},
// 点击查看
handlePreview (item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: item.standType + '_STAND'
}
})
}, e => {
})
window.open(routeUrl.href, '_blank')
},
//截取时间
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>
<style lang="less" scoped>
.release {
.time-title {
margin: 15px;
.time {
float: right;
color:#FFFFFF;
}
a {
color: #ffffff;
&:hover {
color: #e9c851;
cursor:pointer;
text-decoration: underline;
.release {
.time-title {
margin: 15px;
.time {
float: right;
color:#FFFFFF;
}
a {
color: #ffffff;
&:hover {
color: #e9c851;
cursor:pointer;
text-decoration: underline;
}
}
}
}
}
</style>