|
@@ -1,9 +1,11 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { computed, onMounted, ref } from 'vue';
|
|
import { computed, onMounted, ref } from 'vue';
|
|
-import { NNumberAnimation } from 'naive-ui';
|
|
|
|
|
|
+import { NNumberAnimation, useMessage } from 'naive-ui';
|
|
import { controlApi } from "@/api/control"
|
|
import { controlApi } from "@/api/control"
|
|
import { SvgIcon } from '@/components';
|
|
import { SvgIcon } from '@/components';
|
|
|
|
|
|
|
|
+const message = useMessage();
|
|
|
|
+
|
|
const isVisibleBtn = defineModel();
|
|
const isVisibleBtn = defineModel();
|
|
const systemStatus = ref({});
|
|
const systemStatus = ref({});
|
|
const modelSystemStatus = defineModel('system');
|
|
const modelSystemStatus = defineModel('system');
|
|
@@ -94,7 +96,9 @@ const getPositionText = computed(() => {
|
|
return str;
|
|
return str;
|
|
})
|
|
})
|
|
|
|
|
|
-const emitEvent = (type) => {
|
|
|
|
|
|
+const emitEvent = async (type) => {
|
|
|
|
+
|
|
|
|
+ systemStatus.value.activeTwo = systemStatus.value.activeTwo === 1 ? 0 : 1;
|
|
|
|
|
|
// const name = type == 'one' ? '西池' : '东池';
|
|
// const name = type == 'one' ? '西池' : '东池';
|
|
|
|
|
|
@@ -110,9 +114,9 @@ const emitEvent = (type) => {
|
|
// systemStatus.value.activeTwo = systemStatus.value.activeTwo === 1 ? 0 : 1;
|
|
// systemStatus.value.activeTwo = systemStatus.value.activeTwo === 1 ? 0 : 1;
|
|
// }
|
|
// }
|
|
|
|
|
|
- // controlApi.putSystemStatus({ ...systemStatus.value });
|
|
|
|
|
|
+ await controlApi.putSystemStatus({ ...systemStatus.value });
|
|
|
|
|
|
- // message.success(`${name}投药状态更改成功`);
|
|
|
|
|
|
+ message.success(`投药状态更改成功`);
|
|
};
|
|
};
|
|
const emitUpdate = async () => {
|
|
const emitUpdate = async () => {
|
|
emit('on-update');
|
|
emit('on-update');
|
|
@@ -383,8 +387,8 @@ onMounted(() => {
|
|
.circle2,
|
|
.circle2,
|
|
.circle3 {
|
|
.circle3 {
|
|
position: absolute;
|
|
position: absolute;
|
|
- width: 36px;
|
|
|
|
- height: 36px;
|
|
|
|
|
|
+ width: 46px;
|
|
|
|
+ height: 46px;
|
|
background: rgba(137, 142, 254, 1);
|
|
background: rgba(137, 142, 254, 1);
|
|
border: 1px solid rgba(137, 142, 254, 0.85);
|
|
border: 1px solid rgba(137, 142, 254, 0.85);
|
|
border-radius: 999px;
|
|
border-radius: 999px;
|