From e337b10466a0d2cea51303cd526a9964a3136dc4 Mon Sep 17 00:00:00 2001
From: zzyuan <781948537@qq.com>
Date: Wed, 9 Apr 2025 10:02:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=8C=E5=B1=8F=E6=9C=BA=E8=AE=BE=E5=A4=87?=
=?UTF-8?q?=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/device/index.js | 46 ++++++++--------
src/views/base/canteenStall/stall/index.vue | 2 +-
src/views/device/doubleScreen/index.vue | 58 +++++++++++++++------
vue.config.js | 2 +-
4 files changed, 67 insertions(+), 41 deletions(-)
diff --git a/src/api/device/index.js b/src/api/device/index.js
index 9bd675f1..62e2799b 100644
--- a/src/api/device/index.js
+++ b/src/api/device/index.js
@@ -38,31 +38,31 @@ export function updateDeviceApi(data) {
})
}
-// 删除设备信息
-export function deleteDeviceApi(data) {
- return request({
- url: '/smart-canteen/doubleScreenMachine/delete',
- method: 'post',
- headers: {
- "merchant-id":"378915229716713472",
- },
- data: data
- })
- }
-
-// export function deleteDeviceApi(deviceId){
-// const formData = new FormData()
-// formData.append('deviceId', deviceId)
+// // 删除设备信息
+// export function deleteDeviceApi(data) {
// return request({
-// url: '/smart-canteen/doubleScreenMachine/delete',
-// method: 'post',
-// data: formData,
-// headers: {
-// "merchant-id":"378915229716713472",
-// },
-// header:'multipart/form-data'
+// url: '/smart-canteen/doubleScreenMachine/delete',
+// method: 'post',
+// headers: {
+// "merchant-id":"378915229716713472",
+// },
+// data: data
// })
-// }
+// }
+
+export function deleteDeviceApi(deviceId){
+ const formData = new FormData()
+ formData.append('deviceId', deviceId)
+ return request({
+ url: '/smart-canteen/doubleScreenMachine/delete',
+ method: 'post',
+ data: formData,
+ headers: {
+ "merchant-id":"378915229716713472",
+ },
+ header:'multipart/form-data'
+ })
+}
// 获取指定日期菜谱计划菜品详情
diff --git a/src/views/base/canteenStall/stall/index.vue b/src/views/base/canteenStall/stall/index.vue
index 4c295d8c..37ac2dee 100644
--- a/src/views/base/canteenStall/stall/index.vue
+++ b/src/views/base/canteenStall/stall/index.vue
@@ -337,7 +337,7 @@ export default {
let param= {
"areaId":e,
"canteenType":1,
- "pagenation"
+ "pagenation":true
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[]
diff --git a/src/views/device/doubleScreen/index.vue b/src/views/device/doubleScreen/index.vue
index 00d567f5..862b8d08 100644
--- a/src/views/device/doubleScreen/index.vue
+++ b/src/views/device/doubleScreen/index.vue
@@ -150,7 +150,7 @@
>
-
+
@@ -160,7 +160,7 @@
-
+
@@ -314,7 +314,20 @@
activeName:"baseSetting",
deviceData:{},
// 表单参数
- baseForm: {},
+ baseForm: {
+ areaId:null,
+ canteenId:null,
+ stallId:null,
+ deviceNum:"",
+ deviceName:"",
+ deviceSn:"",
+ deviceIp:"",
+ deviceKey:"",
+ deviceAddr:"",
+ deviceMac:"",
+ deviceGateway:"",
+ devicePwd:""
+ },
canteenOptions2:[],//弹窗-食堂下拉选
stallOptions2:[],//弹窗-档口下拉选
// 表单校验
@@ -382,18 +395,18 @@
mounted(){
this.getTreeData();
if(this.$route.query.areaId){
- this.queryParams.areaId = this.$route.query.areaId+''
+ this.queryParams.areaId = this.$route.query.areaId
getCanteenByAreaApi({
"areaId":this.queryParams.areaId,"canteenType": 1
}).then((response) => {
this.canteenOptions=response.rows||[]
- this.queryParams.canteenId=this.$route.query.canteenId+''
+ this.queryParams.canteenId=this.$route.query.canteenId
getStallByCanteenApi({
canteenId:this.queryParams.canteenId
}).then((response) => {
this.stallOptions=response.rows||[];
if(this.$route.query.canteenId){
- this.queryParams.stallId=this.$route.query.stallId+''
+ this.queryParams.stallId=this.$route.query.stallId
}
});
});
@@ -451,13 +464,13 @@
"canteenId":this.queryParams.canteenId,
"stallId":this.queryParams.stallId,
"keyWord":this.queryParams.keyWord,
- "deviceType":20
+ // "deviceType":20
}
console.log("param",param)
- let str = base64.encode(JSON.stringify(param))
- // console.log(str)
- getDeviceListPageApi({"content":str}).then(response => {
- this.tableListData = response.records;
+ // let str = base64.encode(JSON.stringify(param))
+ // console.log({"content":str})
+ getDeviceListPageApi(param).then(response => {
+ this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
@@ -469,7 +482,20 @@
},
// 表单重置
reset() {
- this.baseForm = {};
+ this.baseForm = {
+ areaId:null,
+ canteenId:null,
+ stallId:null,
+ deviceNum:"",
+ deviceName:"",
+ deviceSn:"",
+ deviceIp:"",
+ deviceKey:"",
+ deviceAddr:"",
+ deviceMac:"",
+ deviceGateway:"",
+ devicePwd:""
+ };
this.resetForm("baseForm");
},
/** 新增按钮操作 */
@@ -489,9 +515,9 @@
this.stallOptions2=response.rows||[]
});
this.baseForm = Object.assign({}, row)
- this.$set(this.baseForm,"areaId",row.areaId)
- this.$set(this.baseForm,"canteenId",row.canteenId)
- this.$set(this.baseForm,"stallId",row.stallId)
+ this.$set(this.baseForm,"areaId",Number(row.areaId))
+ this.$set(this.baseForm,"canteenId",Number(row.canteenId))
+ this.$set(this.baseForm,"stallId",Number(row.stallId))
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
@@ -558,7 +584,7 @@
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
- return deleteDeviceApi({deviceId:row.deviceId});
+ return deleteDeviceApi(row.deviceId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
diff --git a/vue.config.js b/vue.config.js
index ca0f420d..eaa44f87 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
- target: `http://192.168.2.82:48380`,
+ target: `http://192.168.2.80:48380`,
// target: `http://192.168.0.244:58580`,
changeOrigin: true,
pathRewrite: {