From 49f1db40efa2a03c0eada89abdfb9e9bd779f64c Mon Sep 17 00:00:00 2001
From: yupan <yupanx@163.com>
Date: Mon, 07 Nov 2022 16:05:09 +0800
Subject: [PATCH] 易晨曦提交1、监测因子趋势页面修改时间控件 2、监测因子对比修改echarts显示
---
src/components/Form/HourPicker1.vue | 57 ++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/src/components/Form/HourPicker1.vue b/src/components/Form/HourPicker1.vue
index 3d64e4f..db98682 100644
--- a/src/components/Form/HourPicker1.vue
+++ b/src/components/Form/HourPicker1.vue
@@ -5,17 +5,16 @@
placeholder="������������"
value-format="yyyy-MM-dd"
/> -->
- <el-time-picker
- is-range
+ <el-date-picker
v-model="value1"
+ type="datetimerange"
range-separator="���"
- start-placeholder="������������"
- end-placeholder="������������"
- placeholder="������������������"
- size="inputSize"
+ start-placeholder="������������"
value-format="yyyy-MM-dd HH"
+ end-placeholder="������������"
+ :picker-options="pickerOptions"
>
- </el-time-picker>
+ </el-date-picker>
</template>
<script>
@@ -23,16 +22,36 @@
// ���������import������������������from'������������������';
export default {
-// import ���������������������������������������������������
+ // import ���������������������������������������������������
components: {},
props: {
- value1: String
+ // value1: String
},
data() {
// ������������������
return {
// newValue1: ''
- newValue1: ''
+ value1: '',
+ timeOne: '',
+ pickerOptions: {
+ onPick: ({ maxDate, minDate }) => {
+
+ // ������������ ������������
+ this.timeOne = minDate.getTime() // ��������������������� ������������������
+ // // ������������������������������������������������������������
+
+ },
+ disabledDate: time => {
+ if (this.timeOne) {
+ const WEEK = 7 * 24 * 3600 * 1000 -1 // ������������6��������� ������7���������
+ const minTime = this.timeOne // ������������
+ const maxTime = this.timeOne + WEEK // ������������
+ return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date()
+ } else {
+ return time.getTime() > new Date()
+ }
+ }
+ },
}
},
// ������������ ���������data������
@@ -40,18 +59,15 @@
// ������data������������������
watch: {
value1(nv, ov) {
- this.newValue1 = nv
+ // this.newValue1 = nv
this.sendPicker()
- }
+ },
},
// ������������ - ��������������������������������� this ���������
- created() {
-
- },
+ created() {},
// ������������ - ��������������������������� DOM ���������
- mounted() {
+ mounted() {},
- },
beforeCreate() {}, // ������������ - ������������
beforeMount() {}, // ������������ - ������������
beforeUpdate() {}, // ������������ - ������������
@@ -62,11 +78,10 @@
// ������������
methods: {
sendPicker() {
- this.$emit('sendPickerChild', this.newValue1)
- }
- } // ���������������keep-alive������������������������������������
+ this.$emit('sendPickerChild', this.value1)
+ },
+ }, // ���������������keep-alive������������������������������������
}
</script>
<style scoped>
-
</style>
--
Gitblit v1.8.0