factoryProductionDashboard.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773
  1. <template>
  2. <vue-fullscreen
  3. class="fp-container"
  4. v-cloak
  5. v-model="isFullscreen"
  6. fullscreenClass="fp-container"
  7. :exit-on-click-wrapper="false"
  8. >
  9. <div class="fp-container" v-cloak>
  10. <div class="fp-header">
  11. <div class="fp-header-left">
  12. <el-select
  13. v-model="factoryId"
  14. size="mini"
  15. class="fp-select"
  16. placeholder="工厂名称"
  17. >
  18. <el-option
  19. v-for="f in factoryList"
  20. :key="f.id"
  21. :label="f.name"
  22. :value="f.id"
  23. />
  24. </el-select>
  25. <el-date-picker
  26. v-model="dateRange"
  27. class="fp-date"
  28. size="mini"
  29. type="daterange"
  30. range-separator="-"
  31. start-placeholder="开始日期"
  32. end-placeholder="结束日期"
  33. value-format="yyyy-MM-dd"
  34. />
  35. </div>
  36. <div class="fp-title">工厂生产综合看板</div>
  37. <div class="fp-header-right">
  38. <div class="fp-time">
  39. <span class="fp-date-text">{{ date }}</span>
  40. <span class="fp-time-text">{{ time }}</span>
  41. <span class="fp-week-text">{{ week }}</span>
  42. </div>
  43. <span class="fp-fullscreen-toggle" @click.passive="onFullscreen">
  44. <i
  45. v-if="isFullscreen"
  46. title="取消全屏"
  47. class="el-icon-_screen-restore"
  48. ></i>
  49. <i v-else title="全屏" class="el-icon-_screen-full"></i>
  50. </span>
  51. </div>
  52. </div>
  53. <div class="fp-body">
  54. <!-- Left -->
  55. <div class="fp-col fp-col-left">
  56. <chart-card title="生产统计" size="small">
  57. <div class="fp-number-card">
  58. <div class="fp-number-display">
  59. <div class="fp-unit-box">
  60. <span class="fp-unit">十万</span>
  61. <div class="fp-digit-box">
  62. <span class="fp-digit">{{
  63. productionStats.transformQuantity[0]
  64. }}</span>
  65. </div>
  66. </div>
  67. <div class="fp-unit-box">
  68. <span class="fp-unit">万</span>
  69. <div class="fp-digit-box">
  70. <span class="fp-digit">{{
  71. productionStats.transformQuantity[1]
  72. }}</span>
  73. </div>
  74. </div>
  75. <div class="fp-unit-box">
  76. <span class="fp-unit">千</span>
  77. <div class="fp-digit-box">
  78. <span class="fp-digit">{{
  79. productionStats.transformQuantity[2]
  80. }}</span>
  81. </div>
  82. </div>
  83. <div class="fp-separator">,</div>
  84. <div class="fp-unit-box">
  85. <span class="fp-unit"></span>
  86. <div class="fp-digit-box">
  87. <span class="fp-digit">{{
  88. productionStats.transformQuantity[3]
  89. }}</span>
  90. </div>
  91. </div>
  92. <div class="fp-unit-box">
  93. <span class="fp-unit"></span>
  94. <div class="fp-digit-box">
  95. <span class="fp-digit">{{
  96. productionStats.transformQuantity[4]
  97. }}</span>
  98. </div>
  99. </div>
  100. <div class="fp-unit-box">
  101. <span class="fp-unit"></span>
  102. <div class="fp-digit-box">
  103. <span class="fp-digit">{{
  104. productionStats.transformQuantity[5]
  105. }}</span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="fp-mini-stats">
  110. <div class="fp-mini-stat">
  111. <div class="fp-mini-icon">
  112. <img src="@/assets/png/Group.png" alt="" />
  113. </div>
  114. <div class="fp-mini-info">
  115. <div class="fp-mini-label">要求生产总数量:</div>
  116. <div class="fp-mini-value">{{
  117. productionStats.requiredTotal
  118. }}</div>
  119. </div>
  120. </div>
  121. <div class="fp-mini-stat">
  122. <div class="fp-mini-icon">
  123. <img src="@/assets/png/Group.png" alt="" />
  124. </div>
  125. <div class="fp-mini-info">
  126. <div class="fp-mini-label">生产达成率:</div>
  127. <div class="fp-mini-value"
  128. >{{ productionStats.achievementRate }}%</div
  129. >
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </chart-card>
  135. <chart-card title="五品" size="small">
  136. <div class="fp-chart-box">
  137. <device-status-chart
  138. v-if="isFlag"
  139. :data="fiveCategoryData"
  140. class="fp-chart-fill"
  141. />
  142. </div>
  143. </chart-card>
  144. <chart-card title="四数" size="small">
  145. <div class="fp-chart-box">
  146. <Bar3DChart
  147. v-if="isFlag"
  148. :data="fourNumberBarData"
  149. :colors="['#1163fb', '#1163fb', '#1163fb', '#1163fb']"
  150. :show-label="true"
  151. class="fp-chart-fill"
  152. />
  153. </div>
  154. </chart-card>
  155. </div>
  156. <!-- Middle -->
  157. <div class="fp-col fp-col-middle">
  158. <div class="fp-middle-top">
  159. <div class="fp-middle-title">
  160. <img class="fp-title-icon" src="@/assets/png/icon.png" alt="" />
  161. <span>生产情况</span>
  162. </div>
  163. <div class="fp-kpis">
  164. <div class="fp-kpi">
  165. <div class="fp-kpi-screen">
  166. <div class="fp-kpi-value fp-kpi-glow">{{
  167. productionKpi.delayedCount
  168. }}</div>
  169. </div>
  170. <div class="fp-kpi-base"></div>
  171. <div class="fp-kpi-label">已延期生产计划数</div>
  172. </div>
  173. <div class="fp-kpi">
  174. <div class="fp-kpi-screen">
  175. <div class="fp-kpi-value fp-kpi-glow"
  176. >{{ productionKpi.planAchievementRate }}%</div
  177. >
  178. </div>
  179. <div class="fp-kpi-base"></div>
  180. <div class="fp-kpi-label">计划达成率</div>
  181. </div>
  182. <div class="fp-kpi">
  183. <div class="fp-kpi-screen">
  184. <div class="fp-kpi-value fp-kpi-glow">{{
  185. productionKpi.unpublishedCount
  186. }}</div>
  187. </div>
  188. <div class="fp-kpi-base"></div>
  189. <div class="fp-kpi-label">未发布计划数</div>
  190. </div>
  191. </div>
  192. <div class="fp-middle-note"
  193. >注:生产计划完成率=已完成生产计划数/所有生产计划数</div
  194. >
  195. </div>
  196. <chart-card title="生产计划进度" size="large">
  197. <div class="fp-table-wrap">
  198. <div class="fp-table-tabs">
  199. <div
  200. v-for="t in planTabs"
  201. :key="t.key"
  202. class="fp-tab"
  203. :class="{ active: activePlanTab === t.key }"
  204. @click="activePlanTab = t.key"
  205. >
  206. {{ t.label }}
  207. </div>
  208. </div>
  209. <div class="fp-table">
  210. <table class="fp-main-table">
  211. <colgroup>
  212. <col style="width: 11%" />
  213. <col style="width: 15%" />
  214. <col style="width: 10%" />
  215. <col style="width: 9%" />
  216. <col style="width: 11%" />
  217. <col style="width: 15%" />
  218. <col style="width: 15%" />
  219. <col style="width: 14%" />
  220. </colgroup>
  221. <thead>
  222. <tr>
  223. <th>计划编号</th>
  224. <th>产品名称</th>
  225. <th>批次号</th>
  226. <th>计划数量</th>
  227. <th>工艺路线</th>
  228. <th>计划开始时间</th>
  229. <th>计划结束时间</th>
  230. <th>计划状态</th>
  231. </tr>
  232. </thead>
  233. </table>
  234. <div class="fp-scroll-body">
  235. <table class="fp-main-table">
  236. <colgroup>
  237. <col style="width: 11%" />
  238. <col style="width: 15%" />
  239. <col style="width: 10%" />
  240. <col style="width: 9%" />
  241. <col style="width: 11%" />
  242. <col style="width: 15%" />
  243. <col style="width: 15%" />
  244. <col style="width: 14%" />
  245. </colgroup>
  246. <tbody>
  247. <tr
  248. v-for="row in filteredPlanRows"
  249. :key="row.planNo"
  250. class="fp-row"
  251. :style="{
  252. backgroundColor: row.isDelayed ? '#ff4d4f' : '#031d42'
  253. }"
  254. >
  255. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  256. row.planNo
  257. }}</td>
  258. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  259. row.productName
  260. }}</td>
  261. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  262. row.batchNo
  263. }}</td>
  264. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  265. row.planQty
  266. }}</td>
  267. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  268. row.currentProcess
  269. }}</td>
  270. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  271. row.planStart
  272. }}</td>
  273. <td class="fp-cell" @mouseenter="syncOverflowTitle">{{
  274. row.planEnd
  275. }}</td>
  276. <td class="fp-cell" @mouseenter="syncOverflowTitle">
  277. <span
  278. :class="
  279. row.isDelayed ? 'fp-status-red' : 'fp-status-blue'
  280. "
  281. >
  282. {{ row.statusText }}
  283. </span>
  284. </td>
  285. </tr>
  286. <tr v-if="filteredPlanRows.length === 0">
  287. <td class="fp-empty" colspan="8">暂无生产计划数据</td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. </div>
  292. </div>
  293. </div>
  294. </chart-card>
  295. </div>
  296. <!-- Right -->
  297. <div class="fp-col fp-col-right">
  298. <div class="fp-inventory-card chart-card">
  299. <div class="card-header fp-inventory-header">
  300. <div class="card-logo">
  301. <img :src="inventoryIcon" alt="" />
  302. </div>
  303. <div class="card-title">库存台账</div>
  304. <div class="fp-inventory-filters">
  305. <span
  306. class="fp-filter-btn"
  307. :class="{ active: activeInventoryFilter === 'category' }"
  308. @click="setInventoryFilter('category')"
  309. >
  310. 分类维度
  311. </span>
  312. <span
  313. class="fp-filter-btn"
  314. :class="{ active: activeInventoryFilter === 'keeper' }"
  315. @click="setInventoryFilter('keeper')"
  316. >
  317. 仓管
  318. </span>
  319. <i class="el-icon-setting fp-filter-icon"></i>
  320. </div>
  321. </div>
  322. <div class="fp-chart-box card-content">
  323. <Bar3DChart
  324. v-if="isFlag"
  325. :data="inventoryLedgerDisplayData"
  326. :colors="inventoryBarColors"
  327. :show-label="true"
  328. :bar-size="[10, 6]"
  329. class="fp-chart-fill"
  330. />
  331. </div>
  332. </div>
  333. <chart-card title="各类型设备台账" size="small">
  334. <div class="fp-chart-box">
  335. <bar-line-combo-chart
  336. v-if="isFlag"
  337. :categories="deviceLedger.categories"
  338. :bar-data="deviceLedger.barData"
  339. :top-bar-data="deviceLedger.topBarData"
  340. :line-data="deviceLedger.lineData"
  341. bar-name="占用数"
  342. top-bar-name="总数量"
  343. line-name="占比"
  344. :show-bar-label="false"
  345. :show-line-label="false"
  346. :show-legend="false"
  347. :bar-colors="['#1163fb', '#1163fb', '#1163fb', '#1163fb']"
  348. top-bar-color="#f9bb19"
  349. class="fp-chart-fill"
  350. />
  351. </div>
  352. </chart-card>
  353. <chart-card title="质量统计" size="small">
  354. <div class="fp-quality">
  355. <div class="fp-quality-top">
  356. <div class="fp-quality-item">
  357. <div class="fp-quality-label">合格率</div>
  358. <div class="fp-quality-value good"
  359. >{{ quality.passRate }}%</div
  360. >
  361. </div>
  362. <div class="fp-quality-item">
  363. <div class="fp-quality-label">不合格率</div>
  364. <div class="fp-quality-value bad"
  365. >{{ quality.failRate }}%</div
  366. >
  367. </div>
  368. <div class="fp-quality-item">
  369. <div class="fp-quality-label">损耗率</div>
  370. <div class="fp-quality-value warn"
  371. >{{ quality.lossRate }}%</div
  372. >
  373. </div>
  374. </div>
  375. <div class="fp-quality-bars">
  376. <div class="fp-qbar">
  377. <div class="fp-qbar-name">合格率</div>
  378. <div class="fp-qbar-track">
  379. <div
  380. class="fp-qbar-fill good"
  381. :style="{ width: quality.passRate + '%' }"
  382. ></div>
  383. </div>
  384. </div>
  385. <div class="fp-qbar">
  386. <div class="fp-qbar-name">不合格率</div>
  387. <div class="fp-qbar-track">
  388. <div
  389. class="fp-qbar-fill bad"
  390. :style="{ width: quality.failRate + '%' }"
  391. ></div>
  392. </div>
  393. </div>
  394. <div class="fp-qbar">
  395. <div class="fp-qbar-name">损耗率</div>
  396. <div class="fp-qbar-track">
  397. <div
  398. class="fp-qbar-fill warn"
  399. :style="{ width: quality.lossRate + '%' }"
  400. ></div>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. </chart-card>
  406. </div>
  407. </div>
  408. </div>
  409. </vue-fullscreen>
  410. </template>
  411. <script>
  412. import { component as VueFullscreen } from 'vue-fullscreen';
  413. import ChartCard from './components/ChartCard';
  414. import BarChart from './components/charts/BarChart';
  415. import Bar3DChart from './components/charts/Bar3DChart';
  416. import DeviceStatusChart from './components/charts/DeviceStatusChart';
  417. import BarLineComboChart from './components/charts/BarLineComboChart';
  418. import {
  419. getFactoryProductionDashboardData,
  420. getFactoryProductionDataByPlan,
  421. getFactoryProductionDataByStock,
  422. getFactoryProductionDataByDevice,
  423. getFactoryListByUser
  424. } from '@/api/vis/factoryProductionDashboard';
  425. const inventoryIcon = require('@/assets/png/icon.png');
  426. export default {
  427. name: 'FactoryProductionDashboard',
  428. components: {
  429. VueFullscreen,
  430. ChartCard,
  431. BarChart,
  432. Bar3DChart,
  433. DeviceStatusChart,
  434. BarLineComboChart
  435. },
  436. computed: {
  437. contentWidth() {
  438. return this.$store.state.theme.contentWidth || '100%';
  439. },
  440. inventoryLedgerDisplayData() {
  441. return this.activeInventoryFilter === 'keeper'
  442. ? this.inventoryLedgerKeeperData
  443. : this.inventoryLedgerData;
  444. },
  445. inventoryBarColors() {
  446. return (this.inventoryLedgerDisplayData || []).map(() => '#1163fb');
  447. },
  448. filteredPlanRows() {
  449. if (this.activePlanTab === 'all') return this.planRows;
  450. return this.planRows.filter((r) => r.type === this.activePlanTab);
  451. }
  452. },
  453. watch: {
  454. isFullscreen: {
  455. handler(val) {
  456. this.isFlag = false;
  457. this.$nextTick(() => {
  458. const delay = this._initLayout ? 160 : 0;
  459. this._initLayout = true;
  460. const run = () => {
  461. this.applyScreenSize();
  462. this.$nextTick(() => {
  463. this.isFlag = true;
  464. this.triggerChartResize();
  465. });
  466. };
  467. delay ? setTimeout(run, delay) : run();
  468. });
  469. },
  470. immediate: true
  471. },
  472. contentWidth: {
  473. handler() {
  474. clearTimeout(this.resizeTimer);
  475. this.isFlag = false;
  476. this.resizeTimer = setTimeout(() => {
  477. this.$nextTick(() => {
  478. this.applyScreenSize();
  479. this.isFlag = true;
  480. });
  481. }, 300);
  482. },
  483. immediate: true
  484. },
  485. factoryId() {
  486. this.loadDashboardData();
  487. },
  488. dateRange: {
  489. handler() {
  490. this.loadDashboardData();
  491. },
  492. deep: true
  493. },
  494. activePlanTab() {
  495. this.fetchPlanData();
  496. },
  497. activeInventoryFilter() {
  498. this.fetchInventoryData();
  499. }
  500. },
  501. data() {
  502. return {
  503. isFullscreen: false,
  504. isFlag: false,
  505. _initLayout: false,
  506. resizeTimer: null,
  507. updateTimer: null,
  508. date: '',
  509. time: '',
  510. week: '',
  511. inventoryIcon,
  512. factoryId: '',
  513. factoryList: [],
  514. dateRange: [],
  515. productionStats: {
  516. quantity: 0,
  517. transformQuantity: [0, 0, 0, 0, 0, 0],
  518. requiredTotal: 0,
  519. achievementRate: 0
  520. },
  521. productionKpi: {
  522. delayedCount: 0,
  523. planAchievementRate: 0,
  524. unpublishedCount: 0
  525. },
  526. fiveCategoryData: [
  527. { name: '成品', value: 0 },
  528. { name: '半成品', value: 0 },
  529. { name: '在制品', value: 0 },
  530. { name: '废品', value: 0 },
  531. { name: '返修品', value: 0 }
  532. ],
  533. fourNumberBarData: [
  534. { name: '投入数', value: 0 },
  535. { name: '产出数', value: 0 },
  536. { name: '废品数', value: 0 },
  537. { name: '周转数', value: 0 }
  538. ],
  539. inventoryLedgerData: [],
  540. inventoryLedgerKeeperData: [],
  541. activeInventoryFilter: 'category',
  542. deviceLedger: {
  543. categories: [],
  544. barData: [],
  545. topBarData: [],
  546. lineData: []
  547. },
  548. quality: {
  549. passRate: 0,
  550. failRate: 0,
  551. lossRate: 0
  552. },
  553. planTabs: [
  554. { key: 'all', label: '全部' },
  555. { key: 'monthly', label: '月度滚动计划' },
  556. { key: 'temporary', label: '临时生产计划' },
  557. { key: 'research', label: '分厂临时计划' }
  558. ],
  559. activePlanTab: 'all',
  560. planRows: []
  561. };
  562. },
  563. created() {
  564. this.updateTime();
  565. this.updateTimer = setInterval(this.updateTime, 1000);
  566. const now = new Date();
  567. const today = this.formatDate(now);
  568. this.dateRange = [today, today];
  569. this.getFactoryListByData();
  570. },
  571. mounted() {
  572. this.applyScreenSize();
  573. window.addEventListener('resize', this.handleWindowResize);
  574. document.addEventListener(
  575. 'fullscreenchange',
  576. this.handleFullscreenChange
  577. );
  578. document.addEventListener(
  579. 'webkitfullscreenchange',
  580. this.handleFullscreenChange
  581. );
  582. this.$nextTick(() => {
  583. this.isFlag = true;
  584. });
  585. },
  586. beforeDestroy() {
  587. clearInterval(this.updateTimer);
  588. clearTimeout(this.resizeTimer);
  589. window.removeEventListener('resize', this.handleWindowResize);
  590. document.removeEventListener(
  591. 'fullscreenchange',
  592. this.handleFullscreenChange
  593. );
  594. document.removeEventListener(
  595. 'webkitfullscreenchange',
  596. this.handleFullscreenChange
  597. );
  598. },
  599. methods: {
  600. handleWindowResize() {
  601. clearTimeout(this.resizeTimer);
  602. this.resizeTimer = setTimeout(() => {
  603. this.applyScreenSize();
  604. }, 120);
  605. },
  606. syncOverflowTitle(event) {
  607. const el = event?.currentTarget;
  608. if (!el) return;
  609. const text = (el.innerText || '').trim();
  610. const isOverflowing = el.scrollWidth > el.clientWidth;
  611. el.title = isOverflowing ? text : '';
  612. },
  613. handleFullscreenChange() {
  614. this.isFlag = false;
  615. this.$nextTick(() => {
  616. setTimeout(() => {
  617. this.applyScreenSize();
  618. this.$nextTick(() => {
  619. this.isFlag = true;
  620. this.triggerChartResize();
  621. });
  622. }, 150);
  623. });
  624. },
  625. async getFactoryListByData() {
  626. const par = {
  627. type: 1,
  628. size: 9999
  629. };
  630. await getFactoryListByUser(par).then((res) => {
  631. if (res.list && res.list.length > 0) {
  632. this.factoryList = res.list.map((el) => {
  633. return {
  634. id: el.id,
  635. name: el.name
  636. };
  637. });
  638. }
  639. });
  640. this.factoryId = this.factoryList.length ? this.factoryList[0].id : '';
  641. },
  642. triggerChartResize() {
  643. this.$nextTick(() => {
  644. window.dispatchEvent(new Event('resize'));
  645. });
  646. },
  647. applyScreenSize() {
  648. const isFs = !!(
  649. document.fullscreenElement || document.webkitFullscreenElement
  650. );
  651. let deviceWidth;
  652. let deviceHeight;
  653. if (isFs) {
  654. deviceWidth =
  655. window.innerWidth || document.documentElement.clientWidth;
  656. deviceHeight =
  657. window.innerHeight || document.documentElement.clientHeight;
  658. } else {
  659. deviceWidth = document.documentElement.clientWidth;
  660. deviceHeight = document.documentElement.clientHeight;
  661. }
  662. const eleAdminHeaderHeight =
  663. (!isFs &&
  664. document.getElementsByClassName('ele-admin-header')[0]
  665. ?.offsetHeight) ||
  666. 0;
  667. const eleAdminSidebarWidth =
  668. (!isFs &&
  669. document.getElementsByClassName('ele-admin-sidebar')[0]
  670. ?.offsetWidth) ||
  671. 0;
  672. const eleAdminTabsHeight =
  673. (!isFs &&
  674. document.getElementsByClassName('ele-admin-tabs')[0]
  675. ?.offsetHeight) ||
  676. 0;
  677. const h = isFs
  678. ? deviceHeight
  679. : deviceHeight - eleAdminHeaderHeight - eleAdminTabsHeight;
  680. const w = isFs ? deviceWidth : deviceWidth - eleAdminSidebarWidth;
  681. const setContainerSize = (item) => {
  682. item.style.height = h + 'px';
  683. item.style.width = w + 'px';
  684. };
  685. const containers = [...document.getElementsByClassName('fp-container')];
  686. containers.forEach(setContainerSize);
  687. document.documentElement.style.fontSize = isFs ? '24px' : '16px';
  688. },
  689. onFullscreen() {
  690. this.isFullscreen = !this.isFullscreen;
  691. },
  692. setInventoryFilter(type) {
  693. if (this.activeInventoryFilter === type) return;
  694. this.activeInventoryFilter = type;
  695. },
  696. updateTime() {
  697. const now = new Date();
  698. const pad = (n) => n.toString().padStart(2, '0');
  699. this.time = `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(
  700. now.getSeconds()
  701. )}`;
  702. this.date = `${now.getFullYear()}年${
  703. now.getMonth() + 1
  704. }月${now.getDate()}日`;
  705. const weekMap = {
  706. 0: '日',
  707. 1: '一',
  708. 2: '二',
  709. 3: '三',
  710. 4: '四',
  711. 5: '五',
  712. 6: '六'
  713. };
  714. this.week = `星期${weekMap[now.getDay()]}`;
  715. },
  716. formatDate(d) {
  717. const pad = (n) => n.toString().padStart(2, '0');
  718. return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(
  719. d.getDate()
  720. )}`;
  721. },
  722. formatNumber6(num) {
  723. const paddedStr = String(num ?? 0).padStart(6, '0');
  724. return paddedStr.split('').map((c) => Number(c));
  725. },
  726. normalizeNumber(value) {
  727. const num = Number(value);
  728. return Number.isFinite(num) ? num : 0;
  729. },
  730. normalizePercent(value) {
  731. if (value === null || value === undefined || value === '') return 0;
  732. const text = String(value).replace('%', '').trim();
  733. const num = Number(text);
  734. return Number.isFinite(num) ? Number(num.toFixed(2)) : 0;
  735. },
  736. normalizeNameValueList(list) {
  737. if (!Array.isArray(list)) return [];
  738. return list.map((item) => ({
  739. name: item?.name || '--',
  740. value: this.normalizeNumber(item?.value)
  741. }));
  742. },
  743. getBaseParams(extra = {}) {
  744. if (!this.factoryId) return null;
  745. const [rangeStart, rangeEnd] = this.dateRange || [];
  746. const today = this.formatDate(new Date());
  747. const startTime = rangeStart || today;
  748. const endTime = rangeEnd || startTime;
  749. return {
  750. factoryId: this.factoryId,
  751. startTime,
  752. endTime,
  753. ...extra
  754. };
  755. },
  756. getInventoryStockType(filterType = this.activeInventoryFilter) {
  757. return filterType === 'keeper' ? 2 : 1;
  758. },
  759. mapPlanTabType(tab = this.activePlanTab) {
  760. const tabTypeMap = {
  761. all: 0,
  762. monthly: 1,
  763. temporary: 2,
  764. research: 3
  765. };
  766. return tabTypeMap[tab] ?? 0;
  767. },
  768. mapPlanStatus(status) {
  769. const statusMap = {
  770. 1: '待排产',
  771. 2: '待发布',
  772. 3: '发布失败',
  773. 4: '待生产',
  774. 5: '进行中',
  775. 6: '已完成',
  776. 7: '延期',
  777. 8: '待下达'
  778. };
  779. return statusMap[Number(status)] || '--';
  780. },
  781. formatPlanDate(value) {
  782. if (!value) return '--';
  783. const text = String(value).replace('T', ' ');
  784. return text.slice(0, 10);
  785. },
  786. mapPlanRow(row, planTab = this.activePlanTab) {
  787. const status = Number(row?.status || 0);
  788. return {
  789. planNo: row?.code || '--',
  790. productName: row?.productName || '--',
  791. batchNo: row?.batchNo || '--',
  792. planQty: this.normalizeNumber(row?.planQuantity),
  793. currentProcess: row?.produceRoutingName || '--',
  794. planStart: this.formatPlanDate(row?.plannedStartTime),
  795. planEnd: this.formatPlanDate(row?.plannedEndTime),
  796. isDelayed: status === 7,
  797. statusText: this.mapPlanStatus(status),
  798. type: planTab
  799. };
  800. },
  801. buildDeviceLedger(list) {
  802. const normalized = Array.isArray(list)
  803. ? list.map((item) => {
  804. const total = this.normalizeNumber(item?.value);
  805. const occupied = this.normalizeNumber(
  806. item?.value2 !== undefined ? item?.value2 : item?.value
  807. );
  808. return {
  809. name: item?.name || '--',
  810. total,
  811. occupied
  812. };
  813. })
  814. : [];
  815. return {
  816. categories: normalized.map((item) => item.name),
  817. barData: normalized.map((item) => item.occupied),
  818. topBarData: normalized.map((item) => item.total),
  819. lineData: normalized.map((item) =>
  820. item.total
  821. ? Number(((item.occupied / item.total) * 100).toFixed(2))
  822. : 0
  823. )
  824. };
  825. },
  826. applyDashboardSummary(data = {}) {
  827. const quantity = this.normalizeNumber(data?.quantity);
  828. this.productionStats.quantity = quantity;
  829. this.productionStats.transformQuantity = this.formatNumber6(quantity);
  830. this.productionStats.requiredTotal = this.normalizeNumber(
  831. data?.totalQuantity
  832. );
  833. this.productionStats.achievementRate = this.normalizePercent(
  834. data?.quantityAchievementRate
  835. );
  836. this.productionKpi.delayedCount = this.normalizeNumber(data?.delayNumber);
  837. this.productionKpi.planAchievementRate = this.normalizePercent(
  838. data?.achievementRate
  839. );
  840. this.productionKpi.unpublishedCount = this.normalizeNumber(
  841. data?.numberToBeProduced
  842. );
  843. this.fiveCategoryData = [
  844. {
  845. name: '成品',
  846. value: this.normalizeNumber(data?.finishedProductQuantity)
  847. },
  848. {
  849. name: '半成品',
  850. value: this.normalizeNumber(data?.semiFinishedProductQuantity)
  851. },
  852. {
  853. name: '在制品',
  854. value: this.normalizeNumber(data?.workInProgressQuantity)
  855. },
  856. {
  857. name: '废品',
  858. value: this.normalizeNumber(data?.scrapProductQuantity)
  859. },
  860. {
  861. name: '返修品',
  862. value: this.normalizeNumber(data?.reworkProductQuantity)
  863. }
  864. ];
  865. this.fourNumberBarData = [
  866. { name: '投入数', value: this.normalizeNumber(data?.inputQuantity) },
  867. { name: '产出数', value: this.normalizeNumber(data?.outputQuantity) },
  868. { name: '废品数', value: this.normalizeNumber(data?.scrapQuantity) },
  869. { name: '周转数', value: this.normalizeNumber(data?.turnoverQuantity) }
  870. ];
  871. this.quality.passRate = this.normalizePercent(data?.passRate);
  872. this.quality.failRate = this.normalizePercent(data?.defectiveRate);
  873. this.quality.lossRate = this.normalizePercent(data?.attritionRate);
  874. },
  875. async loadDashboardData() {
  876. const baseParams = this.getBaseParams();
  877. if (!baseParams) return;
  878. await Promise.all([
  879. this.fetchSummaryData(baseParams),
  880. this.fetchInventoryData(baseParams),
  881. this.fetchDeviceData(baseParams),
  882. this.fetchPlanData(baseParams)
  883. ]);
  884. },
  885. async fetchSummaryData(baseParams = this.getBaseParams()) {
  886. if (!baseParams) return;
  887. try {
  888. const data = await getFactoryProductionDashboardData(baseParams);
  889. this.applyDashboardSummary(data || {});
  890. } catch (error) {
  891. console.error('获取工厂生产综合看板汇总数据失败:', error);
  892. this.applyDashboardSummary({});
  893. }
  894. },
  895. async fetchInventoryData(
  896. baseParams = this.getBaseParams(),
  897. filterType = this.activeInventoryFilter
  898. ) {
  899. if (!baseParams) return;
  900. try {
  901. const list = await getFactoryProductionDataByStock({
  902. ...baseParams,
  903. stockType: this.getInventoryStockType(filterType)
  904. });
  905. if (filterType !== this.activeInventoryFilter) return;
  906. const normalized = this.normalizeNameValueList(list);
  907. if (filterType === 'keeper') {
  908. this.inventoryLedgerKeeperData = normalized;
  909. } else {
  910. this.inventoryLedgerData = normalized;
  911. }
  912. } catch (error) {
  913. console.error('获取库存台账数据失败:', error);
  914. if (filterType === 'keeper') {
  915. this.inventoryLedgerKeeperData = [];
  916. } else {
  917. this.inventoryLedgerData = [];
  918. }
  919. }
  920. },
  921. async fetchDeviceData(baseParams = this.getBaseParams()) {
  922. if (!baseParams) return;
  923. try {
  924. const list = await getFactoryProductionDataByDevice(baseParams);
  925. this.deviceLedger = this.buildDeviceLedger(list);
  926. } catch (error) {
  927. console.error('获取各类型设备台账数据失败:', error);
  928. this.deviceLedger = this.buildDeviceLedger([]);
  929. }
  930. },
  931. async fetchPlanData(
  932. baseParams = this.getBaseParams(),
  933. planTab = this.activePlanTab
  934. ) {
  935. if (!baseParams) return;
  936. try {
  937. const list = await getFactoryProductionDataByPlan({
  938. ...baseParams,
  939. type: this.mapPlanTabType(planTab)
  940. });
  941. if (planTab !== this.activePlanTab) return;
  942. this.planRows = Array.isArray(list)
  943. ? list.map((item) => this.mapPlanRow(item, planTab))
  944. : [];
  945. } catch (error) {
  946. console.error('获取生产计划进度数据失败:', error);
  947. if (planTab === this.activePlanTab) {
  948. this.planRows = [];
  949. }
  950. }
  951. }
  952. }
  953. };
  954. </script>
  955. <style lang="scss" scoped>
  956. [v-cloak] {
  957. display: none;
  958. }
  959. .fp-container {
  960. font-size: 16px;
  961. font-family: 'AlibabaPuHuiTi';
  962. background-image: url('@/assets/png/bj.png');
  963. background-repeat: no-repeat;
  964. background-size: 100% 100%;
  965. background-color: rgb(8, 29, 65);
  966. height: 100%;
  967. overflow: hidden;
  968. display: flex;
  969. flex-direction: column;
  970. min-height: 0;
  971. }
  972. .fp-header {
  973. background-image: url('@/assets/border2.png');
  974. background-repeat: no-repeat;
  975. background-size: 100% 100%;
  976. height: 8.5%;
  977. min-height: 64px;
  978. max-height: 72px;
  979. display: flex;
  980. align-items: center;
  981. justify-content: space-between;
  982. padding: 0 14px;
  983. box-sizing: border-box;
  984. }
  985. .fp-header-left {
  986. width: 24%;
  987. display: flex;
  988. gap: 8px;
  989. align-items: center;
  990. justify-content: flex-start;
  991. padding: 0;
  992. margin-top: 1%;
  993. }
  994. .fp-select {
  995. width: 36%;
  996. }
  997. .fp-date {
  998. width: 64%;
  999. }
  1000. /* 顶部筛选控件皮肤,贴近原始大屏样式 */
  1001. ::v-deep .fp-header-left .el-input__inner,
  1002. ::v-deep .fp-header-left .el-range-editor.el-input__inner {
  1003. background-color: #011944;
  1004. border: 1px solid #0b6fd5;
  1005. color: #e9f3ff;
  1006. height: 28px;
  1007. line-height: 28px;
  1008. border-radius: 2px;
  1009. box-shadow: 0 0 4px rgba(11, 109, 213, 0.45);
  1010. }
  1011. ::v-deep .fp-header-left .el-input__inner::placeholder,
  1012. ::v-deep .fp-header-left .el-range-input::placeholder {
  1013. color: #6f8fb8;
  1014. }
  1015. ::v-deep .fp-header-left .el-input__suffix,
  1016. ::v-deep .fp-header-left .el-range__icon,
  1017. ::v-deep .fp-header-left .el-range-separator {
  1018. color: #9fc5ff;
  1019. }
  1020. ::v-deep .fp-header-left .el-range-input {
  1021. background-color: transparent;
  1022. color: #e9f3ff;
  1023. }
  1024. .fp-title {
  1025. flex: 1;
  1026. min-width: 0;
  1027. text-align: center;
  1028. font-family: '优设标题黑';
  1029. color: #fff;
  1030. font-size: clamp(2rem, 2.45vw, 2.7rem);
  1031. letter-spacing: clamp(0.16rem, 0.28vw, 0.4rem);
  1032. line-height: 1.08;
  1033. white-space: nowrap;
  1034. overflow: hidden;
  1035. text-overflow: clip;
  1036. transform: none;
  1037. }
  1038. .fp-header-right {
  1039. width: 24%;
  1040. display: flex;
  1041. justify-content: flex-end;
  1042. align-items: center;
  1043. gap: 12px;
  1044. margin-top: 1%;
  1045. color: #7fa7ce;
  1046. font-size: 0.8rem;
  1047. }
  1048. .fp-time {
  1049. color: rgb(210 215 221);
  1050. font-weight: 600;
  1051. }
  1052. .fp-time-text {
  1053. padding: 0 6px;
  1054. }
  1055. .fp-fullscreen-toggle {
  1056. cursor: pointer;
  1057. }
  1058. .fp-body {
  1059. flex: 1;
  1060. display: flex;
  1061. gap: 0.6rem;
  1062. padding: 0.55rem 0.75rem 0.75rem;
  1063. box-sizing: border-box;
  1064. min-height: 0;
  1065. overflow: hidden;
  1066. }
  1067. .fp-col {
  1068. display: flex;
  1069. flex-direction: column;
  1070. gap: 0.8rem;
  1071. min-height: 0;
  1072. }
  1073. .fp-col-left,
  1074. .fp-col-right {
  1075. width: 24.5%;
  1076. min-width: 0;
  1077. }
  1078. .fp-col-middle {
  1079. flex: 1;
  1080. min-width: 0;
  1081. }
  1082. .fp-chart-box {
  1083. flex: 1;
  1084. min-height: 0;
  1085. padding: 6px 10px 10px;
  1086. box-sizing: border-box;
  1087. }
  1088. .fp-chart-fill {
  1089. width: 100%;
  1090. height: 100%;
  1091. }
  1092. /* 库存台账:自定义卡片,标题右侧带筛选 */
  1093. .fp-inventory-card {
  1094. flex: 0.8 !important;
  1095. background-color: rgba(8, 29, 65, 0.8);
  1096. border: 1px solid #124c77;
  1097. overflow: hidden;
  1098. display: flex;
  1099. flex-direction: column;
  1100. min-height: 0;
  1101. }
  1102. .fp-inventory-header {
  1103. display: flex;
  1104. align-items: center;
  1105. padding: 0.2rem 0.5rem;
  1106. gap: 0.3rem;
  1107. background-color: rgb(0, 64, 133);
  1108. border-bottom: 1px solid #124c77;
  1109. font-family: '优设标题黑';
  1110. font-size: 1.2rem;
  1111. color: #fff;
  1112. flex-shrink: 0;
  1113. }
  1114. .fp-inventory-header .card-title {
  1115. flex: 1;
  1116. font-size: clamp(1rem, 1.8vw, 1.4rem);
  1117. }
  1118. .fp-inventory-filters {
  1119. display: flex;
  1120. align-items: center;
  1121. gap: 8px;
  1122. font-size: 0.75rem;
  1123. color: #9fc5ff;
  1124. }
  1125. .fp-filter-btn {
  1126. cursor: pointer;
  1127. padding: 2px 6px;
  1128. border: 1px solid rgba(18, 76, 119, 0.8);
  1129. border-radius: 2px;
  1130. white-space: nowrap;
  1131. }
  1132. .fp-filter-btn:hover {
  1133. color: #3bfff2;
  1134. border-color: rgba(20, 205, 201, 0.6);
  1135. }
  1136. .fp-filter-btn.active {
  1137. color: #3bfff2;
  1138. background: linear-gradient(
  1139. 180deg,
  1140. rgba(20, 205, 201, 0.26),
  1141. rgba(17, 99, 251, 0.2)
  1142. );
  1143. border-color: rgba(20, 205, 201, 0.85);
  1144. box-shadow: 0 0 8px rgba(20, 205, 201, 0.35);
  1145. }
  1146. .fp-filter-icon {
  1147. font-size: 1rem;
  1148. cursor: pointer;
  1149. }
  1150. /* left number card */
  1151. .fp-number-card {
  1152. height: 100%;
  1153. min-width: 0;
  1154. padding: 0 10px 10px;
  1155. display: flex;
  1156. flex-direction: column;
  1157. gap: 10px;
  1158. box-sizing: border-box;
  1159. }
  1160. .fp-number-display {
  1161. flex: 1;
  1162. min-width: 0;
  1163. display: flex;
  1164. align-items: center;
  1165. justify-content: center;
  1166. gap: 0.3rem;
  1167. }
  1168. .fp-unit-box {
  1169. display: flex;
  1170. flex-direction: column;
  1171. align-items: center;
  1172. flex: 1 1 0;
  1173. min-width: 1.2rem;
  1174. max-width: 3rem;
  1175. height: 5rem;
  1176. position: relative;
  1177. }
  1178. .fp-unit {
  1179. font-size: 14px;
  1180. color: #a4b9d7;
  1181. position: absolute;
  1182. top: -22px;
  1183. left: 50%;
  1184. transform: translateX(-50%);
  1185. width: 35px;
  1186. white-space: nowrap;
  1187. }
  1188. .fp-digit-box {
  1189. background-image: url('@/assets/png/num_bj.png');
  1190. background-repeat: no-repeat;
  1191. background-size: 100% 100%;
  1192. color: #fff;
  1193. padding: 0 0.4rem;
  1194. height: 5rem;
  1195. font-size: clamp(1rem, 3.5vw, 2.2rem);
  1196. display: flex;
  1197. align-items: center;
  1198. justify-content: center;
  1199. font-weight: bold;
  1200. border-radius: 2px;
  1201. width: 100%;
  1202. box-sizing: border-box;
  1203. }
  1204. .fp-separator {
  1205. flex-shrink: 0;
  1206. color: #fff;
  1207. font-size: clamp(1.2rem, 3vw, 2.5rem);
  1208. font-weight: 700;
  1209. margin: 0 2px;
  1210. display: flex;
  1211. align-items: center;
  1212. }
  1213. .fp-mini-stats {
  1214. display: flex;
  1215. gap: 10px;
  1216. }
  1217. .fp-mini-stat {
  1218. flex: 1;
  1219. display: flex;
  1220. gap: 8px;
  1221. padding: 6px 8px;
  1222. border: 1px solid rgba(88, 137, 196, 0.9);
  1223. background-color: rgba(0, 123, 255, 0.1);
  1224. border-radius: 4px;
  1225. align-items: center;
  1226. min-width: 0;
  1227. }
  1228. .fp-mini-icon {
  1229. width: 1.6rem;
  1230. height: 1.6rem;
  1231. padding: 0.35rem;
  1232. background-color: rgba(0, 64, 133, 0.3);
  1233. display: flex;
  1234. align-items: center;
  1235. justify-content: center;
  1236. flex-shrink: 0;
  1237. }
  1238. .fp-mini-icon img {
  1239. width: 100%;
  1240. height: 100%;
  1241. object-fit: contain;
  1242. }
  1243. .fp-mini-info {
  1244. min-width: 0;
  1245. display: flex;
  1246. flex-direction: column;
  1247. align-items: center;
  1248. flex: 1;
  1249. }
  1250. .fp-mini-label {
  1251. color: #fff;
  1252. font-size: 0.75rem;
  1253. letter-spacing: 1px;
  1254. white-space: nowrap;
  1255. }
  1256. .fp-mini-value {
  1257. color: #3bfff2;
  1258. font-weight: bold;
  1259. font-size: 0.75rem;
  1260. white-space: nowrap;
  1261. }
  1262. /* middle top */
  1263. .fp-middle-top {
  1264. border: 1px solid #031a64;
  1265. background: radial-gradient(
  1266. circle at top,
  1267. rgba(50, 197, 225, 0.22),
  1268. transparent 55%
  1269. )
  1270. rgba(5, 18, 86, 0.95);
  1271. height: 21%;
  1272. min-height: 118px;
  1273. display: flex;
  1274. flex-direction: column;
  1275. padding: 8px 12px 10px;
  1276. box-sizing: border-box;
  1277. }
  1278. .fp-middle-title {
  1279. display: flex;
  1280. align-items: center;
  1281. gap: 8px;
  1282. color: #fff;
  1283. font-family: '优设标题黑';
  1284. font-size: 1.2rem;
  1285. }
  1286. .fp-title-icon {
  1287. width: 18px;
  1288. height: 18px;
  1289. }
  1290. .fp-kpis {
  1291. flex: 1;
  1292. display: grid;
  1293. grid-template-columns: repeat(3, 1fr);
  1294. gap: 14px;
  1295. align-items: center;
  1296. padding-top: 6px;
  1297. }
  1298. .fp-kpi {
  1299. height: 100%;
  1300. display: flex;
  1301. flex-direction: column;
  1302. align-items: center;
  1303. justify-content: flex-start;
  1304. color: #fff;
  1305. gap: 4px;
  1306. position: relative;
  1307. overflow: hidden;
  1308. padding-top: 6px;
  1309. }
  1310. .fp-kpi-screen {
  1311. width: 66%;
  1312. min-height: 3.5rem;
  1313. border: 1px solid rgba(43, 150, 255, 0.6);
  1314. border-radius: 6px;
  1315. background: linear-gradient(
  1316. 180deg,
  1317. rgba(118, 255, 255, 0.22),
  1318. rgba(40, 176, 255, 0.26) 54%,
  1319. rgba(10, 36, 121, 0.36)
  1320. );
  1321. box-shadow: 0 0 20px rgba(43, 202, 255, 0.4),
  1322. 0 0 12px rgba(17, 99, 251, 0.28) inset;
  1323. display: flex;
  1324. align-items: center;
  1325. justify-content: center;
  1326. position: relative;
  1327. transform: perspective(280px) rotateX(8deg) skewX(-3deg);
  1328. transform-origin: center bottom;
  1329. }
  1330. .fp-kpi-screen::before,
  1331. .fp-kpi-screen::after {
  1332. content: '';
  1333. position: absolute;
  1334. bottom: -8px;
  1335. width: 24%;
  1336. height: 10px;
  1337. border-bottom: 2px solid rgba(43, 202, 255, 0.62);
  1338. }
  1339. .fp-kpi-screen::before {
  1340. left: 3%;
  1341. transform: skewX(-26deg);
  1342. }
  1343. .fp-kpi-screen::after {
  1344. right: 3%;
  1345. transform: skewX(26deg);
  1346. }
  1347. .fp-kpi-base {
  1348. width: 44%;
  1349. height: 0.32rem;
  1350. border-radius: 999px;
  1351. background: linear-gradient(
  1352. 180deg,
  1353. rgba(142, 255, 255, 0.98),
  1354. rgba(22, 238, 255, 0.95) 48%,
  1355. rgba(17, 99, 251, 0.82)
  1356. );
  1357. box-shadow: 0 0 16px rgba(22, 238, 255, 0.72),
  1358. 0 0 8px rgba(17, 99, 251, 0.45);
  1359. }
  1360. .fp-kpi-value {
  1361. font-family: 'LCD2B';
  1362. font-size: clamp(1.45rem, 3vw, 2.5rem);
  1363. font-weight: 800;
  1364. letter-spacing: 0.06em;
  1365. }
  1366. .fp-kpi-label {
  1367. font-size: 0.92rem;
  1368. color: #cfe4ff;
  1369. letter-spacing: 0.5px;
  1370. margin-top: 4px;
  1371. }
  1372. .fp-kpi-glow {
  1373. text-shadow: 0 0 8px rgba(185, 255, 255, 0.8),
  1374. 0 0 16px rgba(20, 205, 201, 0.65), 0 0 24px rgba(17, 99, 251, 0.42);
  1375. }
  1376. .fp-middle-note {
  1377. font-size: 0.75rem;
  1378. color: rgba(255, 255, 255, 0.85);
  1379. letter-spacing: 0.12rem;
  1380. text-align: right;
  1381. }
  1382. /* table */
  1383. .fp-table-wrap {
  1384. height: 100%;
  1385. display: flex;
  1386. flex-direction: column;
  1387. padding: 4px 8px 8px;
  1388. box-sizing: border-box;
  1389. min-height: 0;
  1390. }
  1391. .fp-table-tabs {
  1392. display: flex;
  1393. gap: 6px;
  1394. padding: 4px 0 8px;
  1395. flex-wrap: wrap;
  1396. }
  1397. .fp-tab {
  1398. padding: 6px 10px;
  1399. border: 1px solid rgba(18, 76, 119, 0.9);
  1400. background-color: rgba(3, 29, 66, 0.6);
  1401. color: #e9ecef;
  1402. border-radius: 4px;
  1403. cursor: pointer;
  1404. font-size: 0.85rem;
  1405. user-select: none;
  1406. }
  1407. .fp-tab.active {
  1408. border-color: rgba(20, 205, 201, 0.95);
  1409. color: #3bfff2;
  1410. box-shadow: 0 0 10px rgba(20, 205, 201, 0.2);
  1411. }
  1412. .fp-table {
  1413. flex: 1;
  1414. min-height: 0;
  1415. display: flex;
  1416. flex-direction: column;
  1417. }
  1418. .fp-main-table {
  1419. width: 100%;
  1420. border-collapse: collapse;
  1421. table-layout: fixed;
  1422. }
  1423. .fp-main-table thead th {
  1424. background-color: rgba(3, 29, 66, 0.95);
  1425. padding: 0.55rem 0.2rem;
  1426. text-align: center;
  1427. font-weight: bold;
  1428. color: #0b6fd5;
  1429. border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  1430. font-size: clamp(0.74rem, 0.9vw, 0.82rem);
  1431. line-height: 1.15;
  1432. white-space: normal;
  1433. overflow: hidden;
  1434. text-overflow: clip;
  1435. word-break: keep-all;
  1436. }
  1437. .fp-scroll-body {
  1438. flex: 1;
  1439. min-height: 0;
  1440. overflow: hidden;
  1441. }
  1442. .fp-cell {
  1443. padding: 0.35rem 0.2rem;
  1444. text-align: center;
  1445. color: #e9ecef;
  1446. font-size: 0.82rem;
  1447. border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  1448. white-space: nowrap;
  1449. overflow: hidden;
  1450. text-overflow: ellipsis;
  1451. }
  1452. .fp-row:hover .fp-cell {
  1453. background-color: rgba(3, 29, 66, 0.8) !important;
  1454. }
  1455. .fp-empty {
  1456. text-align: center;
  1457. padding: 1rem;
  1458. color: #7fa7ce;
  1459. }
  1460. .fp-status-red {
  1461. color: #fff;
  1462. font-weight: 700;
  1463. }
  1464. .fp-status-blue {
  1465. color: #ffd16c;
  1466. font-weight: 700;
  1467. }
  1468. /* quality */
  1469. .fp-quality {
  1470. height: 100%;
  1471. padding: 8px 10px 10px;
  1472. box-sizing: border-box;
  1473. display: flex;
  1474. flex-direction: column;
  1475. gap: 12px;
  1476. perspective: 700px;
  1477. }
  1478. .fp-quality-top {
  1479. display: grid;
  1480. grid-template-columns: repeat(3, 1fr);
  1481. gap: 10px;
  1482. }
  1483. .fp-quality-item {
  1484. border: 1px solid rgba(18, 76, 119, 0.9);
  1485. border-radius: 6px;
  1486. background: linear-gradient(
  1487. 180deg,
  1488. rgba(22, 120, 201, 0.18),
  1489. rgba(3, 29, 66, 0.72) 62%,
  1490. rgba(2, 21, 54, 0.9)
  1491. );
  1492. padding: 8px 10px;
  1493. display: flex;
  1494. flex-direction: column;
  1495. align-items: center;
  1496. gap: 6px;
  1497. position: relative;
  1498. transform: perspective(260px) rotateX(8deg);
  1499. transform-origin: center bottom;
  1500. box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22),
  1501. 0 0 12px rgba(18, 129, 214, 0.22) inset;
  1502. overflow: hidden;
  1503. }
  1504. .fp-quality-item::before {
  1505. content: '';
  1506. position: absolute;
  1507. top: 0;
  1508. left: 8%;
  1509. right: 8%;
  1510. height: 1px;
  1511. background: linear-gradient(
  1512. 90deg,
  1513. rgba(255, 255, 255, 0),
  1514. rgba(153, 245, 255, 0.95),
  1515. rgba(255, 255, 255, 0)
  1516. );
  1517. }
  1518. .fp-quality-label {
  1519. color: #cfe4ff;
  1520. font-size: 0.85rem;
  1521. letter-spacing: 1px;
  1522. }
  1523. .fp-quality-value {
  1524. font-family: 'LCD2B';
  1525. font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  1526. font-weight: 800;
  1527. text-shadow: 0 0 8px rgba(111, 233, 255, 0.35),
  1528. 0 0 14px rgba(17, 99, 251, 0.28);
  1529. }
  1530. .fp-quality-value.good {
  1531. color: #14cdc9;
  1532. }
  1533. .fp-quality-value.bad {
  1534. color: #ff4d4f;
  1535. }
  1536. .fp-quality-value.warn {
  1537. color: #f9bb19;
  1538. }
  1539. .fp-quality-bars {
  1540. flex: 1;
  1541. display: flex;
  1542. flex-direction: column;
  1543. justify-content: center;
  1544. gap: 10px;
  1545. }
  1546. .fp-qbar {
  1547. display: flex;
  1548. gap: 10px;
  1549. align-items: center;
  1550. }
  1551. .fp-qbar-name {
  1552. width: 72px;
  1553. color: #e9ecef;
  1554. font-size: 0.85rem;
  1555. }
  1556. .fp-qbar-track {
  1557. flex: 1;
  1558. height: 10px;
  1559. border-radius: 999px;
  1560. background: linear-gradient(
  1561. 180deg,
  1562. rgba(6, 34, 82, 0.92),
  1563. rgba(2, 25, 61, 0.88)
  1564. );
  1565. border: 1px solid rgba(18, 76, 119, 0.9);
  1566. overflow: hidden;
  1567. position: relative;
  1568. box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3) inset;
  1569. }
  1570. .fp-qbar-track::before {
  1571. content: '';
  1572. position: absolute;
  1573. left: 4px;
  1574. right: 4px;
  1575. top: 1px;
  1576. height: 2px;
  1577. border-radius: 999px;
  1578. background: linear-gradient(
  1579. 90deg,
  1580. rgba(255, 255, 255, 0),
  1581. rgba(168, 233, 255, 0.5),
  1582. rgba(255, 255, 255, 0)
  1583. );
  1584. pointer-events: none;
  1585. }
  1586. .fp-qbar-fill {
  1587. height: 100%;
  1588. border-radius: 999px;
  1589. box-shadow: 0 0 10px currentColor;
  1590. position: relative;
  1591. }
  1592. .fp-qbar-fill::after {
  1593. content: '';
  1594. position: absolute;
  1595. right: 0;
  1596. top: -1px;
  1597. width: 16px;
  1598. height: calc(100% + 2px);
  1599. border-radius: 999px;
  1600. background: radial-gradient(
  1601. circle at 25% 50%,
  1602. rgba(255, 255, 255, 0.62),
  1603. rgba(255, 255, 255, 0) 70%
  1604. );
  1605. }
  1606. .fp-qbar-fill.good {
  1607. background: linear-gradient(
  1608. 90deg,
  1609. rgba(20, 205, 201, 1),
  1610. rgba(20, 205, 201, 0.25)
  1611. );
  1612. }
  1613. .fp-qbar-fill.bad {
  1614. background: linear-gradient(
  1615. 90deg,
  1616. rgba(255, 77, 79, 1),
  1617. rgba(255, 77, 79, 0.2)
  1618. );
  1619. }
  1620. .fp-qbar-fill.warn {
  1621. background: linear-gradient(
  1622. 90deg,
  1623. rgba(249, 187, 25, 1),
  1624. rgba(249, 187, 25, 0.25)
  1625. );
  1626. }
  1627. /* 覆盖通用 ChartCard 的最小高度,避免低分辨率下被挤出可视区 */
  1628. ::v-deep .chart-container,
  1629. ::v-deep .process-chart-container,
  1630. ::v-deep .product-top10-chart-container,
  1631. ::v-deep .qualification-rate-chart-container {
  1632. min-height: 0 !important;
  1633. }
  1634. ::v-deep .chart-card .card-content {
  1635. min-height: 0;
  1636. }
  1637. </style>
  1638. <style>
  1639. .el-icon-_screen-full,
  1640. .el-icon-_screen-restore {
  1641. font-size: 1.2rem;
  1642. cursor: pointer;
  1643. transition: all 0.3s;
  1644. color: #7fa7ce;
  1645. }
  1646. .el-icon-_screen-full:hover,
  1647. .el-icon-_screen-restore:hover {
  1648. color: #fff;
  1649. transform: scale(1.1);
  1650. }
  1651. </style>