Compare commits

...

24 Commits

Author SHA1 Message Date
wangwenhua
65c9e8da08 系统名称 2025-10-22 11:47:06 +08:00
wangwenhua
ef5db16c69 系统名称 2025-10-22 11:39:00 +08:00
wangwenhua
40ff6ecc96 系统名称 2025-10-22 11:18:59 +08:00
wangwenhua
5be2e5fb3a 系统名称 2025-10-22 10:56:41 +08:00
wangwenhua
9eb44403b5 Merge branch 'master' of http://git.hivekion.com:3000/liaoboping/LSSE-front
# Conflicts:
#	src/views/subsystem/scene/index.vue
2025-10-22 10:03:29 +08:00
wangwenhua
e95e5fe60f 系统名称 2025-10-21 05:08:52 +08:00
wangwenhua
88dc73abdc 系统名称 2025-10-21 05:07:47 +08:00
wangwenhua
abf7a67d07 系统名称 2025-10-20 21:47:46 +08:00
wangwenhua
6cb58b2691 系统名称 2025-10-20 20:51:44 +08:00
王文华
94bd55fc95 aa 2025-10-20 20:19:46 +08:00
liaoboping
1cdeb42c17 Merge branch 'master' of http://git.hivekion.com:3000/liaoboping/LSSE-front 2025-10-20 16:45:08 +08:00
liaoboping
33faa4621b coding 2025-10-20 16:40:31 +08:00
wangwenhua
1103f9ee9c 系统名称 2025-10-18 12:50:00 +08:00
wangwenhua
ca43ccbdd3 Merge branch 'master' of http://git.hivekion.com:3000/liaoboping/LSSE-front
# Conflicts:
#	public/config.js
2025-10-17 15:29:21 +08:00
liaoboping
9fbfd5fa74 coding 2025-09-28 14:12:40 +08:00
liaoboping
cf6127ae20 图形icon24×24 2025-09-28 14:10:45 +08:00
liaoboping
ff935e4155 保障气象环境 2025-09-28 13:04:14 +08:00
liaoboping
5ad5ba1d24 coding 2025-09-28 11:56:31 +08:00
liaoboping
2bbc1fbda0 配置式注释 2025-09-28 11:27:31 +08:00
liaoboping
04892007e9 配置式,是否使用第三方登录,是否显示系统菜单 2025-09-28 11:21:00 +08:00
liaoboping
4aca5a138e 数据库结构分类 2025-09-28 11:12:29 +08:00
liaoboping
8c8c548f70 三方登录 2025-09-28 10:50:29 +08:00
liaoboping
51a6fcbfb9 三方登录 2025-09-28 10:40:20 +08:00
wangwenhua
53cacb507c a 2025-09-26 19:44:54 +08:00
21 changed files with 673 additions and 157 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.53:8090 VUE_APP_MAP_URL=http://192.168.0.225:8090

14
public/config.js vendored
View File

