# Conflicts:
#	public/config.js
This commit is contained in:
wangwenhua 2025-10-17 15:29:21 +08:00
commit ca43ccbdd3
11 changed files with 358 additions and 79 deletions

20
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',
evaluationSrc: 'http://192.168.0.189:8088/thirdLogin/thirdLoginPage?username=admin',
VUE_APP_API_URL: 'http://192.168.0.225:8099', // 评估子系统 内嵌iframe地址
VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.225:8099', evaluationSrc: 'http://192.168.0.53:8088/thirdLogin/thirdLoginPage?username=admin',
// 服务端地址
VUE_APP_API_URL: 'http://192.168.0.53:8099',
// websocket服务地址
VUE_APP_WEBSOCKET_URL: 'ws://192.168.0.53:8099',
} }

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)
}) })
}) })
@ -104,8 +170,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
@ -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

@ -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

@ -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
@ -298,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: {
@ -621,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

@ -129,7 +129,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,6 +23,7 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
@ -41,7 +42,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 +82,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()