Commit 63b8b6f9 by 周田

feat:删除提示框

parent e8e7f4c8
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import axios from 'axios'; import axios from 'axios';
import { ElMessage } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import type { DeviceInfo } from '@/components/device_communication/types'; import type { DeviceInfo } from '@/components/device_communication/types';
import EditDialog from './EditDialog.vue'; import EditDialog from './EditDialog.vue';
...@@ -66,6 +66,8 @@ watch(() => props.deviceInfo, () => { ...@@ -66,6 +66,8 @@ watch(() => props.deviceInfo, () => {
const emit = defineEmits(['deleteDeviceInfo']) const emit = defineEmits(['deleteDeviceInfo'])
const del = () => { const del = () => {
ElMessageBox.confirm("确认删除吗?", "TIP")
.then(() => {
let station_id = deviceInfo.value.station_id let station_id = deviceInfo.value.station_id
let id = deviceInfo.value.id let id = deviceInfo.value.id
axios.delete('/api/device_communication/communicate/' + id + '/') axios.delete('/api/device_communication/communicate/' + id + '/')
...@@ -79,6 +81,8 @@ const del = () => { ...@@ -79,6 +81,8 @@ const del = () => {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}) })
})
.catch(() => {});
} }
const changeDeviceInfo = (device_info: DeviceInfo) => { const changeDeviceInfo = (device_info: DeviceInfo) => {
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment