Browse Source

Merge remote-tracking branch 'remotes/origin/master'

# Conflicts:
#	04.系统编码/Frontend/src/uilts/axios.ts
master
xiaowuler 4 years ago
parent
commit
165b889d32
  1. 4
      04.系统编码/Frontend/.idea/workspace.xml
  2. 3752
      04.系统编码/Frontend/package-lock.json
  3. 3
      04.系统编码/Frontend/package.json
  4. BIN
      04.系统编码/Frontend/public/images/picture.png
  5. BIN
      04.系统编码/Frontend/public/images/picture1.png
  6. BIN
      04.系统编码/Frontend/public/images/picture2.png
  7. BIN
      04.系统编码/Frontend/public/images/picture3.png
  8. BIN
      04.系统编码/Frontend/public/images/picture5.png
  9. 4
      04.系统编码/Frontend/src/App.vue
  10. 4
      04.系统编码/Frontend/src/components/DecisionSupport.vue
  11. 364
      04.系统编码/Frontend/src/components/MicrowaveRadiation.vue
  12. 17
      04.系统编码/Frontend/src/components/RamanLidar.vue
  13. 20
      04.系统编码/Frontend/src/index.less
  14. 2
      04.系统编码/Frontend/src/uilts/Config.ts

4
04.系统编码/Frontend/.idea/workspace.xml

@ -3,6 +3,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="4b7d7b72-f5b8-41e4-85d5-6267bdc12fc5" name="默认变更列表" comment=""> <list default="true" id="4b7d7b72-f5b8-41e4-85d5-6267bdc12fc5" name="默认变更列表" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/App.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/App.vue" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/App.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/App.vue" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -99,7 +101,7 @@
<workItem from="1638524838907" duration="8000" /> <workItem from="1638524838907" duration="8000" />
<workItem from="1638752962691" duration="9088000" /> <workItem from="1638752962691" duration="9088000" />
<workItem from="1638768088746" duration="2255000" /> <workItem from="1638768088746" duration="2255000" />
<workItem from="1638770403708" duration="6218000" /> <workItem from="1638770403708" duration="11594000" />
</task> </task>
<task id="LOCAL-00001" summary="2021 12 01"> <task id="LOCAL-00001" summary="2021 12 01">
<created>1638357539757</created> <created>1638357539757</created>

3752
04.系统编码/Frontend/package-lock.json

File diff suppressed because it is too large

3
04.系统编码/Frontend/package.json

@ -15,7 +15,8 @@
"qs": "^6.10.1", "qs": "^6.10.1",
"typescript": "^4.5.2", "typescript": "^4.5.2",
"vue": "^3.0.4", "vue": "^3.0.4",
"vue-router": "^4.0.12" "vue-router": "^4.0.12",
"jsencrypt": "3.0.0-rc.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/compiler-sfc": "^3.0.4", "@vue/compiler-sfc": "^3.0.4",

BIN
04.系统编码/Frontend/public/images/picture.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
04.系统编码/Frontend/public/images/picture1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

BIN
04.系统编码/Frontend/public/images/picture2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

BIN
04.系统编码/Frontend/public/images/picture3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 KiB

BIN
04.系统编码/Frontend/public/images/picture5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

4
04.系统编码/Frontend/src/App.vue

