| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902 |
- <template>
- <div class="dashboard">
- <LoginModal
- :visible="showLoginModal"
- @success="handleLoginSuccess"
- @cancel="handleLoginCancel"
- />
- <header class="header">
- <h1 class="title">
- 宝时立库
- <span class="title-meta">· 总库位 {{ locations.length }}</span>
- <span class="title-legend">
- <span class="legend-chip legend-chip-a">A</span>
- <span class="legend-chip legend-chip-b">B</span>
- <span class="legend-chip legend-chip-c">C</span>
- </span>
- </h1>
- <div class="controls">
- <label class="filter-item">
- <span class="selector-label">资源类型</span>
- <select v-model="selectedCategory" class="level-select">
- <option value="">全部</option>
- <option v-for="category in categoryOptions" :key="category" :value="category">
- {{ category }}
- </option>
- </select>
- </label>
- <label class="filter-item">
- <span class="selector-label">库位属性</span>
- <select v-model="selectedLocationAttribute" class="level-select">
- <option value="">全部</option>
- <option
- v-for="attribute in locationAttributeOptions"
- :key="attribute"
- :value="attribute"
- >
- {{ getLocationAttributeLabel(attribute) }}
- </option>
- </select>
- </label>
- <label class="filter-item">
- <span class="selector-label">容器</span>
- <select v-model="selectedHasContainer" class="level-select">
- <option value="">全部</option>
- <option value="Y">有容器</option>
- <option value="N">无容器</option>
- </select>
- </label>
- <label class="filter-item filter-input-item">
- <span class="selector-label">库位组</span>
- <span class="filter-input-wrap">
- <input
- v-model="locGroupKeywordInput"
- class="filter-input"
- type="text"
- placeholder="输入库位组"
- @keydown.enter="applyLocGroupFilter"
- />
- <button
- v-if="locGroupKeywordInput"
- class="filter-clear-btn"
- type="button"
- @click="clearLocGroupFilter"
- >
- <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
- <path
- d="M4.22 4.22a.75.75 0 0 1 1.06 0L8 6.94l2.72-2.72a.75.75 0 1 1 1.06 1.06L9.06 8l2.72 2.72a.75.75 0 1 1-1.06 1.06L8 9.06l-2.72 2.72a.75.75 0 1 1-1.06-1.06L6.94 8 4.22 5.28a.75.75 0 0 1 0-1.06z"
- fill="currentColor"
- />
- </svg>
- </button>
- <button class="filter-confirm-btn" type="button" @click="applyLocGroupFilter">
- <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
- <path
- d="M6.5 2.5a4 4 0 1 0 2.47 7.15l2.69 2.68 1.06-1.06-2.68-2.69A4 4 0 0 0 6.5 2.5zm0 1.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"
- fill="currentColor"
- />
- </svg>
- </button>
- </span>
- </label>
- <label class="filter-item filter-input-item">
- <span class="selector-label">库位号</span>
- <span class="filter-input-wrap">
- <input
- v-model="locationIdKeywordInput"
- class="filter-input"
- type="text"
- placeholder="输入库位号"
- @keydown.enter="applyLocationIdFilter"
- />
- <button
- v-if="locationIdKeywordInput"
- class="filter-clear-btn"
- type="button"
- @click="clearLocationIdFilter"
- >
- <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
- <path
- d="M4.22 4.22a.75.75 0 0 1 1.06 0L8 6.94l2.72-2.72a.75.75 0 1 1 1.06 1.06L9.06 8l2.72 2.72a.75.75 0 1 1-1.06 1.06L8 9.06l-2.72 2.72a.75.75 0 1 1-1.06-1.06L6.94 8 4.22 5.28a.75.75 0 0 1 0-1.06z"
- fill="currentColor"
- />
- </svg>
- </button>
- <button class="filter-confirm-btn" type="button" @click="applyLocationIdFilter">
- <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
- <path
- d="M6.5 2.5a4 4 0 1 0 2.47 7.15l2.69 2.68 1.06-1.06-2.68-2.69A4 4 0 0 0 6.5 2.5zm0 1.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"
- fill="currentColor"
- />
- </svg>
- </button>
- </span>
- </label>
- <label class="toggle-item">
- <span class="selector-label">库位组边框</span>
- <input
- :checked="showGroupBorder"
- class="toggle-input"
- type="checkbox"
- @change="handleGroupBorderToggle"
- />
- <span class="toggle-track">
- <span class="toggle-thumb"></span>
- </span>
- </label>
- <label class="toggle-item">
- <span class="selector-label">库区边框</span>
- <input
- :checked="showZoneBorder"
- class="toggle-input"
- type="checkbox"
- @change="handleZoneBorderToggle"
- />
- <span class="toggle-track">
- <span class="toggle-thumb"></span>
- </span>
- </label>
- <label class="toggle-item">
- <span class="selector-label">卡片</span>
- <input v-model="showTooltip" class="toggle-input" type="checkbox" />
- <span class="toggle-track">
- <span class="toggle-thumb"></span>
- </span>
- </label>
- <select
- v-model.number="currentLevel"
- class="level-select level-select-floor"
- @change="handleLevelChange"
- >
- <option v-for="level in levelRange" :key="level" :value="level">
- {{ level }}层
- </option>
- </select>
- <div ref="refreshControlRef" class="refresh-control">
- <button
- class="refresh-btn"
- :disabled="loading || refreshing"
- @click="handleManualRefresh"
- @contextmenu.prevent="handleRefreshContextMenu"
- >
- {{ refreshCountdownText }}
- </button>
- <div
- v-if="showRefreshPopover"
- class="refresh-popover"
- @click.stop
- >
- <input
- ref="refreshIntervalInputRef"
- v-model="refreshIntervalInput"
- class="refresh-popover-input"
- type="text"
- inputmode="numeric"
- @keydown.enter="applyRefreshInterval"
- />
- <button
- class="refresh-popover-confirm"
- type="button"
- @click="applyRefreshInterval"
- >
- <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
- <path
- d="M6.46 11.03 3.43 8a.75.75 0 1 1 1.06-1.06l1.97 1.96 5.05-5.04A.75.75 0 0 1 12.57 4.9l-5.58 5.59a.75.75 0 0 1-1.06 0z"
- fill="currentColor"
- />
- </svg>
- </button>
- </div>
- </div>
- <button class="logout-btn" @click="handleLogout">退出</button>
- </div>
- </header>
- <main class="main-content">
- <div v-if="loading" class="loading">加载中...</div>
- <div v-else-if="error" class="error">
- {{ error }}
- </div>
- <div v-else class="map-container">
- <WarehouseMap
- :locations="locations"
- :current-level="currentLevel"
- :selected-category="selectedCategory"
- :selected-location-attribute="selectedLocationAttribute"
- :selected-has-container="selectedHasContainer"
- :loc-group-keyword="appliedLocGroupKeyword"
- :location-id-keyword="appliedLocationIdKeyword"
- :show-group-border="showGroupBorder"
- :show-zone-border="showZoneBorder"
- :show-tooltip="showTooltip"
- @select-loc-group="handleSelectLocGroup"
- @select-location-id="handleSelectLocationId"
- />
- </div>
- </main>
- </div>
- </template>
- <script setup lang="ts">
- import { ref, onMounted, computed, onBeforeUnmount, nextTick } from 'vue'
- import { fetchLocationData } from './api/location'
- import type { LocationAttributeCode, LocationResourceDataVO } from './types'
- import WarehouseMap from './components/WarehouseMap.vue'
- import LoginModal from './components/LoginModal.vue'
- import { config } from './config'
- import { isAuthenticated, removeToken } from './utils/auth'
- const LEVEL_STORAGE_KEY = 'warehouse-map.current-level'
- const REFRESH_INTERVAL_STORAGE_KEY = 'warehouse-map.refresh-interval-ms'
- const getInitialLevel = () => {
- const savedLevel = window.localStorage.getItem(LEVEL_STORAGE_KEY)
- const parsedLevel = savedLevel ? Number(savedLevel) : NaN
- if (Number.isInteger(parsedLevel) && parsedLevel >= config.minLevel && parsedLevel <= config.maxLevel) {
- return parsedLevel
- }
- return config.minLevel
- }
- const getInitialRefreshInterval = () => {
- const savedInterval = window.localStorage.getItem(REFRESH_INTERVAL_STORAGE_KEY)
- const parsedInterval = savedInterval ? Number(savedInterval) : NaN
- if (Number.isInteger(parsedInterval) && parsedInterval > 0) {
- return parsedInterval
- }
- return config.refreshInterval
- }
- const currentLevel = ref(getInitialLevel())
- const locations = ref<LocationResourceDataVO[]>([])
- const loading = ref(false)
- const refreshing = ref(false)
- const hasLoadedOnce = ref(false)
- const error = ref('')
- const showLoginModal = ref(false)
- const selectedCategory = ref('')
- const selectedLocationAttribute = ref<LocationAttributeCode | ''>('')
- const selectedHasContainer = ref<'Y' | 'N' | ''>('')
- const locGroupKeywordInput = ref('')
- const appliedLocGroupKeyword = ref('')
- const locationIdKeywordInput = ref('')
- const appliedLocationIdKeyword = ref('')
- const showGroupBorder = ref(false)
- const showZoneBorder = ref(false)
- const showTooltip = ref(true)
- const refreshIntervalMs = ref(getInitialRefreshInterval())
- const showRefreshPopover = ref(false)
- const refreshIntervalInput = ref(String(Math.max(Math.floor(refreshIntervalMs.value / 1000), 1)))
- const now = ref(Date.now())
- const nextRefreshAt = ref(Date.now() + refreshIntervalMs.value)
- const refreshControlRef = ref<HTMLElement | null>(null)
- const refreshIntervalInputRef = ref<HTMLInputElement | null>(null)
- let refreshTimer: number | null = null
- let countdownTimer: number | null = null
- const LOCATION_ATTRIBUTE_LABEL_MAP: Record<LocationAttributeCode, string> = {
- OK: '正常',
- FI: '禁入',
- HD: '封存',
- SC: '管控'
- }
- const levelRange = computed(() => {
- const levels = []
- for (let i = config.minLevel; i <= config.maxLevel; i++) {
- levels.push(i)
- }
- return levels
- })
- const categoryOptions = computed(() => {
- return [...new Set(locations.value.map((loc) => loc.category).filter(Boolean))].sort()
- })
- const locationAttributeOptions = computed<LocationAttributeCode[]>(() => {
- return [...new Set(locations.value.map((loc) => loc.locationAttribute).filter(Boolean))] as LocationAttributeCode[]
- })
- const getLocationAttributeLabel = (attribute: LocationAttributeCode) => {
- return LOCATION_ATTRIBUTE_LABEL_MAP[attribute] || attribute
- }
- const copyText = async (text: string) => {
- if (!text) return
- try {
- await navigator.clipboard.writeText(text)
- return
- } catch (error) {
- console.warn('Clipboard API copy failed, fallback to execCommand.', error)
- }
- const textarea = document.createElement('textarea')
- textarea.value = text
- textarea.setAttribute('readonly', 'true')
- textarea.style.position = 'fixed'
- textarea.style.top = '-9999px'
- document.body.appendChild(textarea)
- textarea.select()
- document.execCommand('copy')
- document.body.removeChild(textarea)
- }
- const applyLocGroupFilter = () => {
- appliedLocGroupKeyword.value = locGroupKeywordInput.value.trim()
- }
- const applyLocationIdFilter = () => {
- appliedLocationIdKeyword.value = locationIdKeywordInput.value.trim()
- }
- const clearLocGroupFilter = () => {
- locGroupKeywordInput.value = ''
- appliedLocGroupKeyword.value = ''
- }
- const clearLocationIdFilter = () => {
- locationIdKeywordInput.value = ''
- appliedLocationIdKeyword.value = ''
- }
- const handleGroupBorderToggle = (event: Event) => {
- const enabled = (event.target as HTMLInputElement).checked
- showGroupBorder.value = enabled
- if (enabled) {
- showZoneBorder.value = false
- }
- }
- const handleZoneBorderToggle = (event: Event) => {
- const enabled = (event.target as HTMLInputElement).checked
- showZoneBorder.value = enabled
- if (enabled) {
- showGroupBorder.value = false
- }
- }
- const refreshCountdownText = computed(() => {
- const remainMs = Math.max(nextRefreshAt.value - now.value, 0)
- const totalSeconds = Math.floor(remainMs / 1000)
- const minutes = Math.floor(totalSeconds / 60)
- const seconds = totalSeconds % 60
- return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`
- })
- const loadLocationData = async (options: { silent?: boolean } = {}) => {
- const { silent = false } = options
- if (!isAuthenticated()) {
- showLoginModal.value = true
- return
- }
- const shouldUseSilentRefresh = silent && hasLoadedOnce.value
- if (shouldUseSilentRefresh) {
- refreshing.value = true
- } else {
- loading.value = true
- error.value = ''
- }
- try {
- const data = await fetchLocationData({
- warehouse: config.warehouse,
- locLevel: currentLevel.value
- })
- locations.value = data
- hasLoadedOnce.value = true
- } catch (err: any) {
- if (!shouldUseSilentRefresh) {
- error.value = err.message || '加载数据失败,请检查接口连接'
- }
- console.error('Failed to load location data:', err)
- } finally {
- if (shouldUseSilentRefresh) {
- refreshing.value = false
- } else {
- loading.value = false
- }
- }
- }
- const scheduleNextRefresh = () => {
- if (refreshTimer !== null) {
- window.clearTimeout(refreshTimer)
- }
- nextRefreshAt.value = Date.now() + refreshIntervalMs.value
- refreshTimer = window.setTimeout(async () => {
- await loadLocationData({ silent: true })
- scheduleNextRefresh()
- }, refreshIntervalMs.value)
- }
- const handleLevelChange = () => {
- window.localStorage.setItem(LEVEL_STORAGE_KEY, String(currentLevel.value))
- loadLocationData()
- scheduleNextRefresh()
- }
- const handleManualRefresh = () => {
- loadLocationData({ silent: true })
- scheduleNextRefresh()
- }
- const applyRefreshInterval = () => {
- const nextSeconds = Number(refreshIntervalInput.value.trim())
- if (!Number.isInteger(nextSeconds) || nextSeconds <= 0) {
- return
- }
- refreshIntervalMs.value = nextSeconds * 1000
- refreshIntervalInput.value = String(nextSeconds)
- window.localStorage.setItem(REFRESH_INTERVAL_STORAGE_KEY, String(refreshIntervalMs.value))
- showRefreshPopover.value = false
- scheduleNextRefresh()
- }
- const handleRefreshContextMenu = async () => {
- refreshIntervalInput.value = String(Math.max(Math.floor(refreshIntervalMs.value / 1000), 1))
- showRefreshPopover.value = true
- await nextTick()
- refreshIntervalInputRef.value?.focus()
- refreshIntervalInputRef.value?.select()
- }
- const handleDocumentClick = (event: MouseEvent) => {
- if (!showRefreshPopover.value) {
- return
- }
- const target = event.target as Node | null
- if (target && refreshControlRef.value?.contains(target)) {
- return
- }
- showRefreshPopover.value = false
- }
- const handleLoginSuccess = () => {
- showLoginModal.value = false
- loadLocationData()
- scheduleNextRefresh()
- }
- const handleSelectLocGroup = async (locGroup1: string) => {
- await copyText(locGroup1)
- if (appliedLocGroupKeyword.value === locGroup1) {
- locGroupKeywordInput.value = ''
- appliedLocGroupKeyword.value = ''
- return
- }
- locGroupKeywordInput.value = locGroup1
- appliedLocGroupKeyword.value = locGroup1
- locationIdKeywordInput.value = ''
- appliedLocationIdKeyword.value = ''
- }
- const handleSelectLocationId = async (locationId: string) => {
- await copyText(locationId)
- if (appliedLocationIdKeyword.value === locationId) {
- locationIdKeywordInput.value = ''
- appliedLocationIdKeyword.value = ''
- return
- }
- locationIdKeywordInput.value = locationId
- appliedLocationIdKeyword.value = locationId
- locGroupKeywordInput.value = ''
- appliedLocGroupKeyword.value = ''
- }
- const handleLoginCancel = () => {
- // 不允许取消登录,必须登录才能使用
- }
- const handleLogout = () => {
- if (refreshTimer !== null) {
- window.clearTimeout(refreshTimer)
- refreshTimer = null
- }
- removeToken()
- locations.value = []
- hasLoadedOnce.value = false
- loading.value = false
- refreshing.value = false
- showLoginModal.value = true
- }
- onMounted(() => {
- countdownTimer = window.setInterval(() => {
- now.value = Date.now()
- }, 1000)
- document.addEventListener('mousedown', handleDocumentClick)
- if (!isAuthenticated()) {
- showLoginModal.value = true
- } else {
- loadLocationData()
- scheduleNextRefresh()
- }
- })
- onBeforeUnmount(() => {
- if (refreshTimer !== null) {
- window.clearTimeout(refreshTimer)
- }
- if (countdownTimer !== null) {
- window.clearInterval(countdownTimer)
- }
- document.removeEventListener('mousedown', handleDocumentClick)
- })
- </script>
- <style scoped>
- .dashboard {
- width: 100%;
- height: 100vh;
- display: flex;
- flex-direction: column;
- background: #0f1419;
- }
- .header {
- padding: 10px 18px;
- background: linear-gradient(180deg, #24313b 0%, #161d24 100%);
- border-bottom: 1px solid #6f8ca7;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .title {
- display: flex;
- align-items: baseline;
- gap: 6px;
- font-size: 18px;
- font-weight: bold;
- line-height: 1.1;
- color: #d5e4f2;
- text-shadow: 0 0 8px rgba(111, 140, 167, 0.18);
- }
- .title-meta {
- font-size: 11px;
- font-weight: normal;
- color: rgba(230, 237, 243, 0.75);
- }
- .title-legend {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- margin-left: 2px;
- }
- .legend-chip {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- min-width: 18px;
- height: 14px;
- padding: 0 4px;
- border-radius: 999px;
- font-size: 9px;
- font-weight: 600;
- line-height: 1;
- color: #f4f7fa;
- }
- .legend-chip-a {
- background: #008000;
- }
- .legend-chip-b {
- background: #0000ff;
- color: #f4f8ff;
- }
- .legend-chip-c {
- background: #ffff00;
- color: #5a5200;
- }
- .controls {
- display: flex;
- align-items: center;
- gap: 6px;
- }
- .level-selector {
- display: flex;
- align-items: center;
- gap: 6px;
- color: #d4e2f2;
- }
- .filter-item {
- display: flex;
- align-items: center;
- gap: 4px;
- color: #d4e2f2;
- }
- .filter-input-item {
- min-width: auto;
- }
- .toggle-item {
- display: flex;
- align-items: center;
- gap: 4px;
- color: #d4e2f2;
- }
- .selector-label {
- font-size: 11px;
- color: #b9cbdb;
- }
- .level-select {
- min-width: 76px;
- padding: 6px 24px 6px 8px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(111, 140, 167, 0.4);
- color: #eef4f8;
- cursor: pointer;
- font-size: 12px;
- transition: all 0.3s;
- border-radius: 4px;
- outline: none;
- appearance: none;
- background-image:
- linear-gradient(45deg, transparent 50%, #7a96af 50%),
- linear-gradient(135deg, #7a96af 50%, transparent 50%);
- background-position:
- calc(100% - 13px) calc(50% - 2px),
- calc(100% - 8px) calc(50% - 2px);
- background-size: 5px 5px, 5px 5px;
- background-repeat: no-repeat;
- line-height: 1;
- }
- .level-select-floor {
- min-width: 64px;
- }
- .filter-input-wrap {
- position: relative;
- display: inline-flex;
- width: 136px;
- }
- .filter-input {
- width: 100%;
- padding: 6px 8px;
- padding-right: 50px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(111, 140, 167, 0.4);
- color: #eef4f8;
- font-size: 12px;
- border-radius: 4px;
- outline: none;
- line-height: 1;
- }
- .filter-input::placeholder {
- color: rgba(185, 203, 219, 0.58);
- }
- .filter-input:hover,
- .filter-input:focus {
- background: rgba(111, 140, 167, 0.12);
- border-color: #7a96af;
- }
- .filter-confirm-btn {
- position: absolute;
- top: 1px;
- right: 1px;
- width: 24px;
- height: calc(100% - 2px);
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border: none;
- border-left: 1px solid rgba(111, 140, 167, 0.3);
- background: transparent;
- color: #dce8f3;
- cursor: pointer;
- border-radius: 0 3px 3px 0;
- }
- .filter-clear-btn {
- position: absolute;
- top: 1px;
- right: 25px;
- width: 24px;
- height: calc(100% - 2px);
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border: none;
- border-left: 1px solid rgba(111, 140, 167, 0.3);
- background: transparent;
- color: #dce8f3;
- cursor: pointer;
- }
- .filter-clear-btn:hover,
- .filter-confirm-btn:hover {
- background: rgba(111, 140, 167, 0.14);
- }
- .filter-action-icon {
- width: 12px;
- height: 12px;
- }
- .toggle-input {
- position: absolute;
- opacity: 0;
- pointer-events: none;
- }
- .toggle-track {
- position: relative;
- width: 34px;
- height: 18px;
- border-radius: 999px;
- background: rgba(111, 140, 167, 0.24);
- border: 1px solid rgba(111, 140, 167, 0.5);
- transition: all 0.2s;
- cursor: pointer;
- }
- .toggle-thumb {
- position: absolute;
- top: 1px;
- left: 1px;
- width: 14px;
- height: 14px;
- border-radius: 50%;
- background: #eef4f8;
- transition: transform 0.2s;
- }
- .toggle-input:checked + .toggle-track {
- background: rgba(111, 140, 167, 0.45);
- border-color: #d7e2ea;
- }
- .toggle-input:checked + .toggle-track .toggle-thumb {
- transform: translateX(16px);
- }
- .level-select:hover,
- .level-select:focus {
- background: rgba(111, 140, 167, 0.12);
- border-color: #7a96af;
- }
- .refresh-btn {
- min-width: 58px;
- padding: 6px 8px;
- background: rgba(111, 140, 167, 0.12);
- border: 1px solid rgba(111, 140, 167, 0.5);
- color: #e6edf3;
- cursor: pointer;
- font-size: 11px;
- transition: all 0.3s;
- border-radius: 4px;
- line-height: 1;
- }
- .refresh-control {
- position: relative;
- }
- .refresh-popover {
- position: absolute;
- top: calc(100% + 6px);
- right: 0;
- display: inline-flex;
- align-items: center;
- gap: 4px;
- padding: 4px;
- background: rgba(20, 29, 37, 0.96);
- border: 1px solid rgba(111, 140, 167, 0.4);
- border-radius: 4px;
- box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
- z-index: 20;
- }
- .refresh-popover-input {
- width: 56px;
- padding: 6px 8px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(111, 140, 167, 0.4);
- color: #eef4f8;
- font-size: 12px;
- border-radius: 4px;
- outline: none;
- line-height: 1;
- }
- .refresh-popover-input:focus {
- background: rgba(111, 140, 167, 0.12);
- border-color: #7a96af;
- }
- .refresh-popover-confirm {
- width: 24px;
- height: 28px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border: 1px solid rgba(111, 140, 167, 0.3);
- background: rgba(255, 255, 255, 0.04);
- color: #dce8f3;
- border-radius: 4px;
- cursor: pointer;
- }
- .refresh-popover-confirm:hover {
- background: rgba(111, 140, 167, 0.14);
- border-color: #7a96af;
- }
- .refresh-btn:hover:not(:disabled) {
- background: rgba(111, 140, 167, 0.2);
- border-color: #7a96af;
- }
- .refresh-btn:disabled {
- opacity: 0.7;
- cursor: wait;
- }
- .logout-btn {
- padding: 6px 10px;
- background: rgba(210, 92, 92, 0.08);
- border: 1px solid rgba(210, 92, 92, 0.45);
- color: #f2bcbc;
- cursor: pointer;
- font-size: 11px;
- transition: all 0.3s;
- border-radius: 4px;
- line-height: 1;
- }
- .logout-btn:hover {
- background: rgba(210, 92, 92, 0.16);
- border-color: rgba(210, 92, 92, 0.7);
- color: #ffd4d4;
- }
- .main-content {
- flex: 1;
- padding: 0 12px 12px;
- overflow: auto;
- }
- .loading,
- .error {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 18px;
- color: #d5e4f2;
- }
- .error {
- color: #ff4444;
- }
- .map-container {
- width: 100%;
- height: 100%;
- }
- </style>
|