|
@ -1,6 +1,6 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { getContainerList } from 'apis/container' |
|
|
import { getContainerList } from 'apis/container' |
|
|
import { craftList, craftRestore } from 'apis/crafts' |
|
|
|
|
|
|
|
|
import { craftList } from 'apis/crafts' |
|
|
import { getSolsList } from 'apis/solution' |
|
|
import { getSolsList } from 'apis/solution' |
|
|
import logoutIcon from 'assets/images/logout.svg' |
|
|
import logoutIcon from 'assets/images/logout.svg' |
|
|
import CheckCraft from 'components/home/CheckCraft/index.vue' |
|
|
import CheckCraft from 'components/home/CheckCraft/index.vue' |
|
@ -8,7 +8,6 @@ import Liquid from 'components/home/Liquid/index.vue' |
|
|
import Check from 'components/system/Check/index.vue' |
|
|
import Check from 'components/system/Check/index.vue' |
|
|
import EditDate from 'components/system/EditDate/index.vue' |
|
|
import EditDate from 'components/system/EditDate/index.vue' |
|
|
import Stop from 'components/system/Stop/index.vue' |
|
|
import Stop from 'components/system/Stop/index.vue' |
|
|
import { ElMessageBox } from 'element-plus' |
|
|
|
|
|
import { useActivateDebug } from 'hooks/useActivateDebug' |
|
|
import { useActivateDebug } from 'hooks/useActivateDebug' |
|
|
import { useServerTime } from 'hooks/useServerTime' |
|
|
import { useServerTime } from 'hooks/useServerTime' |
|
|
import { isClose } from 'libs/socket' |
|
|
import { isClose } from 'libs/socket' |
|
@ -43,13 +42,11 @@ watch(() => systemStore.systemStatus, () => { |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
console.log('systemStatus', systemStore.systemStatus) |
|
|
console.log('systemStatus', systemStore.systemStatus) |
|
|
if (!systemStore.systemStatus.currentUser) { |
|
|
if (!systemStore.systemStatus.currentUser) { |
|
|
console.log(123) |
|
|
|
|
|
await router.push('/login') |
|
|
await router.push('/login') |
|
|
} |
|
|
} |
|
|
solutionList.value = (await getSolsList()).list |
|
|
solutionList.value = (await getSolsList()).list |
|
|
if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser?.username !== 'test') { |
|
|
if (!systemStore.systemStatus.selfTest && systemStore.systemStatus.currentUser?.username !== 'test') { |
|
|
isCheck.value = true |
|
|
isCheck.value = true |
|
|
return |
|
|
|
|
|
} |
|
|
} |
|
|
await checkCraft() |
|
|
await checkCraft() |
|
|
}) |
|
|
}) |
|
@ -57,25 +54,27 @@ onMounted(async () => { |
|
|
const checkCraftVisible = ref(false) |
|
|
const checkCraftVisible = ref(false) |
|
|
const checkCraft = async () => { |
|
|
const checkCraft = async () => { |
|
|
const res = await craftList() |
|
|
const res = await craftList() |
|
|
if (res && res.length > 0) { |
|
|
|
|
|
ElMessageBox.confirm( |
|
|
|
|
|
'发现有异常预设, 是否处理恢复? ', |
|
|
|
|
|
'提示', |
|
|
|
|
|
{ |
|
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
closeOnPressEscape: false, |
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
customClass: 'init-message', |
|
|
|
|
|
}, |
|
|
|
|
|
).then(async () => { |
|
|
|
|
|
await craftRestore(true) |
|
|
|
|
|
checkCraftVisible.value = true |
|
|
|
|
|
}).catch(async () => { |
|
|
|
|
|
await craftRestore(false) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
systemStore.errorCraft = res && res.length > 0 |
|
|
|
|
|
// if (res && res.length > 0) { |
|
|
|
|
|
|
|
|
|
|
|
// ElMessageBox.confirm( |
|
|
|
|
|
// '发现有异常工艺, 是否处理恢复? ', |
|
|
|
|
|
// '提示', |
|
|
|
|
|
// { |
|
|
|
|
|
// confirmButtonText: '确认', |
|
|
|
|
|
// cancelButtonText: '取消', |
|
|
|
|
|
// closeOnClickModal: false, |
|
|
|
|
|
// closeOnPressEscape: false, |
|
|
|
|
|
// type: 'warning', |
|
|
|
|
|
// customClass: 'init-message', |
|
|
|
|
|
// }, |
|
|
|
|
|
// ).then(async () => { |
|
|
|
|
|
// await craftRestore(true) |
|
|
|
|
|
// checkCraftVisible.value = true |
|
|
|
|
|
// }).catch(async () => { |
|
|
|
|
|
// await craftRestore(false) |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// meta的isDefault=true 并且 当isDebug=true时,把debug路由的页面也显示 |
|
|
// meta的isDefault=true 并且 当isDebug=true时,把debug路由的页面也显示 |
|
|