@ -7,7 +7,7 @@
import { onMounted, reactive, ref, toRefs, watch } from 'vue'; import { onMounted, reactive, ref, toRefs, watch } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import Header from './components/Shared/Header.vue'; import Header from './components/Shared/Header.vue';
import {clear} from "./uilts/storage";
export default { export default {
name: 'App', name: 'App',
@ -24,12 +24,12 @@
// } // }
}) })
watch(() => router.currentRoute.value.path, watch(() => router.currentRoute.value.path,
(current, prev) => { (current, prev) => {
showHeader.value = current === "/Login" ? false : true; showHeader.value = current === "/Login" ? false : true;
} }
); );
const getRem = (pwidth, prem) => { const getRem = (pwidth, prem) => {
let html = document.getElementsByTagName("html")[0]; let html = document.getElementsByTagName("html")[0];
let oWidth = document.body.clientWidth || document.documentElement.clientWidth; let oWidth = document.body.clientWidth || document.documentElement.clientWidth;

4
04.系统编码/Frontend/src/components/DecisionSupport.vue

@ -200,8 +200,8 @@ import { post } from '../uilts/axios';
height: calc(~"100% - 0.6rem"); height: calc(~"100% - 0.6rem");
padding: 0.2rem 0 0.2rem 0.2rem; padding: 0.2rem 0 0.2rem 0.2rem;
.save-btn { .save-btn {
top: 0.6rem; top: 0.2rem;
right: 0.6rem; right: 0.2rem;
} }
.advice-picture-view { .advice-picture-view {
width: 100%; width: 100%;

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

@ -1,5 +1,9 @@
<template> <template>
<div class="tabs"> <div class="tabs">
<div class="tab-item" @click="onTabClick('MWR')" :class="{'active': currentTab === 'MWR'}">
质控对比
<img src="/images/line.png" v-if="currentTab === 'MWR'" />
</div>
<div class="tab-item" @click="onTabClick('kuoxian')" :class="{'active': currentTab === 'kuoxian'}"> <div class="tab-item" @click="onTabClick('kuoxian')" :class="{'active': currentTab === 'kuoxian'}">
垂直廓线 垂直廓线
<img src="/images/line.png" v-if="currentTab === 'kuoxian'" /> <img src="/images/line.png" v-if="currentTab === 'kuoxian'" />
@ -12,9 +16,9 @@
T-logP图 T-logP图
<img src="/images/line.png" v-if="currentTab === 'T-logP'" /> <img src="/images/line.png" v-if="currentTab === 'T-logP'" />
</div> </div>
<div class="tab-item" @click="onTabClick('BPFY')" :class="{'active': currentTab === 'BPFY'}"> <div class="tab-item" @click="onTabClick('shixu_BPFY')" :class="{'active': currentTab === 'shixu_BPFY'}">
BP反演产品 BP反演产品
<img src="/images/line.png" v-if="currentTab === 'BPFY'" /> <img src="/images/line.png" v-if="currentTab === 'shixu_BPFY'" />
</div> </div>
</div> </div>
<div class="main"> <div class="main">
@ -23,28 +27,30 @@
<h2 class="tip">区域选择</h2> <h2 class="tip">区域选择</h2>
<el-row :gutter="12"> <el-row :gutter="12">
<el-col :span="8"><span @click="onRegionClick('jiangning')" :class="{'active': currentRegion === 'jiangning'}">江宁</span></el-col> <el-col :span="8"><span @click="onRegionClick('jiangning')" :class="{'active': currentRegion === 'jiangning'}">江宁</span></el-col>
<el-col :span="8"><span @click="onRegionClick('liuhe')" :class="{'active': currentRegion === 'liuhe'}">六合</span></el-col>
<el-col :span="8"><span @click="onRegionClick('pukou')" :class="{'active': currentRegion === 'pukou'}">浦口</span></el-col>
<el-col :span="8"><span @click="onRegionClick('gaochun')" :class="{'active': currentRegion === 'gaochun'}">高淳</span></el-col>
<el-col :span="8"><span @click="onRegionClick('lishui')" :class="{'active': currentRegion === 'lishui'}">溧水</span></el-col>
</el-row> </el-row>
</div> </div>
<div class="menu-item" v-if="currentTab === 'kuoxian' || currentTab === 'shixu'"> <div class="menu-item" v-if="currentTab === 'MWR' || currentTab === 'kuoxian' || currentTab === 'shixu' || currentTab === 'shixu_BPFY'">
<h2 class="tip">要素选择</h2> <h2 class="tip">要素选择</h2>
<el-row :gutter="12"> <el-row :gutter="12">
<el-col :span="8" v-if="currentTab === 'kuoxian'"><span @click="onElementClick('TEMPERATURE', 'TEMP')" :class="{'active': currentElement === 'TEMPERATURE'}">温度</span></el-col> <el-col :span="8" v-if="currentTab === 'MWR' || currentTab === 'kuoxian' || currentTab === 'shixu_BPFY'"><span @click="onElementClick('TEMP')" :class="{'active': currentElement === 'TEMP'}">温度</span></el-col>
<el-col :span="8" v-if="currentTab === 'kuoxian'"><span @click="onElementClick('HUMIDITY', 'RH')" :class="{'active': currentElement === 'HUMIDITY'}">湿度</span></el-col> <el-col :span="8" v-if="currentTab === 'kuoxian' || currentTab === 'shixu_BPFY'"><span @click="onElementClick('RH')" :class="{'active': currentElement === 'RH'}">湿度</span></el-col>
<el-col :span="8" v-if="currentTab === 'shixu'"><span @click="onElementClick('CAPE时序图', 'CAPE')" :class="{'active': currentElement === 'CAPE时序图'}">CAPE</span></el-col> <el-col :span="8" v-if="currentTab === 'kuoxian' || currentTab === 'shixu_BPFY'"><span @click="onElementClick('VD')" :class="{'active': currentElement === 'VD'}">水汽密度</span></el-col>
<el-col :span="8" v-if="currentTab === 'shixu'"><span @click="onElementClick('CIN时序图', 'CIN')" :class="{'active': currentElement === 'CIN时序图'}">CIN</span></el-col> <el-col :span="8" v-if="currentTab === 'shixu'"><span @click="onElementClick('CAPE')" :class="{'active': currentElement === 'CAPE'}">CAPE</span></el-col>
<el-col :span="8" v-if="currentTab === 'shixu'"><span @click="onElementClick('CIN')" :class="{'active': currentElement === 'CIN'}">CIN</span></el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="container panel"> <div class="container panel">
<div class="toolbar"> <div class="toolbar" :class="{'day-toolbar': currentTab === 'MWR'}">
<div class="times"> <div class="times" v-if="currentTab === 'MWR'">
<div class="time-item" v-for="(time, index) in days" :key="index" :class="{'active': currentTime === time.date}">
<span class="time" @click="onDayClick(time, index)">{{time.day}}</span>
</div>
</div>
<div class="times" v-else>
<div class="time-item" v-for="(time, index) in times" :key="index" :class="{'active': currentTime === time.date, 'first-hour': time.minute === '00'}"> <div class="time-item" v-for="(time, index) in times" :key="index" :class="{'active': currentTime === time.date, 'first-hour': time.minute === '00'}">
<span class="hour">{{time.hour}}</span> <span class="hour">{{time.hour}}</span>
<span class="minute" @click="onTimeClick(time, index)">{{time.minute}}</span> <span class="time" @click="onTimeClick(time, index)">{{time.minute}}</span>
</div> </div>
</div> </div>
<el-date-picker v-model="date" type="date" placeholder="请选择" :clearable="false" :editable="false" class="date-picker" @change="onChange"> <el-date-picker v-model="date" type="date" placeholder="请选择" :clearable="false" :editable="false" class="date-picker" @change="onChange">
@ -53,7 +59,7 @@
<span @click="onPrevDayClick"><img src="/images/prev.png" /></span> <span @click="onPrevDayClick"><img src="/images/prev.png" /></span>
<span @click="onNextDayClick"><img src="/images/next.png" /></span> <span @click="onNextDayClick"><img src="/images/next.png" /></span>
</div> </div>
<el-select v-model="currentHour" placeholder="" @change="onChange"> <el-select v-model="currentHour" placeholder="" @change="onChange" v-show="currentTab !== 'MWR'">
<el-option <el-option
v-for="item in hours" v-for="item in hours"
:key="item.value" :key="item.value"
@ -62,22 +68,88 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<p class="unit"></p> <p class="unit" v-if="currentTab !== 'MWR'"></p>
<div class="refresh-btn" @click="onRefreshClick"> <div class="refresh-btn" @click="onRefreshClick">
<img src="/images/refresh.png" /> <img src="/images/refresh.png" />
</div> </div>
<div class="btns-group"> <div class="btns-group">
<span @click="onPlayClick">{{isPlay ? '暂停动画' : '播放动画'}}</span> <span @click="onPlayClick">{{isPlay ? '暂停动画' : '播放动画'}}</span>
<a @click="onDownloadClick">下载动画</a> <a @click="onDownloadClick">下载动画</a>
<a id="weboDownload" download :href="downloadSrc" style="display: none;">下载隐藏层</a> <a id="weboDownload" download :href="downloadSrc" class="hide">下载隐藏层</a>
</div> </div>
</div> </div>
<div class="picture-view"> <div class="picture-view">
<span class="arrow arrow-prev" @click="onPrevImgClick"><img src="/images/prev-btn.png" /></span> <span class="arrow arrow-prev" @click="onPrevImgClick"><img src="/images/prev-btn.png" /></span>
<span class="arrow arrow-next" @click="onNextImgClick"><img src="/images/next-btn.png" /></span> <span class="arrow arrow-next" @click="onNextImgClick"><img src="/images/next-btn.png" /></span>
<a :href="downloadImgUrl" download class="save-btn"><img src="/images/save.png" /></a> <span class="save-btn" @click="onSaveClick" v-if="currentTab === 'MWR'"><img src="/images/save.png" /></span>
<div class="picture-container"> <a :href="downloadImgUrl" download class="save-btn" v-else><img src="/images/save.png" /></a>
<h2 class="title">{{title}}</h2> <div class="download-pictures hide" id="pictures">
<a v-for="(url, index) in urls" :key="index" download></a>
</div>
<div class="picture-container contrast-picture-container" v-if="currentTab === 'MWR'">
<div class="picture">
<h2 class="title">原始数据</h2>
<el-image
:src="contrast.noQCImgUrl"
:preview-src-list="contrast.noQCImgPreview"
:initial-index="0"
fit="contain"
@load="onImageLoad"
>
<template #error>
<div class="image-slot">
<img src="/images/null-picture.png" />
</div>
<p class="image-tip">暂无图片</p>
</template>
<template #placeholder>
<div class="image-placeholder">正在加载...</div>
</template>
</el-image>
</div>
<div class="picture">
<h2 class="title">异常值标记</h2>
<el-image
:src="contrast.checkImgUrl"
:preview-src-list="contrast.checkImgPreview"
:initial-index="0"
fit="contain"
@load="onImageLoad"
>
<template #error>
<div class="image-slot">
<img src="/images/null-picture.png" />
</div>
<p class="image-tip">暂无图片</p>
</template>
<template #placeholder>
<div class="image-placeholder">正在加载...</div>
</template>
</el-image>
</div>
<div class="picture">
<h2 class="title">野点插补结果</h2>
<el-image
:src="contrast.fillingImgUrl"
:preview-src-list="contrast.fillingImgPreview"
:initial-index="0"
fit="contain"
@load="onImageLoad"
>
<template #error>
<div class="image-slot">
<img src="/images/null-picture.png" />
</div>
<p class="image-tip">暂无图片</p>
</template>
<template #placeholder>
<div class="image-placeholder">正在加载...</div>
</template>
</el-image>
</div>
</div>
<div class="picture-container" v-if="currentTab !== 'MWR'">
<!-- <h2 class="title">{{title}}</h2> -->
<div class="picture"> <div class="picture">
<el-image <el-image
:src="imgUrl" :src="imgUrl"
@ -107,22 +179,26 @@
import { onMounted, reactive, toRefs } from 'vue'; import { onMounted, reactive, toRefs } from 'vue';
import moment from "moment"; import moment from "moment";
import { MicrowaveRadiationConfig } from '../uilts/Config'; import { MicrowaveRadiationConfig } from '../uilts/Config';
import { post } from '../uilts/axios'; import { post } from '../uilts/axios';
export default { export default {
name: 'MicrowaveRadiation', name: 'MicrowaveRadiation',
setup() { setup() {
let timer = null; let timer = null;
let dateFormat = '2021-12-05';
let contrastDateFormat = '2021-11-10';
let options = reactive({ let options = reactive({
currentTab: 'kuoxian', currentTab: 'MWR',
currentRegion: 'jiangning', currentRegion: 'jiangning',
currentType: 'TEMP', currentType: 'TEMP',
currentElement: 'TEMPERATURE', currentElement: 'TEMP',
currentCategory: 'CAPE', currentCategory: 'CAPE',
date: moment('2021-11-01').format('YYYY-MM-DD'), date: moment(contrastDateFormat).format('YYYY-MM-DD'),
currentHour: '10', currentHour: '23',
hours: [], hours: [],
times: [], times: [],
days: [],
currentTime: null, currentTime: null,
imgUrl: '/images/default-picture.png', imgUrl: '/images/default-picture.png',
downloadImgUrl: '/images/default-picture.png', downloadImgUrl: '/images/default-picture.png',
@ -130,67 +206,84 @@ import { post } from '../uilts/axios';
isPlay: false, isPlay: false,
title: null, title: null,
index: 0, index: 0,
downloadSrc: null downloadSrc: null,
contrast: {
noQCImgUrl: '/images/picture.png',
noQCImgPreview: ['/images/picture.png'],
checkImgUrl: '/images/picture.png',
checkImgPreview: ['/images/picture.png'],
fillingImgUrl: '/images/picture.png',
fillingImgPreview: ['/images/picture.png']
},
urls: []
}) })
onMounted(() => { onMounted(() => {
initHours(); initHours();
initTimeLine(); initDays();
setTitle(moment(options.date, 'YYYY-MM-DD').hour(parseInt(options.currentHour))); setTimeout(() => activeContrastImage(), 50);
setTimeout(() => {
activeImage(moment(options.times[options.times.length - 1].date).hour(), moment(options.times[options.times.length - 1].date).minute());
}, 50);
}) })
const onTabClick = (name) => { const onTabClick = (name) => {
options.currentTab = name; options.currentTab = name;
if (options.currentTab === 'kuoxian') {
options.currentType = 'TEMP'; if (options.currentTab === 'MWR') {
options.currentElement = 'TEMPERATURE'; options.date = moment(contrastDateFormat).format('YYYY-MM-DD');
} else if (options.currentTab === 'shixu') { options.currentElement = 'TEMP';
options.currentType = 'CAPE'; options.index = options.days.length - 1;
options.currentElement = 'CAPE时序图';
} else if (options.currentTab === 'T-logP') { initDays();
options.currentType = 'T-logP'; setTimeout(() => activeContrastImage(), 50)
options.currentElement = 'T-logP';
} else { } else {
options.currentType = 'BPFY'; if (options.currentTab === 'kuoxian' || options.currentTab === 'shixu_BPFY')
options.currentElement = 'BPFY'; options.currentElement = 'TEMP';
else if (options.currentTab === 'shixu')
options.currentElement = 'CAPE';
options.date = moment(dateFormat).format('YYYY-MM-DD');
options.index = options.times.length - 1;
initTimeLine();
setTimeout(() => activeImage(moment(options.times[options.times.length - 1].date).hour(), moment(options.times[options.times.length - 1].date).minute()), 50)
} }
cancelActive(); cancelActive();
setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
} }
const onRegionClick = (region) => { const onRegionClick = (region) => {
options.currentRegion = region; options.currentRegion = region;
cancelActive(); cancelActive();
setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute()); if (options.currentTab === 'MWR')
activeContrastImage();
else
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
} }
const onElementClick = (element, type) => { const onElementClick = (element) => {
options.currentElement = element; options.currentElement = element;
options.currentType = type;
cancelActive(); cancelActive();
setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
const onCategoryClick = (category) => { if (options.currentTab === 'MWR')
options.currentCategory = category; activeContrastImage();
else
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
} }
const setTitle = (date) => { const activeContrastImage = () => {
options.title = date.format('YYYY.MM.DD HH:mm') + ' ' + options.currentElement; options.contrast.noQCImgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_noQC', moment(options.currentTime, 'YYYY-MM-DD'));
options.contrast.noQCImgPreview = [options.contrast.noQCImgUrl];
options.contrast.checkImgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_check', moment(options.currentTime, 'YYYY-MM-DD'));
options.contrast.checkImgPreview = [options.contrast.checkImgUrl];
options.contrast.fillingImgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_filling', moment(options.currentTime, 'YYYY-MM-DD'));
options.contrast.fillingImgPreview = [options.contrast.fillingImgUrl];
} }
const activeImage = (hour, minute) => { const activeImage = (hour, minute) => {
let time = moment(options.date).hour(hour).minute(minute); let time = moment(options.date).hour(hour).minute(minute);
let type = (options.currentTab === 'T-logP' || options.currentTab === 'BPFY') ? options.currentTab : (options.currentTab + '_' + options.currentType); let type = options.currentTab === 'T-logP' ? options.currentTab : (options.currentTab + '_' + options.currentElement);
options.imgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time); options.imgUrl = MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time);
options.srcList = [options.imgUrl]; options.srcList = [options.imgUrl];
} }
@ -227,13 +320,14 @@ import { post } from '../uilts/axios';
} }
const prepareParams = () => { const prepareParams = () => {
let time = options.currentTab === 'MWR' ? moment(options.days[0].date).format("YYYYMMDDHHmmss") + '-' + moment(options.days[options.days.length - 1].date).format("YYYYMMDDHHmmss") : moment(options.times[0].date).format("YYYYMMDDHHmmss") + '-' + moment(options.times[options.times.length - 1].date).format("YYYYMMDDHHmmss");
return { return {
model: 'weibo', model: 'weibo',
station: options.currentRegion, station: options.currentRegion,
elementCode: options.currentType, elementCode: options.currentType,
type: options.currentTab, type: options.currentTab,
time: moment(options.times[0].date).format("YYYYMMDDHHmmss") + '-' + moment(options.times[options.times.length - 1].date).format("YYYYMMDDHHmmss"), time: time,
urls: prepareUrls() urls: options.currentTab === 'MWR' ? prepareContrastUrls() : prepareUrls()
} }
} }
@ -241,13 +335,27 @@ import { post } from '../uilts/axios';
let urls = []; let urls = [];
for(let index = 0, len = options.times.length; index < len; index++){ for(let index = 0, len = options.times.length; index < len; index++){
let time = moment(options.times[index].date); let time = moment(options.times[index].date);
let type = (options.currentTab === 'T-logP' || options.currentTab === 'BPFY') ? options.currentTab : (options.currentTab + '_' + options.currentType); let type = options.currentTab === 'T-logP' ? options.currentTab : (options.currentTab + '_' + options.currentElement);
urls.push(MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time)); urls.push(MicrowaveRadiationConfig.getUrl(options.currentRegion, type, time));
} }
return urls; return urls;
} }
const prepareContrastUrls = () => {
let urls = [];
for(let i = 0, len = options.days.length; i < len; i++){
let time = moment(options.days[i].date);
urls.push(
MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_noQC', time),
MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_check', time),
MicrowaveRadiationConfig.getUrl(options.currentRegion, options.currentTab + '_filling', time)
);
}
return urls;
}
const converToBase64 = (path) => { const converToBase64 = (path) => {
let img = new Image(); let img = new Image();
img.src = path; img.src = path;
@ -268,9 +376,9 @@ import { post } from '../uilts/axios';
const initTimeLine = () => { const initTimeLine = () => {
options.times = []; options.times = [];
options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).format('YYYY-MM-DD HH:mm'); options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).minute(30).format('YYYY-MM-DD HH:mm');
let now = moment(options.date).hour(parseInt(options.currentHour) - 2); let now = moment(options.date).hour(parseInt(options.currentHour) - 2).minute(30);
let minute = now.minute(); let minute = now.minute();
const remainder = minute % 6; const remainder = minute % 6;
@ -284,15 +392,31 @@ import { post } from '../uilts/axios';
options.times.push({ options.times.push({
hour: now.add(6, 'minute').format('HH时'), hour: now.add(6, 'minute').format('HH时'),
minute: now.format('mm'), minute: now.format('mm'),
date: now.format('YYYY-MM-DD HH:mm'), date: now.format('YYYY-MM-DD HH:mm')
name: 'hour' + now.format('HH')
}); });
} }
options.index = options.times.length - 1; options.index = options.times.length - 1;
} }
const initDays = () => {
options.days = [];
options.currentTime = moment(options.date).format('YYYY-MM-DD');
let now = moment(options.date).add(1, 'day');
for (let i = 0; i < 10 ; i++) {
options.days.push({
day: now.add(-1, 'day').format('DD'),
date: now.format('YYYY-MM-DD'),
})
}
options.days.reverse();
options.index = options.days.length - 1;
}
const initHours = () => { const initHours = () => {
for (let i = 0; i < 23; i++) { for (let i = 0; i < 24; i++) {
options.hours.push({ options.hours.push({
value: i, value: i,
label: i < 10 ? '0' + i : i, label: i < 10 ? '0' + i : i,
@ -304,24 +428,38 @@ import { post } from '../uilts/axios';
options.currentTime = time.date; options.currentTime = time.date;
options.index = index; options.index = index;
cancelActive(); cancelActive();
setTitle(moment(time.date, 'YYYY-MM-DD HH:mm'));
activeImage(moment(time.date).hour(), moment(time.date).minute()); activeImage(moment(time.date).hour(), moment(time.date).minute());
} }
const onDayClick = (time, index) => {
options.currentTime = time.date;
options.index = index;
cancelActive();
activeContrastImage();
}
const cancelActive = () => { const cancelActive = () => {
clearTimer(); clearTimer();
options.isPlay = false; options.isPlay = false;
} }
const onPrevDayClick = () => { const onPrevDayClick = () => {
options.date = moment(options.date).add(-1, 'day').format('YYYY-MM-DD') options.date = moment(options.date).add(-1, 'day').format('YYYY-MM-DD');
} }
const onNextDayClick = () => { const onNextDayClick = () => {
options.date = moment(options.date).add(1, 'day').format('YYYY-MM-DD') options.date = moment(options.date).add(1, 'day').format('YYYY-MM-DD');
} }
const onPrevImgClick = () => { const onPrevImgClick = () => {
prevElement();
}
const onNextImgClick = () => {
nextElement();
}
const prevElement = () => {
let element = getCurrentElement(); let element = getCurrentElement();
options.index--; options.index--;
@ -330,8 +468,8 @@ import { post } from '../uilts/axios';
setCurrentPlayElement(element); setCurrentPlayElement(element);
} }
const onNextImgClick = () => { const nextElement = () => {
let element = getCurrentElement(); let element = getCurrentElement();
options.index++; options.index++;
@ -343,15 +481,22 @@ import { post } from '../uilts/axios';
const onRefreshClick = () => { const onRefreshClick = () => {
cancelActive(); cancelActive();
let element = getCurrentElement();; let element = getCurrentElement();
if (options.currentTab === 'MWR') {
options.date = moment(contrastDateFormat).format('YYYY-MM-DD');
options.currentTime = options.date;
element.children[options.days.length - 1].classList.add('active');
options.currentHour = '10'; activeContrastImage();
options.date = moment('2021-11-01').format('YYYY-MM-DD'); } else {
options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).format('YYYY-MM-DD HH:mm'); options.currentHour = '23';
options.date = moment(dateFormat).format('YYYY-MM-DD');
options.currentTime = moment(options.date).hour(parseInt(options.currentHour)).format('YYYY-MM-DD HH:mm');
element.children[options.times.length - 1].classList.add('active');
setTitle(moment(options.currentTime, 'YYYY-MM-DD HH:mm')); activeImage(moment(options.currentTime).hour(), moment(options.currentTime).minute(30));
activeImage(moment(options.currentTime).hour(), moment(options.currentTime).minute()); }
element.children[options.times.length - 1].classList.add('active');
} }
const onPlayClick = () => { const onPlayClick = () => {
@ -391,24 +536,58 @@ import { post } from '../uilts/axios';
element.children[i].classList.remove('active'); element.children[i].classList.remove('active');
element.children[options.index].classList.add('active'); element.children[options.index].classList.add('active');
options.currentTime = options.times[options.index].date;
setTitle(moment(options.times[options.index].date, 'YYYY-MM-DD HH:mm')); if(options.currentTab === 'MWR') {
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute()); options.currentTime = options.days[options.index].date;
activeContrastImage();
}
else {
options.currentTime = options.times[options.index].date;
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
}
} }
const onChange = () => { const onChange = () => {
initTimeLine(); initTimeLine();
setTitle(moment(options.date).hour(parseInt(options.currentHour)));
activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute()); activeImage(moment(options.times[options.index].date).hour(), moment(options.times[options.index].date).minute());
} }
const onSaveClick = () => {
let pictures = document.getElementById('pictures');
options.urls = [options.contrast.noQCImgUrl, options.contrast.checkImgUrl, options.contrast.fillingImgUrl];
console.log(options.urls)
for (let i = 0; i < options.urls.length; i++) {
let img = new Image();
img.src = options.urls[i];
let canvas = document.createElement("canvas") as HTMLCanvasElement;
canvas.width = img.width;
canvas.height = img.height;
let ctx = canvas.getContext("2d");
let base64 = '';
img.setAttribute("crossOrigin",'Anonymous');
img.onload = function() {
ctx.drawImage(img, 0, 0);
base64 = canvas.toDataURL("image/png");
pictures.children[i].setAttribute('href', base64);
let button: HTMLElement = pictures.children[i] as HTMLElement;
setTimeout(() => {
button.click();
}, 500);
};
}
}
return { return {
...toRefs(options), ...toRefs(options),
onTabClick, onTabClick,
onRegionClick, onRegionClick,
onElementClick, onElementClick,
onCategoryClick,
onTimeClick, onTimeClick,
onDayClick,
onPrevDayClick, onPrevDayClick,
onNextDayClick, onNextDayClick,
onPrevImgClick, onPrevImgClick,
@ -417,11 +596,28 @@ import { post } from '../uilts/axios';
onPlayClick, onPlayClick,
onChange, onChange,
onImageLoad, onImageLoad,
onDownloadClick onDownloadClick,
onSaveClick
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main {
.container {
.contrast-picture-container {
width: calc(~"100% - 2.5rem");
margin: 0 auto;
flex-direction: row;
align-items: center;
.picture {
flex-direction: column;
.title {
padding-bottom: 0;
font-size: 0.22rem;
}
}
}
}
}
</style> </style>

17
04.系统编码/Frontend/src/components/RamanLidar.vue

@ -21,10 +21,10 @@
</div> </div>
</div> </div>
<div class="container panel"> <div class="container panel">
<div class="toolbar raman-toolbar"> <div class="toolbar day-toolbar">
<div class="times"> <div class="times">
<div class="time-item" v-for="(time, index) in times" :key="index" :class="{'active': currentTime === time.date}"> <div class="time-item" v-for="(time, index) in times" :key="index" :class="{'active': currentTime === time.date}">
<span class="minute" @click="onTimeClick(time, index)">{{time.day}}</span> <span class="time" @click="onTimeClick(time, index)">{{time.day}}</span>
</div> </div>
</div> </div>
<el-date-picker v-model="date" type="date" placeholder="请选择" :clearable="false" :editable="false" class="date-picker" @change="onChange"> <el-date-picker v-model="date" type="date" placeholder="请选择" :clearable="false" :editable="false" class="date-picker" @change="onChange">
@ -349,17 +349,4 @@ import { post } from '../uilts/axios';
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main {
.container {
.raman-toolbar {
.times {
.time-item {
.minute {
line-height: 0.46rem;
}
}
}
}
}
}
</style> </style>

20
04.系统编码/Frontend/src/index.less

@ -193,7 +193,7 @@ img {
font-size: 0; font-size: 0;
} }
&.minute { &.time {
width: 0.37rem; width: 0.37rem;
line-height: 0.26rem; line-height: 0.26rem;
text-align: center; text-align: center;
@ -203,7 +203,7 @@ img {
} }
&.active { &.active {
.minute { .time {
color: #ffffff; color: #ffffff;
background-color: #498DF0; background-color: #498DF0;
@ -244,7 +244,7 @@ img {
} }
} }
.first-hour::before, .time-item .minute::before { .first-hour::before, .time-item .time::before {
content: ''; content: '';
width: 1px; width: 1px;
height: 100%; height: 100%;
@ -338,6 +338,16 @@ img {
margin-left: 0.06rem; margin-left: 0.06rem;
} }
} }
&.day-toolbar {
.times {
.time-item {
.time {
line-height: 0.46rem;
}
}
}
}
} }
.picture-view { .picture-view {
@ -455,4 +465,8 @@ img {
z-index: 10; z-index: 10;
} }
} }
}
.hide {
display: none !important;
} }

2
04.系统编码/Frontend/src/uilts/Config.ts

@ -10,7 +10,7 @@ export class Config {
export class MicrowaveRadiationConfig { export class MicrowaveRadiationConfig {
private static url: string = Config.parentUrl + "/weibo"; private static url: string = Config.parentUrl + "/weibo";
public static getUrl(station: string, type: string, time: Moment): string { public static getUrl(station: string, type: string, time: Moment): string {
return this.url+ '/' + station + '/' + type + '/' + time.format("YYYY/YYYYMM/YYYYMMDD/YYYYMMDDHHmmss.png"); return this.url+ '/' + station + '/' + type + '/' + time.format('YYYY/YYYYMM/YYYYMMDD/') + (type === 'T-logP' ? 'T_logP' : type) + time.format('_YYYYMMDDHHmm.png');
} }
} }

Loading…
Cancel
Save