Compare commits

..

1 Commits

Author SHA1 Message Date
wangwenhua
dd980ee0af 数据库分类 2025-09-27 00:34:47 +08:00
21 changed files with 199 additions and 673 deletions

View File

@ -3,4 +3,4 @@ VUE_APP_PREVIEW=true
VUE_APP_API_BASE_URL=/api VUE_APP_API_BASE_URL=/api
VUE_APP_API_URL=http://192.168.0.53:8099 VUE_APP_API_URL=http://192.168.0.53:8099
VUE_APP_MAP_BASE_URL=/map VUE_APP_MAP_BASE_URL=/map
VUE_APP_MAP_URL=http://192.168.0.225:8090 VUE_APP_MAP_URL=http://192.168.0.53:8090

14
public/config.js vendored
View File

@ -1,25 +1,11 @@
// @ts-ignore // @ts-ignore
window._CONFIG = { window._CONFIG = {
// 地图用图片资源地址
ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg', ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg',
RoadProviderUrl: '', RoadProviderUrl: '',
TerrainProviderUrl: '/map/mapTerrain/', TerrainProviderUrl: '/map/mapTerrain/',
// 显示系统菜单
showSystemMenu: true,
// 使用第三方登录
useThirdLogin: false,
// 第三方登录地址
thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin', thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin',
// 第三方注册AppId
clientId: '0123456789', clientId: '0123456789',
// 评估子系统 内嵌iframe地址
evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin', evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin',
// 服务端地址
VUE_APP_API_URL: 'http://192.168.0.53:8099', VUE_APP_API_URL: 'http://192.168.0.53:8099',
// websocket服务地址
VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53:8099', VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53:8099',
} }

View File

@ -5,7 +5,7 @@ window._CONFIG = {
TerrainProviderUrl: '/map/mapTerrain/', TerrainProviderUrl: '/map/mapTerrain/',
thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin', thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin',
clientId: '0123456789', clientId: '0123456789',
evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin', evaluationSrc: 'http://192.168.0.225:8088/thirdLogin/thirdLoginPage?username=admin',
VUE_APP_API_URL: 'http://192.168.0.53:8099', VUE_APP_API_URL: 'http://192.168.0.225:8099',
VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53:8099', VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.225:8099',
} }

2
public/index.html vendored
View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>App.ico"> <link rel="icon" href="<%= BASE_URL %>App.ico">
<title>基于大数据的智能化后装保障链仿真分析方法工具</title> <title>仿真分析方法工具</title>
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style> <style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
<script src="/jquery.min.js"></script> <script src="/jquery.min.js"></script>
<!-- <script src="https://files.worldwind.arc.nasa.gov/artifactory/web/0.9.0/worldwind.min.js"></script> --> <!-- <script src="https://files.worldwind.arc.nasa.gov/artifactory/web/0.9.0/worldwind.min.js"></script> -->

View File

@ -23,7 +23,7 @@ export default {
menu: { menu: {
locale: true locale: true
}, },
title: '基于大数据的智能化后装保障链仿真分析方法工具', title: '仿真分析方法工具',
pwa: false, pwa: false,
iconfontUrl: '', iconfontUrl: '',
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true' production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true'

View File

@ -18,7 +18,7 @@ export const constantRouterMap = [
path: '/', path: '/',
name: 'index', name: 'index',
component: RouteView, component: RouteView,
meta: { title: '基于大数据的智能化后装保障链仿真分析方法工具' }, meta: { title: '仿真分析方法工具' },
redirect: '/user/welcome', redirect: '/user/welcome',
}, },
{ {

View File

@ -11,7 +11,7 @@ import openThirdLogin from './utils/openThirdLogin'
NProgress.configure({ showSpinner: false }) // NProgress Configuration NProgress.configure({ showSpinner: false }) // NProgress Configuration
const allowList = ['login', 'Welcome'] // no redirect allowList const allowList = ['thirdLogin', 'login', 'register', 'registerResult'] // no redirect allowList
const loginRoutePath = '/user/login' const loginRoutePath = '/user/login'
const defaultRoutePath = '/user/welcome' const defaultRoutePath = '/user/welcome'
@ -58,11 +58,11 @@ router.beforeEach((to, from, next) => {
}) })
// 失败时,获取用户信息失败时,调用登出,来清空历史保留信息 // 失败时,获取用户信息失败时,调用登出,来清空历史保留信息
store.dispatch('Logout').then(() => { store.dispatch('Logout').then(() => {
if (window._CONFIG.useThirdLogin) { // if (process.env.NODE_ENV === 'production') {
openThirdLogin() // openThirdLogin()
} else { // } else {
next({ path: loginRoutePath, query: { redirect: to.fullPath } }) next({ path: loginRoutePath, query: { redirect: to.fullPath } })
} // }
}) })
}) })
} else { } else {
@ -74,11 +74,11 @@ router.beforeEach((to, from, next) => {
// 在免登录名单,直接进入 // 在免登录名单,直接进入
next() next()
} else { } else {
if (window._CONFIG.useThirdLogin) { // if (process.env.NODE_ENV === 'production') {
openThirdLogin() // openThirdLogin()
} else { // } else {
next({ path: loginRoutePath, query: { redirect: to.fullPath } }) next({ path: loginRoutePath, query: { redirect: to.fullPath } })
} // }
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
} }
} }

View File

