yuxin.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <vue-fullscreen
  3. class="box-container"
  4. v-cloak
  5. v-model="isFullscreen"
  6. fullscreenClass="box-container"
  7. :exit-on-click-wrapper="false"
  8. >
  9. <div class="box-container" v-cloak>
  10. <div class="scroll-wrapper">
  11. <!-- 头部区域 -->
  12. <div class="header-section">
  13. <div class="box-header-scroll">
  14. <!-- <div class="logo">
  15. <el-select
  16. v-model="selectedStation"
  17. placeholder="请选择"
  18. class="custom-select"
  19. popper-class="custom-select-dropdown"
  20. >
  21. <el-option
  22. v-for="item in stationList"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. />
  27. </el-select>
  28. </div> -->
  29. <div class="header-center">
  30. <div class="title">设备运维看板</div>
  31. </div>
  32. <!-- <div class="time">
  33. <div class="time-display">
  34. <span class="date-text">{{ currentDate }}</span>
  35. <span class="time-text">{{ currentTime }}</span>
  36. </div>
  37. </div> -->
  38. <div class="time">
  39. <div class="time-display">
  40. <span class="date-text">{{ currentDate }}</span>
  41. <span class="time-text">{{ currentTime }}</span>
  42. </div>
  43. <span class="fullscreen-toggle" @click.passive="onFullscreen">
  44. <i
  45. v-if="isFullscreen"
  46. title="取消全屏"
  47. class="el-icon-_screen-restore"
  48. />
  49. <i v-else title="全屏" class="el-icon-_screen-full" />
  50. </span>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- 统计卡片区域 -->
  55. <div class="stats">
  56. <!-- <el-row :gutter="16">
  57. <el-col :span="8"> -->
  58. <stat-card
  59. v-for="item in statsCardList"
  60. :key="item.key"
  61. :label="item.label"
  62. :value="item.value"
  63. :unit="item.unit"
  64. :icon="item.icon"
  65. :icon-color="item.iconColor"
  66. :icon-bg="item.iconBg"
  67. :value-color="item.valueColor"
  68. :bgimg="'url(' + item.bgimg + ')'"
  69. />
  70. <!-- </el-col>
  71. <el-col :span="8"> -->
  72. <!-- <stat-card
  73. :bgimg="'url(' + require('@/assets/pcs/runDevice.png') + ')'"
  74. label="运行数"
  75. :value="345"
  76. unit="台"
  77. icon="el-icon-video-play"
  78. icon-color="#67C23A"
  79. icon-bg="#f0f9eb"
  80. value-color="#67C23A"
  81. /> -->
  82. <!-- </el-col>
  83. <el-col :span="8"> -->
  84. <!-- <stat-card
  85. :bgimg="'url(' + require('@/assets/pcs/runDevice.png') + ')'"
  86. label="维修数"
  87. :value="5"
  88. unit="台"
  89. icon="el-icon-setting"
  90. icon-color="#E6A23C"
  91. icon-bg="#fdf6ec"
  92. value-color="#E6A23C"
  93. /> -->
  94. <!-- </el-col> -->
  95. <!-- </el-row> -->
  96. </div>
  97. <!-- 双栏布局区域 -->
  98. <div class="two-column-layout">
  99. <!-- 左侧区域 -->
  100. <div class="left-section">
  101. <!-- 年运行率趋势图 -->
  102. <div class="panel chart-panel">
  103. <div class="panel-title">
  104. <div class="panel-icon"></div>
  105. 年运行率趋势图
  106. </div>
  107. <div class="chart-container">
  108. <trend-chart :option="yearRunRateOption" height="100%" />
  109. </div>
  110. </div>
  111. <!-- 年故障率趋势图 -->
  112. <div class="panel chart-panel">
  113. <div class="panel-title">
  114. <div class="panel-icon"></div>
  115. 年故障率趋势图
  116. </div>
  117. <div class="chart-container">
  118. <trend-chart :option="yearFaultRateOption" height="100%" />
  119. </div>
  120. </div>
  121. <!-- 年维修次数趋势图 -->
  122. <div class="panel chart-panel">
  123. <div class="panel-title">
  124. <div class="panel-icon"></div>
  125. 年维修次数趋势图
  126. </div>
  127. <div class="chart-container">
  128. <trend-chart :option="yearRepairCountOption" height="100%" />
  129. </div>
  130. </div>
  131. </div>
  132. <!-- 右侧区域 -->
  133. <div class="right-section">
  134. <!-- 月运行率趋势 -->
  135. <div class="panel chart-panel">
  136. <div class="panel-title">
  137. <div class="panel-icon"></div>
  138. 月运行率趋势图
  139. </div>
  140. <div class="chart-container">
  141. <trend-chart :option="monthRunRateOption" height="100%" />
  142. </div>
  143. </div>
  144. <!-- 月故障率趋势图 -->
  145. <div class="panel chart-panel">
  146. <div class="panel-title">
  147. <div class="panel-icon"></div>
  148. 月故障率趋势图
  149. </div>
  150. <div class="chart-container">
  151. <trend-chart :option="monthFaultRateOption" height="100%" />
  152. </div>
  153. </div>
  154. <!-- 月维修次数趋势图 -->
  155. <div class="panel chart-panel">
  156. <div class="panel-title">
  157. <div class="panel-icon"></div>
  158. 月维修次数趋势图
  159. </div>
  160. <div class="chart-container">
  161. <trend-chart :option="monthRepairCountOption" height="100%" />
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </vue-fullscreen>
  169. </template>
  170. <script>
  171. import * as echarts from 'echarts'
  172. import { component } from 'vue-fullscreen'
  173. import TrendChart from './components/TrendChart.vue'
  174. import StatCard from './components/StatCard.vue'
  175. import { deviceIndexStatistics } from '@/api/main/index.js'
  176. // 固定场站列表
  177. const FIXED_STATIONS = ['5#站', '6#站', '7#站']
  178. // 固定 12 个月份的 x 轴标签
  179. const MONTHS_12 = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
  180. // 获取当月所有天数(1日 ~ 28/29/30/31日)
  181. function getCurrentMonthDays() {
  182. const now = new Date()
  183. const daysInMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate()
  184. return Array.from({ length: daysInMonth }, (_, i) => (i + 1) + '日')
  185. }
  186. // 将 API 数据(dateTime="2026-05-15")格式化为当月日报图 xData + seriesConfig
  187. function formatDayTrendData(list, valueKey, colors) {
  188. const valueField = valueKey || 'rate'
  189. const DAYS = getCurrentMonthDays()
  190. const stationMap = {}
  191. list.forEach((item) => {
  192. const station = item.stationName
  193. const day = parseInt(item.dateTime.split('-')[2]) // "2026-05-15" → 15
  194. const dayLabel = DAYS[day - 1] // 15 → "15日"
  195. if (!stationMap[station]) stationMap[station] = {}
  196. stationMap[station][dayLabel] = item[valueField]
  197. })
  198. const seriesConfig = FIXED_STATIONS.map((name, idx) => ({
  199. name,
  200. data: DAYS.map((d) => stationMap[name]?.[d] ?? 0),
  201. color: colors[idx % colors.length]
  202. }))
  203. return { xData: DAYS, seriesConfig }
  204. }
  205. // 将 API 数据 [{stationName, dateTime, rate}] 格式化为 chart 所需的 xData(固定12月) + seriesConfig
  206. // 始终按 FIXED_STATIONS 顺序输出,无数据月份补 0
  207. function formatTrendData(list, valueKey, colors) {
  208. const valueField = valueKey || 'rate'
  209. const stationMap = {}
  210. list.forEach((item) => {
  211. const station = item.stationName
  212. const month = parseInt(item.dateTime.split('-')[1]) // "2026-05" → 5
  213. const monthLabel = MONTHS_12[month - 1] // 5 → "5月"
  214. if (!stationMap[station]) stationMap[station] = {}
  215. stationMap[station][monthLabel] = item[valueField]
  216. })
  217. const seriesConfig = FIXED_STATIONS.map((name, idx) => ({
  218. name,
  219. data: MONTHS_12.map((m) => stationMap[name]?.[m] ?? 0), // 缺月/缺站统一补 0
  220. color: colors[idx % colors.length]
  221. }))
  222. return { xData: MONTHS_12, seriesConfig }
  223. }
  224. const palette = ['#3b82f6', '#22d3ee', '#facc15', '#f87171', '#a78bfa', '#34d399']
  225. function makeMultiLineOption(xData, seriesConfig, unit) {
  226. const series = seriesConfig.map((item, idx) => {
  227. const color = item.color || palette[idx % palette.length]
  228. return {
  229. name: item.name,
  230. type: 'line',
  231. data: item.data,
  232. smooth: true,
  233. symbol: 'circle',
  234. symbolSize: 4,
  235. lineStyle: { width: 2, color: color },
  236. itemStyle: { color: color },
  237. areaStyle: {
  238. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  239. { offset: 0, color: color },
  240. { offset: 1, color: 'rgba(13,31,74,0.01)' }
  241. ]),
  242. opacity: 0.2
  243. }
  244. }
  245. })
  246. return {
  247. tooltip: {
  248. trigger: 'axis',
  249. backgroundColor: 'rgba(8,21,46,0.9)',
  250. borderColor: 'rgba(42,90,170,0.4)',
  251. textStyle: { color: '#fff', fontSize: 12 }
  252. },
  253. legend: {
  254. bottom: 0,
  255. textStyle: { color: '#8ba3c7', fontSize: 11 },
  256. itemWidth: 14,
  257. itemHeight: 8
  258. },
  259. grid: { left: '3%', right: '4%', bottom: '12%', top: '8%', containLabel: true },
  260. xAxis: {
  261. type: 'category',
  262. boundaryGap: false,
  263. data: xData,
  264. axisLine: { lineStyle: { color: '#4a6fa5' } },
  265. axisTick: { show: false },
  266. axisLabel: { color: '#8ba3c7', fontSize: 11 }
  267. },
  268. yAxis: {
  269. type: 'value',
  270. max: function (value) { return Math.ceil(value.max * 1.1) },
  271. axisLine: { show: false },
  272. axisTick: { show: false },
  273. axisLabel: { color: '#8ba3c7', fontSize: 11, formatter: '{value}' + unit },
  274. splitLine: { lineStyle: { color: 'rgba(74,111,165,0.2)', type: 'dashed' } }
  275. },
  276. series: series
  277. }
  278. }
  279. export default {
  280. name: 'DeviceDashboard',
  281. components: { VueFullscreen: component, TrendChart, StatCard },
  282. data() {
  283. return {
  284. isFullscreen: false,
  285. currentDate: '',
  286. currentTime: '',
  287. selectedStation: 'station-6',
  288. stationList: [
  289. { label: '5#场站', value: 'station-5' },
  290. { label: '6#场站', value: 'station-6' },
  291. { label: '7#场站', value: 'station-7' }
  292. ],
  293. statsCardList: [
  294. { label: '设备总数', value: 0, unit: '台', key: 'totalNum', bgimg: require('@/assets/pcs/runDevice.png'), valueColor: '#409EFF', icon: 'el-icon-monitor', iconColor: '#409EFF', iconBg: '#ecf5ff'},
  295. { label: '运行数', value: 0, unit: '台', key: 'runNum', bgimg: require('@/assets/pcs/successInfo.png'), valueColor: '#67C23A', icon: 'el-icon-play', iconColor: '#67C23A', iconBg: '#ecf5ff'},
  296. { label: '维修数', value: 0, unit: '台', key: 'malfunctionNum', bgimg: require('@/assets/pcs/faultDevice.png'), valueColor: '#E6A23C', icon: 'el-icon-maintenance', iconColor: '#E6A23C', iconBg: '#ecf5ff'},
  297. ],
  298. yearRunRateOption: {},
  299. monthRunRateOption: {},
  300. yearFaultRateOption: {},
  301. monthFaultRateOption: {},
  302. yearRepairCountOption: {},
  303. monthRepairCountOption: {}
  304. }
  305. },
  306. computed: {},
  307. mounted() {
  308. this.updateTime()
  309. this.initCharts()
  310. this.updateTimer = setInterval(this.updateTime, 1000)
  311. window.addEventListener('resize', this.handleResize)
  312. },
  313. beforeDestroy() {
  314. clearInterval(this.updateTimer)
  315. window.removeEventListener('resize', this.handleResize)
  316. },
  317. watch: {
  318. isFullscreen: {
  319. handler() {
  320. this.$nextTick(() => this.handleResize())
  321. }
  322. }
  323. },
  324. methods: {
  325. onFullscreen() {
  326. this.isFullscreen = !this.isFullscreen;
  327. },
  328. handleResize() {
  329. const { clientWidth, clientHeight } = document.documentElement
  330. const containers = document.getElementsByClassName('box-container')
  331. Array.from(containers).forEach((item) => {
  332. if (this.isFullscreen) {
  333. item.style.height = clientHeight + 'px'
  334. item.style.width = clientWidth + 'px'
  335. } else {
  336. item.style.height = clientHeight - 100 + 'px'
  337. item.style.width = clientWidth - 240 + 'px'
  338. }
  339. })
  340. this.$nextTick(() => {
  341. Object.values(this.$children).forEach(child => {
  342. child.chartInstance && child.chartInstance.resize()
  343. })
  344. })
  345. },
  346. updateTime() {
  347. const now = new Date()
  348. const y = now.getFullYear()
  349. const m = (now.getMonth() + 1)
  350. const d = now.getDate()
  351. this.currentDate = y + '-' + m + '-' + d
  352. this.currentTime =
  353. now.getHours().toString().padStart(2, '0') + ':' +
  354. now.getMinutes().toString().padStart(2, '0') + ':' +
  355. now.getSeconds().toString().padStart(2, '0')
  356. },
  357. async initCharts() {
  358. const res = await deviceIndexStatistics()
  359. console.log('res', res)
  360. this.statsCardList.forEach((item) => {
  361. item.value = res[item.key];
  362. });
  363. // ========== 年运行率趋势图 — nyxlList ==========
  364. if (res.nyxlList && res.nyxlList.length) {
  365. const { xData, seriesConfig } = formatTrendData(res.nyxlList, 'rate', palette)
  366. this.yearRunRateOption = makeMultiLineOption(xData, seriesConfig, '%')
  367. } else {
  368. this.yearRunRateOption = makeMultiLineOption(MONTHS_12, [
  369. { name: '暂无数据', data: new Array(12).fill(0), color: '#8ba3c7' }
  370. ], '%')
  371. }
  372. // ========== 月运行率趋势图 — ryxlList(X轴=当月天数)==========
  373. const daysOfMonth = getCurrentMonthDays()
  374. if (res.ryxlList && res.ryxlList.length) {
  375. const { xData: x2, seriesConfig: sc2 } = formatDayTrendData(res.ryxlList, 'rate', palette)
  376. this.monthRunRateOption = makeMultiLineOption(x2, sc2, '%')
  377. } else {
  378. this.monthRunRateOption = makeMultiLineOption(daysOfMonth, [
  379. { name: '暂无数据', data: new Array(daysOfMonth.length).fill(0), color: '#8ba3c7' }
  380. ], '%')
  381. }
  382. // ========== 年故障率趋势图 — ngzlList ==========
  383. if (res.ngzlList && res.ngzlList.length) {
  384. const { xData: x3, seriesConfig: sc3 } = formatTrendData(res.ngzlList, 'rate', ['#f87171', '#facc15', '#8ba3c7'])
  385. this.yearFaultRateOption = makeMultiLineOption(x3, sc3, '%')
  386. } else {
  387. this.yearFaultRateOption = makeMultiLineOption(MONTHS_12, [
  388. { name: '暂无数据', data: new Array(12).fill(0), color: '#8ba3c7' }
  389. ], '%')
  390. }
  391. // ========== 月故障率趋势图(暂用模拟,后续可接入其他数据源)==========
  392. if(res.rgzList && res.rgzList.length) {
  393. const { xData: x4, seriesConfig: sc4 } = formatDayTrendData(res.rgzList, 'rate', ['#f87171', '#facc15', '#8ba3c7'])
  394. this.monthFaultRateOption = makeMultiLineOption(x4, sc4, '%')
  395. } else {
  396. this.monthFaultRateOption = makeMultiLineOption(daysOfMonth, [
  397. { name: '暂无数据', data: new Array(daysOfMonth.length).fill(0), color: '#a78bfa' }
  398. ], '%')
  399. }
  400. // ========== 年维修次数趋势图 — ngzlList ==========
  401. if (res.ngzlList && res.ngzlList.length) {
  402. const { xData: x5, seriesConfig: sc5 } = formatTrendData(res.ngzlList, 'rate', ['#f87171', '#facc15', '#3b82f6'])
  403. this.yearRepairCountOption = makeMultiLineOption(x5, sc5, '%')
  404. } else {
  405. this.yearRepairCountOption = makeMultiLineOption(MONTHS_12, [
  406. { name: '暂无数据', data: new Array(12).fill(0), color: '#8ba3c7' }
  407. ], '%')
  408. }
  409. // ========== 月维修次数趋势图(暂用默认占位,X轴=当月天数)==========
  410. if(res.rgzList && res.rgzList.length) {
  411. const { xData: x6, seriesConfig: sc6 } = formatDayTrendData(res.rgzList, 'rate', ['#f87171', '#facc15', '#8ba3c7'])
  412. this.monthRepairCountOption = makeMultiLineOption(x6, sc6, '%')
  413. } else {
  414. this.monthRepairCountOption = makeMultiLineOption(daysOfMonth, [
  415. { name: '暂无数据', data: new Array(daysOfMonth.length).fill(0), color: '#a78bfa' }
  416. ], '%')
  417. }
  418. },
  419. }
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. .box-container {
  424. width: 100%;
  425. min-height: 100vh;
  426. .scroll-wrapper {
  427. width: 100%;
  428. min-height: 100vh;
  429. background:
  430. radial-gradient(ellipse at top, rgba(13, 45, 110, 0.3) 0%, transparent 50%),
  431. radial-gradient(ellipse at bottom, rgba(8, 25, 65, 0.5) 0%, transparent 50%),
  432. linear-gradient(180deg, #0a1630 0%, #0d1f4a 50%, #08152e 100%);
  433. font-family: 'Microsoft YaHei', sans-serif;
  434. display: flex;
  435. flex-direction: column;
  436. }
  437. .header-section {
  438. flex-shrink: 0;
  439. padding-top: 10px;
  440. }
  441. .box-header-scroll {
  442. height: 80px;
  443. background: url('~@/assets/pcs/header.png') no-repeat center top;
  444. background-size: 100% 100%;
  445. display: flex;
  446. // align-items: center;
  447. justify-content: center;
  448. padding: 0 20px;
  449. position: relative;
  450. padding-top: 10px;
  451. .logo {
  452. padding-top: 10px;
  453. position: absolute;
  454. left: 80px;
  455. ::v-deep .custom-select {
  456. .el-input__inner {
  457. background: #0d2960;
  458. border: 1px solid #1a4a8a;
  459. color: #fff;
  460. height: 36px;
  461. line-height: 36px;
  462. &::placeholder { color: #8ba3c7; }
  463. }
  464. .el-input__suffix .el-input__icon { color: #8ba3c7; }
  465. }
  466. }
  467. .header-center {
  468. .title {
  469. font-size: 28px;
  470. font-weight: bold;
  471. color: #fff;
  472. text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  473. letter-spacing: 4px;
  474. }
  475. }
  476. .time {
  477. position: absolute;
  478. right: 30px;
  479. display: flex;
  480. align-items: center;
  481. .time-display {
  482. display: flex;
  483. flex-direction: column;
  484. align-items: flex-end;
  485. .date-text {
  486. font-size: 14px;
  487. color: #8ba3c7;
  488. }
  489. .time-text {
  490. font-size: 20px;
  491. font-weight: bold;
  492. color: #fff;
  493. }
  494. }
  495. }
  496. }
  497. .stats {
  498. display: flex;
  499. padding: 10px 30px;
  500. justify-content: space-around;
  501. }
  502. .two-column-layout {
  503. display: flex;
  504. justify-content: space-between;
  505. flex: 1;
  506. min-height: 0;
  507. padding: 0 20px 20px 20px;
  508. background: url('~@/assets/pcs/back.png') no-repeat center top;
  509. background-size: 100% 100%;
  510. font-size: 0;
  511. margin-top: 10px;
  512. .left-section,
  513. .right-section {
  514. display: inline-flex;
  515. flex-direction: column;
  516. gap: 15px;
  517. flex: 1;
  518. min-height: 0;
  519. font-size: 14px;
  520. white-space: normal;
  521. margin-right: 20px;
  522. &:last-child { margin-right: 0; }
  523. }
  524. }
  525. .panel {
  526. padding: 15px;
  527. min-height: 0;
  528. .panel-title {
  529. font-size: 18px;
  530. font-family: 'YouSheBiaoTiHei', 'Microsoft YaHei', sans-serif;
  531. color: #fff;
  532. margin-bottom: 15px;
  533. height: 42px;
  534. padding-left: 40px;
  535. position: relative;
  536. display: flex;
  537. align-items: center;
  538. background: url('~@/assets/pcs/titleb.png') no-repeat center top;
  539. background-size: 100% 100%;
  540. .panel-icon {
  541. position: absolute;
  542. left: 15px;
  543. width: 20px;
  544. height: 25px;
  545. background: url('~@/assets/pcs/titleIcon.png') no-repeat center top;
  546. background-size: 100% 100%;
  547. }
  548. }
  549. }
  550. .data-panel {
  551. flex: 0.6;
  552. min-height: 200px;
  553. .data-grid {
  554. display: flex;
  555. gap: 12px;
  556. flex-wrap: wrap;
  557. align-items: center;
  558. justify-content: space-between;
  559. height: calc(100% - 50px);
  560. .data-item {
  561. display: flex;
  562. align-items: center;
  563. padding-left: 15px;
  564. width: 21%;
  565. height: 60px;
  566. background: url('~@/assets/pcs/leftItem.png') no-repeat center top;
  567. background-size: 100% 100%;
  568. .img {
  569. width: 35px;
  570. height: 35px;
  571. background: url('~@/assets/pcs/icon.png') no-repeat center top;
  572. background-size: 100% 100%;
  573. }
  574. .data-item_value {
  575. display: flex;
  576. flex-direction: column;
  577. margin-left: 10px;
  578. }
  579. .data-label {
  580. font-size: 12px;
  581. color: #8ba3c7;
  582. }
  583. .data-value {
  584. font-size: 18px;
  585. font-weight: bold;
  586. color: #b6ceff;
  587. text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  588. }
  589. }
  590. }
  591. }
  592. .chart-panel {
  593. flex: 1;
  594. min-height: 250px;
  595. display: flex;
  596. flex-direction: column;
  597. .chart-container {
  598. width: 100%;
  599. flex: 1;
  600. min-height: 0;
  601. }
  602. }
  603. .alert-panel {
  604. flex: 0.6;
  605. min-height: 220px;
  606. display: flex;
  607. flex-direction: column;
  608. .alert-stats {
  609. flex: 1;
  610. display: flex;
  611. align-items: center;
  612. height: calc(100% - 50px);
  613. .alert-cards {
  614. width: 50%;
  615. height: 100%;
  616. display: flex;
  617. flex-wrap: wrap;
  618. justify-content: space-around;
  619. align-items: center;
  620. .alert-card-item {
  621. width: 42%;
  622. height: 28%;
  623. display: flex;
  624. align-items: center;
  625. padding-left: 15px;
  626. background: url('~@/assets/pcs/leftItem.png') no-repeat center top;
  627. background-size: 100% 100%;
  628. .img {
  629. width: 28px;
  630. height: 28px;
  631. background: url('~@/assets/pcs/icon.png') no-repeat center top;
  632. background-size: 100% 100%;
  633. }
  634. .data-item_value {
  635. display: flex;
  636. flex-direction: column;
  637. margin-left: 10px;
  638. }
  639. .data-label {
  640. font-size: 11px;
  641. color: #8ba3c7;
  642. }
  643. .data-value {
  644. font-size: 16px;
  645. font-weight: bold;
  646. color: #b6ceff;
  647. text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  648. small { font-size: 10px; color: #8ba3c7; margin-left: 2px; }
  649. }
  650. }
  651. }
  652. .alert-pie-chart {
  653. width: 50%;
  654. height: 100%;
  655. display: flex;
  656. align-items: center;
  657. justify-content: center;
  658. .alert-pie {
  659. width: 100%;
  660. height: 100%;
  661. min-height: 180px;
  662. }
  663. }
  664. }
  665. }
  666. }
  667. // .stat-cards-section {
  668. // display: flex;
  669. // gap: 20px;
  670. // padding: 0 20px 10px 20px;
  671. // flex-shrink: 0;
  672. // .stat-card {
  673. // flex: 1;
  674. // height: 100px;
  675. // background: linear-gradient(135deg, rgba(16, 42, 88, 0.9) 0%, rgba(10, 28, 65, 0.85) 100%);
  676. // border: 1px solid rgba(42, 90, 170, 0.4);
  677. // border-radius: 8px;
  678. // display: flex;
  679. // align-items: center;
  680. // padding: 0 24px;
  681. // position: relative;
  682. // overflow: hidden;
  683. // &::before {
  684. // content: '';
  685. // position: absolute;
  686. // top: 0; left: 0; right: 0;
  687. // height: 2px;
  688. // background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  689. // box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  690. // }
  691. // &.blue {
  692. // .stat-icon {
  693. // background: linear-gradient(135deg, #3b82f6, #2563eb);
  694. // box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  695. // }
  696. // .stat-value .num { color: #3b82f6; }
  697. // }
  698. // &.green {
  699. // .stat-icon {
  700. // background: linear-gradient(135deg, #22c55e, #16a34a);
  701. // box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
  702. // }
  703. // .stat-value .num { color: #22c55e; }
  704. // }
  705. // &.red {
  706. // .stat-icon {
  707. // background: linear-gradient(135deg, #ef4444, #dc2626);
  708. // box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  709. // }
  710. // .stat-value .num { color: #ef4444; }
  711. // }
  712. // .stat-icon {
  713. // width: 56px;
  714. // height: 56px;
  715. // border-radius: 50%;
  716. // display: flex;
  717. // align-items: center;
  718. // justify-content: center;
  719. // flex-shrink: 0;
  720. // i {
  721. // font-size: 24px;
  722. // color: #fff;
  723. // }
  724. // }
  725. // .stat-label {
  726. // flex: 1;
  727. // font-size: 16px;
  728. // color: #8ba3c7;
  729. // padding: 0 20px;
  730. // text-align: center;
  731. // }
  732. // .stat-value {
  733. // display: flex;
  734. // align-items: baseline;
  735. // .num {
  736. // font-size: 36px;
  737. // font-weight: 700;
  738. // text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  739. // }
  740. // .unit {
  741. // font-size: 14px;
  742. // color: #8ba3c7;
  743. // margin-left: 4px;
  744. // }
  745. // }
  746. // }
  747. // }
  748. .fullscreen-toggle {
  749. cursor: pointer;
  750. font-size: 20px;
  751. color: #8ba3c7;
  752. transition: color 0.3s;
  753. margin-left: 10px;
  754. &:hover {
  755. color: #3b82f6;
  756. }
  757. }
  758. [v-cloak] { display: none; }
  759. </style>