|
@@ -3,39 +3,80 @@
|
|
|
<el-card>
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span>标准规范</span>
|
|
|
- <el-button style="float: right; padding: 3px 0" type="text">更多<i class="el-icon-arrow-right" /></el-button>
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="showMore">更多<i class="el-icon-arrow-right" /></el-button>
|
|
|
</div>
|
|
|
<el-scrollbar class="spec-content">
|
|
|
- <el-table :data="specData" :show-header="false">
|
|
|
+ <el-table v-loading="loading" :data="tableData" :show-header="false">
|
|
|
<el-table-column show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link :underline="false">{{ scope.row.name }}</el-link>
|
|
|
+ <el-link :underline="false" @click="showDetail(scope.row.id)">{{ scope.row.title }}</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="createDate" width="150" />
|
|
|
+ <el-table-column prop="createTime" width="150" />
|
|
|
</el-table>
|
|
|
</el-scrollbar>
|
|
|
</el-card>
|
|
|
+ <info-view ref="infoView" :type-data="typeData" is-home />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { fetchTableList } from '@/api/info'
|
|
|
+
|
|
|
+import { hasValidRecords } from '@/utils/convert'
|
|
|
+
|
|
|
+import InfoView from '@/views/info/InfoView'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'HomeSpec',
|
|
|
+ components: {
|
|
|
+ InfoView
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- specData: [
|
|
|
- { id: '1', name: 'Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1Spec1', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '2', name: 'Spec2', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '3', name: 'Spec3', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '4', name: 'Spec4', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '5', name: 'Spec5', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '6', name: 'Spec6', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '7', name: 'Spec7', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '8', name: 'Spec8', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '9', name: 'Spec9', link: '', createDate: '2023-07-07 10:01:02' },
|
|
|
- { id: '10', name: 'Spec10', link: '', createDate: '2023-07-07 10:01:02' }
|
|
|
- ]
|
|
|
+ tableData: [],
|
|
|
+ typeData: [{ 'id': 1, 'label': '通知通告' }, { 'id': 2, 'label': '信息交流' }, { 'id': 3, 'label': '标准规范' }],
|
|
|
+ // others
|
|
|
+ loading: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getSpecData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSpecData() {
|
|
|
+ this.loading = true
|
|
|
+ const params = {
|
|
|
+ current: 1,
|
|
|
+ size: 50,
|
|
|
+ delFlag: 0,
|
|
|
+ messageType: 3
|
|
|
+ }
|
|
|
+ fetchTableList(params).then(response => {
|
|
|
+ this.loading = false
|
|
|
+ if (hasValidRecords(response)) {
|
|
|
+ this.tableData = response.data.records
|
|
|
+ this.total = response.data.total
|
|
|
+ } else {
|
|
|
+ this.tableData = []
|
|
|
+ this.total = 0
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error)
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ duration: 0,
|
|
|
+ showClose: true,
|
|
|
+ message: '获取标准规范列表出错: ' + error.message
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showMore() {
|
|
|
+ this.$router.push('/info')
|
|
|
+ },
|
|
|
+ showDetail(id) {
|
|
|
+ this.$refs['infoView'].open(id)
|
|
|
}
|
|
|
}
|
|
|
}
|