|
|
@ -287,17 +287,34 @@ export default { |
|
|
|
// } |
|
|
|
}, |
|
|
|
async requestURL(functionId, options = {}) { |
|
|
|
let result = await request({ |
|
|
|
url: `/business/device/functions/${this.deviceId}/${functionId}`, |
|
|
|
method: "post", |
|
|
|
data: options, |
|
|
|
}); |
|
|
|
console.log("工作模式") |
|
|
|
console.log(result) |
|
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
|
//模式设定:SETMD;模式查询:ASKMD;时间设定:SETTM;时间查询:ASKTM;自定义设置:SETDF;自定义查询:ASKDF |
|
|
|
return result; |
|
|
|
|
|
|
|
const url = `/business/device/functions/${this.deviceId}/${functionId}`; |
|
|
|
if (!this.deviceId) { |
|
|
|
throw new Error("设备ID为空,无法发送请求"); |
|
|
|
} |
|
|
|
let result = await request({ |
|
|
|
url, |
|
|
|
method: "post", |
|
|
|
data: options, |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
// 'Authorization': 'Bearer ' + getToken() |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
console.log("完整响应:", result); |
|
|
|
console.log("JSON:", JSON.stringify(result)); |
|
|
|
|
|
|
|
if (!result || result.code !== 200) { |
|
|
|
Message.error(result?.msg || "请求失败"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async tabClick() { |
|
|
|
if (this.activeName == "second") { |
|
|
|
if (this.isMultiControl) |
|
|
|