(维修/清洁模式)自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示 #39
Labels
No Label
area/smartpanel
bug
done-waiting-confirmed
kind/feature
page/admin
page/simplepage
page/tab-admin
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: smartoilets-front/projects#39
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
例如 siteName wcName, 等都可以从URL中获取到的值
https://smartoilets.net/simplepage/twsc/4a/male?profile=cleaner
用于设置维修(清洁)模式
同时前端页面的显示条件需要根据这个接口返回的某个字段来判断显示具体的内容.
维修模式时需要显示 清洁中.... 正常模式则显示空闲数据, 看下这个该如何规范.
相关的 HTTP API 为 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=twsc&wcName=4A&roomType=male
可以做一个简单的验证,确认好命名规范后先发出来, 这边同步修改SVG
https://gitea.yunhorn.com/smartoilets-front/projects/attachments/b0349cac-230e-4b9e-8e76-594f3172ff27
自定义请求支持变量传递to 自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示處理好了, 可以驗證一下,目前添加了 siteName, roomType, wcName , deviceId, 這些變量, 其餘變量可通過增加 url query params 來來提供變量以及對應的值,比如 https://x.com?a=abc
此时 在 payload 中声明 {{a}}, 则会自动替换成 abc
具体来说就是这个页面 https://smartoilets.net/simplepage/PWH/F2/male 需要去查询https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male 接口,然后根据接口的结果来决定是显示黄色这块还是显示空闲数据,这里也是需要变量的方式命名规范的方式 来做,也就是这个URL 应该是SVG里面命名定义的,而不是前端写死的.
这个该issue的第二个内容, 目前似乎只做了第一个内容.
自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示to (维修/清洁模式)自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示已經支持 http 請求命名, 命名規範詳情可以參考文檔。
舉例請求 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male
返回值為
{
"msg": "success",
"timestamp": 1735378109679,
"data": {
"siteName": "PWH",
"wcName": "F2",
"roomType": "male",
"isRepair": false
}
}
当 isRepair 为 true时才显示, 则明明为:
STS__CONDITION_RENDER://smartoilets.net/openapi/api/wc/info/wcStatus?siteName={{siteName}}&wcName={{wcName}}&roomType={{roomType}}:data.isRepair:true