This commit is contained in:
liaoboping 2025-10-20 16:40:31 +08:00
parent 9fbfd5fa74
commit 33faa4621b
7 changed files with 69 additions and 60 deletions

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

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

View File

@ -298,7 +298,7 @@ export default {
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

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

@ -25,6 +25,8 @@
<script> <script>
import { getAction } from '@/api/manage' 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() {