@ -10,13 +10,13 @@ const constantRouterComponents = {
BlankLayout: BlankLayout, BlankLayout: BlankLayout,
RouteView: RouteView, RouteView: RouteView,
PageView: PageView, PageView: PageView,
403: () => import(/* webpackChunkName: "error" */ '@/views/exception/403'), '403': () => import(/* webpackChunkName: "error" */ '@/views/exception/403'),
404: () => import(/* webpackChunkName: "error" */ '@/views/exception/404'), '404': () => import(/* webpackChunkName: "error" */ '@/views/exception/404'),
500: () => import(/* webpackChunkName: "error" */ '@/views/exception/500'), '500': () => import(/* webpackChunkName: "error" */ '@/views/exception/500'),
// 你需要动态引入的页面组件 // 你需要动态引入的页面组件
WorkplaceEquipment: () => import('@/views/dashboard/WorkplaceEquipment'), WorkplaceEquipment: () => import('@/views/dashboard/WorkplaceEquipment'),
Analysis: () => import('@/views/dashboard/Analysis'), Analysis: () => import('@/views/dashboard/Analysis')
// 'TestWork': () => import(/* webpackChunkName: "TestWork" */ '@/views/dashboard/TestWork') // 'TestWork': () => import(/* webpackChunkName: "TestWork" */ '@/views/dashboard/TestWork')
} }
@ -24,7 +24,7 @@ const constantRouterComponents = {
const notFoundRouter = { const notFoundRouter = {
path: '*', path: '*',
redirect: '/404', redirect: '/404',
hidden: true, hidden: true
} }
// 根级菜单 // 根级菜单
@ -36,72 +36,9 @@ const rootRouter = {
component: 'BasicLayout', component: 'BasicLayout',
// redirect: '/dashboard/equipment', // redirect: '/dashboard/equipment',
meta: { meta: {
title: '首页', title: '首页'
}, },
children: [], children: []
}
const systemNav = {
id: '_67ed94a37b03415c8ee77a8991e79745',
title: '系统管理',
key: 'System',
name: '系统管理',
component: 'BasicLayout',
redirect: '/system/userlist',
parentId: '',
icon: 'dashboard',
children: [
{
id: '_1',
title: '菜单管理',
key: 'MenuList',
name: '菜单管理',
component: 'isystem/menuList',
redirect: null,
parentId: '67ed94a37b03415c8ee77a8991e79745',
icon: 'dashboard',
},
{
id: '_5114bf6a963f41149ab2435c86551927',
title: '用户管理',
key: 'UserList',
name: '用户管理',
component: 'isystem/userList',
redirect: null,
parentId: '67ed94a37b03415c8ee77a8991e79745',
icon: 'dashboard',
},
{
id: '_230a5ebe7cdc41acb997122d6de2d86f',
title: '角色管理',
key: 'RoleList',
name: '角色管理',
component: 'isystem/roleList',
redirect: null,
parentId: '67ed94a37b03415c8ee77a8991e79745',
icon: 'dashboard',
},
{
id: '_2fd1683b13c241be84c34185ff55028e',
title: '字典管理',
key: 'DictIndex',
name: '字典管理',
component: 'isystem/dict/dictlist',
redirect: null,
parentId: '67ed94a37b03415c8ee77a8991e79745',
icon: 'dashboard',
},
{
id: '_85924f8619f1451e847c9f69705f360f',
title: '系统日志',
key: 'LogList',
name: '系统日志',
component: 'isystem/logList',
redirect: null,
parentId: '67ed94a37b03415c8ee77a8991e79745',
icon: 'dashboard',
},
],
} }
/** /**
@ -138,11 +75,11 @@ const systemNav = {
// }) // })
// }) // })
// } // }
export const generatorDynamicRouter = (token) => { export const generatorDynamicRouter = token => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loginService loginService
.getCurrentUserNav() .getCurrentUserNav()
.then((res) => { .then(res => {
console.log('generatorDynamicRouter response:', res) console.log('generatorDynamicRouter response:', res)
const data = res.data const data = res.data
const childrenNav = [] const childrenNav = []
@ -150,14 +87,53 @@ export const generatorDynamicRouter = (token) => {
// 后端数据, 根级树数组, 根级 PID // 后端数据, 根级树数组, 根级 PID
listToTree(data, childrenNav, '') listToTree(data, childrenNav, '')
console.log('childrenNav', childrenNav) console.log('childrenNav', childrenNav)
if (window._CONFIG.showSystemMenu) { childrenNav[0].title ='保障实体类数据库'
childrenNav.push(systemNav) childrenNav[1].title ='业务应用类数据库'
const aaa = new Array(8)
const bbb = new Array(8)
for(let i = 0; i < childrenNav[0].children.length; i++) {
// if(childrenNav[0].children[i].key ==='xdsjk' || childrenNav[0].children[i].key ==='fasjk'
// || childrenNav[0].children[i].key ==='jcsjk' || childrenNav[0].children[i].key ==='txsjk' || childrenNav[0].children[i].key ==='yxjlsjk'){
//
// aaa.push(childrenNav[0].children[i])
// }
if(childrenNav[0].children[i].key ==='txsjk') {
bbb.push(childrenNav[0].children[i])
childrenNav[0].children.splice(i, 1)
}
if(childrenNav[0].children[i].key ==='xdsjk') {
bbb.push(childrenNav[0].children[i])
childrenNav[0].children.splice(i, 1)
}
if(childrenNav[0].children[i].key ==='fasjk') {
bbb.push(childrenNav[0].children[i])
childrenNav[0].children.splice(i, 1)
}
if(childrenNav[0].children[i].key ==='jcsjk') {
bbb.push(childrenNav[0].children[i])
childrenNav[0].children.splice(i, 1)
}
if(childrenNav[0].children[i].key ==='yxjlsjk') {
bbb.push(childrenNav[0].children[i])
childrenNav[0].children.splice(i, 1)
}
} }
// childrenNav[0].children =aaa
childrenNav[1].children =bbb
// for(let i = 0; i < childrenNav[1].children.length; i++) {
// if(childrenNav[1].children[i].key ==='zzllsjk' || childrenNav[1].children[i].key ==='bzllsjk'
// || childrenNav[1].children[i].key ==='bzhjsjk' || childrenNav[1].children[i].key ==='zbsjk' || childrenNav[1].children[i].key ==='zzsjk'){
// childrenNav[1].children.splice(i, 1)
// console.log(childrenNav[1].children)
// }
// }
const routers = generator(childrenNav) const routers = generator(childrenNav)
console.log('routers', routers) console.log('routers', routers)
resolve(routers) resolve(routers)
}) })
.catch((err) => { .catch(err => {
reject(err) reject(err)
}) })
}) })
@ -170,8 +146,8 @@ export const generatorDynamicRouter = (token) => {
* @param parent * @param parent
* @returns {*} * @returns {*}
*/ */
export const generator = (routerMap, parent) => { export const generator = (routerMap, parent) => {
return routerMap.map((item) => { return routerMap.map(item => {
const { title, show, hideChildren, hiddenHeaderContent, target, icon } = item || item.meta || {} const { title, show, hideChildren, hiddenHeaderContent, target, icon } = item || item.meta || {}
const currentRouter = { const currentRouter = {
// 如果路由设置了 path则作为默认 path否则 路由地址 动态拼接生成如 /dashboard/workplace // 如果路由设置了 path则作为默认 path否则 路由地址 动态拼接生成如 /dashboard/workplace
@ -189,9 +165,9 @@ export const generator = (routerMap, parent) => {
title: title, title: title,
icon: icon || undefined, icon: icon || undefined,
hiddenHeaderContent: hiddenHeaderContent, hiddenHeaderContent: hiddenHeaderContent,
target: target, target: target
// permission: item.name // permission: item.name
}, }
} }
// 是否设置了隐藏菜单 // 是否设置了隐藏菜单
if (show === false) { if (show === false) {
@ -223,13 +199,13 @@ export const generator = (routerMap, parent) => {
* @param parentId 父ID * @param parentId 父ID
*/ */
const listToTree = (list, tree, parentId) => { const listToTree = (list, tree, parentId) => {
list.forEach((item) => { list.forEach(item => {
// 判断是否为父级菜单 // 判断是否为父级菜单
if (item.parentId === parentId) { if (item.parentId === parentId) {
const child = { const child = {
...item, ...item,
key: item.key || item.name, key: item.key || item.name,
children: [], children: []
} }
// 迭代 list 找到当前菜单相符合的所有子菜单 // 迭代 list 找到当前菜单相符合的所有子菜单
listToTree(list, child.children, item.id) listToTree(list, child.children, item.id)

View File

@ -10,7 +10,7 @@ const user = {
welcome: '', welcome: '',
avatar: '', avatar: '',
roles: [], roles: [],
info: {}, info: {}
}, },
mutations: { mutations: {
@ -29,82 +29,75 @@ const user = {
}, },
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
state.info = info state.info = info
}, }
}, },
actions: { actions: {
// 登录 // 登录
Login({ commit }, userInfo) { Login ({ commit }, userInfo) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(userInfo) login(userInfo).then(response => {
.then((response) => { console.log(response)
console.log(response) const result = response.data
const result = response.data storage.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
storage.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000) commit('SET_TOKEN', result.token)
commit('SET_TOKEN', result.token) resolve()
resolve() }).catch(error => {
}) reject(error)
.catch((error) => { })
reject(error)
})
}) })
}, },
// 获取用户信息 // 获取用户信息
GetInfo({ commit }) { GetInfo ({ commit }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo() getInfo().then(response => {
.then((response) => { const result = response.data
const result = response.data if (result && result.id) {
if (result && result.id) { localStorage.setItem('userId',result.id)
localStorage.setItem('userId', result.id) localStorage.setItem('uRealName', result.nickName)
localStorage.setItem('uRealName', result.nickName) }
} if (result.roles && result.permissions.length > 0) {
if (result.roles && result.permissions.length > 0) { const role = result.roles
const role = result.roles role.permissions = result.permissions.filter(item => item)
role.permissions = result.permissions.filter((item) => item) role.permissions.map(per => {
role.permissions.map((per) => { if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
if (per.actionEntitySet != null && per.actionEntitySet.length > 0) { const action = per.actionEntitySet.map(action => { return action.action })
const action = per.actionEntitySet.map((action) => { per.actionList = action
return action.action }
}) })
per.actionList = action // role.permissionList = role.permissions.map(permission => { return permission })
} commit('SET_ROLES', result.roles)
}) commit('SET_INFO', result)
// role.permissionList = role.permissions.map(permission => { return permission }) } else {
commit('SET_ROLES', result.roles.length === 0 ? ['bfa9086508284827b6a967d126dabeb'] : result.roles) reject(new Error('getInfo: roles must be a non-null array !'))
commit('SET_INFO', result) }
} else { commit('SET_NAME', { name: result.name, welcome: welcome() })
reject(new Error('getInfo: roles must be a non-null array !')) commit('SET_AVATAR', result.avatar)
} resolve(response)
commit('SET_NAME', { name: result.name, welcome: welcome() }) }).catch(error => {
commit('SET_AVATAR', result.avatar) reject(error)
resolve(response) })
})
.catch((error) => {
reject(error)
})
}) })
}, },
// 登出 // 登出
Logout({ commit, state }) { Logout ({ commit, state }) {
return new Promise((resolve) => { return new Promise((resolve) => {
logout(state.token) logout(state.token).then(() => {
.then(() => { commit('SET_TOKEN', '')
commit('SET_TOKEN', '') commit('SET_ROLES', [])
commit('SET_ROLES', []) storage.remove(ACCESS_TOKEN)
storage.remove(ACCESS_TOKEN) resolve()
resolve() }).catch((err) => {
}) console.log('logout fail:', err)
.catch((err) => { // resolve()
console.log('logout fail:', err) }).finally(() => {
// resolve() })
})
.finally(() => {})
}) })
}, }
},
}
} }
export default user export default user

View File

@ -1,5 +1,5 @@
export default () => { export default () => {
const redirectUri = window.location.origin + '/user/welcome' const redirectUri = window.location.origin + '/user/thirdLogin'
window.location.href = window.location.href =
window._CONFIG.thirdLoginUrl + window._CONFIG.thirdLoginUrl +
'?response_type=code&active_type=user&state=' + '?response_type=code&active_type=user&state=' +

View File

@ -26,10 +26,7 @@ const errorHandler = (error) => {
description: data.message, description: data.message,
}) })
} }
if ( if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
(error.response.status === 500 && error.response.data.message === '未找到授权信息') ||
(error.response.status === 401 && !(data.result && data.result.isLogin))
) {
notification.error({ notification.error({
message: '温馨提示', message: '温馨提示',
description: '登录过期,请重新登录', description: '登录过期,请重新登录',
@ -38,21 +35,13 @@ const errorHandler = (error) => {
if (token) { if (token) {
store.dispatch('Logout').then(() => { store.dispatch('Logout').then(() => {
setTimeout(() => { setTimeout(() => {
if (window._CONFIG.useThirdLogin) { // if (process.env.NODE_ENV === 'production') {
openThirdLogin() // openThirdLogin()
} else { // } else {
window.location = '/user/login?redirect=' + window.location.pathname window.location.reload()
} // }
}, 1000) }, 1500)
}) })
} else {
setTimeout(() => {
if (window._CONFIG.useThirdLogin) {
openThirdLogin()
} else {
window.location = '/user/login?redirect=' + window.location.pathname
}
}, 1000)
} }
} }
} }

View File

@ -38,15 +38,8 @@
:pageConfig="qxhj.pageConfig" :pageConfig="qxhj.pageConfig"
:showTool="qxhj.showTool" :showTool="qxhj.showTool"
> >
<template #tablecell-lastBegTime="{ record }">
{{ record.lastBegTime.replace('T', ' ') }}
</template>
<template #tablecell-lastEndTime="{ record }">
{{ record.lastEndTime.replace('T', ' ') }}
</template>
<template #tablecell-action="{ record }"> <template #tablecell-action="{ record }">
<a-button type="text-primary" icon="edit" @click="handleOpenEditQxhjModal(record)"></a-button> <a-button type="text-primary" icon="edit" @click="handleOpenEditQxhjModal(record)"></a-button>
<a-button type="text-danger" icon="delete" @click="handleDeleteQxhj(record)"></a-button>
</template> </template>
</AntQueryTable> </AntQueryTable>
</a-card> </a-card>
@ -98,7 +91,6 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage'
export default { export default {
name: 'Bzhjsjk', name: 'Bzhjsjk',
data() { data() {
@ -116,13 +108,17 @@ export default {
table: {}, table: {},
immediate: false, immediate: false,
query: (queryParams) => query: (queryParams) =>
getAction(`/baseData/weatherResource/list`, { scenarioId: this.xd.selectedKeys[0], ...queryParams }), this.$http({
url: `/baseData/weatherResource/list`,
method: 'get',
params: { scenarioId: this.xd.selectedKeys[0], ...queryParams },
}),
columns: [ columns: [
{ dataIndex: 'serial' }, { dataIndex: 'serial' },
{ title: '天气类型', dataIndex: 'weatherType' }, { title: '天气类型', dataIndex: 'weatherType' },
{ title: '持续开始时间', dataIndex: 'lastBegTime' }, { title: '持续开始时间', dataIndex: 'lastBegTime' },
{ title: '持续结束时间', dataIndex: 'lastEndTime' }, { title: '持续结束时间', dataIndex: 'lastEndTime' },
{ dataIndex: 'action', width: 100 }, // { dataIndex: 'action', width: 100 },
], ],
}, },
pageConfig: true, pageConfig: true,
@ -140,8 +136,8 @@ export default {
options: { options: {
dataSource: () => ({ dataSource: () => ({
data: [ data: [
{ title: '下雨', id: 'rain' }, { title: 'rain', id: 'rain' },
{ title: '下雪', id: 'snow' }, { title: 'snow', id: 'snow' },
], ],
}), }),
}, },
@ -168,7 +164,12 @@ export default {
tableConfig: { tableConfig: {
table: {}, table: {},
immediate: false, immediate: false,
query: (queryParams) => getAction(`/environment/ebe/list`, { id: this.xd.selectedKeys[0], ...queryParams }), query: (queryParams) =>
this.$http({
url: `/environment/ebe/list`,
method: 'get',
params: { id: this.xd.selectedKeys[0], ...queryParams },
}),
columns: [ columns: [
{ dataIndex: 'serial' }, { dataIndex: 'serial' },
{ title: '电磁强度', dataIndex: 'fieldStrength' }, { title: '电磁强度', dataIndex: 'fieldStrength' },
@ -218,14 +219,6 @@ export default {
}[this.layoutRight] }[this.layoutRight]
}, },
}, },
watch: {
'qxhjModal.formData': {
handler(v) {
console.log(JSON.parse(JSON.stringify(v)))
},
deep: true,
},
},
created() { created() {
this.getXdListData() this.getXdListData()
}, },
@ -233,7 +226,10 @@ export default {
async getXdListData() { async getXdListData() {
try { try {
this.xd.loading = true this.xd.loading = true
const res = await getAction(`/baseData/scenario/all`) const res = await this.$http({
url: `/baseData/scenario/all`,
method: 'get',
})
this.xd.listData = res.data this.xd.listData = res.data
if (this.xd.selectedKeys.length === 0) { if (this.xd.selectedKeys.length === 0) {
this.xd.selectedKeys = [this.xd.listData[0].id] this.xd.selectedKeys = [this.xd.listData[0].id]
@ -256,35 +252,22 @@ export default {
this.qxhjModal.formData = { scenarioId: this.xd.selectedKeys[0] } this.qxhjModal.formData = { scenarioId: this.xd.selectedKeys[0] }
this.qxhjModal.visible = true this.qxhjModal.visible = true
}, },
async handleOpenEditQxhjModal(record) { handleOpenEditQxhjModal(record) {
try { this.qxhjModal.title = `编辑气象环境`
const res = await getAction('/baseData/weatherResource/getInfo', { id: record.id }) this.qxhjModal.mode = 'edit'
this.qxhjModal.title = `编辑气象环境` this.qxhjModal.formData = { ...record }
this.qxhjModal.mode = 'edit' this.qxhjModal.visible = true
this.qxhjModal.formData = res.data
this.$set(this.qxhjModal.formData, 'lastBegTimeStr', res.data.lastBegTime.replace('T', ' '))
this.$set(this.qxhjModal.formData, 'lastEndTimeStr', res.data.lastEndTime.replace('T', ' '))
this.qxhjModal.visible = true
} catch (error) {
console.log(error)
}
}, },
handleSubmitQxhj(formData) { handleSubmitQxhj(formData) {
return postAction(`/baseData/weatherResource/add`, formData) return this.$http({
url: `/baseData/weatherResource/add`,
method: 'post',
data: formData,
})
}, },
handleSubmitQxhjSuccess() { handleSubmitQxhjSuccess() {
this.$refs['qxhj-table'].commitAction('query') this.$refs['qxhj-table'].commitAction('query')
}, },
async handleDeleteQxhj(record) {
try {
await this.$confirm({ title: '温馨提示', content: '确定要删除该气象吗?' })
const res = await getAction('/baseData/weatherResource/remove/' + record.id)
this.$message.success(res.message)
this.$refs['qxhj-table'].commitAction('query')
} catch (error) {
console.log(error)
}
},
handleOpenAddDchjModal() { handleOpenAddDchjModal() {
this.dchjModal.title = '新建电磁环境' this.dchjModal.title = '新建电磁环境'

View File

@ -28,49 +28,49 @@ export default {
{ {
title: '作战力量数据库', title: '作战力量数据库',
image: require('@/assets/images/simulation-scene/database/zzllsjk.png'), image: require('@/assets/images/simulation-scene/database/zzllsjk.png'),
path: '/bzstlsjk/zzllsjk', path: '/databaseSystem/zzllsjk',
}, },
{ {
title: '保障力量数据库', title: '保障力量数据库',
image: require('@/assets/images/simulation-scene/database/bzllsjk.png'), image: require('@/assets/images/simulation-scene/database/bzllsjk.png'),
path: '/bzstlsjk/bzllsjk', path: '/databaseSystem/bzllsjk',
}, },
{ {
title: '保障环境数据库', title: '保障环境数据库',
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'), image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
path: '/bzstlsjk/bzhjsjk', path: '/databaseSystem/bzhjsjk',
}, },
{ {
title: '装备数据库', title: '装备数据库',
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'), image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
path: '/bzstlsjk/zbsjk', path: '/databaseSystem/zbsjk',
}, },
], ],
ywyylsjk: [ ywyylsjk: [
{ {
title: '想定数据库', title: '想定数据库',
image: require('@/assets/images/simulation-scene/database/xdsjk.png'), image: require('@/assets/images/simulation-scene/database/xdsjk.png'),
path: '/ywyylsjk/xdsjk', path: '/databaseSystem/xdsjk',
}, },
{ {
title: '方案数据库', title: '方案数据库',
image: require('@/assets/images/simulation-scene/database/fasjk.png'), image: require('@/assets/images/simulation-scene/database/fasjk.png'),
path: '/ywyylsjk/fasjk', path: '/databaseSystem/fasjk',
}, },
{ {
title: '进程数据库', title: '进程数据库',
image: require('@/assets/images/simulation-scene/database/jcsjk.png'), image: require('@/assets/images/simulation-scene/database/jcsjk.png'),
path: '/ywyylsjk/jcsjk', path: '/databaseSystem/jcsjk',
}, },
{ {
title: '图形数据库', title: '图形数据库',
image: require('@/assets/images/simulation-scene/database/txsjk.png'), image: require('@/assets/images/simulation-scene/database/txsjk.png'),
path: '/ywyylsjk/txsjk', path: '/databaseSystem/txsjk',
}, },
{ {
title: '运行记录数据库', title: '运行记录数据库',
image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'), image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'),
path: '/ywyylsjk/yxjlsjk', path: '/databaseSystem/yxjlsjk',
}, },
], ],
} }

View File

@ -14,7 +14,7 @@
<a-button type="primary" icon="plus" @click="handleOpenAddModal">新增</a-button> <a-button type="primary" icon="plus" @click="handleOpenAddModal">新增</a-button>
</template> </template>
<template #tablecell-iconBase64="{ text }"> <template #tablecell-iconBase64="{ text }">
<img :src="text" alt="" style="width: 24px; height: 24px; object-fit: contain" /> <img :src="text" alt="" style="width: 100px; height: 70px; object-fit: contain" />
</template> </template>
<template #tablecell-action="{ record }"> <template #tablecell-action="{ record }">
<a-button type="text-primary" icon="edit" @click="handleOpenEditModal(record)"></a-button> <a-button type="text-primary" icon="edit" @click="handleOpenEditModal(record)"></a-button>

View File

@ -58,12 +58,12 @@
</div> </div>
</ModuleWrapper> </ModuleWrapper>
<ModuleWrapper height="55%" title="保障需求清单"> <ModuleWrapper height="55%" title="保障需求清单">
&lt;!&ndash; <template #title> <!-- <template #title>
<a-radio-group v-model="qd.qdlx" button-style="solid"> <a-radio-group v-model="qd.qdlx" button-style="solid">
<a-radio-button value="xqqd">需求清单</a-radio-button> <a-radio-button value="xqqd">需求清单</a-radio-button>
<a-radio-button value="bzqd">保障清单</a-radio-button> <a-radio-button value="bzqd">保障清单</a-radio-button>
</a-radio-group> </a-radio-group>
</template> &ndash;&gt; </template> -->
<div class="normal" style="padding: 5px; overflow-y: auto"> <div class="normal" style="padding: 5px; overflow-y: auto">
<a-table <a-table
class="simulation-table-plain" class="simulation-table-plain"
@ -292,58 +292,13 @@ export default {
}) })
}, },
methods: { methods: {
handleChange(value, key, column) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target[column] = value;
this.data = newData;
}
},
edit(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target.editable = true;
this.data = newData;
}
},
save(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
delete target.editable;
this.data = newData;
}
},
cancel(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
Object.assign(target, this.cacheData.find(item => key === item.key));
delete target.editable;
this.data = newData;
}
},
handleDelete(key) {
this.data = this.data.filter(item => item.key !== key);
},
handleAdd() {
this.data.push({
key: Date.now(),
name: '',
age: null,
address: '',
editable: true
});
},
getTree(target, treeData, showKeys) { getTree(target, treeData, showKeys) {
treeData.forEach((item) => { treeData.forEach((item) => {
const newChildren = [] const newChildren = []
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
this.getTree(newChildren, item.children, showKeys) this.getTree(newChildren, item.children, showKeys)
} }
if (newChildren.length > 0 || showKeys.includes(+item.key)) { if (newChildren.length > 0 || showKeys.includes(item.key)) {
target.push({ ...item, children: newChildren }) target.push({ ...item, children: newChildren })
} }
}) })

View File

@ -36,7 +36,6 @@
<a-menu :selectedKeys="[]" mode="horizontal" theme="dark"> <a-menu :selectedKeys="[]" mode="horizontal" theme="dark">
<a-menu-item @click="handleOpenStatisticPage()"> 统计分析 </a-menu-item> <a-menu-item @click="handleOpenStatisticPage()"> 统计分析 </a-menu-item>
</a-menu> </a-menu>
<el-button type="primary" @click="downloadExcel1" >支援保障仿真效果统计表</el-button>
</div> </div>
<div <div
ref="scene-cesium-container" ref="scene-cesium-container"
@ -57,7 +56,6 @@
</a-tree> </a-tree>
</div> </div>
</ModuleWrapper> </ModuleWrapper>
<ModuleWrapper title="统计报表" height="10%"><div> <a-button type="primary" @click="downloadExcel1" >支援保障仿真效果统计表</a-button></div></ModuleWrapper>
<ModuleWrapper height="55%" title="保障需求清单"> <ModuleWrapper height="55%" title="保障需求清单">
<div class="normal" style="padding: 5px; overflow-y: auto"> <div class="normal" style="padding: 5px; overflow-y: auto">
<a-table <a-table
@ -278,80 +276,6 @@ export default {
}) })
}, },
methods: { methods: {
downloadExcel1() {
this.axios({
method: 'get',
url: '/downloadExcel1',
responseType: 'blob'
}).then(res => {
const blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = '支援保障仿真效果统计表.xlsx'
link.click()
URL.revokeObjectURL(link.href)
this.loading = false
}).catch(() => {
this.loading = false
this.$message.error('下载失败')
})
},
getWeathers(){
this.$http({
url: `/baseData/weatherResource/list`,
method: 'get',
params: { scenarioId: this.scenarioId},
}).then(res => {
this.data = res.data
})
},
handleChange(value, key, column) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target[column] = value;
this.data = newData;
}
},
edit(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target.editable = true;
this.data = newData;
}
},
save(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
delete target.editable;
this.data = newData;
}
},
cancel(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
// Object.assign(target, this.newData.find(item => key === item.key));
delete target.editable;
this.data = newData;
}
},
handleDelete(key) {
this.data = this.data.filter(item => item.key !== key);
},
handleAdd() {
this.data.push({
key: Date.now(),
name: '',
age: null,
address: '',
editable: true
});
},
getTree(target, treeData, showKeys) { getTree(target, treeData, showKeys) {
treeData.forEach((item) => { treeData.forEach((item) => {
const newChildren = [] const newChildren = []
@ -484,15 +408,20 @@ export default {
}, },
handleOpenStatisticPage() { handleOpenStatisticPage() {
if (this.roomInfo.status === 3) {
this.childWindow = window.open( this.childWindow = window.open(
`/?roomId=${this.roomId}&scenarioId=${this.scenarioId}`, `/roomStatistics?roomId=${this.roomId}&scenarioId=${this.scenarioId}`,
'roomStatistics', 'roomStatistics',
'height=' + 'height=' +
window.screen.height + window.screen.height +
',width=600,' + ',width=600,' +
',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no' ',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'
) )
} else if (this.roomInfo.status === 0) {
this.$message.error('请完成推演后再进行操作!')
} else {
this.$message.error('推演进行中,请在推演结束后再进行操作!')
}
}, },
}, },
} }

View File

@ -30,53 +30,6 @@
<div class="tool_btn" style="grid-area: 1 / 1 / 2 / 4"> <div class="tool_btn" style="grid-area: 1 / 1 / 2 / 4">
<a-menu :selectedKeys="[]" mode="horizontal" theme="dark"> <a-menu :selectedKeys="[]" mode="horizontal" theme="dark">
<a-menu-item @click="handleOpenGuaranteeProcessPage()"> 保障流程 </a-menu-item> <a-menu-item @click="handleOpenGuaranteeProcessPage()"> 保障流程 </a-menu-item>
<a-menu-item @click="handleOpenGuaranteeWeatherModal()"> 气象环境 </a-menu-item>
<a-modal
v-model="guaranteeWeatherModal.visible"
width="900px"
:maskClosable="false"
:destroyOnClose="true"
:footer="null"
>
<template #title>
<span>{{ guaranteeWeatherModal.title }}</span>
<a-button
type="primary"
icon="plus"
style="margin-left: 10px"
shape="circle"
@click="handleOpenAddQxhjModal"
></a-button>
</template>
<AntQueryTable
ref="qxhj-table"
height="100%"
:queryConfig="guaranteeWeatherModal.qxhj.queryConfig"
:tableConfig="guaranteeWeatherModal.qxhj.tableConfig"
:pageConfig="guaranteeWeatherModal.qxhj.pageConfig"
:showTool="guaranteeWeatherModal.qxhj.showTool"
>
<template #tablecell-lastBegTime="{ record }">
{{ record.lastBegTime.replace('T', ' ') }}
</template>
<template #tablecell-lastEndTime="{ record }">
{{ record.lastEndTime.replace('T', ' ') }}
</template>
<template #tablecell-action="{ record }">
<a-button type="text-primary" icon="edit" @click="handleOpenEditQxhjModal(record)"></a-button>
<a-button type="text-danger" icon="delete" @click="handleDeleteQxhj(record)"></a-button>
</template>
</AntQueryTable>
<AntFormModal
:visible.sync="guaranteeWeatherModal.qxhjModal.visible"
:title="guaranteeWeatherModal.qxhjModal.title"
:formItems="guaranteeWeatherModal.qxhjModal.formItems"
:formRules="guaranteeWeatherModal.qxhjModal.formRules"
:formData="guaranteeWeatherModal.qxhjModal.formData"
:onSubmit="handleSubmitQxhj"
@success="handleSubmitQxhjSuccess"
></AntFormModal>
</a-modal>
</a-menu> </a-menu>
</div> </div>
<div <div
@ -131,45 +84,7 @@
</a-tree> </a-tree>
</div> </div>
</ModuleWrapper> </ModuleWrapper>
<ModuleWrapper title="天气预设" height="25%"> <ModuleWrapper height="55%">
<div>
<a-button type="primary" @click="handleAdd" icon="plus">新增</a-button>
<a-table
:columns="columns"
:dataSource="this.weatherData"
:pagination="false"
bordered
rowKey="key"
>
<!-- <template v-for="col in columns" :slot="col" slot-scope="text, record">-->
<!-- <div :key="col">-->
<!-- <a-input-->
<!-- v-if="record.editable"-->
<!-- :value="text"-->
<!-- @change="e => handleChange(e.target.value, record.key, col)"-->
<!-- />-->
<!-- <template v-else>{{ text }}</template>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template slot="operation" slot-scope="text, record">-->
<!-- <template v-if="record.editable">-->
<!-- <a @click="save(record.key)">保存</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a @click="cancel(record.key)">取消</a>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <a @click="edit(record.key)">编辑</a>-->
<!-- <a-divider type="vertical" />-->
<!-- <a-popconfirm title="确认删除?" @confirm="() => handleDelete(record.key)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </template>-->
<!-- </template>-->
</a-table>
</div>
</ModuleWrapper>
<ModuleWrapper height="30%">
<template #title> <template #title>
<a-radio-group v-model="fd.type" button-style="solid" @change="getFdListData"> <a-radio-group v-model="fd.type" button-style="solid" @change="getFdListData">
<a-radio-button :value="5">作战分队</a-radio-button> <a-radio-button :value="5">作战分队</a-radio-button>
@ -273,6 +188,7 @@ import Zoom from './components/Zoom.vue'
import BlbzModal from './components/BlbzModal.vue' import BlbzModal from './components/BlbzModal.vue'
import Jcsx from './components/Jcsx.vue' import Jcsx from './components/Jcsx.vue'
import Zzxd from './components/Zzxd.vue' import Zzxd from './components/Zzxd.vue'
export default { export default {
name: 'SubsystemScenePresetting', name: 'SubsystemScenePresetting',
components: { components: {
@ -287,20 +203,6 @@ export default {
scenarioName: '', scenarioName: '',
cesium: null, cesium: null,
scenarioDetail: null, scenarioDetail: null,
weatherData:[
{ key: '1', weatherType: '张三', lastBegTime: 32, editable: false },
{ key: '2', weatherType: '李四', lastBegTime: 42, editable: false }
],
columns: [
{ title: '天气类型', dataIndex: 'weatherType',key: 'weatherType' },
{ title: '持续开始时间', dataIndex: 'lastBegTime',key: 'lastBegTime' },
{ title: '持续结束时间', dataIndex: 'lastEndTime',key: 'lastEndTime' },
{
title: '操作',
dataIndex: 'operation',
scopedSlots: { customRender: 'operation' }
}
],
zzbzll: { zzbzll: {
loading: false, loading: false,
treeData: [], treeData: [],
@ -345,63 +247,6 @@ export default {
actionList: [], actionList: [],
}, },
childWindow: null, childWindow: null,
guaranteeWeatherModal: {
visible: false,
title: '气象环境',
qxhj: {
queryConfig: false,
tableConfig: {
table: {},
immediate: true,
query: (queryParams) =>
getAction(`/baseData/weatherResource/list`, { scenarioId: this.scenarioId, ...queryParams }),
columns: [
{ dataIndex: 'serial' },
{ title: '天气类型', dataIndex: 'weatherType' },
{ title: '持续开始时间', dataIndex: 'lastBegTime' },
{ title: '持续结束时间', dataIndex: 'lastEndTime' },
{ dataIndex: 'action', width: 100 },
],
},
pageConfig: true,
showTool: false,
},
qxhjModal: {
visible: false,
title: '',
mode: '',
formItems: [
{
label: '天气类型',
prop: 'weatherType',
component: 'AntOriginSelect',
options: {
dataSource: () => ({
data: [
{ title: '下雨', id: 'rain' },
{ title: '下雪', id: 'snow' },
],
}),
},
},
{
label: '持续开始时间',
prop: 'lastBegTimeStr',
component: 'a-date-picker',
options: { showTime: true, valueFormat: 'YYYY-MM-DD HH:mm:ss' },
},
{
label: '持续结束时间',
prop: 'lastEndTimeStr',
component: 'a-date-picker',
options: { showTime: true, valueFormat: 'YYYY-MM-DD HH:mm:ss' },
},
],
formRules: {},
formData: {},
},
},
} }
}, },
computed: { computed: {
@ -425,9 +270,7 @@ export default {
}, },
created() { created() {
this.scenarioId = this.$route.params.scenarioId this.scenarioId = this.$route.params.scenarioId
console.log("============="+this.$route.params.scenarioId)
this.scenarioName = this.$route.params.scenarioName this.scenarioName = this.$route.params.scenarioName
this.getWeathers()
window.addEventListener('beforeunload', (e) => { window.addEventListener('beforeunload', (e) => {
this.childWindow && this.childWindow.close() this.childWindow && this.childWindow.close()
return true // returnValue return true // returnValue
@ -440,61 +283,6 @@ export default {
this.getFdListData() this.getFdListData()
}, },
methods: { methods: {
getWeathers(){
this.$http({
url: `/baseData/weatherResource/list`,
method: 'get',
params: { scenarioId: this.scenarioId},
}).then(res => {
this.weatherData = res.data
console.log("================="+JSON.stringify(this.weatherData))
})
},
handleChange(value, key, column) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target[column] = value;
this.data = newData;
}
},
edit(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
target.editable = true;
this.data = newData;
}
},
save(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
delete target.editable;
this.data = newData;
}
},
cancel(key) {
const newData = [...this.data];
const target = newData.find(item => key === item.key);
if (target) {
// Object.assign(target, this.newData.find(item => key === item.key));
delete target.editable;
this.data = newData;
}
},
handleDelete(key) {
this.data = this.data.filter(item => item.key !== key);
},
handleAdd() {
this.data.push({
key: Date.now(),
name: '',
age: null,
address: '',
editable: true
});
},
getTree(target, treeData, showKeys) { getTree(target, treeData, showKeys) {
treeData.forEach((item) => { treeData.forEach((item) => {
const newChildren = [] const newChildren = []
@ -725,52 +513,6 @@ export default {
',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no' ',top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'
) )
}, },
handleOpenGuaranteeWeatherModal() {
this.guaranteeWeatherModal.visible = true
},
handleOpenAddQxhjModal() {
this.guaranteeWeatherModal.qxhjModal.title = '新建气象环境'
this.guaranteeWeatherModal.qxhjModal.mode = 'add'
this.guaranteeWeatherModal.qxhjModal.formData = { scenarioId: this.scenarioId }
this.guaranteeWeatherModal.qxhjModal.visible = true
},
async handleOpenEditQxhjModal(record) {
try {
const res = await getAction('/baseData/weatherResource/getInfo', { id: record.id })
this.guaranteeWeatherModal.qxhjModal.title = `编辑气象环境`
this.guaranteeWeatherModal.qxhjModal.mode = 'edit'
this.guaranteeWeatherModal.qxhjModal.formData = res.data
this.$set(
this.guaranteeWeatherModal.qxhjModal.formData,
'lastBegTimeStr',
res.data.lastBegTime.replace('T', ' ')
)
this.$set(
this.guaranteeWeatherModal.qxhjModal.formData,
'lastEndTimeStr',
res.data.lastEndTime.replace('T', ' ')
)
this.guaranteeWeatherModal.qxhjModal.visible = true
} catch (error) {
console.log(error)
}
},
handleSubmitQxhj(formData) {
return postAction(`/baseData/weatherResource/add`, formData)
},
handleSubmitQxhjSuccess() {
this.$refs['qxhj-table'].commitAction('query')
},
async handleDeleteQxhj(record) {
try {
await this.$confirm({ title: '温馨提示', content: '确定要删除该气象吗?' })
const res = await getAction('/baseData/weatherResource/remove/' + record.id)
this.$message.success(res.message)
this.$refs['qxhj-table'].commitAction('query')
} catch (error) {
console.log(error)
}
},
}, },
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<Flex class="user-login-page" fd="co" ai="c" jc="c" style="height: 100%"> <Flex class="user-login-page" fd="co" ai="c" jc="c" style="height: 100%">
<div class="user-login-title">基于大数据的智能化后装保障链仿真分析方法工具</div> <div class="user-login-title">仿真分析方法工具</div>
<Grid style="width: 917px; height: 445px" :columns="['524px', '329px', '0px']" gap="32px"> <Grid style="width: 917px; height: 445px" :columns="['524px', '329px', '0px']" gap="32px">
<div class="oh" style="grid-area: 1 / 1 / 2 / 4"> <div class="oh" style="grid-area: 1 / 1 / 2 / 4">
<img class="user-login-bg" :src="bgLogin" alt="" /> <img class="user-login-bg" :src="bgLogin" alt="" />

View File

@ -63,26 +63,24 @@ export default {
return this.isAdmin || this.isInstructor || this.isTrainer return this.isAdmin || this.isInstructor || this.isTrainer
}, },
}, },
created() { async created() {
const searchParams = new URLSearchParams(window.location.search) const searchParams = new URLSearchParams(window.location.search)
const searchCode = searchParams.get('code') const searchCode = searchParams.get('code')
const localCode = window.localStorage.getItem('code') const localCode = window.localStorage.getItem('code')
console.log('----------',searchCode,localCode)
if (searchCode) { if (searchCode) {
window.localStorage.setItem('code', searchCode) window.localStorage.setItem('code', searchCode)
window.location.href = window.location.origin + window.location.pathname window.location.href = window.location.origin + window.location.pathname
} else if (localCode) { } else if (localCode) {
try { try {
const tokenRes = this.$http({ const tokenRes = await this.$http({
url: '/oauth2/thirdLogin', url: '/oauth2/thirdLogin',
method: 'get', method: 'get',
params: { code: localCode }, params: { code: localCode },
}) })
console.log(tokenRes.data.token) this.$store.commit('SET_TOKEN', '123')
storage.set(ACCESS_TOKEN, tokenRes.data.token, 7 * 24 * 60 * 60 * 1000) storage.set(ACCESS_TOKEN, tokenRes.data.token, 7 * 24 * 60 * 60 * 1000)
console.log('--------')
this.$store.commit('SET_TOKEN', tokenRes.data.token) this.$store.commit('SET_TOKEN', tokenRes.data.token)
const res = this.$http({ const res = await this.$http({
url: '/auth/userInfo', url: '/auth/userInfo',
method: 'get', method: 'get',
}) })
@ -95,7 +93,7 @@ export default {
} }
} else { } else {
try { try {
const res = this.$http({ const res = await this.$http({
url: '/auth/userInfo', url: '/auth/userInfo',
method: 'get', method: 'get',
}) })
@ -131,7 +129,7 @@ export default {
onCancel() {}, onCancel() {},
}) })
} }
if (window._CONFIG.useThirdLogin) { if (process.env.NODE_ENV === 'production') {
this.$store.dispatch('Logout').then(() => { this.$store.dispatch('Logout').then(() => {
openThirdLogin() openThirdLogin()
}) })

View File

@ -23,10 +23,7 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import storage from 'store'
export default { export default {
data() { data() {
@ -44,7 +41,7 @@ export default {
moduleCode: 'db_system', moduleCode: 'db_system',
moduleName: '数据库子系统', moduleName: '数据库子系统',
icon: require('@/assets/images/simulation-scene/system-icon/database.png'), icon: require('@/assets/images/simulation-scene/system-icon/database.png'),
modulePath: '/bzstlsjk/zzllsjk', modulePath: '/databaseSystem/zzllsjk',
}, },
{ {
moduleCode: 'simulation_system', moduleCode: 'simulation_system',
@ -84,27 +81,7 @@ export default {
userInfo: (state) => state.user.info, userInfo: (state) => state.user.info,
}), }),
}, },
async created() { created() {
const searchParams = new URLSearchParams(window.location.search)
const searchCode = searchParams.get('code')
const localCode = window.localStorage.getItem('code')
if (searchCode) {
window.localStorage.setItem('code', searchCode)
window.location.href = window.location.origin + window.location.pathname
} else if (localCode) {
try {
const tokenRes = await getAction('/oauth2/thirdLogin', { code: localCode })
storage.set(ACCESS_TOKEN, tokenRes.data.token, 7 * 24 * 60 * 60 * 1000)
this.$store.commit('SET_TOKEN', tokenRes.data.token)
await this.$store.dispatch('GetInfo')
} catch (error) {
console.log(error)
} finally {
window.localStorage.removeItem('code')
}
} else {
this.$store.dispatch('GetInfo')
}
window.addEventListener('beforeunload', (e) => { window.addEventListener('beforeunload', (e) => {
this.openChildren.forEach((childWindow) => { this.openChildren.forEach((childWindow) => {
childWindow && childWindow.close() childWindow && childWindow.close()

View File

@ -56,7 +56,6 @@ const vueConfig = {
CESIUM_BASE_URL: JSON.stringify('./'), CESIUM_BASE_URL: JSON.stringify('./'),
}), }),
], ],
// en_US: `if prod, add externals` // en_US: `if prod, add externals`
// zh_CN: `这里是用来控制编译忽略外部依赖的,与 config.plugin('html') 配合可以编译时引入外部CDN文件依赖` // zh_CN: `这里是用来控制编译忽略外部依赖的,与 config.plugin('html') 配合可以编译时引入外部CDN文件依赖`
// externals: isProd ? assetsCDN.externals : {} // externals: isProd ? assetsCDN.externals : {}
@ -112,7 +111,6 @@ const vueConfig = {
devServer: { devServer: {
// development server port 8000 // development server port 8000
port, port,
host: '192.168.0.53',
public: (os.networkInterfaces().以太网 || os.networkInterfaces().WLAN)?.slice(-1)[0].address + ':' + port, public: (os.networkInterfaces().以太网 || os.networkInterfaces().WLAN)?.slice(-1)[0].address + ':' + port,
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11 // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
proxy: { proxy: {
@ -125,7 +123,7 @@ const vueConfig = {
}, },
}, },
'/map': { '/map': {
target: process.env.VUE_APP_MAP_URL + '/', target: process.env.VUE_APP_MAP_URL + '/map',
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {