From 6f3fac4493995e16ee0f37c6cf2b06e5de2a6a72 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 02 七月 2025 16:27:37 +0800 Subject: [PATCH] 1. 将场景图片的分类修改为从服务端动态获取; 2. 问题整改节目中的问题复现功能修改为可拖动对话框且移除背景模态框; --- src/components/search-option/FYOptionTime.vue | 65 +++++++++++++++----------------- 1 files changed, 30 insertions(+), 35 deletions(-) diff --git a/src/components/search-option/FYOptionTime.vue b/src/components/search-option/FYOptionTime.vue index 9a6ba6f..b745a32 100644 --- a/src/components/search-option/FYOptionTime.vue +++ b/src/components/search-option/FYOptionTime.vue @@ -1,18 +1,24 @@ <template> - <el-form-item label="鏃堕棿"> + <el-form-item :label="label" :prop="prop"> <el-date-picker - v-model="selectedOptions" - type="month" + v-model="date" + @change="handleChange" + :type="type" placeholder="閫夋嫨鏃堕棿" + start-placeholder="閫夋嫨寮�濮嬫椂闂�" + end-placeholder="閫夋嫨缁撴潫鏃堕棿" style="width: 150px" + v-bind="$attrs" /> </el-form-item> </template> <script> -import dayjs from 'dayjs' +import dayjs from 'dayjs'; -const MONTH = 'month' +const MONTH = 'month'; +const DATE = 'date'; +const RANGE = 'datetimerange'; export default { props: { @@ -21,50 +27,39 @@ default: MONTH }, // 杩斿洖缁撴灉 - value: Date, + value: Date || Array, // 鏄惁榛樿杩斿洖鍒濆閫夐」 initValue: { type: Boolean, default: true + }, + label: { + type: String, + default: '鏃堕棿' + }, + prop: { + type: String, + default: 'time' } }, - emits: ['update:value'], + emits: ['update:value', 'change'], data() { return { - selectedOptions: '' - } + date: this.value + }; }, - watch: { - selectedOptions: { - handler(nVal, oVal) { - if (nVal != oVal) { - this.$emit('update:value', nVal) - } - } - }, - value: { - handler(nVal, oVal) { - if (nVal != oVal) { - this.selectedOptions = nVal - } - }, - immediate: true - } - }, + computed: {}, methods: { - timeFormat() { - switch (this.type) { - case MONTH: - return 'YYYY-MM' - default: - return 'YYYY-MM' - } + handleChange(value) { + this.$emit('update:value', value); + this.$emit('change', value); } }, mounted() { if (this.initValue) { - this.selectedOptions = new Date() + this.date = new Date(); + this.handleChange(this.date); } } -} +}; </script> -- Gitblit v1.9.3