全局替换终端
This commit is contained in:
@@ -26,6 +26,15 @@
|
||||
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
|
||||
import { ref, onMounted, nextTick, watch } from 'vue'
|
||||
|
||||
interface Props {
|
||||
nextFlag?: boolean
|
||||
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag:false
|
||||
})
|
||||
|
||||
const interval = ref(3)
|
||||
const timeFlag = ref(1)
|
||||
const count = ref(0)
|
||||
@@ -112,7 +121,7 @@ const timeChange = (e: number) => {
|
||||
|
||||
// 当前
|
||||
const nowTime = () => {
|
||||
console.log(interval.value,"000000000");
|
||||
console.log(interval.value, '000000000')
|
||||
timeChange(interval.value)
|
||||
}
|
||||
// 上一个
|
||||
@@ -194,8 +203,9 @@ const next = () => {
|
||||
if (interval.value == 3) {
|
||||
if (month == 12) {
|
||||
year = year + 1
|
||||
|
||||
// 年份进位后,大于当前的年份,是不科学的
|
||||
if (presentY < year) {
|
||||
if (presentY < year && !props.nextFlag) {
|
||||
startTime = presentY + '-12-01'
|
||||
if (presentD < 10) {
|
||||
endTime = presentY + '-12' + '-0' + presentD
|
||||
@@ -224,7 +234,7 @@ const next = () => {
|
||||
// 年份等于当前年份
|
||||
if (presentY == year) {
|
||||
// 月份超过当前月份,是不科学的
|
||||
if (month >= presentM) {
|
||||
if (month >= presentM && !props.nextFlag) {
|
||||
if (presentM < 10) {
|
||||
startTime = year + '-0' + presentM + '-01'
|
||||
if (presentD < 10) {
|
||||
@@ -269,14 +279,14 @@ const next = () => {
|
||||
if (month == 10) {
|
||||
year = year + 1
|
||||
// 年份进位后大于当前年份是不科学的
|
||||
if (year > presentY) {
|
||||
if (year > presentY && !props.nextFlag) {
|
||||
startTime = presentY + '-10-01'
|
||||
if (presentD < 10) {
|
||||
endTime = year + '-' + presentM + '-0' + presentD
|
||||
} else {
|
||||
endTime = year + '-' + presentM + '-' + presentD
|
||||
}
|
||||
} else if (year == presentY) {
|
||||
} else if (year == presentY ) {
|
||||
startTime = year + '-01-01'
|
||||
// 当前月份大约3月份
|
||||
if (presentM > 3) {
|
||||
@@ -296,7 +306,7 @@ const next = () => {
|
||||
} else {
|
||||
month = month + 3
|
||||
// 季度进位后,超过当前月份是不科学的
|
||||
if (year == presentY) {
|
||||
if (year == presentY && !props.nextFlag) {
|
||||
if (month >= presentM) {
|
||||
// 当季度进位后大于当前月,以当前月的时间显示季度
|
||||
if (presentM > 0 && presentM < 4) {
|
||||
@@ -372,7 +382,7 @@ const next = () => {
|
||||
} else {
|
||||
year = year + 1
|
||||
// 年份进位后大于当前年份,是不科学的
|
||||
if (year >= presentY) {
|
||||
if (year >= presentY && !props.nextFlag) {
|
||||
startTime = presentY + '-01-01'
|
||||
if (presentM < 10) {
|
||||
if (presentD < 10) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 600px">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
<DatePicker ref="datePickerRef" :nextFlag="nextFlag"></DatePicker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域" v-if="area">
|
||||
@@ -61,12 +61,14 @@ interface Props {
|
||||
datePicker?: boolean
|
||||
area?: boolean
|
||||
showSearch?: boolean
|
||||
nextFlag?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
datePicker: false,
|
||||
area: false,
|
||||
showSearch: true
|
||||
showSearch: true,
|
||||
nextFlag: false
|
||||
})
|
||||
// 动态计算table高度
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
|
||||
Reference in New Issue
Block a user