riku
2024-08-29 6b6eff08baa3d052b66fd2e68f1ac0d8495f6f8a
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
<template>
  <BaseCard>
    <template #content>
      <el-radio-group v-model="radio" size="default" @change="handleChange">
        <el-radio v-for="(item, i) in options" :key="i" :value="item.value">{{
          item.label
        }}</el-radio>
      </el-radio-group>
    </template>
  </BaseCard>
</template>
 
<script>
// 监测因子单选框
import { radioOptions } from '@/constant/radio-options';
import { TYPE0 } from '@/constant/device-type';
 
export default {
  props: {
    deviceType: {
      type: String,
      // type0: 车载或无人机; type1:无人船
      default: TYPE0
    }
  },
  emits: ['change'],
  data() {
    return {
      radio: radioOptions(TYPE0)[0].value
    };
  },
  computed: {
    options() {
      return radioOptions(this.deviceType);
    }
  },
  watch: {
    deviceType(nV, oV) {
      if (nV != oV) {
        this.radio = this.options[0].value;
      }
    }
  },
  methods: {
    handleChange(value) {
      this.$emit('change', value);
      // todo 地图3d图像切换展示监测因子
    }
  }
};
</script>
<style scoped>
.el-radio {
  --el-radio-text-color: white;
  --el-color-primary: #23dad1;
  margin-right: 10px;
  height: initial;
}
</style>