CrossingDetailPanel.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <div class="crossing-detail-panel">
  3. <div class="detail-panel-left">
  4. <div class="intersection-video-wrap">
  5. <IntersectionMapVideos :mapData="intersectionData" :videoUrls="currentRoute.cornerVideos" />
  6. </div>
  7. <div class="signal-timing-wrap">
  8. <div class="header">
  9. <div class="title-area">
  10. <span class="main-title">方案状态</span>
  11. <span class="sub-info">(周期: {{ cycleLength }} 相位差: {{ phaseDiff }} 协调时间: {{ coordTime }})</span>
  12. </div>
  13. </div>
  14. <SignalTimingChart :cycleLength="cycleLength" :currentTime="currentSec" :phaseData="mockPhaseData" :showScanLine="dataReady" :autoScan="dataReady" @scan-tick="onScanTick" />
  15. </div>
  16. </div>
  17. <div class="detail-panel-right">
  18. <form class="detail-right-form" @submit.prevent>
  19. <div class="form-group">
  20. <div class="control-method">
  21. <div class="control-label-wrap">
  22. <span class="control-label">控制方式</span>
  23. <div class="control-operation">
  24. <div class="operation-btn"
  25. :class="{ 'is-active': isManualMode }"
  26. @click="toggleManualMode">
  27. {{ isManualMode ? '退出手动控制' : '手动控制' }}
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="form-interactive-area" :class="{ 'is-disabled': !isManualMode }">
  33. <div class="control-method-content">
  34. <SegmentedRadio v-model="currentMethod" :options="controlMethodOptions" size="auto" />
  35. </div>
  36. <div class="control-scheme">
  37. <div class="control-label-wrap">
  38. <span class="control-label">控制方案</span>
  39. <DropdownSelect v-model="currentScheme" :options="schemeOptions" size="auto" />
  40. </div>
  41. <div class="current-stage">
  42. <div class="current-stage-warp">
  43. <div class="current-stage-label">当前阶段:</div>
  44. <div v-for="(item, index) in currentStageList" :key="index" class="stage-item-wrapper">
  45. <div
  46. class="phase-box"
  47. :class="{ 'is-active': item.value === currentStage }"
  48. @click="currentStage = item.value"
  49. >
  50. <img :src="item.img" alt="stage" class="phase-image" />
  51. </div>
  52. <input
  53. type="number"
  54. v-model.number="item.time"
  55. class="stage-input"
  56. :disabled="currentMethod !== 'temp'"
  57. :title="currentMethod !== 'temp' ? '仅临时方案可修改' : '修改阶段时间'"
  58. />
  59. <span class="unit">s</span>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- 方案圆饼图 -->
  64. <div class="donut-row" v-if="!showLockTime">
  65. <div class="donut-item">
  66. <div class="donut-title">实时方案(执行方案3)</div>
  67. <PlanDonutChart
  68. :chartData="realtimeDonutData"
  69. :centerValue="String(realtimeRemaining)"
  70. centerLabel="剩余时长"
  71. :showTotal="true"
  72. :totalValue="cycleLength"
  73. :scale="panelScale"
  74. />
  75. </div>
  76. <div class="donut-item">
  77. <div class="donut-title">下周期方案</div>
  78. <PlanDonutChart
  79. :chartData="nextCycleDonutData"
  80. :centerValue="String(cycleLength)"
  81. centerLabel="总时长"
  82. :showTotal="false"
  83. :scale="panelScale"
  84. />
  85. </div>
  86. </div>
  87. <transition name="fade">
  88. <div class="lock-time" v-if="showLockTime">
  89. <div class="lock-time-label-wrap glow-header">
  90. <div class="lock-time-label">锁定时间</div>
  91. <div class="lock-time-close" @click="showLockTime = false">✕</div>
  92. </div>
  93. <div class="lock-time-options">
  94. <div class="lock-time-option">
  95. <label>
  96. <input type="radio" v-model="lockTimeType" value="continuous" /> 持续放行
  97. </label>
  98. </div>
  99. <div class="lock-time-option">
  100. <label>
  101. <input type="radio" v-model="lockTimeType" value="timer" /> 放行
  102. <DropdownSelect placeholder="锁定时间" v-model="currentLocktime" :options="locktimeOptions" size="auto"
  103. @click.native.prevent />
  104. 秒解锁
  105. </label>
  106. </div>
  107. </div>
  108. </div>
  109. </transition>
  110. </div>
  111. </div>
  112. <div class="button-group" v-show="isManualMode">
  113. <div>
  114. <button type="button" class="btn btn-cancel" @click="onCancel()">取消</button>
  115. <button type="button" class="btn btn-confirm" @click="onConfirm()">确认</button>
  116. </div>
  117. </div>
  118. </div>
  119. </form>
  120. </div>
  121. </div>
  122. </template>
  123. <script>
  124. import SignalTimingChart from '@/components/ui/SignalTimingChart.vue';
  125. import IntersectionMapVideos from '@/components/ui/IntersectionMapVideos.vue';
  126. import SegmentedRadio from '@/components/ui/SegmentedRadio.vue';
  127. import DropdownSelect from '@/components/ui/DropdownSelect.vue';
  128. import PlanDonutChart from '@/components/ui/PlanDonutChart.vue';
  129. import { apiGetCrossingDetailData } from '@/api';
  130. export default {
  131. name: 'CrossingPanel',
  132. components: {
  133. SignalTimingChart,
  134. IntersectionMapVideos,
  135. SegmentedRadio,
  136. DropdownSelect,
  137. PlanDonutChart
  138. },
  139. props: {
  140. preloadedData: { type: Object, default: null },
  141. iconMode: { type: String, default: 'simple' } // 'default' | 'simple'
  142. },
  143. data() {
  144. return {
  145. // 核心状态控制
  146. isManualMode: false, // 是否处于手动控制模式
  147. showLockTime: false, // 是否显示锁定时间弹窗
  148. lockTimeType: 'continuous', // 锁定时间类型
  149. dataReady: false,
  150. followPhase: false,
  151. intersectionData: {},
  152. currentRoute: {},
  153. cycleLength: 140,
  154. currentSec: 0,
  155. phaseDiff: 0,
  156. coordTime: 0,
  157. mockPhaseData: [],
  158. panelScale: 1,
  159. // 控制方式数据
  160. controlMethodOptions: [],
  161. currentMethod: 'temp',
  162. currentScheme: 'early_peak',
  163. schemeOptions: [],
  164. // 实时方案圆饼图数据(从 phaseData 动态生成)
  165. realtimeDonutData: [],
  166. // 下周期方案圆饼图数据
  167. nextCycleDonutData: [],
  168. // 实时方案剩余时长
  169. realtimeRemaining: 0,
  170. // 各阶段基础数据(从 phaseData 解析)
  171. phaseStages: [],
  172. currentLocktime: 50,
  173. locktimeOptions: [],
  174. currentStage: '1',
  175. // 补充了 time 属性,用于双向绑定输入框的时间
  176. currentStageList: []
  177. }
  178. },
  179. watch: {
  180. // 监听控制方式切换
  181. currentMethod(newVal) {
  182. // 需求4:切换步进方案策略时,出现锁定时间弹窗
  183. if (newVal === 'step') {
  184. this.showLockTime = true;
  185. } else {
  186. this.showLockTime = false;
  187. }
  188. // 模拟需求1:根据不同模式,切换对应的控制方案数据 (Mock 逻辑)
  189. this.updateSchemeDataByMethod(newVal);
  190. }
  191. },
  192. mounted() {
  193. this.initScaleObserver();
  194. if (this.preloadedData) {
  195. this.applyData(this.preloadedData);
  196. } else {
  197. this.loadData();
  198. }
  199. },
  200. beforeDestroy() {
  201. if (this._ro) this._ro.disconnect();
  202. },
  203. methods: {
  204. onScanTick(activeTime) {
  205. if (!this.mockPhaseData || this.mockPhaseData.length === 0) return;
  206. // 只看第一轨道(trackIdx=0)的相位
  207. const phase = this.mockPhaseData.find(p => p[0] === 0 && activeTime >= p[1] && activeTime < p[2]);
  208. if (!phase) return;
  209. const type = phase[5]; // green/stripe/yellow/red
  210. const iconValue = phase[6]; // 如 "STRAIGHT_DOWN,STRAIGHT_UP"
  211. const direction = phase[7]; // ns/ew
  212. const phaseName = phase[3]; // P1/P2 等
  213. const endTime = phase[2];
  214. const remaining = Math.max(0, Math.round(endTime - activeTime));
  215. const nsGreen = (type === 'green' && direction === 'ns');
  216. const ewGreen = (type === 'green' && direction === 'ew');
  217. // 从图标值解析当前允许的行驶方向类型
  218. // STRAIGHT→S, TURN_*_LEFT→L, *_UTURN→U
  219. let activeArrowTypes = [];
  220. if ((nsGreen || ewGreen) && iconValue) {
  221. const icons = iconValue.split(',');
  222. icons.forEach(ic => {
  223. if (ic.includes('UTURN')) activeArrowTypes.push('U');
  224. if (ic.includes('TURN') && !ic.includes('UTURN')) activeArrowTypes.push('L');
  225. if (ic.includes('STRAIGHT')) activeArrowTypes.push('S');
  226. });
  227. // 去重
  228. activeArrowTypes = [...new Set(activeArrowTypes)];
  229. }
  230. this.$set(this.intersectionData, 'signals', {
  231. ns: {
  232. phaseName: nsGreen ? (phaseName || '南北') : (this.intersectionData.signals?.ns?.phaseName || '南北'),
  233. time: remaining,
  234. isGreen: nsGreen,
  235. activeArrowTypes: nsGreen ? activeArrowTypes : []
  236. },
  237. ew: {
  238. phaseName: ewGreen ? (phaseName || '东西') : (this.intersectionData.signals?.ew?.phaseName || '东西'),
  239. time: remaining,
  240. isGreen: ewGreen,
  241. activeArrowTypes: ewGreen ? activeArrowTypes : []
  242. }
  243. });
  244. // 更新实时方案圆饼图的已走时长
  245. this.updateRealtimeDonut(activeTime);
  246. },
  247. // 从 phaseData 解析4个阶段的绿灯时长,构建圆饼图数据
  248. buildDonutFromPhaseData() {
  249. const phaseData = this.mockPhaseData || [];
  250. const stageColors = ['#3b82f6', '#a855f7', '#14b8a6', '#f59e0b'];
  251. const stageLabels = ['1-南北直行', '2-南北左转', '3-东西直行', '4-东西左转'];
  252. // 提取 track 0 的绿灯相位(每阶段的第一个 green)
  253. const greenPhases = phaseData.filter(p => p[0] === 0 && p[5] === 'green');
  254. const stages = greenPhases.slice(0, 4).map((p, i) => ({
  255. label: stageLabels[i] || `阶段${i + 1}`,
  256. value: p[4], // 绿灯时长
  257. start: p[1], // 阶段开始时间
  258. end: p[2], // 绿灯结束时间
  259. color: stageColors[i]
  260. }));
  261. this.phaseStages = stages;
  262. // 实时方案:已走时长 + 4个阶段
  263. this.realtimeDonutData = [
  264. { label: '已走时长', value: 0, color: '#8892a0' },
  265. ...stages.map(s => ({ label: s.label, value: s.value, color: s.color }))
  266. ];
  267. this.realtimeRemaining = this.cycleLength;
  268. // 下周期方案:4个阶段,初始数据与实时方案相同
  269. this.nextCycleDonutData = stages.map(s => ({
  270. label: s.label,
  271. value: s.value,
  272. color: s.color
  273. }));
  274. },
  275. // 根据扫描线时间更新实时方案圆饼图
  276. updateRealtimeDonut(activeTime) {
  277. if (this.phaseStages.length === 0) return;
  278. const elapsed = Math.round(activeTime);
  279. const remaining = Math.max(0, this.cycleLength - elapsed);
  280. this.realtimeRemaining = remaining;
  281. // 计算各阶段的剩余时长
  282. const stageValues = this.phaseStages.map(s => {
  283. if (activeTime >= s.end) return 0; // 阶段已完成
  284. if (activeTime < s.start) return s.value; // 阶段未开始
  285. return Math.max(0, Math.round(s.end - activeTime)); // 阶段进行中
  286. });
  287. this.realtimeDonutData = [
  288. { label: '已走时长', value: elapsed, color: '#8892a0' },
  289. ...this.phaseStages.map((s, i) => ({
  290. label: s.label,
  291. value: stageValues[i],
  292. color: s.color
  293. }))
  294. ];
  295. },
  296. initScaleObserver() {
  297. const ro = new ResizeObserver(entries => {
  298. const { width } = entries[0].contentRect;
  299. const s = Math.min(width / 1315, 1);
  300. this.$el.style.setProperty('--s', s);
  301. this.panelScale = s;
  302. });
  303. ro.observe(this.$el);
  304. this._ro = ro;
  305. },
  306. async loadData() {
  307. const nodeId = this.$attrs.id || this.id;
  308. const data = await apiGetCrossingDetailData(nodeId, { iconMode: this.iconMode });
  309. if (data) {
  310. this.applyData(data);
  311. }
  312. },
  313. applyData(data) {
  314. this.currentRoute = data.currentRoute || {};
  315. this.intersectionData = data.intersectionData || {};
  316. this.mockPhaseData = data.phaseData || [];
  317. this.cycleLength = data.cycleLength || 140;
  318. this.currentSec = data.currentTime || 0;
  319. this.phaseDiff = data.phaseDiff || 0;
  320. this.coordTime = data.coordTime || 0;
  321. this.currentStageList = data.stageList || [];
  322. this.buildDonutFromPhaseData();
  323. this.$nextTick(() => {
  324. this.dataReady = true;
  325. });
  326. this.schemeOptions = data.schemeOptions || [];
  327. if (data.currentScheme) this.currentScheme = data.currentScheme;
  328. if (data.controlMethodOptions) this.controlMethodOptions = data.controlMethodOptions;
  329. if (data.currentMethod) this.currentMethod = data.currentMethod;
  330. if (data.locktimeOptions) this.locktimeOptions = data.locktimeOptions;
  331. },
  332. // 切换手动控制模式
  333. toggleManualMode() {
  334. this.isManualMode = !this.isManualMode;
  335. if (!this.isManualMode) {
  336. // 如果退出手动模式,可选择重置表单状态
  337. this.showLockTime = false;
  338. }
  339. },
  340. // 模拟:根据控制方式改变下拉方案的数据
  341. updateSchemeDataByMethod(method) {
  342. if (method === 'system') {
  343. this.schemeOptions = [
  344. { label: '系统优化方案A', value: 'sys_a' },
  345. { label: '系统优化方案B', value: 'sys_b' }
  346. ];
  347. this.currentScheme = 'sys_a';
  348. } else {
  349. this.schemeOptions = [
  350. { label: '早高峰', value: 'early_peak' },
  351. { label: '晚高峰', value: 'evening_peak' },
  352. { label: '平峰', value: 'normal' }
  353. ];
  354. this.currentScheme = 'early_peak';
  355. }
  356. },
  357. // 取消按钮
  358. onCancel() {
  359. this.isManualMode = false;
  360. this.showLockTime = false;
  361. // 可以在此添加回滚初始数据的逻辑
  362. },
  363. // 需求5:点击确认按钮提交 + 表单验证
  364. onConfirm() {
  365. // 验证1:临时方案必须检查时间是否有效
  366. if (this.currentMethod === 'temp') {
  367. const isInvalid = this.currentStageList.some(item => !item.time || item.time <= 0);
  368. if (isInvalid) {
  369. alert('请输入有效的阶段时间 (必须大于0)!');
  370. return;
  371. }
  372. }
  373. // 验证2:步进方案必须选择锁定类型
  374. if (this.currentMethod === 'step') {
  375. if (this.lockTimeType === 'timer' && !this.currentLocktime) {
  376. alert('请选择解锁时间!');
  377. return;
  378. }
  379. }
  380. // 构造提交参数
  381. const submitData = {
  382. method: this.currentMethod,
  383. scheme: this.currentScheme,
  384. stages: this.currentMethod === 'temp' ? this.currentStageList : null,
  385. lockConfig: this.currentMethod === 'step' ? {
  386. type: this.lockTimeType,
  387. time: this.lockTimeType === 'timer' ? this.currentLocktime : null
  388. } : null
  389. };
  390. console.log('提交的数据:', submitData);
  391. // 提交完成后可根据业务决定是否退出手动模式
  392. // this.isManualMode = false;
  393. }
  394. }
  395. }
  396. </script>
  397. <style scoped>
  398. .crossing-detail-panel {
  399. --s: 1;
  400. display: flex;
  401. flex-direction: row;
  402. gap: clamp(4px, calc(var(--s) * 12px), 12px);
  403. height: 100%;
  404. min-height: 0;
  405. overflow: hidden;
  406. }
  407. /* ===== 左侧:还原原始固定 55% 占比 ===== */
  408. .detail-panel-left {
  409. display: flex;
  410. flex-direction: column;
  411. flex: 0 0 55%;
  412. min-height: 0;
  413. min-width: 0;
  414. }
  415. /* ===== 右侧:flex 列容器 + 滚动兜底 ===== */
  416. .detail-panel-right {
  417. flex: 1;
  418. min-width: 0;
  419. min-height: 0;
  420. overflow-y: auto;
  421. overflow-x: hidden;
  422. display: flex;
  423. flex-direction: column;
  424. }
  425. .intersection-video-wrap {
  426. width: 100%;
  427. min-height: 0;
  428. flex: 2;
  429. }
  430. .signal-timing-wrap {
  431. flex: 0 0 auto;
  432. min-height: 0;
  433. height: clamp(110px, calc(var(--s) * 200px), 200px);
  434. width: 100%;
  435. min-width: 0;
  436. background-color: transparent;
  437. box-sizing: border-box;
  438. position: relative;
  439. display: flex;
  440. flex-direction: column;
  441. overflow: hidden;
  442. padding: clamp(3px, calc(var(--s) * 10px), 10px);
  443. }
  444. .header {
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. margin-bottom: clamp(2px, calc(var(--s) * 6px), 15px);
  449. color: #e0e6f1;
  450. flex-shrink: 0;
  451. }
  452. .title-area {
  453. font-size: clamp(9px, calc(var(--s) * 16px), 16px);
  454. }
  455. .main-title {
  456. font-size: clamp(10px, calc(var(--s) * 18px), 18px);
  457. font-weight: bold;
  458. margin-right: clamp(4px, calc(var(--s) * 10px), 10px);
  459. }
  460. .sub-info {
  461. font-size: clamp(8px, calc(var(--s) * 12px), 12px);
  462. opacity: 0.8;
  463. }
  464. .checkbox-area {
  465. font-size: clamp(8px, calc(var(--s) * 12px), 12px);
  466. display: flex;
  467. align-items: center;
  468. cursor: pointer;
  469. opacity: 0.7;
  470. user-select: none;
  471. }
  472. .checkbox-area:hover {
  473. opacity: 1;
  474. }
  475. .checkbox-mock {
  476. width: clamp(10px, calc(var(--s) * 14px), 14px);
  477. height: clamp(10px, calc(var(--s) * 14px), 14px);
  478. border: 1px solid rgba(255, 255, 255, 0.5);
  479. margin-right: clamp(3px, calc(var(--s) * 6px), 6px);
  480. border-radius: 2px;
  481. display: flex;
  482. align-items: center;
  483. justify-content: center;
  484. }
  485. .checkbox-mock.is-checked {
  486. background-color: #4da8ff;
  487. border-color: #4da8ff;
  488. }
  489. .chart-container {
  490. width: 100%;
  491. min-width: 0;
  492. flex: 1;
  493. min-height: 50px;
  494. overflow: hidden;
  495. }
  496. .loading-overlay {
  497. flex: 1;
  498. display: flex;
  499. align-items: center;
  500. justify-content: center;
  501. color: #758599;
  502. font-size: 14px;
  503. }
  504. /* ===== 右侧表单内层容器 ===== */
  505. .detail-right-form {
  506. flex: 1;
  507. min-height: 0;
  508. display: flex;
  509. flex-direction: column;
  510. }
  511. .form-group {
  512. flex: 1;
  513. min-height: 0;
  514. display: flex;
  515. flex-direction: column;
  516. }
  517. /** 控制方法 */
  518. .control-method {
  519. color: #ffffff;
  520. flex-shrink: 0;
  521. }
  522. .control-label-wrap {
  523. display: flex;
  524. align-items: center;
  525. margin-bottom: clamp(4px, calc(var(--s) * 10px), 20px);
  526. column-gap: clamp(4px, calc(var(--s) * 10px), 20px);
  527. }
  528. .control-label {
  529. font-size: clamp(12px, calc(var(--s) * 22px), 28px);
  530. color: #ffffff;
  531. white-space: nowrap;
  532. }
  533. .control-label-wrap span {
  534. display: inline-block;
  535. }
  536. .operation-btn {
  537. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  538. cursor: pointer;
  539. user-select: none;
  540. }
  541. .operation-btn:hover {
  542. text-decoration: underline;
  543. }
  544. .operation-btn.is-active {
  545. text-decoration: underline;
  546. }
  547. .control-method .control-label-wrap {
  548. justify-content: space-between;
  549. }
  550. /* 控制方式按钮组:设置 font-size 供 SegmentedRadio size="auto" 继承 */
  551. .control-method-content {
  552. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  553. }
  554. .control-scheme {
  555. margin-top: clamp(4px, calc(var(--s) * 10px), 20px);
  556. /* 设置 font-size 供 DropdownSelect size="auto" 继承 */
  557. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  558. }
  559. .lock-time {
  560. width: 80%;
  561. border-radius: 8px;
  562. box-shadow:
  563. inset 0px 0px 10px 0px rgba(88, 146, 255, 0.4),
  564. inset 20px 0px 30px -10px rgba(88, 146, 255, 0.15);
  565. }
  566. .lock-time-label-wrap {
  567. display: flex;
  568. align-items: center;
  569. justify-content: space-between;
  570. padding: clamp(4px, calc(var(--s) * 8px), 10px);
  571. border-radius: 8px 8px 0 0;
  572. color: #ffffff;
  573. }
  574. .lock-time-label {
  575. font-size: clamp(10px, calc(var(--s) * 16px), 16px);
  576. color: #ffffff;
  577. }
  578. .lock-time-options {
  579. display: flex;
  580. flex-direction: column;
  581. row-gap: clamp(4px, calc(var(--s) * 10px), 10px);
  582. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  583. padding: clamp(4px, calc(var(--s) * 10px), 10px);
  584. color: #ffffff;
  585. }
  586. .lock-time-option {
  587. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  588. }
  589. .lock-time-close {
  590. cursor: pointer;
  591. }
  592. .glow-header {
  593. background: linear-gradient(180deg,
  594. rgba(65, 115, 205, 0.6) 0%,
  595. rgba(40, 70, 130, 0.1) 100%);
  596. backdrop-filter: blur(10px);
  597. }
  598. .current-stage {
  599. background-color: rgba(65, 115, 205, 0.2);
  600. border: 1px solid #3660a5;
  601. margin-bottom: clamp(4px, calc(var(--s) * 10px), 20px);
  602. display: flex;
  603. justify-content: center;
  604. }
  605. .current-stage-warp {
  606. display: flex;
  607. align-items: center;
  608. justify-content: center;
  609. flex-wrap: wrap;
  610. gap: clamp(4px, calc(var(--s) * 8px), 10px);
  611. padding: clamp(6px, calc(var(--s) * 12px), 32px);
  612. color: #ffffff;
  613. }
  614. .current-stage-label {
  615. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  616. width: auto;
  617. white-space: nowrap;
  618. }
  619. .stage-input {
  620. width: clamp(32px, calc(var(--s) * 65px), 65px);
  621. border: 1px solid rgba(161,190,255,0.7);
  622. background-color: transparent;
  623. padding: clamp(2px, calc(var(--s) * 5px), 5px);
  624. color: #ffffff;
  625. text-align: center;
  626. }
  627. .phase-box {
  628. position: relative;
  629. width: clamp(30px, calc(var(--s) * 65px), 65px);
  630. height: clamp(30px, calc(var(--s) * 65px), 65px);
  631. background: #E6F0FF;
  632. border-radius: 4px;
  633. display: flex;
  634. align-items: center;
  635. justify-content: center;
  636. cursor: pointer;
  637. transition: all 0.3s ease;
  638. box-sizing: border-box;
  639. overflow: hidden;
  640. }
  641. .phase-image {
  642. width: 100%;
  643. height: 100%;
  644. object-fit: contain;
  645. display: block;
  646. }
  647. .phase-box::after {
  648. content: '';
  649. position: absolute;
  650. top: 0;
  651. left: 0;
  652. width: 100%;
  653. height: 100%;
  654. background: rgba(30, 106, 255, 0.5);
  655. opacity: 0;
  656. transition: opacity 0.3s ease;
  657. pointer-events: none;
  658. }
  659. .phase-box.is-active::after {
  660. opacity: 1;
  661. }
  662. /** 按钮 */
  663. .btn {
  664. display: inline-flex;
  665. justify-content: center;
  666. align-items: center;
  667. height: clamp(22px, calc(var(--s) * 36px), 36px);
  668. padding: 0 clamp(10px, calc(var(--s) * 32px), 32px);
  669. font-size: clamp(9px, calc(var(--s) * 14px), 14px);
  670. border-radius: 4px;
  671. cursor: pointer;
  672. user-select: none;
  673. transition: all 0.2s ease-in-out;
  674. box-sizing: border-box;
  675. }
  676. .btn-cancel {
  677. background-color: transparent;
  678. color: #d1d5db;
  679. border: 1px solid rgba(130, 150, 190, 0.4);
  680. }
  681. .btn-cancel:hover {
  682. color: #ffffff;
  683. border-color: rgba(130, 150, 190, 0.8);
  684. background-color: rgba(255, 255, 255, 0.05);
  685. }
  686. .btn-cancel:active {
  687. background-color: rgba(255, 255, 255, 0.1);
  688. }
  689. .btn-confirm {
  690. background-color: #3b74ff;
  691. color: #ffffff;
  692. border: 1px solid #3b74ff;
  693. }
  694. .btn-confirm:hover {
  695. background-color: #5a8bff;
  696. border-color: #5a8bff;
  697. box-shadow: 0 2px 8px rgba(59, 116, 255, 0.3);
  698. }
  699. .btn-confirm:active {
  700. background-color: #265bed;
  701. border-color: #265bed;
  702. box-shadow: none;
  703. }
  704. .button-group {
  705. display: flex;
  706. justify-content: flex-end;
  707. margin-top: clamp(4px, calc(var(--s) * 10px), 20px);
  708. flex-shrink: 0;
  709. }
  710. .button-group>div {
  711. display: flex;
  712. gap: clamp(4px, calc(var(--s) * 8px), 12px);
  713. }
  714. /* 禁用状态 */
  715. .form-interactive-area {
  716. transition: opacity 0.3s;
  717. flex: 1;
  718. min-height: 0;
  719. overflow-y: auto;
  720. overflow-x: hidden;
  721. }
  722. .form-interactive-area.is-disabled {
  723. opacity: 0.6;
  724. pointer-events: none;
  725. }
  726. /* 当前阶段输入框微调 */
  727. .stage-item-wrapper {
  728. display: flex;
  729. flex-direction: column;
  730. align-items: center;
  731. gap: clamp(2px, calc(var(--s) * 4px), 6px);
  732. position: relative;
  733. }
  734. .stage-input {
  735. width: clamp(32px, calc(var(--s) * 65px), 65px);
  736. border: 1px solid rgba(161,190,255,0.7);
  737. background-color: transparent;
  738. padding: clamp(2px, calc(var(--s) * 5px), 5px);
  739. color: #ffffff;
  740. text-align: center;
  741. border-radius: 4px;
  742. }
  743. .stage-input:disabled {
  744. border-color: rgba(255, 255, 255, 0.2);
  745. color: rgba(255, 255, 255, 0.5);
  746. background-color: rgba(0, 0, 0, 0.2);
  747. }
  748. .stage-item-wrapper .unit {
  749. position: absolute;
  750. bottom: clamp(2px, calc(var(--s) * 6px), 6px);
  751. right: clamp(3px, calc(var(--s) * 6px), 8px);
  752. color: #77A1FF;
  753. font-size: clamp(8px, calc(var(--s) * 12px), 12px);
  754. pointer-events: none;
  755. }
  756. /* 弹窗过渡动画 */
  757. .fade-enter-active, .fade-leave-active {
  758. transition: opacity 0.3s, transform 0.3s;
  759. }
  760. .fade-enter, .fade-leave-to {
  761. opacity: 0;
  762. transform: translateY(-10px);
  763. }
  764. /* lock-time 弹窗补充样式 */
  765. .lock-time {
  766. margin-top: clamp(4px, calc(var(--s) * 10px), 15px);
  767. background-color: rgba(20, 30, 50, 0.9);
  768. }
  769. /* 单选框基础对齐 */
  770. .lock-time-option label {
  771. display: flex;
  772. align-items: center;
  773. gap: clamp(3px, calc(var(--s) * 6px), 8px);
  774. cursor: pointer;
  775. }
  776. /* ===== 方案圆饼图左右布局 ===== */
  777. .donut-row {
  778. display: flex;
  779. gap: clamp(4px, calc(var(--s) * 16px), 16px);
  780. width: 100%;
  781. }
  782. .donut-item {
  783. flex: 1;
  784. min-width: 0;
  785. }
  786. .donut-title {
  787. font-size: clamp(11px, calc(var(--s) * 13px), 14px);
  788. color: #a0aec0;
  789. margin-bottom: 4px;
  790. }
  791. </style>