[update] 首页增加企标实施预警和企标发布预警

This commit is contained in:
lideqin
2024-03-19 10:57:25 +08:00
parent db509c74ba
commit df68898e57
@@ -19,6 +19,8 @@
<div class="tab-wrapper">
<div class="tab-div" :class="warningTab === 'newCarType' ? 'curr-tab' : ''" @click="warningTabChange('newCarType')">新车型实施预警</div>
<div class="tab-div" :class="warningTab === 'carInProduction' ? 'curr-tab' : ''" @click="warningTabChange('carInProduction')">在产车实施预警</div>
<div class="tab-div small-tab-div" :class="warningTab === 'enStandardImplement' ? 'curr-tab small-curr-tab' : ''" @click="warningTabChange('enStandardImplement')">企标实施预警</div>
<div class="tab-div small-tab-div" :class="warningTab === 'enStandardPublish' ? 'curr-tab small-curr-tab' : ''" @click="warningTabChange('enStandardPublish')">企标发布预警</div>
</div>
<!--这里的scroll.y必须有后面用媒体查询进行样式覆盖-->
<a-table
@@ -38,7 +40,7 @@
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 标号标名称 -->
<!-- 名称 -->
<template v-slot:standard="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
@@ -46,6 +48,14 @@
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 企标号企标名称 -->
<template v-slot:enStandard="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="text" class="link-a" @click="enStandardDetailClick(record)">{{ text }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
</a-card>
@@ -56,6 +66,75 @@ import { ajaxGetDictItems } from '@/api/api'
import { getAction } from '@api/manage'
import { StandardSource } from '@/enums/commonEnums'
const warningColumns = [
{
title: '来源',
align: 'left',
dataIndex: 'source_dictText',
width: 60,
scopedSlots: { customRender: 'text' }
},
{
title: '标准号',
align: 'left',
dataIndex: 'standardNumber',
width: 120,
scopedSlots: { customRender: 'standard' }
},
{
title: '标准名称',
align: 'left',
dataIndex: 'standardName',
width: 180,
scopedSlots: { customRender: 'standard' }
},
{
title: '新车型实施日期',
align: 'left',
dataIndex: 'newModelImplementationDate',
width: 100,
scopedSlots: { customRender: 'text' }
}
]
const enStandardColumns = [
{
title: '企标编号',
align: 'left',
dataIndex: 'standardNumber',
width: 60,
scopedSlots: { customRender: 'enStandard' }
},
{
title: '企标名称',
align: 'left',
dataIndex: 'standardName',
width: 60,
scopedSlots: { customRender: 'enStandard' }
},
{
title: '标准状态',
align: 'left',
dataIndex: 'standardState_dictText',
width: 60,
scopedSlots: { customRender: 'text' }
},
{
title: '发布日期',
align: 'left',
dataIndex: 'releaseDate',
width: 60,
scopedSlots: { customRender: 'text' }
},
{
title: '实施日期',
align: 'left',
dataIndex: 'implementationDate',
width: 60,
scopedSlots: { customRender: 'text' }
}
]
export default {
name: 'SearchAndWarningCard',
data () {
@@ -120,7 +199,9 @@ export default {
},
url: {
newModelWarningList: '/laws/localTool/standardEarlyWarning/newModelImplementation',
inProductionWarningList: '/laws/localTool/standardEarlyWarning/onTheProduction'
inProductionWarningList: '/laws/localTool/standardEarlyWarning/onTheProduction',
enStandardImplementList: '/laws/localTool/standardEarlyWarning/latestImplementEs',
enStandardPublishList: '/laws/localTool/standardEarlyWarning/latestReleaseEs'
}
}
},
@@ -173,11 +254,16 @@ export default {
this.warningTab = value
this.dataSource = []
if (value === 'newCarType') {
this.columns.splice(1, this.columns.length - 1, ...warningColumns)
this.columns[4].title = '新车型实施日期'
this.columns[4].dataIndex = 'newModelImplementationDate'
} else {
} else if (value === 'carInProduction') {
this.columns.splice(1, this.columns.length - 1, ...warningColumns)
this.columns[4].title = '在产车实施日期'
this.columns[4].dataIndex = 'onTheProductionDate'
} else {
// 是企标实施预警或企标发布预警
this.columns.splice(1, this.columns.length - 1, ...enStandardColumns)
}
this.loadData(1)
},
@@ -208,6 +294,15 @@ export default {
}
})
},
// 企标详情
enStandardDetailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
},
handleTableChange (pagination) {
this.ipagination = pagination
this.loadData()
@@ -226,8 +321,12 @@ export default {
let url = ''
if (this.warningTab === 'newCarType') {
url = this.url.newModelWarningList
} else {
} else if (this.warningTab === 'carInProduction') {
url = this.url.inProductionWarningList
} else if (this.warningTab === 'enStandardImplement') {
url = this.url.enStandardImplementList
} else {
url = this.url.enStandardPublishList
}
getAction(url, params).then((res) => {
if (res.success) {
@@ -264,7 +363,7 @@ export default {
}
// 预警tab切换
.tab-wrapper {
width: 360px;
width: 664px;
display: flex;
justify-content: space-between;
align-items: center;
@@ -281,6 +380,9 @@ export default {
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
font-weight: 400;
}
.small-tab-div {
width: 156px;
}
.curr-tab {
width: 176px;
height: 44px;
@@ -293,6 +395,9 @@ export default {
//transition-duration: 0.1s;
//transition-timing-function: ease-in;
}
.small-curr-tab {
width: 156px;
}
// 通过媒体查询覆盖表格高度
.table /deep/ .ant-table-scroll .ant-table-body {
max-height: calc(100vh - 20px - 162px - 310px) !important;