主题相关接口需要引入 @/common/service/theme.js

  1. import serviceTheme from "@/common/service/theme.js";

(新)moveTo-移动主题的顺序

传入参数

名称 参数 是否必填 说明
主题id theme_id 是
移动到机关后的id move_to 是 要移动的主题后的主题id,如果要移动到第一个,则该参数传入 null

(新)findThreads-查询主题内有多少独立任务

传入参数

名称 参数 是否必填 说明
主题id theme_id 是

返回参数

名称 参数 类型 说明
独立任务的数组 [ 1, 2, 3, 4 ] 数组

store-新增主题

传入参数

名称 参数 是否必填 说明
主题名称 name 是

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true
  1. serviceTheme.store(this.themeName).then((res) => {
  2. console.log(res);
  3. });

fetch-获取主题列表

传入参数

无

返回参数

名称 参数 类型 说明
返回参数 [ ] 列表
id id char(36)
名称 name varchar
连接状态 status int 0 未绑定
1 已绑定-未连接
2 已连接-未启动
3 运行中 -> 2
0 未绑定
1 已绑定-未连接
2 已连接-未启动
3 运行中 -> 2
当前运行机关步骤 current_running varchar
  1. serviceTheme.fetch().then((res) => {
  2. this.themeList = res;
  3. });

findOne-根据ID获取一个详情

用于查询一个方案的具体信息,包括绑定的设备信息详情

传入参数

id

返回参数

名称 参数 类型 说明
返回参数 {} 对象
id id char(36)
名称 name varchar
连接状态 connection_status int 0未连接、1已连接
启动状态 running_status int 0停止、1运行、2暂停、3异常
绑定状态 binding_status c int 0已绑定、1未绑定
status 0 未绑定
1 已绑定-未连接
2 已连接-未启动
3 运行中 -> 2
  1. serviceTheme.findOne(id).then((res) => {
  2. this.themeDetail = res;
  3. });

updateName-修改主题名称

传入参数

名称 参数 是否必填 说明
id id 是 需要修改的id
主题名称 name 是

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true

startUp-启动主题运行

传入参数

名称 参数 是否必填 说明
id id 是 需要启动的主题id

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true

destroy-删除主题

传入参数

名称 参数 是否必填 说明
id id 是 需要启动的主题id

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true
消息 msg varchar

share-分享主题

传入参数

名称 参数 是否必填 说明
id id 是 主题id
分享码 code 是 分享码
权限类型 power 是 ADMIN管理、USE使用

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true
消息 msg varchar
分享的链接 url varchar

download-下载主题到机器

传入参数

名称 参数 是否必填 说明
id id 是 主题id

返回参数

名称 参数 类型 说明
返回参数 { } 对象
状态 status 成功为true
消息 msg varchar

setSortOrder 对机关内的任务进行排序

  1. import themeService from "@/common/service/theme.js";
  2. themeService.setSortOrder(array)
  3. // 数组的格式 应该为:
  4. [
  5. {
  6. "id": 'xxxxxxxx', // 任务ID
  7. },
  8. {
  9. "id": 'xxxxxxxx',
  10. },
  11. {
  12. "id": 'xxxxxxxx',
  13. },
  14. ]