删除station

This commit is contained in:
Jason
2025-11-25 22:47:33 +08:00
parent 85e65462fa
commit 7f18b3d151
12 changed files with 120 additions and 25 deletions

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.24.0
require (
github.com/PaesslerAG/gval v1.2.4
github.com/busy-cloud/boat v0.7.0
github.com/busy-cloud/boat-ui v0.5.12
github.com/busy-cloud/boat-ui v0.5.13
github.com/busy-cloud/dash v0.5.0
github.com/busy-cloud/influxdb v0.5.0
github.com/busy-cloud/modbus v0.5.7

4
go.sum
View File

@@ -14,8 +14,8 @@ github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/busy-cloud/boat v0.7.0 h1:wbalq92tNVnfiWkR3/ideLg7kUwb9OfyG/EhtQ3mSLo=
github.com/busy-cloud/boat v0.7.0/go.mod h1:altMy+/ntoXP1shCUWnaSa6AkAP6v/ridlQ2qPLddYM=
github.com/busy-cloud/boat-ui v0.5.12 h1:sHizQeUtGAoWe3eyXOiaaTiGYaM9Rw/6OAjEuwFvbBM=
github.com/busy-cloud/boat-ui v0.5.12/go.mod h1:t9DwLmJyjbPHcm+IKzC9qUE7futO0pLigI9HIPbkhg0=
github.com/busy-cloud/boat-ui v0.5.13 h1:5gHwm/v7ZvBzAdOTu3XrrbHxuIcA6m46pCr0KtfCSLw=
github.com/busy-cloud/boat-ui v0.5.13/go.mod h1:t9DwLmJyjbPHcm+IKzC9qUE7futO0pLigI9HIPbkhg0=
github.com/busy-cloud/dash v0.5.0 h1:v7onTsSlRKKPN/OHnczyAfPL8+h0pIzrF6FHNh1IJT8=
github.com/busy-cloud/dash v0.5.0/go.mod h1:YpLLCh50vwRy47NM9FFrAeg07Mh0qLxz6dzqYPJZm9c=
github.com/busy-cloud/influxdb v0.5.0 h1:4f3MYHOXbc9WQ3pMd4vEz46/iLHBXUrhRlHgxh64q98=

View File

@@ -45,11 +45,6 @@
"key": "description",
"label": "说明"
},
{
"key": "station",
"label": "地址",
"type": "json"
},
{
"key": "online",
"label": "在线",

View File

@@ -2,6 +2,15 @@
"title": "创建设备",
"template": "form",
"toolbar": [
{
"type": "button",
"label": "选择组织ID",
"action": {
"type": "dialog",
"page": "iot/group-choose",
"after_close": "this.editor.patchValue({group_id: result.id})"
}
},
{
"type": "button",
"label": "选择产品ID",
@@ -38,6 +47,11 @@
"label": "说明",
"type": "text"
},
{
"key": "group_id",
"label": "组织ID",
"type": "text"
},
{
"key": "product_id",
"label": "产品ID",

View File

@@ -65,11 +65,6 @@
"label": "连接器ID",
"type": "text"
},
{
"key": "station",
"label": "地址",
"type": "json"
},
{
"key": "online",
"label": "在线",

View File

@@ -2,6 +2,15 @@
"title": "编辑设备",
"template": "form",
"toolbar": [
{
"type": "button",
"label": "选择组织ID",
"action": {
"type": "dialog",
"page": "iot/group-choose",
"after_close": "this.editor.patchValue({group_id: result.id})"
}
},
{
"type": "button",
"label": "选择产品ID",
@@ -37,6 +46,11 @@
"label": "说明",
"type": "text"
},
{
"key": "group_id",
"label": "组织ID",
"type": "text"
},
{
"key": "product_id",
"label": "产品ID",

View File

@@ -8,7 +8,8 @@
"type": "button",
"action": {
"type": "page",
"page": "iot/device-create"
"page": "iot/device-create",
"params_func": "return {product_id: this.params.product_id, group_id: this.params.group_id}"
}
},
{
@@ -115,7 +116,7 @@
}
],
"search_api": "table/device/search",
"mount": "if(this.params.link_id)this.filter.link_id=this.params.link_id; this.get_extend_fields()",
"mount": "if(this.params.link_id)this.filter.link_id=this.params.link_id; if(this.params.group_id)this.filter.group_id=this.params.group_id; if(this.params.product_id)this.filter.product_id=this.params.product_id; this.get_extend_fields()",
"methods": {
"get_extend_fields": "this.request.get('iot/device/extend/fields').subscribe(res=>{if(res.error)return; res.data.map(f=>this.content.columns.push(f)) })"
}

73
pages/group-choose.json Normal file
View File

@@ -0,0 +1,73 @@
{
"title": "组织",
"template": "table",
"toolbar": [
{
"key": "keyword",
"type": "text",
"placeholder": "请输入关键字"
},
{
"type": "button",
"icon": "search",
"label": "搜索",
"action": {
"type": "script",
"script": "this.keyword=this.toolbar.value.keyword; this.search()"
}
}
],
"keywords": [
"id",
"name",
"description"
],
"operators": [
{
"icon": "check",
"label": "选择",
"action": {
"type": "script",
"script": "this.modelRef.close(data)"
}
}
],
"columns": [
{
"key": "id",
"label": "ID"
},
{
"key": "user_id",
"label": "管理员ID"
},
{
"key": "user",
"label": "管理员"
},
{
"key": "name",
"label": "名称"
},
{
"key": "disabled",
"label": "禁用",
"type": "boolean"
},
{
"key": "created",
"label": "日期",
"type": "date"
}
],
"search_api": "table/group/search",
"joins": [
{
"table": "user",
"local_field": "user_id",
"foreign_field": "id",
"field": "name",
"as": "user"
}
]
}

View File

@@ -39,6 +39,11 @@
],
"load_api": "table/group/detail/:id",
"tabs": [
{
"title": "组织设备",
"page": "iot/device",
"params_func": "return {group_id: params.id}"
},
{
"title": "成员管理",
"page": "iot/member",

View File

@@ -58,7 +58,7 @@
"tabs": [
{
"title": "产品设备",
"page": "iot/product-device",
"page": "iot/device",
"params_func": "return {product_id: params.id}"
},
{

View File

@@ -87,9 +87,13 @@
"label": "说明"
},
{
"key": "station",
"label": "地址",
"type": "json"
"key": "online",
"label": "在线",
"type": "boolean"
},
{
"key": "error",
"label": "错误"
},
{
"key": "disabled",

View File

@@ -64,12 +64,6 @@
"comment": "说明",
"type": "text"
},
{
"name": "station",
"comment": "站号",
"type": "text",
"json": true
},
{
"name": "online",
"comment": "在线",