NEZ-2162 feat: 添加 保留打开底部弹窗的状态
This commit is contained in:
@@ -25,12 +25,14 @@ devWebpackConfig = merge(baseWebpackConfig, {
|
|||||||
// these devServer options should be customized in /config/index.js
|
// these devServer options should be customized in /config/index.js
|
||||||
devServer: {
|
devServer: {
|
||||||
clientLogLevel: 'warning',
|
clientLogLevel: 'warning',
|
||||||
historyApiFallback: {
|
historyApiFallback: true,
|
||||||
index: indexHtml,
|
// historyApiFallback: {
|
||||||
rewrites: [
|
// // rewrites: [
|
||||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, indexHtml) }
|
// // // { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, indexHtml) }
|
||||||
]
|
// // { from: /.*/, to: '/ui' },
|
||||||
},
|
// // { from: '/ui', to: path.posix.join(config.dev.assetsPublicPath, indexHtml) },
|
||||||
|
// // ]
|
||||||
|
// },
|
||||||
hot: true,
|
hot: true,
|
||||||
inline: true,
|
inline: true,
|
||||||
contentBase: false, // since we use CopyWebpackPlugin.
|
contentBase: false, // since we use CopyWebpackPlugin.
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const devStart = process.env.npm_lifecycle_event
|
||||||
|
const indexHtml = devStart === 'dev' ? '/src/entrance/app/index.html' : '/src/entrance/exportHtml/exportHtml.html'
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dev: {
|
dev: {
|
||||||
// Paths
|
// Paths
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ export default {
|
|||||||
/* 使用setTimeout延迟渲染图表,避免样式错乱 */
|
/* 使用setTimeout延迟渲染图表,避免样式错乱 */
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const myChart = this.isInit ? echarts.init(document.getElementById(`chart-canvas-${this.chartId}`)) : getChart(this.chartId)
|
const myChart = this.isInit ? echarts.init(document.getElementById(`chart-canvas-${this.chartId}`)) : getChart(this.chartId)
|
||||||
myChart.clear()
|
|
||||||
if (!myChart) {
|
if (!myChart) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
myChart.clear()
|
||||||
myChart.setOption(chartOption)
|
myChart.setOption(chartOption)
|
||||||
this.isInit && setChart(this.chartId, myChart) // 缓存;不使用vue的data是为避免整个chart被监听导致卡顿
|
this.isInit && setChart(this.chartId, myChart) // 缓存;不使用vue的data是为避免整个chart被监听导致卡顿
|
||||||
|
|
||||||
|
|||||||
@@ -698,7 +698,6 @@ export default {
|
|||||||
if (this.fromTopologyDialog && !this.isPreview) {
|
if (this.fromTopologyDialog && !this.isPreview) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.topologyLoading = false
|
this.topologyLoading = false
|
||||||
console.log(data)
|
|
||||||
getTopology(this.topologyIndex).open(data || {})
|
getTopology(this.topologyIndex).open(data || {})
|
||||||
getTopology(this.topologyIndex).centerView()
|
getTopology(this.topologyIndex).centerView()
|
||||||
getTopology(this.topologyIndex).resize()
|
getTopology(this.topologyIndex).resize()
|
||||||
|
|||||||
@@ -95,9 +95,11 @@ import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab'
|
|||||||
import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint'
|
import scrapeEndpoint from '@/components/common/bottomBox/tabs/scrapeEndpoint'
|
||||||
import IpDetails from '@/components/common/bottomBox/tabs/IpDetails'
|
import IpDetails from '@/components/common/bottomBox/tabs/IpDetails'
|
||||||
import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog'
|
import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog'
|
||||||
|
import routerPathParams from '@/components/common/mixin/routerPathParams'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'bottomBox',
|
name: 'bottomBox',
|
||||||
|
mixins: [routerPathParams],
|
||||||
components: {
|
components: {
|
||||||
scrapeEndpoint,
|
scrapeEndpoint,
|
||||||
LogBottomTab,
|
LogBottomTab,
|
||||||
@@ -314,6 +316,9 @@ export default {
|
|||||||
},
|
},
|
||||||
changeTab (tab) {
|
changeTab (tab) {
|
||||||
this.$emit('update:targetTab', tab)
|
this.$emit('update:targetTab', tab)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.updatePath(this.$route.query, this.$route.path, 'bottomBox')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
afterResize () {
|
afterResize () {
|
||||||
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {
|
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {
|
||||||
|
|||||||
@@ -64,9 +64,11 @@ import assetTab from '@/components/common/bottomBox/tabs/assetTab'
|
|||||||
import { fromRoute } from '@/components/common/js/constants'
|
import { fromRoute } from '@/components/common/js/constants'
|
||||||
import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab'
|
import LogBottomTab from '@/components/common/bottomBox/tabs/logBottomTab'
|
||||||
import detailRightTop from './detailRightTop/detailRightTop'
|
import detailRightTop from './detailRightTop/detailRightTop'
|
||||||
|
import routerPathParams from "@/components/common/mixin/routerPathParams";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'detailViewRight',
|
name: 'detailViewRight',
|
||||||
|
mixins: [routerPathParams],
|
||||||
components: {
|
components: {
|
||||||
LogBottomTab,
|
LogBottomTab,
|
||||||
cabinetTab,
|
cabinetTab,
|
||||||
@@ -276,6 +278,9 @@ export default {
|
|||||||
},
|
},
|
||||||
changeTab (tab) {
|
changeTab (tab) {
|
||||||
this.targetTab = tab
|
this.targetTab = tab
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.updatePath(this.$route.query, this.$route.path, 'bottomBox')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
afterResize () {
|
afterResize () {
|
||||||
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {
|
if (this.from === this.fromRoute.endpoint && this.targetTab === 'endpointQuery') {
|
||||||
@@ -290,6 +295,10 @@ export default {
|
|||||||
this.$emit('getTableData')
|
this.$emit('getTableData')
|
||||||
},
|
},
|
||||||
setTargetTab () {
|
setTargetTab () {
|
||||||
|
if (this.$route.query.targetTab) {
|
||||||
|
this.targetTab = this.$route.query.targetTab
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.from === fromRoute.asset) {
|
if (this.from === fromRoute.asset) {
|
||||||
this.targetTab = 'panelTab'
|
this.targetTab = 'panelTab'
|
||||||
} else if (this.from === fromRoute.endpoint) {
|
} else if (this.from === fromRoute.endpoint) {
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ export default {
|
|||||||
maxBounds: [[-179, -85], [179, 85]],
|
maxBounds: [[-179, -85], [179, 85]],
|
||||||
hash: false,
|
hash: false,
|
||||||
transformRequest: function (url, resourceType) {
|
transformRequest: function (url, resourceType) {
|
||||||
console.log(resourceType)
|
|
||||||
if (resourceType === 'Tile' && url.indexOf('https://api.maptiler.com/tiles/v3') > -1) {
|
if (resourceType === 'Tile' && url.indexOf('https://api.maptiler.com/tiles/v3') > -1) {
|
||||||
const urlParams = url.split('.pbf')[0].split('/')
|
const urlParams = url.split('.pbf')[0].split('/')
|
||||||
const z = urlParams[urlParams.length - 3]
|
const z = urlParams[urlParams.length - 3]
|
||||||
@@ -161,7 +160,6 @@ export default {
|
|||||||
})
|
})
|
||||||
// const marker = L.marker([this.mapParam.latitude, this.mapParam.longitude]).addTo(map)
|
// const marker = L.marker([this.mapParam.latitude, this.mapParam.longitude]).addTo(map)
|
||||||
this.map.on('click', function (e) {
|
this.map.on('click', function (e) {
|
||||||
console.log(e, e.lngLat)
|
|
||||||
const coords = e.lngLat
|
const coords = e.lngLat
|
||||||
geoJSON.features[0].geometry.coordinates = [coords.lng, coords.lat]
|
geoJSON.features[0].geometry.coordinates = [coords.lng, coords.lat]
|
||||||
self.map.getSource('centerMarker').setData(geoJSON)
|
self.map.getSource('centerMarker').setData(geoJSON)
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {},
|
props: {},
|
||||||
|
watch: {
|
||||||
|
detailViewRightObj: {
|
||||||
|
handler (n) {
|
||||||
|
if (n) {
|
||||||
|
this.updatePath(this.$route.query, this.$route.path, 'nzDetailList')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list',
|
detailType: localStorage.getItem('detail-view-' + this.tableId) || 'list',
|
||||||
@@ -21,6 +30,7 @@ export default {
|
|||||||
// this.detailViewRightObj = ''
|
// this.detailViewRightObj = ''
|
||||||
// }
|
// }
|
||||||
this.detailType = flag
|
this.detailType = flag
|
||||||
|
this.$router.replace({ query: { ...this.$route.query, detailType: flag } }).catch(err => {})
|
||||||
let dataList = ''
|
let dataList = ''
|
||||||
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
|
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
|
||||||
if (this.detailType === 'view') {
|
if (this.detailType === 'view') {
|
||||||
|
|||||||
@@ -27,16 +27,79 @@ export default {
|
|||||||
}, 200)
|
}, 200)
|
||||||
qv && this.$set(val.target, val.propertyName, qv)
|
qv && this.$set(val.target, val.propertyName, qv)
|
||||||
})
|
})
|
||||||
|
if (q.bottomBox && JSON.parse(q.bottomBox)) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.detailType = q.detailType
|
||||||
|
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
|
||||||
|
this.$refs[detailType].bottomBox.showSubList = JSON.parse(q.bottomBox)
|
||||||
|
this.$refs[detailType].bottomBox.targetTab = q.targetTab
|
||||||
|
this.$refs[detailType].bottomBox.object = JSON.parse(q.selectObj)
|
||||||
|
})
|
||||||
|
} else if (this.detailType === 'view') {
|
||||||
|
this.detailType = q.detailType
|
||||||
|
this.detailViewRightObj = JSON.parse(q.selectObj)
|
||||||
|
this.$store.commit('setGlobalSearchId', this.detailViewRightObj.id)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 更新path,包含请求参数
|
// 更新path,包含请求参数
|
||||||
updatePath (param, path) {
|
updatePath (param, path, from) {
|
||||||
const params = lodash.cloneDeep(param)
|
const params = lodash.cloneDeep(param)
|
||||||
Object.keys(params).forEach(key => {
|
Object.keys(params).forEach(key => {
|
||||||
if (!params[key]) {
|
if (!params[key]) {
|
||||||
delete params[key]
|
delete params[key]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$router.replace({ path: path, query: params }).catch(err => {})
|
if (!from) {
|
||||||
|
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
|
||||||
|
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
|
||||||
|
params.detailType = this.detailType
|
||||||
|
params.bottomBox = this.$refs[detailType].bottomBox.showSubList
|
||||||
|
if (this.detailType === 'list') {
|
||||||
|
params.targetTab = this.$refs[detailType].bottomBox.targetTab
|
||||||
|
} else {
|
||||||
|
params.targetTab = this.$route.query.targetTab
|
||||||
|
}
|
||||||
|
if (this.detailType === 'list') {
|
||||||
|
params.selectObj = JSON.stringify({
|
||||||
|
id: this.$refs[detailType].bottomBox.object.id,
|
||||||
|
name: this.$refs[detailType].bottomBox.object.name,
|
||||||
|
config: this.$refs[detailType].bottomBox.object.config || '',
|
||||||
|
childrenNum: this.$refs[detailType].bottomBox.object.childrenNum || ''
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
params.selectObj = JSON.stringify({
|
||||||
|
id: this.$refs[detailType].detailViewRightObj.id,
|
||||||
|
name: this.$refs[detailType].detailViewRightObj.name,
|
||||||
|
config: this.$refs[detailType].detailViewRightObj.config || '',
|
||||||
|
childrenNum: this.$refs[detailType].detailViewRightObj.childrenNum || ''
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$router.replace({ path: path, query: params }).catch(err => {})
|
||||||
|
} else if (from === 'nzDatalist') {
|
||||||
|
params.bottomBox = this.bottomBox.showSubList
|
||||||
|
params.targetTab = this.bottomBox.targetTab
|
||||||
|
params.selectObj = JSON.stringify({
|
||||||
|
id: this.bottomBox.object.id,
|
||||||
|
name: this.bottomBox.object.name,
|
||||||
|
config: this.bottomBox.object.config || '',
|
||||||
|
childrenNum: this.bottomBox.object.childrenNum || ''
|
||||||
|
})
|
||||||
|
this.$router.replace({ path: path, query: params }).catch(err => {})
|
||||||
|
} else if (from === 'nzDetailList') {
|
||||||
|
params.targetTab = this.$route.query.targetTab
|
||||||
|
params.selectObj = JSON.stringify({
|
||||||
|
id: this.detailViewRightObj.id,
|
||||||
|
name: this.detailViewRightObj.name,
|
||||||
|
config: this.detailViewRightObj.config || '',
|
||||||
|
childrenNum: this.detailViewRightObj.childrenNum || ''
|
||||||
|
})
|
||||||
|
this.$router.replace({ path: path, query: params }).catch(err => {})
|
||||||
|
} else if (from === 'bottomBox') {
|
||||||
|
params.targetTab = this.targetTab
|
||||||
|
this.$router.replace({ path: path, query: params }).catch(err => {})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
setSearchInput (val, qv) {
|
setSearchInput (val, qv) {
|
||||||
let dataList = ''
|
let dataList = ''
|
||||||
|
|||||||
@@ -106,8 +106,11 @@ import bottomBox from '@/components/common/bottomBox/bottomBox'
|
|||||||
import { bottomBoxWindow } from '@/components/common/js/tools'
|
import { bottomBoxWindow } from '@/components/common/js/tools'
|
||||||
import panelChart from '@/components/chart/panelChart'
|
import panelChart from '@/components/chart/panelChart'
|
||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
|
import routerPathParams from "@/components/common/mixin/routerPathParams";
|
||||||
|
import lodash from "lodash";
|
||||||
export default {
|
export default {
|
||||||
name: 'nzDataList',
|
name: 'nzDataList',
|
||||||
|
mixins: [routerPathParams],
|
||||||
components: {
|
components: {
|
||||||
bottomBox,
|
bottomBox,
|
||||||
panelChart
|
panelChart
|
||||||
@@ -217,6 +220,7 @@ export default {
|
|||||||
this.bottomBox.targetTab = targetTab
|
this.bottomBox.targetTab = targetTab
|
||||||
this.bottomBox.object = JSON.parse(JSON.stringify(row))
|
this.bottomBox.object = JSON.parse(JSON.stringify(row))
|
||||||
this.bottomBox.showSubList = true
|
this.bottomBox.showSubList = true
|
||||||
|
this.updatePath(this.$route.query, this.$route.path, 'nzDatalist')
|
||||||
},
|
},
|
||||||
search (searchObj) {
|
search (searchObj) {
|
||||||
this.$emit('search', searchObj)
|
this.$emit('search', searchObj)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export default {
|
|||||||
// }
|
// }
|
||||||
const Timestamp = new Date().getTime()
|
const Timestamp = new Date().getTime()
|
||||||
const url = '/static/config.json?Timestamp=' + Timestamp
|
const url = '/static/config.json?Timestamp=' + Timestamp
|
||||||
console.log(url)
|
|
||||||
const result = await this.$http.get(url) // 获取本地的config.json 判断是否需要清空localStorage 以及设备的宽 和 axios的baseUrl
|
const result = await this.$http.get(url) // 获取本地的config.json 判断是否需要清空localStorage 以及设备的宽 和 axios的baseUrl
|
||||||
this.$axios.defaults.baseURL = result.body.baseUrl
|
this.$axios.defaults.baseURL = result.body.baseUrl
|
||||||
const version = result.body.version
|
const version = result.body.version
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ axios.interceptors.request.use(
|
|||||||
)
|
)
|
||||||
const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等
|
const accountErrorCode = [518003, 518004, 518005, 518006, 518007, 518008] // 账号锁定等
|
||||||
const licenceErrorCode = [711001]
|
const licenceErrorCode = [711001]
|
||||||
const noJumpPath = ['#/', '#/login']
|
const noJumpPath = ['/', '/login', '/ui/login']
|
||||||
|
|
||||||
// 若get请求的url中带问号,则将url上的参数截取,改为对象形式传参
|
// 若get请求的url中带问号,则将url上的参数截取,改为对象形式传参
|
||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
@@ -81,10 +81,10 @@ axios.interceptors.response.use(
|
|||||||
removePending(response.config)
|
removePending(response.config)
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.hash) == -1) {
|
if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) {
|
||||||
window.location.href = '/'
|
window.location.href = '/'
|
||||||
} else if (response.status === 200) {
|
} else if (response.status === 200) {
|
||||||
if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.hash) == -1) {
|
if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) {
|
||||||
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
|
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
|
||||||
window.location.href = '/'
|
window.location.href = '/'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { returnMenuCode, sortByOrderNum } from '@/permission'
|
|||||||
import moment from 'moment-timezone'
|
import moment from 'moment-timezone'
|
||||||
import { theme } from '@/components/common/js/constants'
|
import { theme } from '@/components/common/js/constants'
|
||||||
|
|
||||||
|
const noJumpPath = ['/', '/login', '/ui/login']
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
menuList: [],
|
menuList: [],
|
||||||
@@ -143,7 +144,7 @@ const user = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 登录成功后跳回到原来页面
|
// 登录成功后跳回到原来页面
|
||||||
if (sessionStorage.getItem('nz-previous-page')) {
|
if (sessionStorage.getItem('nz-previous-page') && noJumpPath.indexOf(sessionStorage.getItem('nz-previous-page')) === -1) {
|
||||||
const route = sessionStorage.getItem('nz-previous-page')
|
const route = sessionStorage.getItem('nz-previous-page')
|
||||||
router.push({
|
router.push({
|
||||||
path: route
|
path: route
|
||||||
@@ -151,6 +152,7 @@ const user = {
|
|||||||
sessionStorage.removeItem('nz-previous-page')
|
sessionStorage.removeItem('nz-previous-page')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
sessionStorage.removeItem('nz-previous-page')
|
||||||
router.push({
|
router.push({
|
||||||
path: path[0],
|
path: path[0],
|
||||||
query: {
|
query: {
|
||||||
|
|||||||
Reference in New Issue
Block a user