@ -1,11 +1,25 @@
// @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.225:8088/thirdLogin/thirdLoginPage?username=admin', evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin',
VUE_APP_API_URL: 'http://192.168.0.225:8099', VUE_APP_API_URL: 'http://192.168.0.53:8099',
VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.225:8099', VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53: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 = ['thirdLogin', 'login', 'register', 'registerResult'] // no redirect allowList const allowList = ['login', 'Welcome'] // 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 (process.env.NODE_ENV === 'production') { if (window._CONFIG.useThirdLogin) {
// 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 (process.env.NODE_ENV === 'production') { if (window._CONFIG.useThirdLogin) {
// 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,9 +36,72 @@ 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',
},
],
} }
/** /**
@ -75,11 +138,11 @@ const rootRouter = {
// }) // })
// }) // })
// } // }
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 = []
@ -87,11 +150,14 @@ 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.push(systemNav)
}
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)
}) })
}) })
@ -105,7 +171,7 @@ export const generatorDynamicRouter = token => {
* @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
@ -123,9 +189,9 @@ export const generatorDynamicRouter = token => {
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) {
@ -157,13 +223,13 @@ export const generatorDynamicRouter = token => {
* @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,20 +29,22 @@ 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).then(response => { login(userInfo)
.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 => { })
.catch((error) => {
reject(error) reject(error)
}) })
}) })
@ -51,7 +53,8 @@ const user = {
// 获取用户信息 // 获取用户信息
GetInfo({ commit }) { GetInfo({ commit }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(response => { getInfo()
.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)
@ -59,15 +62,17 @@ const user = {
} }
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) => {
return action.action
})
per.actionList = action per.actionList = action
} }
}) })
// role.permissionList = role.permissions.map(permission => { return permission }) // role.permissionList = role.permissions.map(permission => { return permission })
commit('SET_ROLES', result.roles) commit('SET_ROLES', result.roles.length === 0 ? ['bfa9086508284827b6a967d126dabeb'] : result.roles)
commit('SET_INFO', result) commit('SET_INFO', result)
} else { } else {
reject(new Error('getInfo: roles must be a non-null array !')) reject(new Error('getInfo: roles must be a non-null array !'))
@ -75,7 +80,8 @@ const user = {
commit('SET_NAME', { name: result.name, welcome: welcome() }) commit('SET_NAME', { name: result.name, welcome: welcome() })
commit('SET_AVATAR', result.avatar) commit('SET_AVATAR', result.avatar)
resolve(response) resolve(response)
}).catch(error => { })
.catch((error) => {
reject(error) reject(error)
}) })
}) })
@ -84,20 +90,21 @@ const user = {
// 登出 // 登出
Logout({ commit, state }) { Logout({ commit, state }) {
return new Promise((resolve) => { return new Promise((resolve) => {
logout(state.token).then(() => { logout(state.token)
.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) => { })
.catch((err) => {
console.log('logout fail:', err) console.log('logout fail:', err)
// resolve() // resolve()
}).finally(() => {
}) })
.finally(() => {})
}) })
} },
},
}
} }
export default user export default user

View File

@ -1,5 +1,5 @@
export default () => { export default () => {
const redirectUri = window.location.origin + '/user/thirdLogin' const redirectUri = window.location.origin + '/user/welcome'
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,7 +26,10 @@ const errorHandler = (error) => {
description: data.message, description: data.message,
}) })
} }
if (error.response.status === 401 && !(data.result && data.result.isLogin)) { if (
(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: '登录过期,请重新登录',
@ -35,13 +38,21 @@ const errorHandler = (error) => {
if (token) { if (token) {
store.dispatch('Logout').then(() => { store.dispatch('Logout').then(() => {
setTimeout(() => { setTimeout(() => {
// if (process.env.NODE_ENV === 'production') { if (window._CONFIG.useThirdLogin) {
// openThirdLogin() openThirdLogin()
// } else { } else {
window.location.reload() window.location = '/user/login?redirect=' + window.location.pathname
// } }
}, 1500) }, 1000)
}) })
} else {
setTimeout(() => {
if (window._CONFIG.useThirdLogin) {
openThirdLogin()
} else {
window.location = '/user/login?redirect=' + window.location.pathname
}
}, 1000)
} }
} }
} }

View File

@ -38,8 +38,15 @@
: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>
@ -91,6 +98,7 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage'
export default { export default {
name: 'Bzhjsjk', name: 'Bzhjsjk',
data() { data() {
@ -108,17 +116,13 @@ export default {
table: {}, table: {},
immediate: false, immediate: false,
query: (queryParams) => query: (queryParams) =>
this.$http({ getAction(`/baseData/weatherResource/list`, { scenarioId: this.xd.selectedKeys[0], ...queryParams }),
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,
@ -136,8 +140,8 @@ export default {
options: { options: {
dataSource: () => ({ dataSource: () => ({
data: [ data: [
{ title: 'rain', id: 'rain' }, { title: '下雨', id: 'rain' },
{ title: 'snow', id: 'snow' }, { title: '下雪', id: 'snow' },
], ],
}), }),
}, },
@ -164,12 +168,7 @@ export default {
tableConfig: { tableConfig: {
table: {}, table: {},
immediate: false, immediate: false,
query: (queryParams) => query: (queryParams) => getAction(`/environment/ebe/list`, { id: this.xd.selectedKeys[0], ...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' },
@ -219,6 +218,14 @@ 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()
}, },
@ -226,10 +233,7 @@ export default {
async getXdListData() { async getXdListData() {
try { try {
this.xd.loading = true this.xd.loading = true
const res = await this.$http({ const res = await getAction(`/baseData/scenario/all`)
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]
@ -252,22 +256,35 @@ 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
}, },
handleOpenEditQxhjModal(record) { async handleOpenEditQxhjModal(record) {
try {
const res = await getAction('/baseData/weatherResource/getInfo', { id: record.id })
this.qxhjModal.title = `编辑气象环境` this.qxhjModal.title = `编辑气象环境`
this.qxhjModal.mode = 'edit' this.qxhjModal.mode = 'edit'
this.qxhjModal.formData = { ...record } 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 this.qxhjModal.visible = true
} catch (error) {
console.log(error)
}
}, },
handleSubmitQxhj(formData) { handleSubmitQxhj(formData) {
return this.$http({ return postAction(`/baseData/weatherResource/add`, formData)
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: '/databaseSystem/zzllsjk', path: '/bzstlsjk/zzllsjk',
}, },
{ {
title: '保障力量数据库', title: '保障力量数据库',
image: require('@/assets/images/simulation-scene/database/bzllsjk.png'), image: require('@/assets/images/simulation-scene/database/bzllsjk.png'),
path: '/databaseSystem/bzllsjk', path: '/bzstlsjk/bzllsjk',
}, },
{ {
title: '保障环境数据库', title: '保障环境数据库',
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'), image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
path: '/databaseSystem/bzhjsjk', path: '/bzstlsjk/bzhjsjk',
}, },
{ {
title: '装备数据库', title: '装备数据库',
image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'), image: require('@/assets/images/simulation-scene/database/bzhjsjk.png'),
path: '/databaseSystem/zbsjk', path: '/bzstlsjk/zbsjk',
}, },
], ],
ywyylsjk: [ ywyylsjk: [
{ {
title: '想定数据库', title: '想定数据库',
image: require('@/assets/images/simulation-scene/database/xdsjk.png'), image: require('@/assets/images/simulation-scene/database/xdsjk.png'),
path: '/databaseSystem/xdsjk', path: '/ywyylsjk/xdsjk',
}, },
{ {
title: '方案数据库', title: '方案数据库',
image: require('@/assets/images/simulation-scene/database/fasjk.png'), image: require('@/assets/images/simulation-scene/database/fasjk.png'),
path: '/databaseSystem/fasjk', path: '/ywyylsjk/fasjk',
}, },
{ {
title: '进程数据库', title: '进程数据库',
image: require('@/assets/images/simulation-scene/database/jcsjk.png'), image: require('@/assets/images/simulation-scene/database/jcsjk.png'),
path: '/databaseSystem/jcsjk', path: '/ywyylsjk/jcsjk',
}, },
{ {
title: '图形数据库', title: '图形数据库',
image: require('@/assets/images/simulation-scene/database/txsjk.png'), image: require('@/assets/images/simulation-scene/database/txsjk.png'),
path: '/databaseSystem/txsjk', path: '/ywyylsjk/txsjk',
}, },
{ {
title: '运行记录数据库', title: '运行记录数据库',
image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'), image: require('@/assets/images/simulation-scene/database/yxjlsjk.png'),
path: '/databaseSystem/yxjlsjk', path: '/ywyylsjk/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: 100px; height: 70px; object-fit: contain" /> <img :src="text" alt="" style="width: 24px; height: 24px; 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="保障需求清单">
<!-- <template #title> &lt;!&ndash; <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> --> </template> &ndash;&gt;
<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,13 +292,58 @@ 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,6 +36,7 @@
<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"
@ -56,6 +57,7 @@
</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
@ -276,6 +278,80 @@ 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 = []
@ -408,20 +484,15 @@ export default {
}, },
handleOpenStatisticPage() { handleOpenStatisticPage() {
if (this.roomInfo.status === 3) {
this.childWindow = window.open( this.childWindow = window.open(
`/roomStatistics?roomId=${this.roomId}&scenarioId=${this.scenarioId}`, `/?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,6 +30,53 @@
<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
@ -84,7 +131,45 @@
</a-tree> </a-tree>
</div> </div>
</ModuleWrapper> </ModuleWrapper>
<ModuleWrapper height="55%"> <ModuleWrapper title="天气预设" height="25%">
<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>
@ -188,7 +273,6 @@ 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: {
@ -203,6 +287,20 @@ 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: [],
@ -247,6 +345,63 @@ 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: {
@ -270,7 +425,9 @@ 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
@ -283,6 +440,61 @@ 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 = []
@ -513,6 +725,52 @@ 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,24 +63,26 @@ export default {
return this.isAdmin || this.isInstructor || this.isTrainer return this.isAdmin || this.isInstructor || this.isTrainer
}, },
}, },
async created() { 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 = await this.$http({ const tokenRes = this.$http({
url: '/oauth2/thirdLogin', url: '/oauth2/thirdLogin',
method: 'get', method: 'get',
params: { code: localCode }, params: { code: localCode },
}) })
this.$store.commit('SET_TOKEN', '123') console.log(tokenRes.data.token)
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 = await this.$http({ const res = this.$http({
url: '/auth/userInfo', url: '/auth/userInfo',
method: 'get', method: 'get',
}) })
@ -93,7 +95,7 @@ export default {
} }
} else { } else {
try { try {
const res = await this.$http({ const res = this.$http({
url: '/auth/userInfo', url: '/auth/userInfo',
method: 'get', method: 'get',
}) })
@ -129,7 +131,7 @@ export default {
onCancel() {}, onCancel() {},
}) })
} }
if (process.env.NODE_ENV === 'production') { if (window._CONFIG.useThirdLogin) {
this.$store.dispatch('Logout').then(() => { this.$store.dispatch('Logout').then(() => {
openThirdLogin() openThirdLogin()
}) })

View File

@ -23,7 +23,10 @@
</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() {
@ -41,7 +44,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: '/databaseSystem/zzllsjk', modulePath: '/bzstlsjk/zzllsjk',
}, },
{ {
moduleCode: 'simulation_system', moduleCode: 'simulation_system',
@ -81,7 +84,27 @@ export default {
userInfo: (state) => state.user.info, userInfo: (state) => state.user.info,
}), }),
}, },
created() { async 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,6 +56,7 @@ 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 : {}
@ -111,6 +112,7 @@ 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: {
@ -123,7 +125,7 @@ const vueConfig = {
}, },
}, },
'/map': { '/map': {
target: process.env.VUE_APP_MAP_URL + '/map', target: process.env.VUE_APP_MAP_URL + '/',
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {