HydrologySimulationPanel.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265
  1. <template>
  2. <div class="simulation-panel">
  3. <div class="timeline-section">
  4. <div class="timeline-card">
  5. <div class="timeline-body">
  6. <div class="timeline-row">
  7. <button class="play-btn" @click="togglePlay">
  8. <span v-if="isPlaying">⏸</span>
  9. <span v-else>▶</span>
  10. </button>
  11. <input
  12. type="range"
  13. class="timeline-slider"
  14. :min="0"
  15. :max="timeLabels.length - 1"
  16. :value="currentTimeIndex"
  17. @input="onTimelineChange"
  18. />
  19. </div>
  20. <div class="timeline-labels">
  21. <span v-for="(label, index) in timeLabels" :key="index" class="timeline-label">{{ label }}</span>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="left-sidebar">
  27. <div class="data-card">
  28. <div class="card-header">
  29. <h3 class="card-title">预演条件设置</h3>
  30. </div>
  31. <div class="card-body">
  32. <div class="section-title">降雨情景选择</div>
  33. <div class="scenario-list">
  34. <div
  35. v-for="(scenario, index) in scenarioList"
  36. :key="index"
  37. class="scenario-item"
  38. :class="{ active: selectedScenario === scenario.value }"
  39. @click="selectScenario(scenario.value)"
  40. >
  41. <div class="scenario-radio" :class="{ checked: selectedScenario === scenario.value }"></div>
  42. <div class="scenario-name">{{ scenario.label }}</div>
  43. </div>
  44. </div>
  45. <div class="section-divider"></div>
  46. <div class="section-title">水库调度方案选择</div>
  47. <div class="scheme-list">
  48. <div
  49. v-for="(scheme, index) in schemeList"
  50. :key="index"
  51. class="scheme-item"
  52. :class="{ active: selectedScheme === scheme.value }"
  53. @click="selectScheme(scheme.value)"
  54. >
  55. <div class="scheme-radio" :class="{ checked: selectedScheme === scheme.value }"></div>
  56. <div class="scheme-name">{{ scheme.label }}</div>
  57. </div>
  58. </div>
  59. <button class="start-btn" @click="startSimulation">
  60. 开始预演
  61. </button>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="right-sidebar">
  66. <div class="chart-card">
  67. <div class="chart-card-header">
  68. <h4 class="chart-card-title">流域径流预演</h4>
  69. </div>
  70. <div class="chart-card-body">
  71. <div class="chart-subtitle">黑林水文站 —— 水位 / 流量预演过程</div>
  72. <div id="heilinChart" class="chart-container"></div>
  73. </div>
  74. </div>
  75. <div class="chart-card">
  76. <div class="chart-card-header">
  77. <h4 class="chart-card-title">小塔山水库预演</h4>
  78. </div>
  79. <div class="chart-card-body">
  80. <div class="chart-subtitle">小塔山水库 —— 入库流量 & 库水位预演</div>
  81. <div id="reservoirChart" class="chart-container"></div>
  82. </div>
  83. </div>
  84. <div class="chart-card">
  85. <div class="chart-card-header">
  86. <h4 class="chart-card-title">调度方案对比预演</h4>
  87. </div>
  88. <div class="chart-card-body">
  89. <div class="chart-subtitle">不同调度方案影响对比</div>
  90. <div id="comparisonChart" class="chart-container"></div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import * as echarts from 'echarts'
  98. export default {
  99. name: 'HydrologySimulationPanel',
  100. props: {
  101. simulationTime: {
  102. type: Number,
  103. default: 0
  104. },
  105. simulationData: {
  106. type: Object,
  107. default: () => ({})
  108. }
  109. },
  110. emits: ['updateSimulationTime', 'updateSimulationData', 'updateScenarioAndRisk'],
  111. data() {
  112. return {
  113. heilinChart: null,
  114. reservoirChart: null,
  115. comparisonChart: null,
  116. selectedScenario: 'light',
  117. selectedScheme: 'current',
  118. currentTimeIndex: 0,
  119. heilinTimeData: [],
  120. reservoirTimeData: [],
  121. isPlaying: false,
  122. playInterval: null,
  123. scenarioList: [
  124. { label: '小雨情景(24h)', value: 'light' },
  125. { label: '中雨情景(24h)', value: 'moderate' },
  126. { label: '大雨情景(24h)', value: 'heavy' },
  127. { label: '24h 暴雨情景', value: 'storm24' },
  128. { label: '72h 暴雨情景', value: 'storm72' }
  129. ],
  130. schemeList: [
  131. { label: '现状调度(默认出库)', value: 'current' },
  132. { label: '提前泄洪(加大出库)', value: 'advance' },
  133. { label: '控制泄洪(减少出库)', value: 'control' }
  134. ],
  135. timeLabels: ['0h', '6h', '12h', '18h', '24h', '30h', '36h', '42h', '48h', '54h', '60h', '66h', '72h']
  136. }
  137. },
  138. computed: {
  139. heilinRiskClass() {
  140. if (this.selectedScenario === 'storm72') return 'danger'
  141. if (this.selectedScenario === 'storm24') return 'warning'
  142. if (this.selectedScenario === 'heavy') return 'attention'
  143. return 'normal'
  144. },
  145. heilinRiskText() {
  146. if (this.selectedScenario === 'storm72') return '超保证水位'
  147. if (this.selectedScenario === 'storm24') return '超警戒水位'
  148. if (this.selectedScenario === 'heavy') return '接近警戒'
  149. return '正常'
  150. },
  151. reservoirRiskClass() {
  152. if (this.selectedScenario === 'storm72' && this.selectedScheme === 'control') return 'danger'
  153. if (this.selectedScenario === 'storm24' && this.selectedScheme !== 'advance') return 'warning'
  154. if (this.selectedScenario === 'storm72' && this.selectedScheme === 'current') return 'warning'
  155. if (this.selectedScenario === 'heavy') return 'attention'
  156. return 'normal'
  157. },
  158. reservoirRiskText() {
  159. if (this.selectedScenario === 'storm72' && this.selectedScheme === 'control') return '超汛限水位'
  160. if (this.selectedScenario === 'storm24' && this.selectedScheme !== 'advance') return '超汛限水位'
  161. if (this.selectedScenario === 'storm72' && this.selectedScheme === 'current') return '超汛限水位'
  162. if (this.selectedScenario === 'heavy') return '接近汛限'
  163. return '正常'
  164. },
  165. riskLevelClass() {
  166. if (this.selectedScenario === 'storm72' || (this.selectedScenario === 'storm24' && this.selectedScheme === 'control')) return 'danger'
  167. if (this.selectedScenario === 'storm24' || (this.selectedScenario === 'heavy' && this.selectedScheme === 'control')) return 'warning'
  168. if (this.selectedScenario === 'heavy') return 'attention'
  169. return 'normal'
  170. },
  171. riskLevelText() {
  172. if (this.selectedScenario === 'storm72' || (this.selectedScenario === 'storm24' && this.selectedScheme === 'control')) return '危险'
  173. if (this.selectedScenario === 'storm24' || (this.selectedScenario === 'heavy' && this.selectedScheme === 'control')) return '警戒'
  174. if (this.selectedScenario === 'heavy') return '注意'
  175. return '正常'
  176. },
  177. conclusionText() {
  178. const scenario = this.scenarioList.find(s => s.value === this.selectedScenario)?.label
  179. if (this.selectedScenario === 'storm72') {
  180. if (this.selectedScheme === 'advance') {
  181. return `${scenario}下,建议提前泄洪,可有效控制库水位。`
  182. } else if (this.selectedScheme === 'control') {
  183. return `${scenario}下,控制泄洪将导致水库严重超汛限水位,建议立即加大泄洪。`
  184. } else {
  185. return `${scenario}下,现状调度将超汛限水位,建议提前泄洪。`
  186. }
  187. } else if (this.selectedScenario === 'storm24') {
  188. if (this.selectedScheme === 'advance') {
  189. return `${scenario}下,提前泄洪可有效控制库水位在汛限以下。`
  190. } else {
  191. return `${scenario}下,将超汛限水位,建议加大泄洪。`
  192. }
  193. } else if (this.selectedScenario === 'heavy') {
  194. return `${scenario}下,库水位接近汛限,建议关注水情变化。`
  195. } else {
  196. return `${scenario}下,水情平稳,可维持现状调度。`
  197. }
  198. }
  199. },
  200. computed: {
  201. currentTimeLabel() {
  202. return this.timeLabels[this.currentTimeIndex] || '0h'
  203. }
  204. },
  205. mounted() {
  206. setTimeout(() => {
  207. this.generateTimeData()
  208. this.initHeilinChart()
  209. this.initReservoirChart()
  210. this.initComparisonChart()
  211. this.updateMapData()
  212. this.emitScenarioAndRisk()
  213. }, 100)
  214. },
  215. beforeUnmount() {
  216. this.stopPlay()
  217. if (this.heilinChart) {
  218. this.heilinChart.dispose()
  219. }
  220. if (this.reservoirChart) {
  221. this.reservoirChart.dispose()
  222. }
  223. if (this.comparisonChart) {
  224. this.comparisonChart.dispose()
  225. }
  226. },
  227. methods: {
  228. selectScenario(value) {
  229. this.selectedScenario = value
  230. this.emitScenarioAndRisk()
  231. },
  232. selectScheme(value) {
  233. this.selectedScheme = value
  234. this.emitScenarioAndRisk()
  235. },
  236. emitScenarioAndRisk() {
  237. const scenario = this.scenarioList.find(s => s.value === this.selectedScenario)?.label || '小雨情景(24h)'
  238. const riskLevel = this.riskLevelText
  239. this.$emit('updateScenarioAndRisk', { scenario, riskLevel, selectedScenario: this.selectedScenario })
  240. },
  241. startSimulation() {
  242. this.currentTimeIndex = 0
  243. this.generateTimeData()
  244. this.$nextTick(() => {
  245. this.initHeilinChart()
  246. this.initReservoirChart()
  247. this.initComparisonChart()
  248. this.updateMapData()
  249. })
  250. },
  251. generateTimeData() {
  252. const { levelData, flowData } = this.getHeilinData()
  253. const { inflowData, levelData: reservoirLevelData } = this.getReservoirData()
  254. this.heilinTimeData = this.timeLabels.map((_, index) => ({
  255. waterLevel: levelData[index]?.toFixed(2) || '3.25',
  256. flow: flowData[index]?.toFixed(1) || '12.5',
  257. rainfall: this.getRainfallForTime(index)
  258. }))
  259. this.reservoirTimeData = this.timeLabels.map((_, index) => ({
  260. waterLevel: reservoirLevelData[index]?.toFixed(2) || '18.5',
  261. storage: this.getStorageForTime(reservoirLevelData[index])
  262. }))
  263. },
  264. getRainfallForTime(index) {
  265. const baseRain = 0.5
  266. let multiplier = 1
  267. if (this.selectedScenario === 'light') multiplier = 1.5
  268. else if (this.selectedScenario === 'moderate') multiplier = 3
  269. else if (this.selectedScenario === 'heavy') multiplier = 6
  270. else if (this.selectedScenario === 'storm24') multiplier = 12
  271. else if (this.selectedScenario === 'storm72') multiplier = 18
  272. const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
  273. const distance = Math.abs(index - peakIndex)
  274. const decay = Math.exp(-distance * 0.15)
  275. return (baseRain * multiplier * decay).toFixed(1)
  276. },
  277. getStorageForTime(level) {
  278. const baseStorage = 2000
  279. const levelDiff = (level || 18.5) - 18.0
  280. const storage = baseStorage + levelDiff * 300
  281. return storage.toFixed(1)
  282. },
  283. onTimelineChange(event) {
  284. this.stopPlay()
  285. this.currentTimeIndex = parseInt(event.target.value)
  286. this.$emit('updateSimulationTime', this.currentTimeIndex)
  287. if (this.heilinTimeData.length === 0 || this.reservoirTimeData.length === 0) {
  288. this.generateTimeData()
  289. }
  290. this.updateMapData()
  291. this.highlightChartPoint()
  292. },
  293. updateMapData() {
  294. const heilinData = this.heilinTimeData[this.currentTimeIndex] || {
  295. waterLevel: '3.25',
  296. flow: '12.5',
  297. rainfall: '0.5'
  298. }
  299. const reservoirData = this.reservoirTimeData[this.currentTimeIndex] || {
  300. waterLevel: '18.5',
  301. storage: '2350.8'
  302. }
  303. this.$emit('updateSimulationData', {
  304. heilinStation: heilinData,
  305. reservoir: reservoirData
  306. })
  307. },
  308. highlightChartPoint() {
  309. },
  310. togglePlay() {
  311. if (this.isPlaying) {
  312. this.stopPlay()
  313. } else {
  314. this.startPlay()
  315. }
  316. },
  317. startPlay() {
  318. this.isPlaying = true
  319. if (this.currentTimeIndex >= this.timeLabels.length - 1) {
  320. this.currentTimeIndex = 0
  321. }
  322. this.playInterval = setInterval(() => {
  323. if (this.currentTimeIndex < this.timeLabels.length - 1) {
  324. this.currentTimeIndex++
  325. this.$emit('updateSimulationTime', this.currentTimeIndex)
  326. this.updateMapData()
  327. } else {
  328. this.stopPlay()
  329. }
  330. }, 800)
  331. },
  332. stopPlay() {
  333. this.isPlaying = false
  334. if (this.playInterval) {
  335. clearInterval(this.playInterval)
  336. this.playInterval = null
  337. }
  338. },
  339. getHeilinData() {
  340. const baseLevel = 3.0
  341. const baseFlow = 10
  342. let levelOffset = 0
  343. let flowMultiplier = 1
  344. if (this.selectedScenario === 'light') {
  345. levelOffset = 0.2
  346. flowMultiplier = 1.2
  347. } else if (this.selectedScenario === 'moderate') {
  348. levelOffset = 0.5
  349. flowMultiplier = 1.8
  350. } else if (this.selectedScenario === 'heavy') {
  351. levelOffset = 0.8
  352. flowMultiplier = 2.8
  353. } else if (this.selectedScenario === 'storm24') {
  354. levelOffset = 1.2
  355. flowMultiplier = 4.2
  356. } else if (this.selectedScenario === 'storm72') {
  357. levelOffset = 1.5
  358. flowMultiplier = 5.5
  359. }
  360. const levelData = this.timeLabels.map((_, i) => {
  361. const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
  362. const distance = Math.abs(i - peakIndex)
  363. const decay = Math.exp(-distance * 0.15)
  364. return baseLevel + levelOffset * decay
  365. })
  366. const flowData = this.timeLabels.map((_, i) => {
  367. const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
  368. const distance = Math.abs(i - peakIndex)
  369. const decay = Math.exp(-distance * 0.12)
  370. return baseFlow + (flowMultiplier - 1) * 15 * decay
  371. })
  372. return { levelData, flowData }
  373. },
  374. getReservoirData() {
  375. const baseInflow = 20
  376. const baseLevel = 18.0
  377. let inflowMultiplier = 1
  378. let levelOffset = 0
  379. if (this.selectedScenario === 'light') {
  380. inflowMultiplier = 1.3
  381. levelOffset = 0.3
  382. } else if (this.selectedScenario === 'moderate') {
  383. inflowMultiplier = 1.8
  384. levelOffset = 0.6
  385. } else if (this.selectedScenario === 'heavy') {
  386. inflowMultiplier = 2.5
  387. levelOffset = 1.0
  388. } else if (this.selectedScenario === 'storm24') {
  389. inflowMultiplier = 3.8
  390. levelOffset = 1.5
  391. } else if (this.selectedScenario === 'storm72') {
  392. inflowMultiplier = 5.0
  393. levelOffset = 2.0
  394. }
  395. if (this.selectedScheme === 'advance') {
  396. levelOffset -= 0.4
  397. } else if (this.selectedScheme === 'control') {
  398. levelOffset += 0.4
  399. }
  400. const inflowData = this.timeLabels.map((_, i) => {
  401. const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
  402. const distance = Math.abs(i - peakIndex)
  403. const decay = Math.exp(-distance * 0.1)
  404. return baseInflow + (inflowMultiplier - 1) * 30 * decay
  405. })
  406. const levelData = this.timeLabels.map((_, i) => {
  407. const peakIndex = this.selectedScenario === 'storm72' ? 12 : 8
  408. const distance = Math.abs(i - peakIndex)
  409. const decay = Math.exp(-distance * 0.08)
  410. return baseLevel + levelOffset * decay
  411. })
  412. return { inflowData, levelData }
  413. },
  414. initHeilinChart() {
  415. if (document.getElementById('heilinChart')) {
  416. if (this.heilinChart) {
  417. this.heilinChart.dispose()
  418. }
  419. this.heilinChart = echarts.init(document.getElementById('heilinChart'))
  420. const { levelData, flowData } = this.getHeilinData()
  421. const option = {
  422. animation: true,
  423. tooltip: {
  424. trigger: 'axis'
  425. },
  426. legend: {
  427. data: ['水位', '流量', '警戒水位', '保证水位'],
  428. textStyle: {
  429. color: '#7bbef6',
  430. fontSize: 10
  431. },
  432. top: 5
  433. },
  434. grid: {
  435. left: '3%',
  436. right: '4%',
  437. bottom: '3%',
  438. top: '40px',
  439. containLabel: true
  440. },
  441. xAxis: {
  442. type: 'category',
  443. boundaryGap: false,
  444. data: this.timeLabels,
  445. axisLine: {
  446. lineStyle: {
  447. color: '#7bbef6'
  448. }
  449. },
  450. axisLabel: {
  451. color: '#7bbef6',
  452. fontSize: 9
  453. }
  454. },
  455. yAxis: [
  456. {
  457. type: 'value',
  458. name: '水位(m)',
  459. nameTextStyle: {
  460. color: '#ffd93d',
  461. fontSize: 10
  462. },
  463. min: 2.5,
  464. max: 5.0,
  465. axisLine: {
  466. lineStyle: {
  467. color: '#ffd93d'
  468. }
  469. },
  470. axisLabel: {
  471. color: '#ffd93d',
  472. fontSize: 9
  473. },
  474. splitLine: {
  475. lineStyle: {
  476. color: 'rgba(123, 190, 246, 0.2)'
  477. }
  478. }
  479. },
  480. {
  481. type: 'value',
  482. name: '流量(m³/s)',
  483. nameTextStyle: {
  484. color: '#62f6fb',
  485. fontSize: 10
  486. },
  487. min: 0,
  488. max: 100,
  489. position: 'right',
  490. axisLine: {
  491. lineStyle: {
  492. color: '#62f6fb'
  493. }
  494. },
  495. axisLabel: {
  496. color: '#62f6fb',
  497. fontSize: 9
  498. },
  499. splitLine: {
  500. show: false
  501. }
  502. }
  503. ],
  504. series: [
  505. {
  506. name: '水位',
  507. type: 'line',
  508. yAxisIndex: 0,
  509. data: levelData,
  510. lineStyle: {
  511. color: '#ffd93d',
  512. width: 2
  513. },
  514. itemStyle: {
  515. color: '#ffd93d'
  516. }
  517. },
  518. {
  519. name: '流量',
  520. type: 'line',
  521. yAxisIndex: 1,
  522. data: flowData,
  523. lineStyle: {
  524. color: '#62f6fb',
  525. width: 2
  526. },
  527. itemStyle: {
  528. color: '#62f6fb'
  529. }
  530. },
  531. {
  532. name: '警戒水位',
  533. type: 'line',
  534. yAxisIndex: 0,
  535. data: new Array(this.timeLabels.length).fill(4.0),
  536. lineStyle: {
  537. color: '#ffd93d',
  538. width: 1,
  539. type: 'dashed'
  540. },
  541. symbol: 'none'
  542. },
  543. {
  544. name: '保证水位',
  545. type: 'line',
  546. yAxisIndex: 0,
  547. data: new Array(this.timeLabels.length).fill(4.5),
  548. lineStyle: {
  549. color: '#ff6b6b',
  550. width: 1,
  551. type: 'dashed'
  552. },
  553. symbol: 'none'
  554. }
  555. ]
  556. }
  557. this.heilinChart.setOption(option)
  558. }
  559. },
  560. initReservoirChart() {
  561. if (document.getElementById('reservoirChart')) {
  562. if (this.reservoirChart) {
  563. this.reservoirChart.dispose()
  564. }
  565. this.reservoirChart = echarts.init(document.getElementById('reservoirChart'))
  566. const { inflowData, levelData } = this.getReservoirData()
  567. const option = {
  568. animation: true,
  569. tooltip: {
  570. trigger: 'axis'
  571. },
  572. legend: {
  573. data: ['入库流量', '库水位', '汛限水位'],
  574. textStyle: {
  575. color: '#7bbef6',
  576. fontSize: 10
  577. },
  578. top: 5
  579. },
  580. grid: {
  581. left: '3%',
  582. right: '4%',
  583. bottom: '3%',
  584. top: '40px',
  585. containLabel: true
  586. },
  587. xAxis: {
  588. type: 'category',
  589. boundaryGap: false,
  590. data: this.timeLabels,
  591. axisLine: {
  592. lineStyle: {
  593. color: '#7bbef6'
  594. }
  595. },
  596. axisLabel: {
  597. color: '#7bbef6',
  598. fontSize: 9
  599. }
  600. },
  601. yAxis: [
  602. {
  603. type: 'value',
  604. name: '水位(m)',
  605. nameTextStyle: {
  606. color: '#ffd93d',
  607. fontSize: 10
  608. },
  609. min: 17,
  610. max: 21,
  611. axisLine: {
  612. lineStyle: {
  613. color: '#ffd93d'
  614. }
  615. },
  616. axisLabel: {
  617. color: '#ffd93d',
  618. fontSize: 9
  619. },
  620. splitLine: {
  621. lineStyle: {
  622. color: 'rgba(123, 190, 246, 0.2)'
  623. }
  624. }
  625. },
  626. {
  627. type: 'value',
  628. name: '流量(m³/s)',
  629. nameTextStyle: {
  630. color: '#62f6fb',
  631. fontSize: 10
  632. },
  633. min: 0,
  634. max: 200,
  635. position: 'right',
  636. axisLine: {
  637. lineStyle: {
  638. color: '#62f6fb'
  639. }
  640. },
  641. axisLabel: {
  642. color: '#62f6fb',
  643. fontSize: 9
  644. },
  645. splitLine: {
  646. show: false
  647. }
  648. }
  649. ],
  650. series: [
  651. {
  652. name: '入库流量',
  653. type: 'line',
  654. yAxisIndex: 1,
  655. data: inflowData,
  656. lineStyle: {
  657. color: '#62f6fb',
  658. width: 2
  659. },
  660. itemStyle: {
  661. color: '#62f6fb'
  662. }
  663. },
  664. {
  665. name: '库水位',
  666. type: 'line',
  667. yAxisIndex: 0,
  668. data: levelData,
  669. lineStyle: {
  670. color: '#ffd93d',
  671. width: 2
  672. },
  673. itemStyle: {
  674. color: '#ffd93d'
  675. }
  676. },
  677. {
  678. name: '汛限水位',
  679. type: 'line',
  680. yAxisIndex: 0,
  681. data: new Array(this.timeLabels.length).fill(20.0),
  682. lineStyle: {
  683. color: '#3b82f6',
  684. width: 1,
  685. type: 'dashed'
  686. },
  687. symbol: 'none'
  688. }
  689. ]
  690. }
  691. this.reservoirChart.setOption(option)
  692. }
  693. },
  694. initComparisonChart() {
  695. if (document.getElementById('comparisonChart')) {
  696. if (this.comparisonChart) {
  697. this.comparisonChart.dispose()
  698. }
  699. this.comparisonChart = echarts.init(document.getElementById('comparisonChart'))
  700. const baseLevel = 18.0
  701. let levelOffset = 0
  702. if (this.selectedScenario === 'light') {
  703. levelOffset = 0.3
  704. } else if (this.selectedScenario === 'moderate') {
  705. levelOffset = 0.6
  706. } else if (this.selectedScenario === 'heavy') {
  707. levelOffset = 1.0
  708. } else if (this.selectedScenario === 'storm24') {
  709. levelOffset = 1.5
  710. } else if (this.selectedScenario === 'storm72') {
  711. levelOffset = 2.0
  712. }
  713. const currentData = this.timeLabels.map((_, i) => {
  714. const peakIndex = this.selectedScenario === 'storm72' ? 12 : 8
  715. const distance = Math.abs(i - peakIndex)
  716. const decay = Math.exp(-distance * 0.08)
  717. return baseLevel + levelOffset * decay
  718. })
  719. const advanceData = currentData.map(v => v - 0.4)
  720. const controlData = currentData.map(v => v + 0.4)
  721. const option = {
  722. animation: true,
  723. tooltip: {
  724. trigger: 'axis'
  725. },
  726. legend: {
  727. data: ['现状调度', '提前泄洪', '控制泄洪'],
  728. textStyle: {
  729. color: '#7bbef6',
  730. fontSize: 10
  731. },
  732. top: 5
  733. },
  734. grid: {
  735. left: '3%',
  736. right: '4%',
  737. bottom: '3%',
  738. top: '40px',
  739. containLabel: true
  740. },
  741. xAxis: {
  742. type: 'category',
  743. boundaryGap: false,
  744. data: this.timeLabels,
  745. axisLine: {
  746. lineStyle: {
  747. color: '#7bbef6'
  748. }
  749. },
  750. axisLabel: {
  751. color: '#7bbef6',
  752. fontSize: 9
  753. }
  754. },
  755. yAxis: {
  756. type: 'value',
  757. name: '库水位(m)',
  758. nameTextStyle: {
  759. color: '#ffd93d',
  760. fontSize: 10
  761. },
  762. min: 17,
  763. max: 21,
  764. axisLine: {
  765. lineStyle: {
  766. color: '#ffd93d'
  767. }
  768. },
  769. axisLabel: {
  770. color: '#ffd93d',
  771. fontSize: 9
  772. },
  773. splitLine: {
  774. lineStyle: {
  775. color: 'rgba(123, 190, 246, 0.2)'
  776. }
  777. }
  778. },
  779. series: [
  780. {
  781. name: '现状调度',
  782. type: 'line',
  783. data: currentData,
  784. lineStyle: {
  785. color: '#f97316',
  786. width: 2
  787. },
  788. itemStyle: {
  789. color: '#f97316'
  790. }
  791. },
  792. {
  793. name: '提前泄洪',
  794. type: 'line',
  795. data: advanceData,
  796. lineStyle: {
  797. color: '#10b981',
  798. width: 2
  799. },
  800. itemStyle: {
  801. color: '#10b981'
  802. }
  803. },
  804. {
  805. name: '控制泄洪',
  806. type: 'line',
  807. data: controlData,
  808. lineStyle: {
  809. color: '#a855f7',
  810. width: 2
  811. },
  812. itemStyle: {
  813. color: '#a855f7'
  814. }
  815. }
  816. ]
  817. }
  818. this.comparisonChart.setOption(option)
  819. }
  820. }
  821. }
  822. }
  823. </script>
  824. <style scoped>
  825. .simulation-panel {
  826. width: 100%;
  827. height: 100%;
  828. }
  829. .timeline-section {
  830. position: absolute;
  831. left: 390px;
  832. right: 460px;
  833. top: 120px;
  834. z-index: 5;
  835. }
  836. .timeline-card {
  837. width: 100%;
  838. background: rgba(0, 20, 40, 0.7);
  839. border-radius: 4px;
  840. overflow: hidden;
  841. box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
  842. }
  843. .timeline-body {
  844. padding: 10px 15px;
  845. }
  846. .timeline-row {
  847. display: flex;
  848. align-items: center;
  849. gap: 10px;
  850. margin-bottom: 10px;
  851. }
  852. .play-btn {
  853. width: 30px;
  854. height: 30px;
  855. background: rgba(0, 212, 255, 0.2);
  856. border: 1px solid rgba(0, 212, 255, 0.5);
  857. border-radius: 4px;
  858. color: #62f6fb;
  859. font-size: 14px;
  860. cursor: pointer;
  861. display: flex;
  862. align-items: center;
  863. justify-content: center;
  864. transition: all 0.3s ease;
  865. }
  866. .play-btn:hover {
  867. background: rgba(0, 212, 255, 0.3);
  868. border-color: #62f6fb;
  869. }
  870. .timeline-slider {
  871. width: 100%;
  872. height: 6px;
  873. -webkit-appearance: none;
  874. appearance: none;
  875. background: rgba(0, 40, 80, 0.8);
  876. border-radius: 3px;
  877. outline: none;
  878. margin-bottom: 6px;
  879. }
  880. .timeline-slider::-webkit-slider-thumb {
  881. -webkit-appearance: none;
  882. appearance: none;
  883. width: 16px;
  884. height: 16px;
  885. border-radius: 50%;
  886. background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  887. cursor: pointer;
  888. box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
  889. transition: all 0.2s ease;
  890. }
  891. .timeline-slider::-webkit-slider-thumb:hover {
  892. transform: scale(1.15);
  893. box-shadow: 0 0 12px rgba(14, 165, 233, 0.8);
  894. }
  895. .timeline-slider::-moz-range-thumb {
  896. width: 16px;
  897. height: 16px;
  898. border-radius: 50%;
  899. background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  900. cursor: pointer;
  901. border: none;
  902. box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
  903. }
  904. .timeline-labels {
  905. display: flex;
  906. justify-content: space-between;
  907. padding: 0 3px;
  908. }
  909. .timeline-label {
  910. font-size: 9px;
  911. color: #7bbef6;
  912. flex-shrink: 0;
  913. }
  914. .left-sidebar {
  915. position: absolute;
  916. left: 20px;
  917. top: 120px;
  918. width: 350px;
  919. z-index: 5;
  920. }
  921. .right-sidebar {
  922. position: absolute;
  923. right: 20px;
  924. top: 120px;
  925. bottom: 20px;
  926. width: 420px;
  927. z-index: 5;
  928. overflow-y: auto;
  929. padding-right: 5px;
  930. }
  931. .right-sidebar::-webkit-scrollbar {
  932. width: 6px;
  933. }
  934. .right-sidebar::-webkit-scrollbar-track {
  935. background: rgba(0, 20, 40, 0.5);
  936. border-radius: 3px;
  937. }
  938. .right-sidebar::-webkit-scrollbar-thumb {
  939. background: rgba(0, 212, 255, 0.4);
  940. border-radius: 3px;
  941. }
  942. .right-sidebar::-webkit-scrollbar-thumb:hover {
  943. background: rgba(0, 212, 255, 0.6);
  944. }
  945. .data-card {
  946. width: 100%;
  947. background: rgba(0, 20, 40, 0.7);
  948. border-radius: 4px;
  949. overflow: hidden;
  950. box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
  951. }
  952. .card-header {
  953. height: 50px;
  954. background-image: url('/src/assets/images/数据小标题.png');
  955. background-size: 100% 100%;
  956. background-position: center;
  957. background-repeat: no-repeat;
  958. display: flex;
  959. align-items: flex-start;
  960. justify-content: space-between;
  961. padding: 6px 20px 0;
  962. }
  963. .card-title {
  964. font-size: 18px;
  965. font-weight: bold;
  966. color: #e0fcff;
  967. margin: 0;
  968. text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
  969. padding-left: 20px;
  970. }
  971. .card-body {
  972. padding: 15px;
  973. font-size: 16px;
  974. line-height: 1.6;
  975. margin-top: -10px;
  976. }
  977. .section-title {
  978. font-size: 14px;
  979. color: #7bbef6;
  980. margin: 5px 0 12px;
  981. font-weight: bold;
  982. }
  983. .scenario-list,
  984. .scheme-list {
  985. display: flex;
  986. flex-direction: column;
  987. gap: 8px;
  988. }
  989. .scenario-item,
  990. .scheme-item {
  991. display: flex;
  992. align-items: center;
  993. gap: 10px;
  994. padding: 10px 12px;
  995. background: rgba(0, 20, 40, 0.5);
  996. border: 1px solid rgba(0, 212, 255, 0.2);
  997. border-radius: 4px;
  998. cursor: pointer;
  999. transition: all 0.3s ease;
  1000. }
  1001. .scenario-item:hover,
  1002. .scenario-item.active,
  1003. .scheme-item:hover,
  1004. .scheme-item.active {
  1005. border-color: #62f6fb;
  1006. background: rgba(98, 246, 251, 0.1);
  1007. }
  1008. .scenario-radio,
  1009. .scheme-radio {
  1010. width: 16px;
  1011. height: 16px;
  1012. border: 2px solid rgba(0, 212, 255, 0.4);
  1013. border-radius: 50%;
  1014. background: transparent;
  1015. flex-shrink: 0;
  1016. transition: all 0.2s ease;
  1017. }
  1018. .scenario-radio.checked,
  1019. .scheme-radio.checked {
  1020. background: #62f6fb;
  1021. border-color: #62f6fb;
  1022. position: relative;
  1023. }
  1024. .scenario-radio.checked::after,
  1025. .scheme-radio.checked::after {
  1026. content: '';
  1027. position: absolute;
  1028. left: 50%;
  1029. top: 50%;
  1030. transform: translate(-50%, -50%);
  1031. width: 6px;
  1032. height: 6px;
  1033. border-radius: 50%;
  1034. background: #000;
  1035. }
  1036. .scenario-name,
  1037. .scheme-name {
  1038. color: #e0fcff;
  1039. font-size: 13px;
  1040. font-weight: bold;
  1041. }
  1042. .section-divider {
  1043. height: 1px;
  1044. background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
  1045. margin: 18px 0;
  1046. }
  1047. .start-btn {
  1048. width: 100%;
  1049. margin-top: 20px;
  1050. padding: 12px 20px;
  1051. background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  1052. border: none;
  1053. border-radius: 6px;
  1054. color: #fff;
  1055. font-size: 16px;
  1056. font-weight: bold;
  1057. cursor: pointer;
  1058. transition: all 0.3s ease;
  1059. box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
  1060. }
  1061. .start-btn:hover {
  1062. background: linear-gradient(135deg, #0284c7, #0891b2);
  1063. box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
  1064. transform: translateY(-2px);
  1065. }
  1066. .start-btn:active {
  1067. transform: translateY(0);
  1068. }
  1069. .chart-card {
  1070. width: 100%;
  1071. background: rgba(0, 20, 40, 0.7);
  1072. border-radius: 4px;
  1073. overflow: hidden;
  1074. box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
  1075. margin-bottom: 15px;
  1076. }
  1077. .chart-card:last-child {
  1078. margin-bottom: 0;
  1079. }
  1080. .chart-card-header {
  1081. height: 40px;
  1082. background-image: url('/src/assets/images/数据小标题.png');
  1083. background-size: 100% 100%;
  1084. background-position: center;
  1085. background-repeat: no-repeat;
  1086. display: flex;
  1087. align-items: flex-start;
  1088. justify-content: center;
  1089. padding: 3px 20px 0;
  1090. }
  1091. .chart-card-title {
  1092. font-size: 15px;
  1093. font-weight: bold;
  1094. color: #e0fcff;
  1095. margin: 0;
  1096. text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
  1097. }
  1098. .chart-card-body {
  1099. padding: 10px 15px 15px;
  1100. }
  1101. .chart-subtitle {
  1102. font-size: 12px;
  1103. color: #7bbef6;
  1104. text-align: center;
  1105. margin-bottom: 8px;
  1106. }
  1107. .chart-container {
  1108. width: 100%;
  1109. height: 180px;
  1110. }
  1111. .risk-assessment {
  1112. display: flex;
  1113. flex-direction: column;
  1114. gap: 12px;
  1115. }
  1116. .risk-item {
  1117. display: flex;
  1118. justify-content: space-between;
  1119. align-items: center;
  1120. padding: 10px 12px;
  1121. background: rgba(0, 30, 60, 0.6);
  1122. border: 1px solid rgba(0, 212, 255, 0.2);
  1123. border-radius: 4px;
  1124. }
  1125. .risk-label {
  1126. color: #7bbef6;
  1127. font-size: 13px;
  1128. font-weight: bold;
  1129. }
  1130. .risk-status,
  1131. .risk-level {
  1132. padding: 4px 12px;
  1133. border-radius: 4px;
  1134. font-size: 12px;
  1135. font-weight: bold;
  1136. }
  1137. .risk-status.normal,
  1138. .risk-level.normal {
  1139. background: #22c55e;
  1140. color: #fff;
  1141. }
  1142. .risk-status.attention,
  1143. .risk-level.attention {
  1144. background: #f59e0b;
  1145. color: #fff;
  1146. }
  1147. .risk-status.warning,
  1148. .risk-level.warning {
  1149. background: #f97316;
  1150. color: #fff;
  1151. }
  1152. .risk-status.danger,
  1153. .risk-level.danger {
  1154. background: #ef4444;
  1155. color: #fff;
  1156. }
  1157. .conclusion-section {
  1158. margin-top: 5px;
  1159. padding: 12px;
  1160. background: rgba(0, 40, 80, 0.6);
  1161. border: 1px solid rgba(0, 212, 255, 0.3);
  1162. border-radius: 4px;
  1163. }
  1164. .conclusion-title {
  1165. font-size: 13px;
  1166. color: #62f6fb;
  1167. font-weight: bold;
  1168. margin-bottom: 8px;
  1169. }
  1170. .conclusion-text {
  1171. font-size: 12px;
  1172. color: #e0fcff;
  1173. line-height: 1.6;
  1174. }
  1175. </style>