feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
<template>
|
2026-05-12 15:15:43 +00:00
|
|
|
<div class="app-desktop-shell" :style="desktopScaleStyle">
|
|
|
|
|
<div class="app-desktop-stage">
|
|
|
|
|
<RouterView />
|
|
|
|
|
<ToastNotification :toast-text="toastText" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-05-12 15:15:43 +00:00
|
|
|
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
2026-05-06 22:23:42 +08:00
|
|
|
import { RouterView } from 'vue-router'
|
|
|
|
|
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
import './assets/styles/global.css'
|
|
|
|
|
|
|
|
|
|
import ToastNotification from './components/shared/ToastNotification.vue'
|
2026-05-06 22:23:42 +08:00
|
|
|
import { useToast } from './composables/useToast.js'
|
2026-05-06 11:00:38 +08:00
|
|
|
|
2026-05-06 22:23:42 +08:00
|
|
|
const { toastText } = useToast()
|
2026-05-12 15:15:43 +00:00
|
|
|
|
|
|
|
|
const DESKTOP_BASE_WIDTH = 1600
|
|
|
|
|
const DESKTOP_BASE_HEIGHT = 920
|
|
|
|
|
const DESKTOP_MIN_SCALE = 0.82
|
|
|
|
|
|
|
|
|
|
const viewportWidth = ref(typeof window === 'undefined' ? DESKTOP_BASE_WIDTH : window.innerWidth)
|
|
|
|
|
const viewportHeight = ref(typeof window === 'undefined' ? DESKTOP_BASE_HEIGHT : window.innerHeight)
|
|
|
|
|
|
|
|
|
|
const desktopScaleStyle = computed(() => {
|
|
|
|
|
const scale = resolveDesktopScale(viewportWidth.value, viewportHeight.value)
|
|
|
|
|
const inverseScale = Number((1 / scale).toFixed(4))
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
'--desktop-ui-scale': scale.toFixed(4),
|
|
|
|
|
'--desktop-ui-inverse-scale': inverseScale.toFixed(4),
|
|
|
|
|
'--desktop-stage-width': `${Math.round(viewportWidth.value * inverseScale)}px`,
|
|
|
|
|
'--desktop-stage-height': `${Math.round(viewportHeight.value * inverseScale)}px`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function resolveDesktopScale(width, height) {
|
|
|
|
|
if (width < 960) {
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const scaleByWidth = width / DESKTOP_BASE_WIDTH
|
|
|
|
|
const scaleByHeight = height / DESKTOP_BASE_HEIGHT
|
|
|
|
|
|
|
|
|
|
return Number(Math.min(1, Math.max(DESKTOP_MIN_SCALE, Math.min(scaleByWidth, scaleByHeight))).toFixed(4))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateViewport() {
|
|
|
|
|
viewportWidth.value = window.innerWidth
|
|
|
|
|
viewportHeight.value = window.innerHeight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
updateViewport()
|
|
|
|
|
window.addEventListener('resize', updateViewport, { passive: true })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener('resize', updateViewport)
|
|
|
|
|
})
|
feat: refactor monolithic App.vue into modular Vue component architecture
- Extract 711-line App.vue into 15+ focused files across 5 directories
- Add data layer (icons, metrics, policies, auditTrail, requests)
- Add composables (useNavigation, useRequests, useChat, useToast)
- Add layout components (SidebarRail, TopBar, FilterBar)
- Add shared components (PanelHead, InfoRow, ToastNotification)
- Add business component (RequestTable) and 5 view components
- Extract global CSS to assets/styles/global.css
- Add start.sh with WSL/Windows cross-platform support
- Add .gitignore for node_modules, dist, and IDE dirs
2026-04-28 17:20:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
2026-05-06 22:23:42 +08:00
|
|
|
<style src="./assets/styles/app.css"></style>
|