From e30bac4cde234e946bef57af8c8aa50139e125db Mon Sep 17 00:00:00 2001
From: chenshuichuan <1154693969@qq.com>
Date: Sat, 8 Jun 2024 11:40:09 +0800
Subject: [PATCH] fix prod env and push device
---
.env.prod | 6 +-
src/api/iot/device/index.ts | 5 +-
src/utils/dict.ts | 1 +
src/views/iot/device/DeviceForm.vue | 12 +--
.../device/components/DeviceAttributeList.vue | 26 +++----
src/views/iot/device/index.vue | 75 ++++++++-----------
src/views/iot/formula/index.vue | 2 +-
src/views/mes/feedingrecord/index.vue | 2 +-
src/views/mes/plan/index.vue | 18 ++++-
.../components/ProduceReportDetailForm.vue | 11 ++-
10 files changed, 77 insertions(+), 81 deletions(-)
diff --git a/.env.prod b/.env.prod
index 842ba616..c7e5c383 100644
--- a/.env.prod
+++ b/.env.prod
@@ -4,12 +4,12 @@ NODE_ENV=production
VITE_DEV=false
# 请求路径
-VITE_BASE_URL='http://localhost:48080'
+VITE_BASE_URL='http://47.106.185.127:48080'
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
VITE_UPLOAD_TYPE=server
# 上传路径
-VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
+VITE_UPLOAD_URL='http://47.106.185.127:48080/admin-api/infra/file/upload'
# 接口地址
VITE_API_URL=/admin-api
@@ -30,4 +30,4 @@ VITE_BASE_PATH=/
VITE_OUT_DIR=dist-prod
# 商城H5会员端域名
-VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'
+VITE_MALL_H5_DOMAIN='http://localhost'
diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts
index 36d398dd..343e1b9a 100644
--- a/src/api/iot/device/index.ts
+++ b/src/api/iot/device/index.ts
@@ -72,7 +72,10 @@ export const DeviceApi = {
exportDevice: async (params) => {
return await request.download({ url: `/iot/device/export-excel`, params })
},
-
+ // 物联设备配置下发
+ pushDevice: async (id: number) => {
+ return await request.get({ url: `/iot/device/pushDevice?id=` + id })
+ },
// ==================== 子表(设备属性) ====================
// 获得设备属性分页
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 4325c7ce..9be180d0 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -262,4 +262,5 @@ export enum DICT_TYPE {
IOT_DEVICE_DATA_TRANSFER_TYPE = "iot_device_data_transfer_type",
IOT_DEVICE_DATA_TYPE = "iot_device_data_type",
IOT_PROXY_SERVER_STATUS = "iot_proxy_server_status",
+ IOT_DEVICE_USE_TYPE = "iot_device_use_type",
}
diff --git a/src/views/iot/device/DeviceForm.vue b/src/views/iot/device/DeviceForm.vue
index f83ce755..e310cdd2 100644
--- a/src/views/iot/device/DeviceForm.vue
+++ b/src/views/iot/device/DeviceForm.vue
@@ -153,17 +153,7 @@
-
-
-
- {{ dict.label }}
-
-
-
+
diff --git a/src/views/iot/device/components/DeviceAttributeList.vue b/src/views/iot/device/components/DeviceAttributeList.vue
index 8c6d6eeb..971452e9 100644
--- a/src/views/iot/device/components/DeviceAttributeList.vue
+++ b/src/views/iot/device/components/DeviceAttributeList.vue
@@ -13,17 +13,9 @@
-
+
-
-
-
-
-
-
-
-
-
+
@@ -34,11 +26,7 @@
-
-
-
-
-
+
@@ -53,10 +41,14 @@
-
+
-
+
+
+
+
+
-
-
-
+
-
-
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
-
-
-
-
-
+
+
@@ -200,6 +168,14 @@
+ 下发
+
+
@@ -318,7 +294,18 @@ const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
-
+/** 下发操作 */
+const handlePushDevice = async (id: number) => {
+ try {
+ // 二次确认
+ await message.confirm("确定要下发该设备到网关吗?")
+ // 发起
+ await DeviceApi.pushDevice(id)
+ message.success("下发完成!")
+ // 刷新列表
+ await getList()
+ } catch {}
+}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
diff --git a/src/views/iot/formula/index.vue b/src/views/iot/formula/index.vue
index 1d5ce45b..2f91148a 100644
--- a/src/views/iot/formula/index.vue
+++ b/src/views/iot/formula/index.vue
@@ -137,7 +137,7 @@
diff --git a/src/views/mes/feedingrecord/index.vue b/src/views/mes/feedingrecord/index.vue
index 1948e6fe..33e0fcf2 100644
--- a/src/views/mes/feedingrecord/index.vue
+++ b/src/views/mes/feedingrecord/index.vue
@@ -170,7 +170,7 @@
-
+
派工
+
+ 开工
+
+
+ 完工
+
- 请选择字典生成
+
+ {{ dict.label }}
+
@@ -68,6 +74,7 @@
\ No newline at end of file
+