wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template>
  <el-row>
    <el-form ref="form">
      <el-form-item v-show="formatInfo.showDate" :label="t('visualization.show_date')">
        <el-select
          v-model="formatInfo.dateFormat"
          :effect="themes"
          style="width: 100%"
          @change="onFormatChange"
        >
          <el-option
            v-for="item in state.dateOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
 
      <el-form-item :label="t('visualization.show_time')">
        <el-select
          v-model="formatInfo.timeFormat"
          :effect="themes"
          filterable
          allow-create
          default-first-option
          style="width: 100%"
          @change="onFormatChange"
        >
          <el-option
            v-for="item in state.timeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-checkbox
          :effect="themes"
          v-model="formatInfo.showWeek"
          :label="t('visualization.show_week')"
          @change="onFormatChange"
        />
      </el-form-item>
    </el-form>
  </el-row>
</template>
 
<script setup lang="ts">
import { reactive, toRefs } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
const state = reactive({
  timeOptions: [
    { value: 'hh:mm:ss', label: 'hh:mm:ss' },
    { value: 'hh时mm分ss秒', label: 'hh时mm分ss秒' },
    { value: '', label: '无' }
  ],
  dateOptions: [
    { value: 'yyyy-MM-dd', label: 'yyyy-MM-dd' },
    { value: 'yyyy/MM/dd', label: 'yyyy/MM/dd' },
    { value: 'yyyy年MM月dd日', label: 'yyyy年MM月dd日' }
  ]
})
 
const props = defineProps({
  canvasId: {
    type: String,
    require: true
  },
  formatInfo: {
    type: Object,
    required: true
  },
  themes: {
    type: String,
    required: true,
    default: 'dark'
  }
})
 
const { formatInfo } = toRefs(props)
 
const onFormatChange = () => {
  // doFormatChange
}
</script>
 
<style lang="less" scoped></style>