开发法规预警页面
This commit is contained in:
@@ -946,5 +946,6 @@ module.exports = {
|
|||||||
question: 'Question',
|
question: 'Question',
|
||||||
ConfirmQuestion: 'Confirm Question',
|
ConfirmQuestion: 'Confirm Question',
|
||||||
disableInput: 'Disable input',
|
disableInput: 'Disable input',
|
||||||
OnlyOrTaskconfirmationOut: 'Only when the list confirmation status or task confirmation status is to be confirmed can the reminder be carried out'
|
OnlyOrTaskconfirmationOut: 'Only when the list confirmation status or task confirmation status is to be confirmed can the reminder be carried out',
|
||||||
|
warningTime:'Warning time',
|
||||||
}
|
}
|
||||||
@@ -952,4 +952,5 @@ module.exports = {
|
|||||||
ConfirmQuestion: '确认催办?',
|
ConfirmQuestion: '确认催办?',
|
||||||
OnlyOrTaskconfirmationOut:'只有清单确认状态或任务确认状态为待确认时才可以进行催办',
|
OnlyOrTaskconfirmationOut:'只有清单确认状态或任务确认状态为待确认时才可以进行催办',
|
||||||
disableInput:'禁止输入',
|
disableInput:'禁止输入',
|
||||||
|
warningTime:'预警时间',
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,10 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route': function(val) {
|
'$route': function(val) {
|
||||||
if (val.meta.title == '首页' || val.meta.title === ' home page') {
|
if (val.meta.title == '首页' ||
|
||||||
|
val.meta.title === ' Home Page' ||
|
||||||
|
this.$route.meta.title === '法规预警' ||
|
||||||
|
this.$route.meta.title === 'Regulatory Early Warning') {
|
||||||
this.Navigation = val.meta.title
|
this.Navigation = val.meta.title
|
||||||
this.subNavigation = null
|
this.subNavigation = null
|
||||||
} else {
|
} else {
|
||||||
@@ -36,7 +39,10 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.$route.meta)
|
console.log(this.$route.meta)
|
||||||
if (this.$route.meta.title === '首页' || this.$route.meta.title === ' home page') {
|
if (this.$route.meta.title === '首页' ||
|
||||||
|
this.$route.meta.title === ' Home Page' ||
|
||||||
|
this.$route.meta.title === '法规预警' ||
|
||||||
|
this.$route.meta.title === 'Regulatory Early Warning') {
|
||||||
this.Navigation = this.$route.meta.title
|
this.Navigation = this.$route.meta.title
|
||||||
this.subNavigation = null
|
this.subNavigation = null
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -165,6 +165,14 @@
|
|||||||
flag: {
|
flag: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
|
},
|
||||||
|
searchQueryList: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
isDefault: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -183,6 +191,12 @@
|
|||||||
},
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.queryParam = {}
|
this.queryParam = {}
|
||||||
|
if (this.isDefault) {
|
||||||
|
let startTime = moment(new Date()).format('YYYY-MM-DD')
|
||||||
|
let endTime = this.getNewDate('after', 6)
|
||||||
|
this.queryParam['warningTime'] = [startTime, endTime]
|
||||||
|
this.queryParam = { ...this.queryParam }
|
||||||
|
}
|
||||||
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
||||||
},
|
},
|
||||||
getSeach() {
|
getSeach() {
|
||||||
@@ -192,12 +206,79 @@
|
|||||||
getAction(this.url.seachList, params).then((res) => {
|
getAction(this.url.seachList, params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.searchList = res.result
|
this.searchList = res.result
|
||||||
|
if (this.searchQueryList && this.searchQueryList.length > 0) {
|
||||||
|
this.searchList = this.searchList.concat(this.searchQueryList)
|
||||||
|
let startTime = moment(new Date()).format('YYYY-MM-DD')
|
||||||
|
let endTime = this.getNewDate('after', 6)
|
||||||
|
this.queryParam['warningTime'] = [startTime, endTime]
|
||||||
|
this.queryParam = { ...this.queryParam }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// handleToggleSearch() {
|
getNewDate(flag, many) {
|
||||||
// this.toggleSearchStatus = !this.toggleSearchStatus
|
|
||||||
// },
|
const thirtyDays = [4, 6, 9, 11] // 30天的月份
|
||||||
|
|
||||||
|
const thirtyOneDays = [1, 3, 5, 7, 8, 10, 12] // 31天的月份
|
||||||
|
|
||||||
|
const currDate = new Date() // 今天日期
|
||||||
|
|
||||||
|
const year = currDate.getFullYear()
|
||||||
|
|
||||||
|
let month = currDate.getMonth() + 1
|
||||||
|
|
||||||
|
let targetDateMilli = 0
|
||||||
|
|
||||||
|
let GMTDate = '' // 中国标准时间
|
||||||
|
|
||||||
|
let targetYear = '' // 年
|
||||||
|
|
||||||
|
let targetMonth = '' // 月
|
||||||
|
|
||||||
|
let targetDate = '' // 日
|
||||||
|
|
||||||
|
let dealTargetDays = '' // 目标日期
|
||||||
|
|
||||||
|
const isLeapYear = !!((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) // 是否是闰年
|
||||||
|
|
||||||
|
let countDays = 0 // 累计天数
|
||||||
|
|
||||||
|
for (let i = 0; i < many; i++) {
|
||||||
|
|
||||||
|
if (flag === 'before') {
|
||||||
|
|
||||||
|
month = month - 1 <= 0 ? 12 : month - 1
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
month = month + 1 > 12 ? 1 : month + 1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
thirtyDays.includes(month) ? (countDays += 30) : thirtyOneDays.includes(month) ? (countDays += 31) : isLeapYear ? (countDays += 29) : (countDays += 28)
|
||||||
|
}
|
||||||
|
|
||||||
|
targetDateMilli = currDate.setDate(
|
||||||
|
currDate.getDate() - (flag === 'before' ? countDays : countDays * -1)
|
||||||
|
)
|
||||||
|
|
||||||
|
GMTDate = new Date(targetDateMilli)
|
||||||
|
|
||||||
|
targetYear = GMTDate.getFullYear()
|
||||||
|
|
||||||
|
targetMonth = GMTDate.getMonth() + 1
|
||||||
|
|
||||||
|
targetDate = GMTDate.getDate()
|
||||||
|
|
||||||
|
targetMonth = targetMonth.toString().padStart(2, '0')
|
||||||
|
|
||||||
|
targetDate = targetDate.toString().padStart(2, '0')
|
||||||
|
|
||||||
|
dealTargetDays = `${targetYear}-${targetMonth}-${targetDate}`
|
||||||
|
|
||||||
|
return dealTargetDays
|
||||||
|
},
|
||||||
dateChange(item) {
|
dateChange(item) {
|
||||||
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
|
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
|
||||||
},
|
},
|
||||||
@@ -216,7 +297,39 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.box-input .ant-select-selection--single {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-select-selection--multiple {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-select-selection__rendered {
|
||||||
|
line-height: 38px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-calendar-picker {
|
||||||
|
line-height: 38px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-calendar-picker-input {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-input .ant-input-number-input-wrap {
|
||||||
|
line-height: 38px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.box-title-text {
|
.box-title-text {
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
|
|||||||
@@ -0,0 +1,218 @@
|
|||||||
|
<template>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<search ref="searchRef"
|
||||||
|
:searchQueryList="searchQueryList"
|
||||||
|
:flag="'1'"
|
||||||
|
:isDefault="true"
|
||||||
|
:url="url"/>
|
||||||
|
</div>
|
||||||
|
<div class="table-operator">
|
||||||
|
<div @click="handleCompare" class="operator-text">
|
||||||
|
<a-icon type="rocket" :rotate="45"/>
|
||||||
|
{{$t('Push')}}
|
||||||
|
</div>
|
||||||
|
<div @click="handleExport" class="operator-text">
|
||||||
|
<a-icon type="export" :rotate="-90"/>
|
||||||
|
{{$t('export')}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a-tabs :model="activeTab" @change="callback">
|
||||||
|
<a-tab-pane :key="$t('ImplementationDate')" :tab="$t('ImplementationDate')">
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane :key="$t('vehicleInProductionDate')" :tab="$t('vehicleInProductionDate')">
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
:loading="loading"
|
||||||
|
:pagination="false"
|
||||||
|
:scroll="{x: '100%'}"
|
||||||
|
rowKey="id"
|
||||||
|
:data-source="dataSource"
|
||||||
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||||
|
:columns="columns"
|
||||||
|
>
|
||||||
|
</a-table>
|
||||||
|
<div class="page" v-if="dataSource && dataSource.length > 0">
|
||||||
|
<a-pagination
|
||||||
|
:show-total="total => $t('total')+` ${total} `+$t('strip')"
|
||||||
|
show-quick-jumper
|
||||||
|
show-size-changer
|
||||||
|
:page-size.sync="pageSize"
|
||||||
|
:total="total"
|
||||||
|
@change="pageOnChange"
|
||||||
|
@showSizeChange="SizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<libraryPush
|
||||||
|
:url="url"
|
||||||
|
ref="libraryPushRef"
|
||||||
|
@clearSelected="clearSelected"
|
||||||
|
/>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import search from '@/components/search/index'
|
||||||
|
import libraryPush from '@/components/libraryPush/index'
|
||||||
|
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||||
|
import moment from 'moment'
|
||||||
|
import eventBUs from '../../common/event'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'index',
|
||||||
|
components: {
|
||||||
|
search,
|
||||||
|
libraryPush
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//url传参严格按照当前命名
|
||||||
|
url: {
|
||||||
|
seachList: 'document/bussDocumentLibraryEO/queryCondition' //搜索字段
|
||||||
|
},
|
||||||
|
activeTab: this.$t('ImplementationDate'),
|
||||||
|
loading: false,
|
||||||
|
dataSource: [],
|
||||||
|
selectedRowKeys: [],
|
||||||
|
total: 0,
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
searchQueryList: [
|
||||||
|
{
|
||||||
|
field_show_type: 6,
|
||||||
|
db_field_txt: this.$t('warningTime'),
|
||||||
|
db_field_name: 'warningTime'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
columnsAll: [
|
||||||
|
{
|
||||||
|
title: this.$t('standard'),
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'serial_number',
|
||||||
|
width: 170,
|
||||||
|
scopedSlots: { customRender: 'serial_number' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('title'),
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'title',
|
||||||
|
width: 170,
|
||||||
|
scopedSlots: { customRender: 'titleName' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('status'),
|
||||||
|
align: 'center',
|
||||||
|
width: 140,
|
||||||
|
ellipsis: true,
|
||||||
|
dataIndex: 'state'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('zoneOfApplication'),
|
||||||
|
align: 'center',
|
||||||
|
width: 170,
|
||||||
|
ellipsis: true,
|
||||||
|
dataIndex: 'region'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('technicalField'),
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 170,
|
||||||
|
dataIndex: 'technology_territory'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('vehicleInProductionDate'),
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 210,
|
||||||
|
dataIndex: 'implement_time'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('ImplementationDate'),
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 210,
|
||||||
|
dataIndex: 'xin1_che1_xing2_shi2_shi1_ri4_qi1'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
columns() {
|
||||||
|
let columnsAll = JSON.parse(JSON.stringify(this.columnsAll))
|
||||||
|
if (this.activeTab == this.$t('ImplementationDate')) {
|
||||||
|
for (let i = 0; i < columnsAll.length; i++) {
|
||||||
|
if (columnsAll[i].dataIndex == 'implement_time') {
|
||||||
|
columnsAll.splice(i, 1)
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.activeTab == this.$t('vehicleInProductionDate')) {
|
||||||
|
for (let i = 0; i < columnsAll.length; i++) {
|
||||||
|
if (columnsAll[i].dataIndex == 'xin1_che1_xing2_shi2_shi1_ri4_qi1') {
|
||||||
|
columnsAll.splice(i, 1)
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return columnsAll
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
eventBUs.$on('searchQuery', search => {
|
||||||
|
Object.keys(search).forEach(res => {
|
||||||
|
if (search[res] instanceof Array) {
|
||||||
|
search[res] = search[res].join(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.searchParmes = search
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
eventBUs.$on('searchReset', target => {
|
||||||
|
this.searchParmes = {}
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
callback(tab) {
|
||||||
|
this.activeTab = tab
|
||||||
|
},
|
||||||
|
onSelectChange(value) {
|
||||||
|
this.selectedRowKeys = value
|
||||||
|
},
|
||||||
|
handleCompare() {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
|
||||||
|
},
|
||||||
|
clearSelected() {
|
||||||
|
|
||||||
|
},
|
||||||
|
pageOnChange() {
|
||||||
|
|
||||||
|
},
|
||||||
|
SizeChange() {
|
||||||
|
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
|
||||||
|
.page {
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user