终端检测重新发起

This commit is contained in:
zhujiyan
2024-06-03 15:49:04 +08:00
parent 6c0d7e3d0d
commit 041acae264
5 changed files with 90 additions and 125 deletions

View File

@@ -1,30 +1,30 @@
<template>
<div style="width: 600px;">
<div style="width: 600px">
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="timeValue"
type="daterange"
:disabled="disabledPicker"
style="width: 210px; margin-right: 10px"
unlink-panels
:clearable="false"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="timeValue"
type="daterange"
:disabled="disabledPicker"
style="width: 220px; margin-right: 10px"
unlink-panels
:clearable="false"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
</div>
</template>
<script lang="ts" setup>
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
import { ref, onMounted, nextTick,watch} from 'vue'
import { ref, onMounted, nextTick, watch } from 'vue'
const interval = ref(3)
const timeFlag = ref(1)
@@ -112,6 +112,7 @@ const timeChange = (e: number) => {
// 当前
const nowTime = () => {
console.log(interval.value,"000000000");
timeChange(interval.value)
}
// 上一个
@@ -142,7 +143,6 @@ const preClick = () => {
//按周
} else if (interval.value == 4) {
//根据开始时间推
let start = new Date(year, month - 1, date)
start.setDate(start.getDate() - 7)
startTime = formatTime(start)
@@ -179,7 +179,6 @@ const preClick = () => {
//下一个
const next = () => {
//向后
let startTime = timeValue.value[0]
let endTime = timeValue.value[1]
let year = parseInt(startTime.substring(0, 4))
@@ -499,7 +498,7 @@ function formatDate(date: Date): string {
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth ,timeChange})
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth, timeChange })
</script>
<style scoped>

View File

@@ -9,7 +9,7 @@
label-position="left"
:inline="true"
>
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 600px;">
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 610px;">
<DatePicker ref="datePickerRef"></DatePicker>
</el-form-item>