From c40500d288339cd9b2200f8f909e3cd5471c0c22 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 30 八月 2024 17:38:29 +0800 Subject: [PATCH] 1. 优化3D动画中风向的变化逻辑; 2. 修复折线图切换因子时,数据直接跳转至起始处的问题; 3. 折线图和表格加回风向因子; 4. 优化风向的均值计算为矢量计算,同时最大最小值不显示; 5. 新增表格数据导出功能; --- src/components/search/OptionDevice.vue | 32 +++++++------------------------- 1 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/components/search/OptionDevice.vue b/src/components/search/OptionDevice.vue index 6fc1b0a..2ba1468 100644 --- a/src/components/search/OptionDevice.vue +++ b/src/components/search/OptionDevice.vue @@ -8,7 +8,7 @@ class="w-120" > <el-option - v-for="(s, i) in deviceList" + v-for="(s, i) in deviceOptions" :key="i" :label="s.label" :value="s.value" @@ -18,6 +18,8 @@ </template> <script> +import { deviceList } from '@/constant/device-type'; + export default { props: { type: String, @@ -28,20 +30,12 @@ return {}; }, computed: { - deviceList() { - const t = this.type ? this.type : '0a'; - return [1, 2, 3].map((v) => { - const label = `${this.getDeviceType(t)}璁惧${v}鍙穈; - const value = `${t}000000000${v}`; - return { - label: label, - value: value - }; - }); + deviceOptions() { + return deviceList(this.type); } }, watch: { - deviceList(nV, oV) { + deviceOptions(nV, oV) { if (nV != oV) { this.handleChange(nV[0].value); } @@ -50,22 +44,10 @@ methods: { handleChange(value) { this.$emit('update:modelValue', value); - }, - getDeviceType(t) { - switch (t) { - case '0a': - return '杞﹁浇'; - case '0b': - return '鏃犱汉鏈�'; - case '0c': - return '鏃犱汉鑸�'; - default: - return '杞﹁浇'; - } } }, mounted() { - this.handleChange(this.deviceList[0].value); + this.handleChange(this.deviceOptions[0].value); } }; </script> -- Gitblit v1.9.3