fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
@@ -17,7 +17,6 @@ import useLocalStore from '@/stores/local'
|
||||
import useGlobalStore from '@/stores'
|
||||
import PasswordChangeModal from '@/components/change-password'
|
||||
import Logo from '@/assets/logo.png'
|
||||
import { useLoginApi } from '@/api/login'
|
||||
|
||||
export default () => {
|
||||
const navigate = useNavigate()
|
||||
@@ -26,7 +25,6 @@ export default () => {
|
||||
const { userInfo, clear, isDark, locale, setDark, changeLocale } =
|
||||
useLocalStore(state => state)
|
||||
const { connected } = useGlobalStore(state => state)
|
||||
const loginApi = useLoginApi()
|
||||
|
||||
const [isPasswordModalVisible, setIsPasswordModalVisible] = useState(false) // 添加状态管理
|
||||
|
||||
@@ -39,8 +37,6 @@ export default () => {
|
||||
}
|
||||
|
||||
const logout = () => {
|
||||
// 业务影响:退出登录时通知后端删除 refresh token,防止 token 被复用
|
||||
loginApi.signOut({}).catch(() => {})
|
||||
clear()
|
||||
navigate('/login')
|
||||
}
|
||||
|
||||
@@ -1,14 +1,58 @@
|
||||
import React from 'react'
|
||||
import { Layout } from '@douyinfe/semi-ui'
|
||||
import { useLocation, useOutlet } from 'react-router-dom'
|
||||
import React, {useEffect, useState} from 'react'
|
||||
import {Layout} from '@douyinfe/semi-ui'
|
||||
import {useLocation, useOutlet} from 'react-router-dom'
|
||||
import Breadcrumb from '@/layouts/breadcrumb'
|
||||
import Menu from '@/layouts/menu'
|
||||
import {useSystemApi} from '@/api/system'
|
||||
import {useWorkOrderApi} from '@/api/work-order'
|
||||
import RecoveryDialog from '@/components/recovery-dialog'
|
||||
import useGlobalStore from '@/stores'
|
||||
import './index.scss'
|
||||
import { CSSTransition, SwitchTransition } from 'react-transition-group'
|
||||
|
||||
export default () => {
|
||||
const location = useLocation()
|
||||
const outlet = useOutlet()
|
||||
const api = useSystemApi()
|
||||
const woApi = useWorkOrderApi()
|
||||
const [recoveryPending, setRecoveryPending] = useState(false)
|
||||
const [recoveryVisible, setRecoveryVisible] = useState(false)
|
||||
const { connected, showStopGuide } = useGlobalStore(state => state)
|
||||
|
||||
const checkRecovery = () => {
|
||||
api.getStatus()
|
||||
.then(status => {
|
||||
if (status.recoveryPending && !recoveryVisible) {
|
||||
setRecoveryPending(true)
|
||||
setRecoveryVisible(true)
|
||||
}
|
||||
if (status.stopPending) {
|
||||
woApi.queryWorkOrders({ page: 1, limit: 100, statuses: ['CANCELLING'] })
|
||||
.then(res => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
showStopGuide({ orderId: res.data[0].id, phase: 'cancelling' })
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
checkRecovery()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (connected) {
|
||||
checkRecovery()
|
||||
}
|
||||
}, [connected])
|
||||
|
||||
const handleRecoveryClose = () => {
|
||||
setRecoveryVisible(false)
|
||||
setRecoveryPending(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Layout.Sider style={{ backgroundColor: 'var(--semi-color-bg-1)' }}>
|
||||
@@ -21,18 +65,15 @@ export default () => {
|
||||
<Breadcrumb />
|
||||
</Layout.Header>
|
||||
<Layout.Content>
|
||||
{/*<SwitchTransition mode="out-in">*/}
|
||||
{/* <CSSTransition*/}
|
||||
{/* key={location.key}*/}
|
||||
{/* in={true}*/}
|
||||
{/* timeout={300}*/}
|
||||
{/* classNames="fade">*/}
|
||||
{outlet}
|
||||
{/*</CSSTransition>*/}
|
||||
{/*</SwitchTransition>*/}
|
||||
{outlet}
|
||||
</Layout.Content>
|
||||
</Layout>
|
||||
</Layout.Content>
|
||||
|
||||
<RecoveryDialog
|
||||
visible={recoveryVisible}
|
||||
onClose={handleRecoveryClose}
|
||||
/>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ export default () => {
|
||||
<Nav
|
||||
style={{ maxWidth: 220, height: '100%' }}
|
||||
limitIndent={false}
|
||||
defaultIsCollapsed={false}
|
||||
// defaultSelectedKeys={['/']}
|
||||
selectedKeys={currentKeys}
|
||||
renderWrapper={({ itemElement, isSubNav, props }) => {
|
||||
|
||||
Reference in New Issue
Block a user