Browse Source

commit

master
xuhuihui 3 years ago
parent
commit
9b0a55a9db
  1. 82
      04.系统编码/Frontend/src/components/MicrowaveRadiation.vue
  2. 11
      04.系统编码/Frontend/src/index.less

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

@ -241,8 +241,7 @@
setTimeout(() => { setTimeout(() => {
changeColor() changeColor()
},0) },0)
reloadQualityComparison() reloadData()
reloadQualityInterpolation()
}) })
// const onTabClick = (name) => { // const onTabClick = (name) => {
@ -257,6 +256,7 @@
const onTabClick = (name) => { const onTabClick = (name) => {
options.currentTab = name; options.currentTab = name;
options.currentElement = 'six-minute' options.currentElement = 'six-minute'
reloadData()
// initTimeLine() // initTimeLine()
// if ( options.currentTab === 'MWR' ) { // if ( options.currentTab === 'MWR' ) {
// options.date = moment('2021-11-10').format('YYYY-MM-DD'); // options.date = moment('2021-11-10').format('YYYY-MM-DD');
@ -484,8 +484,7 @@
// options.currentTime = time.date; // options.currentTime = time.date;
options.titleStartTime = moment(time.date).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm').format('YYYY-MM-DD HH:mm:ss') options.titleStartTime = moment(time.date).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm').format('YYYY-MM-DD HH:mm:ss')
options.titleEndTime = time.date options.titleEndTime = time.date
reloadQualityComparison() reloadData()
reloadQualityInterpolation()
// options.index = index; // options.index = index;
// test() // test()
// cancelActive(); // cancelActive();
@ -507,19 +506,19 @@
// //
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');
initTimeLine()
options.titleStartTime = moment(options.date).hour(parseInt(options.currentHour) + options.apiTimeLength).minute(options.currentElement === 'six-minute' ? 36 : 30).format('YYYY-MM-DD HH:mm:ss'); options.titleStartTime = moment(options.date).hour(parseInt(options.currentHour) + options.apiTimeLength).minute(options.currentElement === 'six-minute' ? 36 : 30).format('YYYY-MM-DD HH:mm:ss');
options.titleEndTime = moment(options.date).hour(parseInt(options.currentHour)).minute(options.currentElement === 'six-minute' ? 30 : 0).format('YYYY-MM-DD HH:mm:ss'); options.titleEndTime = moment(options.date).hour(parseInt(options.currentHour)).minute(options.currentElement === 'six-minute' ? 30 : 0).format('YYYY-MM-DD HH:mm:ss');
reloadQualityComparison() reloadData()
reloadQualityInterpolation()
} }
// //
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');
initTimeLine()
options.titleStartTime = moment(options.date).hour(parseInt(options.currentHour) + options.apiTimeLength).minute(options.currentElement === 'six-minute' ? 36 : 30).format('YYYY-MM-DD HH:mm:ss'); options.titleStartTime = moment(options.date).hour(parseInt(options.currentHour) + options.apiTimeLength).minute(options.currentElement === 'six-minute' ? 36 : 30).format('YYYY-MM-DD HH:mm:ss');
options.titleEndTime = moment(options.date).hour(parseInt(options.currentHour)).minute(options.currentElement === 'six-minute' ? 30 : 0).format('YYYY-MM-DD HH:mm:ss'); options.titleEndTime = moment(options.date).hour(parseInt(options.currentHour)).minute(options.currentElement === 'six-minute' ? 30 : 0).format('YYYY-MM-DD HH:mm:ss');
reloadQualityComparison() reloadData()
reloadQualityInterpolation()
} }
// const onPrevImgClick = () => { // const onPrevImgClick = () => {
@ -578,7 +577,6 @@
const timeExcute = () => { const timeExcute = () => {
clearTimer(); clearTimer();
let element = getCurrentElement(); let element = getCurrentElement();
timer = setInterval( () => { timer = setInterval( () => {
@ -614,7 +612,7 @@
} }
} }
const onChange = (e) => { const onChange = () => {
initTimeLine(reloadData); initTimeLine(reloadData);
// if(options.currentTab === 'MWR') { // if(options.currentTab === 'MWR') {
@ -629,32 +627,32 @@
reloadQualityInterpolation() reloadQualityInterpolation()
} }
const onSaveClick = () => { // const onSaveClick = () => {
let pictures = document.getElementById('pictures'); // let pictures = document.getElementById('pictures');
options.urls = [options.contrast.noQCImgUrl, options.contrast.checkImgUrl, options.contrast.fillingImgUrl]; // options.urls = [options.contrast.noQCImgUrl, options.contrast.checkImgUrl, options.contrast.fillingImgUrl];
for (let i = 0; i < options.urls.length; i++) { // for (let i = 0; i < options.urls.length; i++) {
let img = new Image(); // let img = new Image();
img.src = options.urls[i]; // img.src = options.urls[i];
let canvas = document.createElement("canvas") as HTMLCanvasElement; // let canvas = document.createElement("canvas") as HTMLCanvasElement;
canvas.width = img.width; // canvas.width = img.width;
canvas.height = img.height; // canvas.height = img.height;
//
let ctx = canvas.getContext("2d"); // let ctx = canvas.getContext("2d");
let base64 = ''; // let base64 = '';
//
img.setAttribute("crossOrigin",'Anonymous'); // img.setAttribute("crossOrigin",'Anonymous');
img.onload = function() { // img.onload = function() {
ctx.drawImage(img, 0, 0); // ctx.drawImage(img, 0, 0);
base64 = canvas.toDataURL("image/png"); // base64 = canvas.toDataURL("image/png");
pictures.children[i].setAttribute('href', base64); // pictures.children[i].setAttribute('href', base64);
//
let button: HTMLElement = pictures.children[i] as HTMLElement; // let button: HTMLElement = pictures.children[i] as HTMLElement;
setTimeout(() => { // setTimeout(() => {
button.click(); // button.click();
}, 500); // }, 500);
}; // };
} // }
} // }
const changeColor = () => { const changeColor = () => {
let timeLine = document.querySelectorAll('.time-item') let timeLine = document.querySelectorAll('.time-item')
@ -666,6 +664,8 @@
}) })
} }
// //
const reloadQualityComparison = () => { const reloadQualityComparison = () => {
const startTime = moment(options.currentTime).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm').format('YYYY-MM-DD HH:mm:00'); const startTime = moment(options.currentTime).add(options.apiTimeLength, 'h').add(options.apiTimeInterval, 'm').format('YYYY-MM-DD HH:mm:00');
@ -737,9 +737,9 @@
} }
} }
const onImageMove = (e) => { // const onImageMove = (e) => {
console.log(e); // console.log(e);
} // }
return { return {
...toRefs(options), ...toRefs(options),
@ -757,9 +757,9 @@
onChange, onChange,
onImageLoad, onImageLoad,
// onDownloadClick, // onDownloadClick,
onSaveClick, // onSaveClick,
changeColor, changeColor,
onImageMove // onImageMove
} }
} }
} }

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

@ -263,6 +263,17 @@ img {
//} //}
} }
.halfHour { .halfHour {
:nth-child(4n-2) {
span.time {
background-color: #CDDAF6;
}
}
:nth-child(4n-1) {
span.time {
background-color: #CDDAF6;
}
}
:nth-child(even) { :nth-child(even) {
span.hour { span.hour {
font-size: 0.12rem !important; font-size: 0.12rem !important;

Loading…
Cancel
Save