he wei
5 天以前 3c3576d5792bfabcef84979757ee344712e71cd3
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
<script setup>
import { ref, onMounted } from "vue";
import alarmParams from '@/components/alarmParams.vue';
 
import useElement from "@/hooks/useElement.js";
    const { $loading, $message, $confirm } = useElement();
 
const emit = defineEmits(['close']);
 
import {
  // getBattAlmParam,
} from '@/api/control.js';
 
const props = defineProps({
  id: {
    type: [String, Number],
    default: '',
  },
  visible: {
    type: Boolean,
    default: false
  },
});
 
const alarmTypeList = ref([]);
 
async function getParams() {
  // if (!props.id) return;
  // let loading = $loading();
  // let res = await getBattAlmParam(props.id);
  // // console.log('res', res, '=============');
  // let { code, data, data2 } = res;
  // let list = [];
  // if (code && data) {
  //   list = data2;
  // }
  // loading.close();
  // alarmTypeList.value = list;
}
 
function close () {
  emit('close');
}
 
onMounted(() => {
  getParams();
});
</script>
 
<template>
  <alarm-params :list="alarmTypeList" @update:visible="close" @change="getParams"></alarm-params>
</template>
 
<style scoped lang="less">
 
</style>