App.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. <template>
  2. <div class="dashboard">
  3. <LoginModal
  4. :visible="showLoginModal"
  5. @success="handleLoginSuccess"
  6. @cancel="handleLoginCancel"
  7. />
  8. <header class="header">
  9. <h1 class="title">
  10. 宝时立库
  11. <span class="title-meta">· 总库位 {{ locations.length }}</span>
  12. <span class="title-legend">
  13. <span class="legend-chip legend-chip-a">A</span>
  14. <span class="legend-chip legend-chip-b">B</span>
  15. <span class="legend-chip legend-chip-c">C</span>
  16. </span>
  17. </h1>
  18. <div class="controls">
  19. <label class="filter-item">
  20. <span class="selector-label">资源类型</span>
  21. <select v-model="selectedCategory" class="level-select">
  22. <option value="">全部</option>
  23. <option v-for="category in categoryOptions" :key="category" :value="category">
  24. {{ category }}
  25. </option>
  26. </select>
  27. </label>
  28. <label class="filter-item">
  29. <span class="selector-label">库位属性</span>
  30. <select v-model="selectedLocationAttribute" class="level-select">
  31. <option value="">全部</option>
  32. <option
  33. v-for="attribute in locationAttributeOptions"
  34. :key="attribute"
  35. :value="attribute"
  36. >
  37. {{ getLocationAttributeLabel(attribute) }}
  38. </option>
  39. </select>
  40. </label>
  41. <label class="filter-item">
  42. <span class="selector-label">容器</span>
  43. <select v-model="selectedHasContainer" class="level-select">
  44. <option value="">全部</option>
  45. <option value="Y">有容器</option>
  46. <option value="N">无容器</option>
  47. </select>
  48. </label>
  49. <label class="filter-item filter-input-item">
  50. <span class="selector-label">库位组</span>
  51. <span class="filter-input-wrap">
  52. <input
  53. v-model="locGroupKeywordInput"
  54. class="filter-input"
  55. type="text"
  56. placeholder="输入库位组"
  57. @keydown.enter="applyLocGroupFilter"
  58. />
  59. <button
  60. v-if="locGroupKeywordInput"
  61. class="filter-clear-btn"
  62. type="button"
  63. @click="clearLocGroupFilter"
  64. >
  65. <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
  66. <path
  67. 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"
  68. fill="currentColor"
  69. />
  70. </svg>
  71. </button>
  72. <button class="filter-confirm-btn" type="button" @click="applyLocGroupFilter">
  73. <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
  74. <path
  75. 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"
  76. fill="currentColor"
  77. />
  78. </svg>
  79. </button>
  80. </span>
  81. </label>
  82. <label class="filter-item filter-input-item">
  83. <span class="selector-label">库位号</span>
  84. <span class="filter-input-wrap">
  85. <input
  86. v-model="locationIdKeywordInput"
  87. class="filter-input"
  88. type="text"
  89. placeholder="输入库位号"
  90. @keydown.enter="applyLocationIdFilter"
  91. />
  92. <button
  93. v-if="locationIdKeywordInput"
  94. class="filter-clear-btn"
  95. type="button"
  96. @click="clearLocationIdFilter"
  97. >
  98. <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
  99. <path
  100. 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"
  101. fill="currentColor"
  102. />
  103. </svg>
  104. </button>
  105. <button class="filter-confirm-btn" type="button" @click="applyLocationIdFilter">
  106. <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
  107. <path
  108. 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"
  109. fill="currentColor"
  110. />
  111. </svg>
  112. </button>
  113. </span>
  114. </label>
  115. <label class="toggle-item">
  116. <span class="selector-label">库位组边框</span>
  117. <input
  118. :checked="showGroupBorder"
  119. class="toggle-input"
  120. type="checkbox"
  121. @change="handleGroupBorderToggle"
  122. />
  123. <span class="toggle-track">
  124. <span class="toggle-thumb"></span>
  125. </span>
  126. </label>
  127. <label class="toggle-item">
  128. <span class="selector-label">库区边框</span>
  129. <input
  130. :checked="showZoneBorder"
  131. class="toggle-input"
  132. type="checkbox"
  133. @change="handleZoneBorderToggle"
  134. />
  135. <span class="toggle-track">
  136. <span class="toggle-thumb"></span>
  137. </span>
  138. </label>
  139. <label class="toggle-item">
  140. <span class="selector-label">卡片</span>
  141. <input v-model="showTooltip" class="toggle-input" type="checkbox" />
  142. <span class="toggle-track">
  143. <span class="toggle-thumb"></span>
  144. </span>
  145. </label>
  146. <select
  147. v-model.number="currentLevel"
  148. class="level-select level-select-floor"
  149. @change="handleLevelChange"
  150. >
  151. <option v-for="level in levelRange" :key="level" :value="level">
  152. {{ level }}层
  153. </option>
  154. </select>
  155. <div ref="refreshControlRef" class="refresh-control">
  156. <button
  157. class="refresh-btn"
  158. :disabled="loading || refreshing"
  159. @click="handleManualRefresh"
  160. @contextmenu.prevent="handleRefreshContextMenu"
  161. >
  162. {{ refreshCountdownText }}
  163. </button>
  164. <div
  165. v-if="showRefreshPopover"
  166. class="refresh-popover"
  167. @click.stop
  168. >
  169. <input
  170. ref="refreshIntervalInputRef"
  171. v-model="refreshIntervalInput"
  172. class="refresh-popover-input"
  173. type="text"
  174. inputmode="numeric"
  175. @keydown.enter="applyRefreshInterval"
  176. />
  177. <button
  178. class="refresh-popover-confirm"
  179. type="button"
  180. @click="applyRefreshInterval"
  181. >
  182. <svg viewBox="0 0 16 16" aria-hidden="true" class="filter-action-icon">
  183. <path
  184. 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"
  185. fill="currentColor"
  186. />
  187. </svg>
  188. </button>
  189. </div>
  190. </div>
  191. <button class="logout-btn" @click="handleLogout">退出</button>
  192. </div>
  193. </header>
  194. <main class="main-content">
  195. <div v-if="loading" class="loading">加载中...</div>
  196. <div v-else-if="error" class="error">
  197. {{ error }}
  198. </div>
  199. <div v-else class="map-container">
  200. <WarehouseMap
  201. :locations="locations"
  202. :current-level="currentLevel"
  203. :selected-category="selectedCategory"
  204. :selected-location-attribute="selectedLocationAttribute"
  205. :selected-has-container="selectedHasContainer"
  206. :loc-group-keyword="appliedLocGroupKeyword"
  207. :location-id-keyword="appliedLocationIdKeyword"
  208. :show-group-border="showGroupBorder"
  209. :show-zone-border="showZoneBorder"
  210. :show-tooltip="showTooltip"
  211. @select-loc-group="handleSelectLocGroup"
  212. @select-location-id="handleSelectLocationId"
  213. />
  214. </div>
  215. </main>
  216. </div>
  217. </template>
  218. <script setup lang="ts">
  219. import { ref, onMounted, computed, onBeforeUnmount, nextTick } from 'vue'
  220. import { fetchLocationData } from './api/location'
  221. import type { LocationAttributeCode, LocationResourceDataVO } from './types'
  222. import WarehouseMap from './components/WarehouseMap.vue'
  223. import LoginModal from './components/LoginModal.vue'
  224. import { config } from './config'
  225. import { isAuthenticated, removeToken } from './utils/auth'
  226. const LEVEL_STORAGE_KEY = 'warehouse-map.current-level'
  227. const REFRESH_INTERVAL_STORAGE_KEY = 'warehouse-map.refresh-interval-ms'
  228. const getInitialLevel = () => {
  229. const savedLevel = window.localStorage.getItem(LEVEL_STORAGE_KEY)
  230. const parsedLevel = savedLevel ? Number(savedLevel) : NaN
  231. if (Number.isInteger(parsedLevel) && parsedLevel >= config.minLevel && parsedLevel <= config.maxLevel) {
  232. return parsedLevel
  233. }
  234. return config.minLevel
  235. }
  236. const getInitialRefreshInterval = () => {
  237. const savedInterval = window.localStorage.getItem(REFRESH_INTERVAL_STORAGE_KEY)
  238. const parsedInterval = savedInterval ? Number(savedInterval) : NaN
  239. if (Number.isInteger(parsedInterval) && parsedInterval > 0) {
  240. return parsedInterval
  241. }
  242. return config.refreshInterval
  243. }
  244. const currentLevel = ref(getInitialLevel())
  245. const locations = ref<LocationResourceDataVO[]>([])
  246. const loading = ref(false)
  247. const refreshing = ref(false)
  248. const hasLoadedOnce = ref(false)
  249. const error = ref('')
  250. const showLoginModal = ref(false)
  251. const selectedCategory = ref('')
  252. const selectedLocationAttribute = ref<LocationAttributeCode | ''>('')
  253. const selectedHasContainer = ref<'Y' | 'N' | ''>('')
  254. const locGroupKeywordInput = ref('')
  255. const appliedLocGroupKeyword = ref('')
  256. const locationIdKeywordInput = ref('')
  257. const appliedLocationIdKeyword = ref('')
  258. const showGroupBorder = ref(false)
  259. const showZoneBorder = ref(false)
  260. const showTooltip = ref(true)
  261. const refreshIntervalMs = ref(getInitialRefreshInterval())
  262. const showRefreshPopover = ref(false)
  263. const refreshIntervalInput = ref(String(Math.max(Math.floor(refreshIntervalMs.value / 1000), 1)))
  264. const now = ref(Date.now())
  265. const nextRefreshAt = ref(Date.now() + refreshIntervalMs.value)
  266. const refreshControlRef = ref<HTMLElement | null>(null)
  267. const refreshIntervalInputRef = ref<HTMLInputElement | null>(null)
  268. let refreshTimer: number | null = null
  269. let countdownTimer: number | null = null
  270. const LOCATION_ATTRIBUTE_LABEL_MAP: Record<LocationAttributeCode, string> = {
  271. OK: '正常',
  272. FI: '禁入',
  273. HD: '封存',
  274. SC: '管控'
  275. }
  276. const levelRange = computed(() => {
  277. const levels = []
  278. for (let i = config.minLevel; i <= config.maxLevel; i++) {
  279. levels.push(i)
  280. }
  281. return levels
  282. })
  283. const categoryOptions = computed(() => {
  284. return [...new Set(locations.value.map((loc) => loc.category).filter(Boolean))].sort()
  285. })
  286. const locationAttributeOptions = computed<LocationAttributeCode[]>(() => {
  287. return [...new Set(locations.value.map((loc) => loc.locationAttribute).filter(Boolean))] as LocationAttributeCode[]
  288. })
  289. const getLocationAttributeLabel = (attribute: LocationAttributeCode) => {
  290. return LOCATION_ATTRIBUTE_LABEL_MAP[attribute] || attribute
  291. }
  292. const copyText = async (text: string) => {
  293. if (!text) return
  294. try {
  295. await navigator.clipboard.writeText(text)
  296. return
  297. } catch (error) {
  298. console.warn('Clipboard API copy failed, fallback to execCommand.', error)
  299. }
  300. const textarea = document.createElement('textarea')
  301. textarea.value = text
  302. textarea.setAttribute('readonly', 'true')
  303. textarea.style.position = 'fixed'
  304. textarea.style.top = '-9999px'
  305. document.body.appendChild(textarea)
  306. textarea.select()
  307. document.execCommand('copy')
  308. document.body.removeChild(textarea)
  309. }
  310. const applyLocGroupFilter = () => {
  311. appliedLocGroupKeyword.value = locGroupKeywordInput.value.trim()
  312. }
  313. const applyLocationIdFilter = () => {
  314. appliedLocationIdKeyword.value = locationIdKeywordInput.value.trim()
  315. }
  316. const clearLocGroupFilter = () => {
  317. locGroupKeywordInput.value = ''
  318. appliedLocGroupKeyword.value = ''
  319. }
  320. const clearLocationIdFilter = () => {
  321. locationIdKeywordInput.value = ''
  322. appliedLocationIdKeyword.value = ''
  323. }
  324. const handleGroupBorderToggle = (event: Event) => {
  325. const enabled = (event.target as HTMLInputElement).checked
  326. showGroupBorder.value = enabled
  327. if (enabled) {
  328. showZoneBorder.value = false
  329. }
  330. }
  331. const handleZoneBorderToggle = (event: Event) => {
  332. const enabled = (event.target as HTMLInputElement).checked
  333. showZoneBorder.value = enabled
  334. if (enabled) {
  335. showGroupBorder.value = false
  336. }
  337. }
  338. const refreshCountdownText = computed(() => {
  339. const remainMs = Math.max(nextRefreshAt.value - now.value, 0)
  340. const totalSeconds = Math.floor(remainMs / 1000)
  341. const minutes = Math.floor(totalSeconds / 60)
  342. const seconds = totalSeconds % 60
  343. return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`
  344. })
  345. const loadLocationData = async (options: { silent?: boolean } = {}) => {
  346. const { silent = false } = options
  347. if (!isAuthenticated()) {
  348. showLoginModal.value = true
  349. return
  350. }
  351. const shouldUseSilentRefresh = silent && hasLoadedOnce.value
  352. if (shouldUseSilentRefresh) {
  353. refreshing.value = true
  354. } else {
  355. loading.value = true
  356. error.value = ''
  357. }
  358. try {
  359. const data = await fetchLocationData({
  360. warehouse: config.warehouse,
  361. locLevel: currentLevel.value
  362. })
  363. locations.value = data
  364. hasLoadedOnce.value = true
  365. } catch (err: any) {
  366. if (!shouldUseSilentRefresh) {
  367. error.value = err.message || '加载数据失败,请检查接口连接'
  368. }
  369. console.error('Failed to load location data:', err)
  370. } finally {
  371. if (shouldUseSilentRefresh) {
  372. refreshing.value = false
  373. } else {
  374. loading.value = false
  375. }
  376. }
  377. }
  378. const scheduleNextRefresh = () => {
  379. if (refreshTimer !== null) {
  380. window.clearTimeout(refreshTimer)
  381. }
  382. nextRefreshAt.value = Date.now() + refreshIntervalMs.value
  383. refreshTimer = window.setTimeout(async () => {
  384. await loadLocationData({ silent: true })
  385. scheduleNextRefresh()
  386. }, refreshIntervalMs.value)
  387. }
  388. const handleLevelChange = () => {
  389. window.localStorage.setItem(LEVEL_STORAGE_KEY, String(currentLevel.value))
  390. loadLocationData()
  391. scheduleNextRefresh()
  392. }
  393. const handleManualRefresh = () => {
  394. loadLocationData({ silent: true })
  395. scheduleNextRefresh()
  396. }
  397. const applyRefreshInterval = () => {
  398. const nextSeconds = Number(refreshIntervalInput.value.trim())
  399. if (!Number.isInteger(nextSeconds) || nextSeconds <= 0) {
  400. return
  401. }
  402. refreshIntervalMs.value = nextSeconds * 1000
  403. refreshIntervalInput.value = String(nextSeconds)
  404. window.localStorage.setItem(REFRESH_INTERVAL_STORAGE_KEY, String(refreshIntervalMs.value))
  405. showRefreshPopover.value = false
  406. scheduleNextRefresh()
  407. }
  408. const handleRefreshContextMenu = async () => {
  409. refreshIntervalInput.value = String(Math.max(Math.floor(refreshIntervalMs.value / 1000), 1))
  410. showRefreshPopover.value = true
  411. await nextTick()
  412. refreshIntervalInputRef.value?.focus()
  413. refreshIntervalInputRef.value?.select()
  414. }
  415. const handleDocumentClick = (event: MouseEvent) => {
  416. if (!showRefreshPopover.value) {
  417. return
  418. }
  419. const target = event.target as Node | null
  420. if (target && refreshControlRef.value?.contains(target)) {
  421. return
  422. }
  423. showRefreshPopover.value = false
  424. }
  425. const handleLoginSuccess = () => {
  426. showLoginModal.value = false
  427. loadLocationData()
  428. scheduleNextRefresh()
  429. }
  430. const handleSelectLocGroup = async (locGroup1: string) => {
  431. await copyText(locGroup1)
  432. if (appliedLocGroupKeyword.value === locGroup1) {
  433. locGroupKeywordInput.value = ''
  434. appliedLocGroupKeyword.value = ''
  435. return
  436. }
  437. locGroupKeywordInput.value = locGroup1
  438. appliedLocGroupKeyword.value = locGroup1
  439. locationIdKeywordInput.value = ''
  440. appliedLocationIdKeyword.value = ''
  441. }
  442. const handleSelectLocationId = async (locationId: string) => {
  443. await copyText(locationId)
  444. if (appliedLocationIdKeyword.value === locationId) {
  445. locationIdKeywordInput.value = ''
  446. appliedLocationIdKeyword.value = ''
  447. return
  448. }
  449. locationIdKeywordInput.value = locationId
  450. appliedLocationIdKeyword.value = locationId
  451. locGroupKeywordInput.value = ''
  452. appliedLocGroupKeyword.value = ''
  453. }
  454. const handleLoginCancel = () => {
  455. // 不允许取消登录,必须登录才能使用
  456. }
  457. const handleLogout = () => {
  458. if (refreshTimer !== null) {
  459. window.clearTimeout(refreshTimer)
  460. refreshTimer = null
  461. }
  462. removeToken()
  463. locations.value = []
  464. hasLoadedOnce.value = false
  465. loading.value = false
  466. refreshing.value = false
  467. showLoginModal.value = true
  468. }
  469. onMounted(() => {
  470. countdownTimer = window.setInterval(() => {
  471. now.value = Date.now()
  472. }, 1000)
  473. document.addEventListener('mousedown', handleDocumentClick)
  474. if (!isAuthenticated()) {
  475. showLoginModal.value = true
  476. } else {
  477. loadLocationData()
  478. scheduleNextRefresh()
  479. }
  480. })
  481. onBeforeUnmount(() => {
  482. if (refreshTimer !== null) {
  483. window.clearTimeout(refreshTimer)
  484. }
  485. if (countdownTimer !== null) {
  486. window.clearInterval(countdownTimer)
  487. }
  488. document.removeEventListener('mousedown', handleDocumentClick)
  489. })
  490. </script>
  491. <style scoped>
  492. .dashboard {
  493. width: 100%;
  494. height: 100vh;
  495. display: flex;
  496. flex-direction: column;
  497. background: #0f1419;
  498. }
  499. .header {
  500. padding: 10px 18px;
  501. background: linear-gradient(180deg, #24313b 0%, #161d24 100%);
  502. border-bottom: 1px solid #6f8ca7;
  503. display: flex;
  504. justify-content: space-between;
  505. align-items: center;
  506. }
  507. .title {
  508. display: flex;
  509. align-items: baseline;
  510. gap: 6px;
  511. font-size: 18px;
  512. font-weight: bold;
  513. line-height: 1.1;
  514. color: #d5e4f2;
  515. text-shadow: 0 0 8px rgba(111, 140, 167, 0.18);
  516. }
  517. .title-meta {
  518. font-size: 11px;
  519. font-weight: normal;
  520. color: rgba(230, 237, 243, 0.75);
  521. }
  522. .title-legend {
  523. display: inline-flex;
  524. align-items: center;
  525. gap: 4px;
  526. margin-left: 2px;
  527. }
  528. .legend-chip {
  529. display: inline-flex;
  530. align-items: center;
  531. justify-content: center;
  532. min-width: 18px;
  533. height: 14px;
  534. padding: 0 4px;
  535. border-radius: 999px;
  536. font-size: 9px;
  537. font-weight: 600;
  538. line-height: 1;
  539. color: #f4f7fa;
  540. }
  541. .legend-chip-a {
  542. background: #008000;
  543. }
  544. .legend-chip-b {
  545. background: #0000ff;
  546. color: #f4f8ff;
  547. }
  548. .legend-chip-c {
  549. background: #ffff00;
  550. color: #5a5200;
  551. }
  552. .controls {
  553. display: flex;
  554. align-items: center;
  555. gap: 6px;
  556. }
  557. .level-selector {
  558. display: flex;
  559. align-items: center;
  560. gap: 6px;
  561. color: #d4e2f2;
  562. }
  563. .filter-item {
  564. display: flex;
  565. align-items: center;
  566. gap: 4px;
  567. color: #d4e2f2;
  568. }
  569. .filter-input-item {
  570. min-width: auto;
  571. }
  572. .toggle-item {
  573. display: flex;
  574. align-items: center;
  575. gap: 4px;
  576. color: #d4e2f2;
  577. }
  578. .selector-label {
  579. font-size: 11px;
  580. color: #b9cbdb;
  581. }
  582. .level-select {
  583. min-width: 76px;
  584. padding: 6px 24px 6px 8px;
  585. background: rgba(255, 255, 255, 0.04);
  586. border: 1px solid rgba(111, 140, 167, 0.4);
  587. color: #eef4f8;
  588. cursor: pointer;
  589. font-size: 12px;
  590. transition: all 0.3s;
  591. border-radius: 4px;
  592. outline: none;
  593. appearance: none;
  594. background-image:
  595. linear-gradient(45deg, transparent 50%, #7a96af 50%),
  596. linear-gradient(135deg, #7a96af 50%, transparent 50%);
  597. background-position:
  598. calc(100% - 13px) calc(50% - 2px),
  599. calc(100% - 8px) calc(50% - 2px);
  600. background-size: 5px 5px, 5px 5px;
  601. background-repeat: no-repeat;
  602. line-height: 1;
  603. }
  604. .level-select-floor {
  605. min-width: 64px;
  606. }
  607. .filter-input-wrap {
  608. position: relative;
  609. display: inline-flex;
  610. width: 136px;
  611. }
  612. .filter-input {
  613. width: 100%;
  614. padding: 6px 8px;
  615. padding-right: 50px;
  616. background: rgba(255, 255, 255, 0.04);
  617. border: 1px solid rgba(111, 140, 167, 0.4);
  618. color: #eef4f8;
  619. font-size: 12px;
  620. border-radius: 4px;
  621. outline: none;
  622. line-height: 1;
  623. }
  624. .filter-input::placeholder {
  625. color: rgba(185, 203, 219, 0.58);
  626. }
  627. .filter-input:hover,
  628. .filter-input:focus {
  629. background: rgba(111, 140, 167, 0.12);
  630. border-color: #7a96af;
  631. }
  632. .filter-confirm-btn {
  633. position: absolute;
  634. top: 1px;
  635. right: 1px;
  636. width: 24px;
  637. height: calc(100% - 2px);
  638. display: inline-flex;
  639. align-items: center;
  640. justify-content: center;
  641. border: none;
  642. border-left: 1px solid rgba(111, 140, 167, 0.3);
  643. background: transparent;
  644. color: #dce8f3;
  645. cursor: pointer;
  646. border-radius: 0 3px 3px 0;
  647. }
  648. .filter-clear-btn {
  649. position: absolute;
  650. top: 1px;
  651. right: 25px;
  652. width: 24px;
  653. height: calc(100% - 2px);
  654. display: inline-flex;
  655. align-items: center;
  656. justify-content: center;
  657. border: none;
  658. border-left: 1px solid rgba(111, 140, 167, 0.3);
  659. background: transparent;
  660. color: #dce8f3;
  661. cursor: pointer;
  662. }
  663. .filter-clear-btn:hover,
  664. .filter-confirm-btn:hover {
  665. background: rgba(111, 140, 167, 0.14);
  666. }
  667. .filter-action-icon {
  668. width: 12px;
  669. height: 12px;
  670. }
  671. .toggle-input {
  672. position: absolute;
  673. opacity: 0;
  674. pointer-events: none;
  675. }
  676. .toggle-track {
  677. position: relative;
  678. width: 34px;
  679. height: 18px;
  680. border-radius: 999px;
  681. background: rgba(111, 140, 167, 0.24);
  682. border: 1px solid rgba(111, 140, 167, 0.5);
  683. transition: all 0.2s;
  684. cursor: pointer;
  685. }
  686. .toggle-thumb {
  687. position: absolute;
  688. top: 1px;
  689. left: 1px;
  690. width: 14px;
  691. height: 14px;
  692. border-radius: 50%;
  693. background: #eef4f8;
  694. transition: transform 0.2s;
  695. }
  696. .toggle-input:checked + .toggle-track {
  697. background: rgba(111, 140, 167, 0.45);
  698. border-color: #d7e2ea;
  699. }
  700. .toggle-input:checked + .toggle-track .toggle-thumb {
  701. transform: translateX(16px);
  702. }
  703. .level-select:hover,
  704. .level-select:focus {
  705. background: rgba(111, 140, 167, 0.12);
  706. border-color: #7a96af;
  707. }
  708. .refresh-btn {
  709. min-width: 58px;
  710. padding: 6px 8px;
  711. background: rgba(111, 140, 167, 0.12);
  712. border: 1px solid rgba(111, 140, 167, 0.5);
  713. color: #e6edf3;
  714. cursor: pointer;
  715. font-size: 11px;
  716. transition: all 0.3s;
  717. border-radius: 4px;
  718. line-height: 1;
  719. }
  720. .refresh-control {
  721. position: relative;
  722. }
  723. .refresh-popover {
  724. position: absolute;
  725. top: calc(100% + 6px);
  726. right: 0;
  727. display: inline-flex;
  728. align-items: center;
  729. gap: 4px;
  730. padding: 4px;
  731. background: rgba(20, 29, 37, 0.96);
  732. border: 1px solid rgba(111, 140, 167, 0.4);
  733. border-radius: 4px;
  734. box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  735. z-index: 20;
  736. }
  737. .refresh-popover-input {
  738. width: 56px;
  739. padding: 6px 8px;
  740. background: rgba(255, 255, 255, 0.04);
  741. border: 1px solid rgba(111, 140, 167, 0.4);
  742. color: #eef4f8;
  743. font-size: 12px;
  744. border-radius: 4px;
  745. outline: none;
  746. line-height: 1;
  747. }
  748. .refresh-popover-input:focus {
  749. background: rgba(111, 140, 167, 0.12);
  750. border-color: #7a96af;
  751. }
  752. .refresh-popover-confirm {
  753. width: 24px;
  754. height: 28px;
  755. display: inline-flex;
  756. align-items: center;
  757. justify-content: center;
  758. border: 1px solid rgba(111, 140, 167, 0.3);
  759. background: rgba(255, 255, 255, 0.04);
  760. color: #dce8f3;
  761. border-radius: 4px;
  762. cursor: pointer;
  763. }
  764. .refresh-popover-confirm:hover {
  765. background: rgba(111, 140, 167, 0.14);
  766. border-color: #7a96af;
  767. }
  768. .refresh-btn:hover:not(:disabled) {
  769. background: rgba(111, 140, 167, 0.2);
  770. border-color: #7a96af;
  771. }
  772. .refresh-btn:disabled {
  773. opacity: 0.7;
  774. cursor: wait;
  775. }
  776. .logout-btn {
  777. padding: 6px 10px;
  778. background: rgba(210, 92, 92, 0.08);
  779. border: 1px solid rgba(210, 92, 92, 0.45);
  780. color: #f2bcbc;
  781. cursor: pointer;
  782. font-size: 11px;
  783. transition: all 0.3s;
  784. border-radius: 4px;
  785. line-height: 1;
  786. }
  787. .logout-btn:hover {
  788. background: rgba(210, 92, 92, 0.16);
  789. border-color: rgba(210, 92, 92, 0.7);
  790. color: #ffd4d4;
  791. }
  792. .main-content {
  793. flex: 1;
  794. padding: 0 12px 12px;
  795. overflow: auto;
  796. }
  797. .loading,
  798. .error {
  799. display: flex;
  800. justify-content: center;
  801. align-items: center;
  802. height: 100%;
  803. font-size: 18px;
  804. color: #d5e4f2;
  805. }
  806. .error {
  807. color: #ff4444;
  808. }
  809. .map-container {
  810. width: 100%;
  811. height: 100%;
  812. }
  813. </style>