fix:修改底部弹窗 alertMessage 时间错误的问题

This commit is contained in:
zhangyu
2022-03-09 14:26:11 +08:00
parent b44ceec0ca
commit 36cd9af819
15 changed files with 19 additions and 14 deletions

View File

@@ -25,6 +25,7 @@
<alertMessageTable <alertMessageTable
ref="dataTable" ref="dataTable"
:api="url" :api="url"
:orderByFa="'id'"
:loading="tools.loading" :loading="tools.loading"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="subTableHeight" :height="subTableHeight"
@@ -300,8 +301,8 @@ export default {
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.$set(this.searchLabel, 'state', this.state) this.$set(this.searchLabel, 'state', this.state)
if (this.searchTimeHeader && this.searchTimeHeader.length > 1) { if (this.searchTimeHeader && this.searchTimeHeader.length > 1) {
this.$set(this.searchLabel, 'startAt', this.timezoneToUtcTimeStr(this.searchTimeHeader[0])) this.$set(this.searchLabel, 'startAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[0])), 'YYYY-MM-DD HH:mm:ss'))
this.$set(this.searchLabel, 'endAt', this.timezoneToUtcTimeStr(this.searchTimeHeader[1])) this.$set(this.searchLabel, 'endAt', bus.timeFormate(this.timezoneToUtcTime(bus.formateTimeToTime(this.searchTimeHeader[1])), 'YYYY-MM-DD HH:mm:ss'))
} else { } else {
delete this.searchLabel.startAt delete this.searchLabel.startAt
delete this.searchLabel.endAt delete this.searchLabel.endAt

View File

@@ -16,6 +16,7 @@
<template v-slot> <template v-slot>
<alertRuleEvalLogTable <alertRuleEvalLogTable
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -18,6 +18,7 @@
<asset-table <asset-table
ref="dataTable" ref="dataTable"
:api="url" :api="url"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"

View File

@@ -18,6 +18,7 @@
<asset-table <asset-table
ref="dataTable" ref="dataTable"
:api="url" :api="url"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"

View File

@@ -18,6 +18,7 @@
<template v-slot> <template v-slot>
<cabinet-table <cabinet-table
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -56,6 +56,7 @@
<template v-slot> <template v-slot>
<endpointQueryTab <endpointQueryTab
ref="endpointQueryTab" ref="endpointQueryTab"
:orderByFa="'id'"
:from="from" :from="from"
:obj="obj" :obj="obj"
:formatTime="formatTime" :formatTime="formatTime"

View File

@@ -17,6 +17,7 @@
<template v-slot> <template v-slot>
<endpoint-table <endpoint-table
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -15,6 +15,7 @@
<template v-slot> <template v-slot>
<operation-log-table <operation-log-table
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -24,6 +24,7 @@
<template v-slot> <template v-slot>
<scrape-endpoint-table <scrape-endpoint-table
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -15,6 +15,7 @@
<template v-slot> <template v-slot>
<terminal-log-table <terminal-log-table
ref="dataTable" ref="dataTable"
:orderByFa="'id'"
v-loading="tools.loading" v-loading="tools.loading"
:loading="tools.loading" :loading="tools.loading"
:api="url" :api="url"

View File

@@ -339,7 +339,6 @@ export default {
const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
if (this.$route.query.orderBy) { if (this.$route.query.orderBy) {
this.orderBy = this.$route.query.orderBy this.orderBy = this.$route.query.orderBy
console.log('asdasdadsadsa')
} }
let searchKeys = {} let searchKeys = {}
if (path === 'dc') { if (path === 'dc') {

View File

@@ -136,7 +136,6 @@ export default {
this.orderBy = { prop: n, order: 'ascending' } this.orderBy = { prop: n, order: 'ascending' }
} }
// this.orderBy = JSON.parse(JSON.stringify(this.orderBy)) // this.orderBy = JSON.parse(JSON.stringify(this.orderBy))
console.log(n, this.orderBy)
} }
} }
}, },

View File

