From a383d64df4a6de64a3dfe0019b2cdcdc7ea3cf1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=86=8A=E4=B8=BD=E5=90=9B?= <664953382@qq.com>
Date: Tue, 22 Dec 2020 15:55:54 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E6=9D=83?=
=?UTF-8?q?=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/hardware/device.js | 8 +++++++
src/views/hardware/device/list.vue | 35 ++++++++++++++++++++++--------
vue.config.js | 1 +
3 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/src/api/hardware/device.js b/src/api/hardware/device.js
index 073df6e..5c07c23 100644
--- a/src/api/hardware/device.js
+++ b/src/api/hardware/device.js
@@ -52,3 +52,11 @@ export function saveDeviceFirmware(data) {
data
})
}
+
+// 导出设备列表
+export function exportEquipment(params) {
+ return request({
+ url: '/system/device/export',
+ params
+ });
+}
\ No newline at end of file
diff --git a/src/views/hardware/device/list.vue b/src/views/hardware/device/list.vue
index 8a06b6b..6ae18ea 100644
--- a/src/views/hardware/device/list.vue
+++ b/src/views/hardware/device/list.vue
@@ -23,20 +23,22 @@
- 增加
+ 增加
- 批量删除
+
+ 批量删除
-
+
@@ -73,14 +75,14 @@
-->
- 新增节点
+ 新增节点
- 修改
+ 修改
查看节点
删除
+ v-hasPermi="['hardware:device:remove']">删除
@@ -213,6 +215,7 @@ import {
update,
del,
saveDeviceFirmware,
+ exportEquipment
} from "@/api/hardware/device";
// import { nodeList, addNode, nodeInfo, delNode, nodeSelect } from "@/api/system/device/node";
import { select as productSelect } from "@/api/hardware/product";
@@ -347,6 +350,20 @@ export default {
this.getList();
},
methods: {
+ /** 导出按钮操作 */
+ handleExport () {
+ const queryParams = this.queryParams;
+ this.$confirm('是否确认导出所有用户数据项?', "警告", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ }).then(function () {
+ return exportEquipment(queryParams);
+ }).then(response => {
+ this.download(response.msg);
+ })
+ },
+
getDeviceTypeLabel (deviceType) {
let snap = '';
this.deviceTypeList.map(v => {
diff --git a/vue.config.js b/vue.config.js
index 6c7acea..cdb1175 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -37,6 +37,7 @@ module.exports = {
// target: `http://47.115.73.110:8080`,
target: `http://121.37.250.170:8080`,
// target: `http://192.168.0.129:8080`,
+ // target: `http://192.168.0.131:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''