提交 265845eb 编写于 作者: xiaonannet's avatar xiaonannet

新增设备断开功能

上级 7776f97d
...@@ -42,3 +42,11 @@ export function delDevice(id) { ...@@ -42,3 +42,11 @@ export function delDevice(id) {
method: 'delete' method: 'delete'
}) })
} }
// 断开设备连接
export function disconnectDevice(id) {
return request({
url: '/link/device/disconnect/' + id,
method: 'post'
})
}
...@@ -154,6 +154,17 @@ ...@@ -154,6 +154,17 @@
v-hasPermi="['link:device:remove']" v-hasPermi="['link:device:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-loading"
size="mini"
:disabled="multiple"
@click="handleDisconnect"
v-hasPermi="['link:device:disconnect']"
>断开连接</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
...@@ -438,7 +449,7 @@ ...@@ -438,7 +449,7 @@
</template> </template>
<script> <script>
import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/link/device"; import { listDevice, getDevice, delDevice, addDevice, updateDevice , disconnectDevice} from "@/api/link/device";
import mapView from "./mapView"; import mapView from "./mapView";
...@@ -660,6 +671,16 @@ export default { ...@@ -660,6 +671,16 @@ export default {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
/** 断开连接按钮操作 */
handleDisconnect(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认断开连接设备档案编号为"' + ids + '"的数据项?').then(function() {
return disconnectDevice(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('link/device/export', { this.download('link/device/export', {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册