|
@@ -29,6 +29,15 @@
|
|
|
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template #menu="{size,row,index}">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ @click="restart(row)"
|
|
|
+ ><i-ep-edit />重启
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button
|
|
|
:disabled="toDeleteIds.length < 1"
|
|
@@ -45,7 +54,7 @@
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
-import {configSave,configList,deviceUpdateCollect} from "@/api/device";
|
|
|
+import {configSave,deviceRestart,deviceUpdateCollect} from "@/api/device";
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
@@ -81,6 +90,15 @@ const changeItem =(obj,row) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+const restart =(row) => {
|
|
|
+ deviceRestart({id: row.id,collect: row.collect,deviceNo: row.deviceNo}).then((data)=>{
|
|
|
+ if(data.code === '200'){
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ }else{
|
|
|
+ ElMessage.error(data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
delBtn: false,
|