Browse Source

commit

master
xuhuihui 3 years ago
parent
commit
21f38ab1bc
  1. BIN
      04.系统编码/Frontend/public/images/T-logP.png
  2. 94
      04.系统编码/Frontend/src/components/MicrowaveRadiation.vue

BIN
04.系统编码/Frontend/public/images/T-logP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

94
04.系统编码/Frontend/src/components/MicrowaveRadiation.vue

@ -36,9 +36,9 @@
<el-col :span="8"><span :class="{'active': currentElement === 'six-minute'}"
@click="onElementClick('six-minute', -2, 6,0)">6分钟</span></el-col>
<el-col :span="8"><span :class="{'active': currentElement === 'half-hour'}"
@click="onElementClick('half-hour', -12, 30,-2)">30分钟</span></el-col>
@click="onElementClick('half-hour', -12, 30,0)">30分钟</span></el-col>
<el-col :span="8"><span :class="{'active': currentElement === 'one-hour'}"
@click="onElementClick('one-hour', -24, 60,-4)">1小时</span></el-col>
@click="onElementClick('one-hour', -24, 60,0)">1小时</span></el-col>
</el-row>
</div>
</div>
@ -139,19 +139,25 @@
<div id="convectiveHighChartCIN" style="width:100%;height:75%"></div>
</div>
</div>
<div v-if="currentTab === 'T-logP'" class="picture-container contrast-picture-container">
<img src="public/images/T-logP.png" style="width: 80%;height: 80%">
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import {onMounted, reactive, toRefs} from 'vue';
import { onMounted, reactive, toRefs } from 'vue';
import moment from "moment";
import {get} from '../uilts/axios';
import {BoxDrawer, ColorChart, createEmptyCanvas} from "../uilts/box-drawer";
import {Constant} from "../model/constant";
import {HighChartCreate} from "../model/high-chart-create";
import {ElMessage, ElMessageBox} from 'element-plus'
import { get } from '../uilts/axios';
import { BoxDrawer, ColorChart, createEmptyCanvas } from "../uilts/box-drawer";
import { Constant } from "../model/constant";
import { HighChartCreate } from "../model/high-chart-create";
import { ElMessage } from 'element-plus'
export default {
name: 'MicrowaveRadiation',
setup() {
@ -227,7 +233,6 @@ export default {
initEcharts(name);
reloadChangeData();
}, 500)
}
const initEcharts = (name) => {
@ -327,14 +332,13 @@ export default {
}
now.minute(now.minute() - options.apiTimeInterval);
for (let i = 0; i < 20; i++) {
for (let i = 0; i < 24; i++) {
options.times.push({
hour: now.add(options.apiTimeInterval, 'minute').format('HH时'),
minute: now.format('mm'),
date: now.format('YYYY-MM-DD HH:mm:00')
});
}
options.index = options.times.length - 1;
options.titleStartTime = options.times[0].date;
if (callback != null)
@ -342,7 +346,7 @@ export default {
}
const initHours = () => {
for (let i = 0; i < 24; i++) {
for (let i = 1; i < 24; i++) {
options.hours.push({
value: i,
label: i < 10 ? '0' + i : i,
@ -386,45 +390,45 @@ export default {
}
//
const onPlayClick = () => {
options.isPlay = !options.isPlay;
if (options.isPlay) {
timeExcute();
} else {
clearTimer();
}
}
// const onPlayClick = () => {
// options.isPlay = !options.isPlay;
// if (options.isPlay) {
// timeExcute();
// } else {
// clearTimer();
// }
// }
const timeExcute = () => {
clearTimer();
let element = getCurrentElement();
timer = setInterval(() => {
options.index++;
if (options.index > element.childElementCount - 1)
options.index = 0;
setCurrentPlayElement(element);
}, 2000)
}
// const timeExcute = () => {
// clearTimer();
// let element = getCurrentElement();
// timer = setInterval(() => {
// options.index++;
// if (options.index > element.childElementCount - 1)
// options.index = 0;
// setCurrentPlayElement(element);
// }, 2000)
// }
const clearTimer = () => {
if (timer)
clearInterval(timer);
}
// const clearTimer = () => {
// if (timer)
// clearInterval(timer);
// }
const getCurrentElement = () => {
return document.querySelector('.times');
}
const setCurrentPlayElement = (element) => {
for (let i = 0; i < element.childElementCount; i++)
element.children[i].classList.remove('active');
element.children[options.index].classList.add('active');
if (options.currentTab === 'MWR') {
options.currentTime = options.days[options.index].date;
} else {
options.currentTime = options.times[options.index].date;
}
}
// const setCurrentPlayElement = (element) => {
// for (let i = 0; i < element.childElementCount; i++)
// element.children[i].classList.remove('active');
// element.children[options.index].classList.add('active');
// if (options.currentTab === 'MWR') {
// options.currentTime = options.days[options.index].date;
// } else {
// options.currentTime = options.times[options.index].date;
// }
// }
const onChange = () => {
initTimeLine(reloadChangeData);
@ -696,7 +700,7 @@ export default {
onPrevDayClick,
onNextDayClick,
onRefreshClick,
onPlayClick,
// onPlayClick,
onChange,
onImageLoad,
changeColor,

Loading…
Cancel
Save