| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265 |
- <template>
- <div class="simulation-panel">
- <div class="timeline-section">
- <div class="timeline-card">
- <div class="timeline-body">
- <div class="timeline-row">
- <button class="play-btn" @click="togglePlay">
- <span v-if="isPlaying">⏸</span>
- <span v-else>▶</span>
- </button>
- <input
- type="range"
- class="timeline-slider"
- :min="0"
- :max="timeLabels.length - 1"
- :value="currentTimeIndex"
- @input="onTimelineChange"
- />
- </div>
- <div class="timeline-labels">
- <span v-for="(label, index) in timeLabels" :key="index" class="timeline-label">{{ label }}</span>
- </div>
- </div>
- </div>
- </div>
-
- <div class="left-sidebar">
- <div class="data-card">
- <div class="card-header">
- <h3 class="card-title">预演条件设置</h3>
- </div>
- <div class="card-body">
- <div class="section-title">降雨情景选择</div>
- <div class="scenario-list">
- <div
- v-for="(scenario, index) in scenarioList"
- :key="index"
- class="scenario-item"
- :class="{ active: selectedScenario === scenario.value }"
- @click="selectScenario(scenario.value)"
- >
- <div class="scenario-radio" :class="{ checked: selectedScenario === scenario.value }"></div>
- <div class="scenario-name">{{ scenario.label }}</div>
- </div>
- </div>
-
- <div class="section-divider"></div>
-
- <div class="section-title">水库调度方案选择</div>
- <div class="scheme-list">
- <div
- v-for="(scheme, index) in schemeList"
- :key="index"
- class="scheme-item"
- :class="{ active: selectedScheme === scheme.value }"
- @click="selectScheme(scheme.value)"
- >
- <div class="scheme-radio" :class="{ checked: selectedScheme === scheme.value }"></div>
- <div class="scheme-name">{{ scheme.label }}</div>
- </div>
- </div>
-
- <button class="start-btn" @click="startSimulation">
- 开始预演
- </button>
- </div>
- </div>
- </div>
- <div class="right-sidebar">
- <div class="chart-card">
- <div class="chart-card-header">
- <h4 class="chart-card-title">流域径流预演</h4>
- </div>
- <div class="chart-card-body">
- <div class="chart-subtitle">黑林水文站 —— 水位 / 流量预演过程</div>
- <div id="heilinChart" class="chart-container"></div>
- </div>
- </div>
-
- <div class="chart-card">
- <div class="chart-card-header">
- <h4 class="chart-card-title">小塔山水库预演</h4>
- </div>
- <div class="chart-card-body">
- <div class="chart-subtitle">小塔山水库 —— 入库流量 & 库水位预演</div>
- <div id="reservoirChart" class="chart-container"></div>
- </div>
- </div>
-
- <div class="chart-card">
- <div class="chart-card-header">
- <h4 class="chart-card-title">调度方案对比预演</h4>
- </div>
- <div class="chart-card-body">
- <div class="chart-subtitle">不同调度方案影响对比</div>
- <div id="comparisonChart" class="chart-container"></div>
- </div>
- </div>
-
- </div>
- </div>
- </template>
- <script>
- import * as echarts from 'echarts'
- export default {
- name: 'HydrologySimulationPanel',
- props: {
- simulationTime: {
- type: Number,
- default: 0
- },
- simulationData: {
- type: Object,
- default: () => ({})
- }
- },
- emits: ['updateSimulationTime', 'updateSimulationData', 'updateScenarioAndRisk'],
- data() {
- return {
- heilinChart: null,
- reservoirChart: null,
- comparisonChart: null,
- selectedScenario: 'light',
- selectedScheme: 'current',
- currentTimeIndex: 0,
- heilinTimeData: [],
- reservoirTimeData: [],
- isPlaying: false,
- playInterval: null,
- scenarioList: [
- { label: '小雨情景(24h)', value: 'light' },
- { label: '中雨情景(24h)', value: 'moderate' },
- { label: '大雨情景(24h)', value: 'heavy' },
- { label: '24h 暴雨情景', value: 'storm24' },
- { label: '72h 暴雨情景', value: 'storm72' }
- ],
- schemeList: [
- { label: '现状调度(默认出库)', value: 'current' },
- { label: '提前泄洪(加大出库)', value: 'advance' },
- { label: '控制泄洪(减少出库)', value: 'control' }
- ],
- timeLabels: ['0h', '6h', '12h', '18h', '24h', '30h', '36h', '42h', '48h', '54h', '60h', '66h', '72h']
- }
- },
- computed: {
- heilinRiskClass() {
- if (this.selectedScenario === 'storm72') return 'danger'
- if (this.selectedScenario === 'storm24') return 'warning'
- if (this.selectedScenario === 'heavy') return 'attention'
- return 'normal'
- },
- heilinRiskText() {
- if (this.selectedScenario === 'storm72') return '超保证水位'
- if (this.selectedScenario === 'storm24') return '超警戒水位'
- if (this.selectedScenario === 'heavy') return '接近警戒'
- return '正常'
- },
- reservoirRiskClass() {
- if (this.selectedScenario === 'storm72' && this.selectedScheme === 'control') return 'danger'
- if (this.selectedScenario === 'storm24' && this.selectedScheme !== 'advance') return 'warning'
- if (this.selectedScenario === 'storm72' && this.selectedScheme === 'current') return 'warning'
- if (this.selectedScenario === 'heavy') return 'attention'
- return 'normal'
- },
- reservoirRiskText() {
- if (this.selectedScenario === 'storm72' && this.selectedScheme === 'control') return '超汛限水位'
- if (this.selectedScenario === 'storm24' && this.selectedScheme !== 'advance') return '超汛限水位'
- if (this.selectedScenario === 'storm72' && this.selectedScheme === 'current') return '超汛限水位'
- if (this.selectedScenario === 'heavy') return '接近汛限'
- return '正常'
- },
- riskLevelClass() {
- if (this.selectedScenario === 'storm72' || (this.selectedScenario === 'storm24' && this.selectedScheme === 'control')) return 'danger'
- if (this.selectedScenario === 'storm24' || (this.selectedScenario === 'heavy' && this.selectedScheme === 'control')) return 'warning'
- if (this.selectedScenario === 'heavy') return 'attention'
- return 'normal'
- },
- riskLevelText() {
- if (this.selectedScenario === 'storm72' || (this.selectedScenario === 'storm24' && this.selectedScheme === 'control')) return '危险'
- if (this.selectedScenario === 'storm24' || (this.selectedScenario === 'heavy' && this.selectedScheme === 'control')) return '警戒'
- if (this.selectedScenario === 'heavy') return '注意'
- return '正常'
- },
- conclusionText() {
- const scenario = this.scenarioList.find(s => s.value === this.selectedScenario)?.label
- if (this.selectedScenario === 'storm72') {
- if (this.selectedScheme === 'advance') {
- return `${scenario}下,建议提前泄洪,可有效控制库水位。`
- } else if (this.selectedScheme === 'control') {
- return `${scenario}下,控制泄洪将导致水库严重超汛限水位,建议立即加大泄洪。`
- } else {
- return `${scenario}下,现状调度将超汛限水位,建议提前泄洪。`
- }
- } else if (this.selectedScenario === 'storm24') {
- if (this.selectedScheme === 'advance') {
- return `${scenario}下,提前泄洪可有效控制库水位在汛限以下。`
- } else {
- return `${scenario}下,将超汛限水位,建议加大泄洪。`
- }
- } else if (this.selectedScenario === 'heavy') {
- return `${scenario}下,库水位接近汛限,建议关注水情变化。`
- } else {
- return `${scenario}下,水情平稳,可维持现状调度。`
- }
- }
- },
- computed: {
- currentTimeLabel() {
- return this.timeLabels[this.currentTimeIndex] || '0h'
- }
- },
- mounted() {
- setTimeout(() => {
- this.generateTimeData()
- this.initHeilinChart()
- this.initReservoirChart()
- this.initComparisonChart()
- this.updateMapData()
- this.emitScenarioAndRisk()
- }, 100)
- },
- beforeUnmount() {
- this.stopPlay()
- if (this.heilinChart) {
- this.heilinChart.dispose()
- }
- if (this.reservoirChart) {
- this.reservoirChart.dispose()
- }
- if (this.comparisonChart) {
- this.comparisonChart.dispose()
- }
- },
- methods: {
- selectScenario(value) {
- this.selectedScenario = value
- this.emitScenarioAndRisk()
- },
- selectScheme(value) {
- this.selectedScheme = value
- this.emitScenarioAndRisk()
- },
- emitScenarioAndRisk() {
- const scenario = this.scenarioList.find(s => s.value === this.selectedScenario)?.label || '小雨情景(24h)'
- const riskLevel = this.riskLevelText
- this.$emit('updateScenarioAndRisk', { scenario, riskLevel, selectedScenario: this.selectedScenario })
- },
- startSimulation() {
- this.currentTimeIndex = 0
- this.generateTimeData()
- this.$nextTick(() => {
- this.initHeilinChart()
- this.initReservoirChart()
- this.initComparisonChart()
- this.updateMapData()
- })
- },
- generateTimeData() {
- const { levelData, flowData } = this.getHeilinData()
- const { inflowData, levelData: reservoirLevelData } = this.getReservoirData()
-
- this.heilinTimeData = this.timeLabels.map((_, index) => ({
- waterLevel: levelData[index]?.toFixed(2) || '3.25',
- flow: flowData[index]?.toFixed(1) || '12.5',
- rainfall: this.getRainfallForTime(index)
- }))
-
- this.reservoirTimeData = this.timeLabels.map((_, index) => ({
- waterLevel: reservoirLevelData[index]?.toFixed(2) || '18.5',
- storage: this.getStorageForTime(reservoirLevelData[index])
- }))
- },
- getRainfallForTime(index) {
- const baseRain = 0.5
- let multiplier = 1
- if (this.selectedScenario === 'light') multiplier = 1.5
- else if (this.selectedScenario === 'moderate') multiplier = 3
- else if (this.selectedScenario === 'heavy') multiplier = 6
- else if (this.selectedScenario === 'storm24') multiplier = 12
- else if (this.selectedScenario === 'storm72') multiplier = 18
-
- const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
- const distance = Math.abs(index - peakIndex)
- const decay = Math.exp(-distance * 0.15)
- return (baseRain * multiplier * decay).toFixed(1)
- },
- getStorageForTime(level) {
- const baseStorage = 2000
- const levelDiff = (level || 18.5) - 18.0
- const storage = baseStorage + levelDiff * 300
- return storage.toFixed(1)
- },
- onTimelineChange(event) {
- this.stopPlay()
- this.currentTimeIndex = parseInt(event.target.value)
- this.$emit('updateSimulationTime', this.currentTimeIndex)
-
- if (this.heilinTimeData.length === 0 || this.reservoirTimeData.length === 0) {
- this.generateTimeData()
- }
-
- this.updateMapData()
- this.highlightChartPoint()
- },
- updateMapData() {
- const heilinData = this.heilinTimeData[this.currentTimeIndex] || {
- waterLevel: '3.25',
- flow: '12.5',
- rainfall: '0.5'
- }
- const reservoirData = this.reservoirTimeData[this.currentTimeIndex] || {
- waterLevel: '18.5',
- storage: '2350.8'
- }
-
- this.$emit('updateSimulationData', {
- heilinStation: heilinData,
- reservoir: reservoirData
- })
- },
- highlightChartPoint() {
- },
- togglePlay() {
- if (this.isPlaying) {
- this.stopPlay()
- } else {
- this.startPlay()
- }
- },
- startPlay() {
- this.isPlaying = true
- if (this.currentTimeIndex >= this.timeLabels.length - 1) {
- this.currentTimeIndex = 0
- }
- this.playInterval = setInterval(() => {
- if (this.currentTimeIndex < this.timeLabels.length - 1) {
- this.currentTimeIndex++
- this.$emit('updateSimulationTime', this.currentTimeIndex)
- this.updateMapData()
- } else {
- this.stopPlay()
- }
- }, 800)
- },
- stopPlay() {
- this.isPlaying = false
- if (this.playInterval) {
- clearInterval(this.playInterval)
- this.playInterval = null
- }
- },
- getHeilinData() {
- const baseLevel = 3.0
- const baseFlow = 10
- let levelOffset = 0
- let flowMultiplier = 1
-
- if (this.selectedScenario === 'light') {
- levelOffset = 0.2
- flowMultiplier = 1.2
- } else if (this.selectedScenario === 'moderate') {
- levelOffset = 0.5
- flowMultiplier = 1.8
- } else if (this.selectedScenario === 'heavy') {
- levelOffset = 0.8
- flowMultiplier = 2.8
- } else if (this.selectedScenario === 'storm24') {
- levelOffset = 1.2
- flowMultiplier = 4.2
- } else if (this.selectedScenario === 'storm72') {
- levelOffset = 1.5
- flowMultiplier = 5.5
- }
-
- const levelData = this.timeLabels.map((_, i) => {
- const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
- const distance = Math.abs(i - peakIndex)
- const decay = Math.exp(-distance * 0.15)
- return baseLevel + levelOffset * decay
- })
-
- const flowData = this.timeLabels.map((_, i) => {
- const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
- const distance = Math.abs(i - peakIndex)
- const decay = Math.exp(-distance * 0.12)
- return baseFlow + (flowMultiplier - 1) * 15 * decay
- })
-
- return { levelData, flowData }
- },
- getReservoirData() {
- const baseInflow = 20
- const baseLevel = 18.0
- let inflowMultiplier = 1
- let levelOffset = 0
-
- if (this.selectedScenario === 'light') {
- inflowMultiplier = 1.3
- levelOffset = 0.3
- } else if (this.selectedScenario === 'moderate') {
- inflowMultiplier = 1.8
- levelOffset = 0.6
- } else if (this.selectedScenario === 'heavy') {
- inflowMultiplier = 2.5
- levelOffset = 1.0
- } else if (this.selectedScenario === 'storm24') {
- inflowMultiplier = 3.8
- levelOffset = 1.5
- } else if (this.selectedScenario === 'storm72') {
- inflowMultiplier = 5.0
- levelOffset = 2.0
- }
-
- if (this.selectedScheme === 'advance') {
- levelOffset -= 0.4
- } else if (this.selectedScheme === 'control') {
- levelOffset += 0.4
- }
-
- const inflowData = this.timeLabels.map((_, i) => {
- const peakIndex = this.selectedScenario === 'storm72' ? 10 : 6
- const distance = Math.abs(i - peakIndex)
- const decay = Math.exp(-distance * 0.1)
- return baseInflow + (inflowMultiplier - 1) * 30 * decay
- })
-
- const levelData = this.timeLabels.map((_, i) => {
- const peakIndex = this.selectedScenario === 'storm72' ? 12 : 8
- const distance = Math.abs(i - peakIndex)
- const decay = Math.exp(-distance * 0.08)
- return baseLevel + levelOffset * decay
- })
-
- return { inflowData, levelData }
- },
- initHeilinChart() {
- if (document.getElementById('heilinChart')) {
- if (this.heilinChart) {
- this.heilinChart.dispose()
- }
- this.heilinChart = echarts.init(document.getElementById('heilinChart'))
-
- const { levelData, flowData } = this.getHeilinData()
-
- const option = {
- animation: true,
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data: ['水位', '流量', '警戒水位', '保证水位'],
- textStyle: {
- color: '#7bbef6',
- fontSize: 10
- },
- top: 5
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- top: '40px',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: this.timeLabels,
- axisLine: {
- lineStyle: {
- color: '#7bbef6'
- }
- },
- axisLabel: {
- color: '#7bbef6',
- fontSize: 9
- }
- },
- yAxis: [
- {
- type: 'value',
- name: '水位(m)',
- nameTextStyle: {
- color: '#ffd93d',
- fontSize: 10
- },
- min: 2.5,
- max: 5.0,
- axisLine: {
- lineStyle: {
- color: '#ffd93d'
- }
- },
- axisLabel: {
- color: '#ffd93d',
- fontSize: 9
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(123, 190, 246, 0.2)'
- }
- }
- },
- {
- type: 'value',
- name: '流量(m³/s)',
- nameTextStyle: {
- color: '#62f6fb',
- fontSize: 10
- },
- min: 0,
- max: 100,
- position: 'right',
- axisLine: {
- lineStyle: {
- color: '#62f6fb'
- }
- },
- axisLabel: {
- color: '#62f6fb',
- fontSize: 9
- },
- splitLine: {
- show: false
- }
- }
- ],
- series: [
- {
- name: '水位',
- type: 'line',
- yAxisIndex: 0,
- data: levelData,
- lineStyle: {
- color: '#ffd93d',
- width: 2
- },
- itemStyle: {
- color: '#ffd93d'
- }
- },
- {
- name: '流量',
- type: 'line',
- yAxisIndex: 1,
- data: flowData,
- lineStyle: {
- color: '#62f6fb',
- width: 2
- },
- itemStyle: {
- color: '#62f6fb'
- }
- },
- {
- name: '警戒水位',
- type: 'line',
- yAxisIndex: 0,
- data: new Array(this.timeLabels.length).fill(4.0),
- lineStyle: {
- color: '#ffd93d',
- width: 1,
- type: 'dashed'
- },
- symbol: 'none'
- },
- {
- name: '保证水位',
- type: 'line',
- yAxisIndex: 0,
- data: new Array(this.timeLabels.length).fill(4.5),
- lineStyle: {
- color: '#ff6b6b',
- width: 1,
- type: 'dashed'
- },
- symbol: 'none'
- }
- ]
- }
- this.heilinChart.setOption(option)
- }
- },
- initReservoirChart() {
- if (document.getElementById('reservoirChart')) {
- if (this.reservoirChart) {
- this.reservoirChart.dispose()
- }
- this.reservoirChart = echarts.init(document.getElementById('reservoirChart'))
-
- const { inflowData, levelData } = this.getReservoirData()
-
- const option = {
- animation: true,
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data: ['入库流量', '库水位', '汛限水位'],
- textStyle: {
- color: '#7bbef6',
- fontSize: 10
- },
- top: 5
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- top: '40px',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: this.timeLabels,
- axisLine: {
- lineStyle: {
- color: '#7bbef6'
- }
- },
- axisLabel: {
- color: '#7bbef6',
- fontSize: 9
- }
- },
- yAxis: [
- {
- type: 'value',
- name: '水位(m)',
- nameTextStyle: {
- color: '#ffd93d',
- fontSize: 10
- },
- min: 17,
- max: 21,
- axisLine: {
- lineStyle: {
- color: '#ffd93d'
- }
- },
- axisLabel: {
- color: '#ffd93d',
- fontSize: 9
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(123, 190, 246, 0.2)'
- }
- }
- },
- {
- type: 'value',
- name: '流量(m³/s)',
- nameTextStyle: {
- color: '#62f6fb',
- fontSize: 10
- },
- min: 0,
- max: 200,
- position: 'right',
- axisLine: {
- lineStyle: {
- color: '#62f6fb'
- }
- },
- axisLabel: {
- color: '#62f6fb',
- fontSize: 9
- },
- splitLine: {
- show: false
- }
- }
- ],
- series: [
- {
- name: '入库流量',
- type: 'line',
- yAxisIndex: 1,
- data: inflowData,
- lineStyle: {
- color: '#62f6fb',
- width: 2
- },
- itemStyle: {
- color: '#62f6fb'
- }
- },
- {
- name: '库水位',
- type: 'line',
- yAxisIndex: 0,
- data: levelData,
- lineStyle: {
- color: '#ffd93d',
- width: 2
- },
- itemStyle: {
- color: '#ffd93d'
- }
- },
- {
- name: '汛限水位',
- type: 'line',
- yAxisIndex: 0,
- data: new Array(this.timeLabels.length).fill(20.0),
- lineStyle: {
- color: '#3b82f6',
- width: 1,
- type: 'dashed'
- },
- symbol: 'none'
- }
- ]
- }
- this.reservoirChart.setOption(option)
- }
- },
- initComparisonChart() {
- if (document.getElementById('comparisonChart')) {
- if (this.comparisonChart) {
- this.comparisonChart.dispose()
- }
- this.comparisonChart = echarts.init(document.getElementById('comparisonChart'))
-
- const baseLevel = 18.0
- let levelOffset = 0
-
- if (this.selectedScenario === 'light') {
- levelOffset = 0.3
- } else if (this.selectedScenario === 'moderate') {
- levelOffset = 0.6
- } else if (this.selectedScenario === 'heavy') {
- levelOffset = 1.0
- } else if (this.selectedScenario === 'storm24') {
- levelOffset = 1.5
- } else if (this.selectedScenario === 'storm72') {
- levelOffset = 2.0
- }
-
- const currentData = this.timeLabels.map((_, i) => {
- const peakIndex = this.selectedScenario === 'storm72' ? 12 : 8
- const distance = Math.abs(i - peakIndex)
- const decay = Math.exp(-distance * 0.08)
- return baseLevel + levelOffset * decay
- })
-
- const advanceData = currentData.map(v => v - 0.4)
- const controlData = currentData.map(v => v + 0.4)
-
- const option = {
- animation: true,
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data: ['现状调度', '提前泄洪', '控制泄洪'],
- textStyle: {
- color: '#7bbef6',
- fontSize: 10
- },
- top: 5
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- top: '40px',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: this.timeLabels,
- axisLine: {
- lineStyle: {
- color: '#7bbef6'
- }
- },
- axisLabel: {
- color: '#7bbef6',
- fontSize: 9
- }
- },
- yAxis: {
- type: 'value',
- name: '库水位(m)',
- nameTextStyle: {
- color: '#ffd93d',
- fontSize: 10
- },
- min: 17,
- max: 21,
- axisLine: {
- lineStyle: {
- color: '#ffd93d'
- }
- },
- axisLabel: {
- color: '#ffd93d',
- fontSize: 9
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(123, 190, 246, 0.2)'
- }
- }
- },
- series: [
- {
- name: '现状调度',
- type: 'line',
- data: currentData,
- lineStyle: {
- color: '#f97316',
- width: 2
- },
- itemStyle: {
- color: '#f97316'
- }
- },
- {
- name: '提前泄洪',
- type: 'line',
- data: advanceData,
- lineStyle: {
- color: '#10b981',
- width: 2
- },
- itemStyle: {
- color: '#10b981'
- }
- },
- {
- name: '控制泄洪',
- type: 'line',
- data: controlData,
- lineStyle: {
- color: '#a855f7',
- width: 2
- },
- itemStyle: {
- color: '#a855f7'
- }
- }
- ]
- }
- this.comparisonChart.setOption(option)
- }
- }
- }
- }
- </script>
- <style scoped>
- .simulation-panel {
- width: 100%;
- height: 100%;
- }
- .timeline-section {
- position: absolute;
- left: 390px;
- right: 460px;
- top: 120px;
- z-index: 5;
- }
- .timeline-card {
- width: 100%;
- background: rgba(0, 20, 40, 0.7);
- border-radius: 4px;
- overflow: hidden;
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
- }
- .timeline-body {
- padding: 10px 15px;
- }
- .timeline-row {
- display: flex;
- align-items: center;
- gap: 10px;
- margin-bottom: 10px;
- }
- .play-btn {
- width: 30px;
- height: 30px;
- background: rgba(0, 212, 255, 0.2);
- border: 1px solid rgba(0, 212, 255, 0.5);
- border-radius: 4px;
- color: #62f6fb;
- font-size: 14px;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.3s ease;
- }
- .play-btn:hover {
- background: rgba(0, 212, 255, 0.3);
- border-color: #62f6fb;
- }
- .timeline-slider {
- width: 100%;
- height: 6px;
- -webkit-appearance: none;
- appearance: none;
- background: rgba(0, 40, 80, 0.8);
- border-radius: 3px;
- outline: none;
- margin-bottom: 6px;
- }
- .timeline-slider::-webkit-slider-thumb {
- -webkit-appearance: none;
- appearance: none;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: linear-gradient(135deg, #0ea5e9, #06b6d4);
- cursor: pointer;
- box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
- transition: all 0.2s ease;
- }
- .timeline-slider::-webkit-slider-thumb:hover {
- transform: scale(1.15);
- box-shadow: 0 0 12px rgba(14, 165, 233, 0.8);
- }
- .timeline-slider::-moz-range-thumb {
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: linear-gradient(135deg, #0ea5e9, #06b6d4);
- cursor: pointer;
- border: none;
- box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
- }
- .timeline-labels {
- display: flex;
- justify-content: space-between;
- padding: 0 3px;
- }
- .timeline-label {
- font-size: 9px;
- color: #7bbef6;
- flex-shrink: 0;
- }
- .left-sidebar {
- position: absolute;
- left: 20px;
- top: 120px;
- width: 350px;
- z-index: 5;
- }
- .right-sidebar {
- position: absolute;
- right: 20px;
- top: 120px;
- bottom: 20px;
- width: 420px;
- z-index: 5;
- overflow-y: auto;
- padding-right: 5px;
- }
- .right-sidebar::-webkit-scrollbar {
- width: 6px;
- }
- .right-sidebar::-webkit-scrollbar-track {
- background: rgba(0, 20, 40, 0.5);
- border-radius: 3px;
- }
- .right-sidebar::-webkit-scrollbar-thumb {
- background: rgba(0, 212, 255, 0.4);
- border-radius: 3px;
- }
- .right-sidebar::-webkit-scrollbar-thumb:hover {
- background: rgba(0, 212, 255, 0.6);
- }
- .data-card {
- width: 100%;
- background: rgba(0, 20, 40, 0.7);
- border-radius: 4px;
- overflow: hidden;
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
- }
- .card-header {
- height: 50px;
- background-image: url('/src/assets/images/数据小标题.png');
- background-size: 100% 100%;
- background-position: center;
- background-repeat: no-repeat;
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- padding: 6px 20px 0;
- }
- .card-title {
- font-size: 18px;
- font-weight: bold;
- color: #e0fcff;
- margin: 0;
- text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
- padding-left: 20px;
- }
- .card-body {
- padding: 15px;
- font-size: 16px;
- line-height: 1.6;
- margin-top: -10px;
- }
- .section-title {
- font-size: 14px;
- color: #7bbef6;
- margin: 5px 0 12px;
- font-weight: bold;
- }
- .scenario-list,
- .scheme-list {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .scenario-item,
- .scheme-item {
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 10px 12px;
- background: rgba(0, 20, 40, 0.5);
- border: 1px solid rgba(0, 212, 255, 0.2);
- border-radius: 4px;
- cursor: pointer;
- transition: all 0.3s ease;
- }
- .scenario-item:hover,
- .scenario-item.active,
- .scheme-item:hover,
- .scheme-item.active {
- border-color: #62f6fb;
- background: rgba(98, 246, 251, 0.1);
- }
- .scenario-radio,
- .scheme-radio {
- width: 16px;
- height: 16px;
- border: 2px solid rgba(0, 212, 255, 0.4);
- border-radius: 50%;
- background: transparent;
- flex-shrink: 0;
- transition: all 0.2s ease;
- }
- .scenario-radio.checked,
- .scheme-radio.checked {
- background: #62f6fb;
- border-color: #62f6fb;
- position: relative;
- }
- .scenario-radio.checked::after,
- .scheme-radio.checked::after {
- content: '';
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background: #000;
- }
- .scenario-name,
- .scheme-name {
- color: #e0fcff;
- font-size: 13px;
- font-weight: bold;
- }
- .section-divider {
- height: 1px;
- background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
- margin: 18px 0;
- }
- .start-btn {
- width: 100%;
- margin-top: 20px;
- padding: 12px 20px;
- background: linear-gradient(135deg, #0ea5e9, #06b6d4);
- border: none;
- border-radius: 6px;
- color: #fff;
- font-size: 16px;
- font-weight: bold;
- cursor: pointer;
- transition: all 0.3s ease;
- box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
- }
- .start-btn:hover {
- background: linear-gradient(135deg, #0284c7, #0891b2);
- box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
- transform: translateY(-2px);
- }
- .start-btn:active {
- transform: translateY(0);
- }
- .chart-card {
- width: 100%;
- background: rgba(0, 20, 40, 0.7);
- border-radius: 4px;
- overflow: hidden;
- box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
- margin-bottom: 15px;
- }
- .chart-card:last-child {
- margin-bottom: 0;
- }
- .chart-card-header {
- height: 40px;
- background-image: url('/src/assets/images/数据小标题.png');
- background-size: 100% 100%;
- background-position: center;
- background-repeat: no-repeat;
- display: flex;
- align-items: flex-start;
- justify-content: center;
- padding: 3px 20px 0;
- }
- .chart-card-title {
- font-size: 15px;
- font-weight: bold;
- color: #e0fcff;
- margin: 0;
- text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
- }
- .chart-card-body {
- padding: 10px 15px 15px;
- }
- .chart-subtitle {
- font-size: 12px;
- color: #7bbef6;
- text-align: center;
- margin-bottom: 8px;
- }
- .chart-container {
- width: 100%;
- height: 180px;
- }
- .risk-assessment {
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .risk-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 12px;
- background: rgba(0, 30, 60, 0.6);
- border: 1px solid rgba(0, 212, 255, 0.2);
- border-radius: 4px;
- }
- .risk-label {
- color: #7bbef6;
- font-size: 13px;
- font-weight: bold;
- }
- .risk-status,
- .risk-level {
- padding: 4px 12px;
- border-radius: 4px;
- font-size: 12px;
- font-weight: bold;
- }
- .risk-status.normal,
- .risk-level.normal {
- background: #22c55e;
- color: #fff;
- }
- .risk-status.attention,
- .risk-level.attention {
- background: #f59e0b;
- color: #fff;
- }
- .risk-status.warning,
- .risk-level.warning {
- background: #f97316;
- color: #fff;
- }
- .risk-status.danger,
- .risk-level.danger {
- background: #ef4444;
- color: #fff;
- }
- .conclusion-section {
- margin-top: 5px;
- padding: 12px;
- background: rgba(0, 40, 80, 0.6);
- border: 1px solid rgba(0, 212, 255, 0.3);
- border-radius: 4px;
- }
- .conclusion-title {
- font-size: 13px;
- color: #62f6fb;
- font-weight: bold;
- margin-bottom: 8px;
- }
- .conclusion-text {
- font-size: 12px;
- color: #e0fcff;
- line-height: 1.6;
- }
- </style>
|