@@ -446,7 +446,6 @@ export default {
immediate: true, immediate: true,
handler (n) { handler (n) {
const obj = JSON.parse(JSON.stringify(n)) const obj = JSON.parse(JSON.stringify(n))
console.log(obj)
if (obj.param && !obj.param.valueMapping) { if (obj.param && !obj.param.valueMapping) {
obj.param.valueMapping = [] obj.param.valueMapping = []
} }

View File

@@ -16,6 +16,7 @@ router.beforeEach((to, from, next) => {
const configUrl = 'static/config.json?Timestamp=' + new Date().getTime() const configUrl = 'static/config.json?Timestamp=' + new Date().getTime()
if (to.path === '/login') { // 拦截登录页面,现货区外观设置 再系统初始化检查 if (to.path === '/login') { // 拦截登录页面,现货区外观设置 再系统初始化检查
Vue.http.get(configUrl).then(config => { Vue.http.get(configUrl).then(config => {
console.log(1)
const appearance = new Promise(resolve => { const appearance = new Promise(resolve => {
get(config.body.baseUrl + 'sys/appearance').then(res => { get(config.body.baseUrl + 'sys/appearance').then(res => {
if (res.code === 200) { if (res.code === 200) {
@@ -110,6 +111,7 @@ router.beforeEach((to, from, next) => {
store.commit('setLangList', JSON.parse(langList)) store.commit('setLangList', JSON.parse(langList))
} }
Vue.http.get(configUrl).then(config => { Vue.http.get(configUrl).then(config => {
console.log(2)
get(config.body.baseUrl + 'sys/i18n/lang').then(response => { get(config.body.baseUrl + 'sys/i18n/lang').then(response => {
if (response.code === 200) { if (response.code === 200) {
loadI18n(response.data) loadI18n(response.data)
@@ -125,6 +127,7 @@ router.beforeEach((to, from, next) => {
const permissionRequest = new Promise(resolve => { const permissionRequest = new Promise(resolve => {
if (store.getters.menuList.length === 0) { if (store.getters.menuList.length === 0) {
Vue.http.get(configUrl).then(config => { Vue.http.get(configUrl).then(config => {
console.log(3)
post(config.body.baseUrl + 'sys/user/permissions', { token: localStorage.getItem('nz-token') }).then(res => { post(config.body.baseUrl + 'sys/user/permissions', { token: localStorage.getItem('nz-token') }).then(res => {
if (res.code === 200) { if (res.code === 200) {
store.commit('setMenuList', sortByOrderNum(res.data.menus)) store.commit('setMenuList', sortByOrderNum(res.data.menus))
@@ -144,13 +147,6 @@ router.beforeEach((to, from, next) => {
resolve() resolve()
} }
}) })
Vue.http.get(configUrl).then(config => {
get(config.body.baseUrl + 'alert/severity', { pageNo: 1, pageSize: -1 }).then(response => {
if (response.code == 200) {
store.commit('setSeverityData', response.data.list)
}
})
})
Promise.all([i18nRequest, permissionRequest]).then(response => { Promise.all([i18nRequest, permissionRequest]).then(response => {
if (to.path) { if (to.path) {
if (permissionWhiteList.indexOf(to.path) !== -1) { if (permissionWhiteList.indexOf(to.path) !== -1) {

View File

@@ -11,8 +11,8 @@ const user = {
buttonList: [], buttonList: [],
roleList: [], roleList: [],
language: localStorage.getItem('nz-language'), language: localStorage.getItem('nz-language'),
severityData: [], severityData: localStorage.getItem('nz-severityData') ? JSON.parse(localStorage.getItem('nz-severityData')) : [],
severityDataWeight: [] severityDataWeight: localStorage.getItem('nz-severityDataWeight') ? JSON.parse(localStorage.getItem('nz-severityDataWeight')) : []
}, },
mutations: { mutations: {
setLanguage (state, language) { setLanguage (state, language) {
@@ -28,6 +28,7 @@ const user = {
state.roleList = [...roleList] state.roleList = [...roleList]
}, },
setSeverityData (state, severityData) { setSeverityData (state, severityData) {
localStorage.setItem('nz-severityData', JSON.stringify(severityData))
state.severityData = [...severityData] state.severityData = [...severityData]
const arr = JSON.parse(JSON.stringify(severityData.reverse())) const arr = JSON.parse(JSON.stringify(severityData.reverse()))
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
@@ -39,6 +40,7 @@ const user = {
} }
} }
} }
localStorage.setItem('nz-severityDataWeight', JSON.stringify(arr))
state.severityDataWeight = arr state.severityDataWeight = arr
}, },
clean (state) { clean (state) {