Files
foton-laws-system-front/src/pages/home2/components/release/index.vue
T
2021-10-08 10:08:48 +08:00

116 lines
2.9 KiB
Vue

<!-- 标准发布 -->
<template>
<div class="release">
<!-- <ul>-->
<!-- <li v-for="item in standardReleaseList" :key="item.id" class="time-title" >-->
<!-- <div style="height: 18px;">-->
<!-- <a @click="handlePreview(item)" style="color: #333333" class="table-jump">{{ item.standName }}</a>-->
<!-- <span class="time">{{item.issueTime ? $moment(item.issueTime).format('YYYY-MM-DD') : '' }}</span>-->
<!-- </div>-->
<!-- </li>-->
<!-- </ul>-->
<el-table
ref="selection"
:data="standardReleaseList"
tooltip-effect="dark"
style="width: 100%;padding:0 0 20px 0;"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
style="width: 100%">
<el-table-column
type="index"
width="50">
</el-table-column>
<el-table-column
prop="standName"
label="名称">
<template slot-scope="scope">
<span @click="handlePreview(scope.row)">{{ scope.row.standName }}</span>
</template>
</el-table-column>
<el-table-column
width="120"
label="结束时间">
<template slot-scope="scope">
<span>{{scope.row.issueTime ? $moment(scope.row.issueTime).format('YYYY-MM-DD') : '' }}</span>
</template>
</el-table-column>
</el-table>
</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'
}
})
window.open(routeUrl.href, '_blank')
},
//截取时间
getDate (date) {
return date != null ? date.substring(0, date.indexOf(' ')) : ''
},
//获取数据
getAdvice() {
let obj = {}
obj.limit = 10
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)
}
})
}, e => {
})
},
},
}
</script>
<style lang="less" scoped>
.release {
.time-title {
margin: 15px;
.time {
float: right;
color:#333333;
}
a {
color: #ffffff;
&:hover {
color: #e9c851;
cursor:pointer;
text-decoration: underline;
}
}
}
}
</style>