<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>
|