This commit is contained in:
JayJiaJun 2025-05-22 16:20:13 +08:00
commit 31f9b83d44
933 changed files with 135446 additions and 0 deletions

22
.editorconfig Normal file
View File

@ -0,0 +1,22 @@
# 告诉EditorConfig插件这是根文件不用继续往上查找
root = true
# 匹配全部文件
[*]
# 设置字符集
charset = utf-8
# 缩进风格可选space、tab
indent_style = space
# 缩进的空格数
indent_size = 2
# 结尾换行符可选lf、cr、crlf
end_of_line = lf
# 在文件结尾插入新行
insert_final_newline = true
# 删除一行中的前后空格
trim_trailing_whitespace = true
# 匹配md结尾的文件
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

23
.env.development Normal file
View File

@ -0,0 +1,23 @@
# 页面标题
VUE_APP_TITLE = 浙江超亿消防装备有限公司
# 开发环境配置
ENV = 'development'
# 开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 后端接口地址
VUE_APP_SERVER_API_URL = 'http://localhost:8080/'
# Mqtt消息服务器连接地址
VUE_APP_MQTT_SERVER_URL = 'ws://localhost:8083/mqtt'
# 百度地图AK
VUE_APP_BAI_DU_AK = 'nAtaBg9FYzav6c8P9rF9qzsWZfT8O0PD'
# 心知天气key
VUE_APP_XIN_ZHI_KEY = 'SBh45_yy21FU5ErV_'

17
.env.production Normal file
View File

@ -0,0 +1,17 @@
# 页面标题
VUE_APP_TITLE = 浙江超亿消防装备有限公司
# 生产环境配置
ENV = 'production'
# 生产环境
VUE_APP_BASE_API = '/prod-api'
# Mqtt消息服务器连接地址,使用空字符串则会自动获取服务器地址
VUE_APP_MQTT_SERVER_URL = ''
# 百度地图AK
VUE_APP_BAI_DU_AK = 'nAtaBg9FYzav6c8P9rF9qzsWZfT8O0PD'
# 心知天气key
VUE_APP_XIN_ZHI_KEY = 'SBh45_yy21FU5ErV_'

19
.env.staging Normal file
View File

@ -0,0 +1,19 @@
# 页面标题
VUE_APP_TITLE = 浙江超亿消防装备有限公司
NODE_ENV = production
# 测试环境配置
ENV = 'staging'
# 测试环境
VUE_APP_BASE_API = '/stage-api'
# Mqtt消息服务器连接地址
VUE_APP_MQTT_SERVER_URL = 'ws://localhost:8083/mqtt'
# 百度地图AK
VUE_APP_BAI_DU_AK = 'nAtaBg9FYzav6c8P9rF9qzsWZXXXXXX'
# 心知天气key
VUE_APP_XIN_ZHI_KEY = 'SBh45_yy21FU5ErV_'

9
.eslintignore Normal file
View File

@ -0,0 +1,9 @@
# 忽略build目录下类型为js的文件的语法检查
build/*.js
# 忽略src/assets目录下文件的语法检查
src/assets
# 忽略public目录下文件的语法检查
public
# 忽略当前目录下为js的文件的语法检查
*.js
*.vue

210
.eslintrc.js Normal file
View File

@ -0,0 +1,210 @@
/**
*
* 规则说明见 https://cn.eslint.org/docs/rules/
* eslint-plugin-vue 规则见 https://github.com/vuejs/eslint-plugin-vue
*
* "off" 0 - 关闭规则
* "warn" 1 - 开启规则使用警告级别的错误warn (不会导致程序退出)
* "error" 2 - 开启规则使用错误级别的错误error (当被触发的时候程序会退出)
*
*/
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here
rules: {
'vue/max-attributes-per-line': [2, {
'singleline': 10,
'multiline': {
'max': 1,
'allowFirstLine': false
}
}],
'vue/html-self-closing': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/no-template-shadow': "off",
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/no-v-html': 'off',
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'always-multiline'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'always'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': 0,
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
pnpm-lock.yaml
yarn.lock

4
.prettierignore Normal file
View File

@ -0,0 +1,4 @@
.eslintrc.js
/dist/
/node_modules/**
/public/*

10
.prettierrc.js Normal file
View File

@ -0,0 +1,10 @@
module.exports = {
printWidth: 220,
singleQuote: true, // 使用单引号而不是双引号
semi: true, // 句尾是否加;
proseWrap: 'preserve',
tabWidth: 4,
trailingComma: 'es5', // 在对象或数组最后一个元素后面是否加逗号在ES5中加尾逗号
bracketSpacing: true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
htmlWhitespaceSensitivity: 'ignore', // > 不乱换行
};

13
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"editor.formatOnSave": true, //
"editor.defaultFormatter": "esbenp.prettier-vscode", // prettier
"eslint.enable": true, // eslint
"eslint.probe": ["javascript", "javascriptreact", "vue", "html"],
"i18n-ally.localesPaths": ["src/lang"], //
"i18n-ally.keystyle": "flat",
"i18n-ally.sourceLanguage": "en-US", //
"i18n-ally.displayLanguage": "zh-CN",
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
} //
}

575
MQTT接口.md Normal file
View File

@ -0,0 +1,575 @@
# 在线离线接口
# 主题:
/productid/deviceid/status/post
# 原始http推送接口
http://121.41.45.13:8025/receive
abcdefghijkmlnopqrstuvwxyz
# 新的http推送接口
http://121.36.111.27:8080/bridge/get
# 消息格式json格式具体字段如下其中status取值4离线3在线
{"status":3,"isShadow":1,"rssi":-51}
# onenet平台上下线信息
{msg={"dev_name":"1","at":1742873510747,"pid":"JYr2f72uSJ","type":2,"status":1}, signature=25BcZvEQ+kk10rfB9gLnnQ==, time=1742873510772, id=5614fc489df3433f9891d6d4c7c3e5e7, nonce=b1R7hjgp}
"status":1上线 0下线
# 物模型推送接口: 将数据推送至FASTBEE端
/productid/deviceid/property/post
# 消息格式json格式具体字段如下
[{
"id": "co2",
"value": "1",
"remark": ""
}]
# 规则引擎仅作于设备状态更新
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.util.NumberUtil;
Long productId = 136 // 固定 productId
String sysTopic = "" // 系统主题
String sysPayload = "" // 系统数据格式
// 1. 获取原始内容
String payload = msgContext.getPayload()
msgContext.logger.info("原始数据:" + payload)
// 2. ✅ 只提取 msg 内容
try {
// ✅ 使用 Groovy 兼容的正则写法,提取 msg 内的数据
String msgData = (payload =~ /msg=\{(.+?)\}/)[0][1]
msgContext.logger.info("提取后的 msg 数据:" + msgData)
// ✅ 解析提取后的数据
JSONObject msgObj = JSONUtil.parseObj("{" + msgData + "}")
// ✅ 提取 dev_name 作为 serialNumber
String serialNumber = msgObj.getStr("dev_name", "unknown")
// ✅ 解析 status 并进行转换
Integer status = msgObj.getInt("status", -1)
Integer convertedStatus = (status == 0) ? 4 : (status == 1) ? 3 : status
// ✅ 构造转换后的 sysPayload
JSONObject newObj = new JSONObject()
newObj.put("status", convertedStatus)
newObj.put("isShadow", 1)
newObj.put("rssi", msgObj.getInt("rssi", -51)) // 默认 rssi = -51
sysPayload = newObj.toString()
sysTopic = "/" + productId + "/" + serialNumber + "/status/post"
} catch (Exception e) {
msgContext.logger.error("数据解析失败:", e)
sysPayload = "{}"
}
// 3. 打印调试信息
msgContext.logger.info("新主题:" + sysTopic)
msgContext.logger.info("新内容:" + sysPayload)
msgContext.logger.info("NewTopic 长度: " + sysTopic.length());
// 4. 设置新的数据
msgContext.setTopic(sysTopic)
msgContext.setPayload(sysPayload)
msgContext.logger.info("输出:" + msgContext.getTopic());
// 执行Action动作参数(脚本由系统自动生成)
msgContext.setData("mqttBridgeID", 8);
# 定制设备状态
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.util.NumberUtil;
String sysTopic = "/special/device" // 固定主题
String sysPayload = "" // 系统数据格式
// 1. 获取原始内容
String payload = msgContext.getPayload()
msgContext.logger.info(" 原始数据:" + payload)
// 2. ✅ 只提取 msg 内容
try {
// ✅ 使用 Groovy 兼容的正则写法,提取 msg 内的数据
String msgData = (payload =~ /msg=\{(.+?)\}/)[0][1]
msgContext.logger.info(" 提取后的 msg 数据:" + msgData)
// ✅ 解析提取后的数据
JSONObject msgObj = JSONUtil.parseObj("{" + msgData + "}")
// ✅ 提取 dev_name 作为 serialNumber
String serialNumber = msgObj.getStr("dev_name", "unknown")
// ✅ 解析 status 并进行转换 (0=上线,1=下线)
Integer status = msgObj.getInt("status", -1)
Integer convertedStatus = (status == 0) ? 0 : (status == 1) ? 1 : status
// ✅ 构造转换后的 JSON payload
JSONObject newObj = new JSONObject()
newObj.put("serialNumber", serialNumber)
newObj.put("status", convertedStatus)
sysPayload = newObj.toString()
} catch (Exception e) {
msgContext.logger.error(" 数据解析失败:", e)
// 错误时返回默认 JSON
JSONObject errorObj = new JSONObject()
errorObj.put("serialNumber", "error")
errorObj.put("status", -1)
sysPayload = errorObj.toString()
}
// 3. 打印调试信息
msgContext.logger.info(" 新主题:" + sysTopic)
msgContext.logger.info(" 新内容:" + sysPayload)
// 4. 设置新的数据
msgContext.setTopic(sysTopic)
msgContext.setPayload(sysPayload)
msgContext.logger.info(" 输出:" + msgContext.getTopic());
// 执行Action动作参数(脚本由系统自动生成)
msgContext.setData("mqttBridgeID", 8);
# ONENET 物模型
# 物模型
{
msg = {
"notifyType": "property",
"productId": "ebm1xlK9QJ",
"messageType": "notify",
"data": {
"id": "1",
"params": {
"time": {
"time": 1747031766274,
"value": 3
},
"press": {
"time": 1747031766273,
"value": 4
},
"remove": {
"time": 1747031766273,
"value": 2
}
}
},
"deviceName": "D1231XS9KI9X"
},
signature = YoYfkfdyNiYfPmJPLzz5wg == ,
time = 1747031766259,
id = e20abecf848c408fb381bc03a23ebfd7,
nonce = xQLnbAzQ
}
[
{
"id": "params",
"remark": "",
"value": "3"
},
{
"id": "press",
"remark": "",
"value": "3"
},
{
"id": "remove",
"remark": "",
"value": "3"
}
]
[
{
"id": "press",
"remark": "",
"value": "3"
}
]
{
"id": "123",
"version": "1.0",
"params": {
"time": {
"value": 2,
"time": 1706673129818
},
"press": {
"value": 3,
"time": 1706673129818
},
"remove": {
"value": 2
"time": 1747031766273
}
}
}
{
"id": "1234567890123",
"version": "1.0",
"params": {
"press": { "value": 4 },
"remove": { "value": 2 },
"time": { "value": 3 }
}
}
# mqttfx
# 物模型规则脚本
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.util.NumberUtil;
Long productId = 136
String sysTopic = ""
String sysPayload = "[]"
try {
// 1. 获取原始payload
String payload = msgContext.getPayload().trim()
// 2. 安全提取msg JSON兼容各种格式
int msgStart = payload.indexOf('"msg":') + 6
int jsonStart = payload.indexOf('{', msgStart)
int jsonEnd = payload.lastIndexOf('}')
String msgJsonStr = payload.substring(jsonStart, jsonEnd + 1)
msgContext.logger.info(" 提取的msg JSON: " + msgJsonStr)
// 3. 解析JSON
JSONObject msgObj = JSONUtil.parseObj(msgJsonStr)
// 4. 获取设备名(确保字段名正确)
String serialNumber = msgObj.getStr("deviceName", "unknown")
// 5. 处理物模型数据(完全兼容的遍历方式)
JSONObject data = msgObj.getJSONObject("data")
JSONObject params = data.getJSONObject("params")
JSONArray propertyArray = new JSONArray()
// 使用兼容的遍历方式替代each闭包
Set<String> keys = params.keySet()
keys.each { key ->
JSONObject valueObj = params.getJSONObject(key)
if (valueObj != null) {
JSONObject prop = new JSONObject()
prop.set("id", key)
prop.set("remark", "")
prop.set("value", valueObj.getStr("value"))
propertyArray.add(prop)
}
}
// 6. 设置输出
sysPayload = propertyArray.toString()
sysTopic = "/${productId}/${serialNumber}/property/post"
} catch (Exception e) {
msgContext.logger.error(" 处理异常: " + e.getMessage())
} finally {
// 确保有效输出
msgContext.setTopic(sysTopic ?: "/${productId}/unknown/property/post")
msgContext.setPayload(sysPayload ?: "[]")
msgContext.setData("mqttBridgeID", 8)
// 验证日志
msgContext.logger.info("=== 最终结果验证 ===")
msgContext.logger.info(" 设备名: " + (sysTopic.split("/")[2] ?: "null"))
msgContext.logger.info("Payload 内容: " + sysPayload)
}
# 2合1脚本
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.util.NumberUtil;
// 公共配置
Long productId = 136
String sysTopic = ""
String sysPayload = ""
try {
// 1. 获取原始payload
String payload = msgContext.getPayload().trim()
msgContext.logger.info(" 原始数据:" + payload)
// 2. 提取msg内容
String msgContent = payload
if (payload.startsWith("{")) {
// 尝试直接解析为JSON
try {
JSONObject payloadObj = JSONUtil.parseObj(payload)
if (payloadObj.containsKey("msg")) {
msgContent = payloadObj.getStr("msg")
}
} catch (Exception e) {
// 可能是msg={...}格式
if (payload.contains("msg={")) {
int start = payload.indexOf("msg={") + 4
int end = payload.lastIndexOf("}") + 1
msgContent = payload.substring(start, end)
}
}
} else if (payload.contains("msg={")) {
// 处理msg={"key":"value"}格式
int start = payload.indexOf("msg={") + 4
int end = payload.lastIndexOf("}") + 1
msgContent = payload.substring(start, end)
} else if (payload.contains("msg=")) {
// 处理msg=JSON格式不带大括号
int start = payload.indexOf("msg=") + 4
msgContent = payload.substring(start)
}
// 3. 解析msg内容
JSONObject parsedObj = JSONUtil.parseObj(msgContent)
msgContext.logger.info(" 解析后的JSON对象" + parsedObj)
// 4. 判断数据类型并处理
if (parsedObj.containsKey("notifyType") && "property".equals(parsedObj.getStr("notifyType"))) {
// 物模型数据处理 =========================================
msgContext.logger.info(" 检测到物模型数据格式")
// 获取设备名
String serialNumber = parsedObj.getStr("deviceName", "unknown")
// 处理物模型数据
JSONObject data = parsedObj.getJSONObject("data")
JSONObject params = data.getJSONObject("params")
JSONArray propertyArray = new JSONArray()
params.keySet().each { key ->
JSONObject valueObj = params.getJSONObject(key)
if (valueObj != null) {
JSONObject prop = new JSONObject()
prop.set("id", key)
prop.set("remark", "")
prop.set("value", valueObj.getStr("value"))
propertyArray.add(prop)
}
}
// 设置物模型输出
sysPayload = propertyArray.toString()
sysTopic = "/${productId}/${serialNumber}/property/post"
} else if (parsedObj.containsKey("dev_name") || parsedObj.containsKey("status")) {
// 设备状态处理 ===========================================
msgContext.logger.info(" 检测到设备状态数据格式")
// 提取设备信息
String serialNumber = parsedObj.getStr("dev_name", "unknown")
Integer status = parsedObj.getInt("status", -1)
Integer convertedStatus = (status == 0) ? 0 : (status == 1) ? 1 : status
// 构造状态JSON
JSONObject statusObj = new JSONObject()
statusObj.put("serialNumber", serialNumber)
statusObj.put("status", convertedStatus)
// 设置状态输出
sysPayload = statusObj.toString()
sysTopic = "/special/device"
} else {
throw new Exception("无法识别的数据格式")
}
} catch (Exception e) {
msgContext.logger.error(" 处理异常: " + e.getMessage())
// 创建错误响应
JSONObject errorObj = new JSONObject()
errorObj.put("error", e.getMessage())
errorObj.put("originalData", msgContext.getPayload())
sysPayload = errorObj.toString()
sysTopic = "/error/unknown"
} finally {
// 确保有效输出
msgContext.setTopic(sysTopic)
msgContext.setPayload(sysPayload)
msgContext.setData("mqttBridgeID", 8)
// 记录最终结果
msgContext.logger.info("=== 处理结果 ===")
msgContext.logger.info(" 主题: " + sysTopic)
msgContext.logger.info("Payload: " + sysPayload)
}
# 压力传感器的id
{msg={at=1747123666940, imei=868256050123875, type=1, ds_id=3323_0_5700, value=1538.0, dev_id=2415928615}, msg_signature=mpYC8EvR7lB14AzqteyjhA==, nonce=nPyzGpMV}
{"msg":{"at":1747142877978,"imei":"868256050017168","type":1,"ds_id":"3323_0_5700","value":-1.0,"dev_id":2442383559},"msg_signature":"MHjUOUPj0GGfpKpyBZ6BzQ==","nonce":"TdTKIcVq"}
# 上下线消息
{msg={at=1747126859912, login_type=10, imei=868256050123875, type=2, dev_id=2442383559, status=1}, msg_signature=Z/cRScM2TLOUeaptE1hllg==, nonce=BSy0fFIY}
{"msg":{"at":1747126859912,"login_type":10,"imei":"868256050123875","type":2,"dev_id":2442383559,"status":1},"msg_signature":"Z/cRScM2TLOUeaptE1hllg==","nonce":"BSy0fFIY"}
# 移动消息
{"msg":{"at":1747275785411,"imei":"868256050099802","type":1,"ds_id":"30100_0_6500","value":"01","dev_id":2442561775},"msg_signature":"2dRxxL4t9HDW1EmRwIGhfQ==","nonce":"hM31WR88"}
脚本
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.hutool.core.util.NumberUtil;
// 默认 topic
String sysTopic = "/special/device";
String sysPayload = "";
// 获取原始 payload
String payload = msgContext.getPayload();
msgContext.logger.info("原始 payload" + payload);
try {
// 提取 msg 内容
def matcher = (payload =~ /"msg":\{(.+?)\}/);
if (!matcher.find()) {
throw new Exception("未找到 msg 字段");
}
String msgData = matcher[0][1];
msgContext.logger.info("提取出的 msg 内容:" + msgData);
// 将 msgData 转为 JSON 字符串key=value → "key":"value"
String jsonLike = msgData.replaceAll(/(\w+)=([^,}]+)/) { all, k, v ->
"\"${k}\":\"${v}\""
};
jsonLike = "{${jsonLike}}";
msgContext.logger.info("转换为 JSON 格式字符串:" + jsonLike);
JSONObject msgObj = JSONUtil.parseObj(jsonLike);
// 判断是否是物模型数据(包含 ds_id 字段)
if (msgObj.containsKey("ds_id")) {
String dsid = msgObj.getStr("ds_id");
if ("3323_0_5700" != dsid) {
msgContext.logger.info("不处理的 ds_id" + dsid);
return; // 直接跳过不处理
}
// ✅ 物模型处理
String imei = msgObj.getStr("imei", "unknown");
String valueStr = msgObj.getStr("value", "0");
Double valueNum = NumberUtil.parseNumber(msgObj.getStr("value", "0")).doubleValue();
JSONArray array = new JSONArray();
JSONObject data = new JSONObject();
data.put("id", "press");
data.put("remark", "");
data.put("value", valueNum);
array.add(data);
sysPayload = array.toString();
sysTopic = "/138/${imei}/property/post";
} else {
// ✅ 在线离线数据处理
String imei = msgObj.getStr("imei", "unknown");
Integer status = NumberUtil.parseInt(msgObj.getStr("status", "-1"));
Integer loginType = NumberUtil.parseInt(msgObj.getStr("login_type", "-1"));
Long timestamp = msgObj.getLong("at", 0);
JSONObject newPayload = new JSONObject();
newPayload.put("serialNumber", imei);
newPayload.put("status", status);
newPayload.put("loginType", loginType);
newPayload.put("timestamp", timestamp);
sysPayload = newPayload.toString();
sysTopic = "/special/device";
}
} catch (Exception e) {
msgContext.logger.error("解析出错:", e);
JSONObject errorPayload = new JSONObject();
errorPayload.put("serialNumber", "error");
errorPayload.put("status", -1);
sysPayload = errorPayload.toString();
sysTopic = "/special/device";
}
// 设置 topic 和 payload
msgContext.setTopic(sysTopic);
msgContext.setPayload(sysPayload);
// 打印调试信息
msgContext.logger.info("新主题:" + sysTopic);
msgContext.logger.info("新内容:" + sysPayload);
msgContext.logger.info("输出:" + msgContext.getTopic());
// 可选设置
// 执行Action动作参数(脚本由系统自动生成)
msgContext.setData("mqttBridgeID", 7);
// 执行Action动作参数(脚本由系统自动生成)

41
README.md Normal file
View File

@ -0,0 +1,41 @@
## 开发
```bash
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npmmirror.com
# 启动服务
npm run dev
```
浏览器访问 http://localhost:80
## 发布
```bash
# 构建测试环境
npm run build:stage
# 构建生产环境
npm run build:prod
```
## 报错
- Error: error:0308010C:digital envelope routines::unsupported
```bash
# package.json 中scripts 添加 SET NODE_OPTIONS=--openssl-legacy-provider window环境
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"build:stage": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
```
## 工具
- 若使用 vscode 开发代码,则可以安装一下插件辅助开发
- Prettier 统一代码格式,避免冲突
- i18n Ally 提高开发者翻译多语言的效率、简单出错率

13
babel.config.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
presets: [
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
'@vue/cli-plugin-babel/preset',
],
env: {
development: {
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
plugins: ['dynamic-import-node'],
},
},
};

12
bin/build.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 打包Web工程生成dist文件。
echo.
%~d0
cd %~dp0
cd ..
npm run build:prod
pause

1
bin/jessibuca/decoder.js Normal file

File diff suppressed because one or more lines are too long

BIN
bin/jessibuca/decoder.wasm Normal file

Binary file not shown.

637
bin/jessibuca/jessibuca.d.ts vendored Normal file
View File

@ -0,0 +1,637 @@
declare namespace Jessibuca {
/** 超时信息 */
enum TIMEOUT {
/** 当play()的时候,如果没有数据返回 */
loadingTimeout = 'loadingTimeout',
/** 当播放过程中如果超过timeout之后没有数据渲染 */
delayTimeout = 'delayTimeout',
}
/** 错误信息 */
enum ERROR {
/** 播放错误url 为空的时候,调用 play 方法 */
playError = 'playError',
/** http 请求失败 */
fetchError = 'fetchError',
/** websocket 请求失败 */
websocketError = 'websocketError',
/** webcodecs 解码 h265 失败 */
webcodecsH265NotSupport = 'webcodecsH265NotSupport',
/** mediaSource 解码 h265 失败 */
mediaSourceH265NotSupport = 'mediaSourceH265NotSupport',
/** wasm 解码失败 */
wasmDecodeError = 'wasmDecodeError',
}
interface Config {
/**
*
* * string document.getElementById('id')
* */
container: HTMLElement | string;
/**
*
*/
videoBuffer?: number;
/**
* worker地址
* * decoder.js文件 decoder.js decoder.wasm文件必须是放在同一个目录下面 */
decoder?: string;
/**
* 使
*/
forceNoOffscreen?: boolean;
/**
* 'visibilityState''hidden'
*/
hiddenAutoPause?: boolean;
/**
* `false`
*/
hasAudio?: boolean;
/**
* 0()180270
*/
rotate?: boolean;
/**
* 1. `true`,canvas区域,, `setScaleMode(1)`
* 2. `false`canvas区域, `setScaleMode(0)`
*/
isResize?: boolean;
/**
* 1. `true`,canvas区域,,, `setScaleMode(2)`
*/
isFullSize?: boolean;
/**
* 1. `true`ws协议不检验是否以.flv为依据
*/
isFlv?: boolean;
/**
*
*/
debug?: boolean;
/**
* 1. ,
* 2. (loading)(heart),,timeout事件
*/
timeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
heartTimeout?: number;
/**
* 1. ,
* 2. ,,timeout事件
*/
loadingTimeout?: number;
/**
*
*/
supportDblclickFullscreen?: boolean;
/**
*
*/
showBandwidth?: boolean;
/**
*
*/
operateBtns?: {
/** 是否显示全屏按钮 */
fullscreen?: boolean;
/** 是否显示截图按钮 */
screenshot?: boolean;
/** 是否显示播放暂停按钮 */
play?: boolean;
/** 是否显示声音按钮 */
audio?: boolean;
/** 是否显示录制按 */
record?: boolean;
};
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
*/
keepScreenOn?: boolean;
/**
*
*/
isNotMute?: boolean;
/**
*
*/
loadingText?: boolean;
/**
*
*/
background?: string;
/**
* MediaSource硬解码
* * H.264Safari on iOS不支持
* * forceNoOffscreen false ()
*/
useMSE?: boolean;
/**
* Webcodecs硬解码
* * H.264 (chrome 94https或者localhost环境)
* * forceNoOffscreen false )
* */
useWCS?: boolean;
/**
*
* esc -> 退arrowUp -> arrowDown ->
*/
hotKey?: boolean;
/**
* 使MSE或者Webcodecs H265的时候wasm模式
* false Error true wasm模式播放
*/
autoWasm?: boolean;
/**
* heartTimeout ,
*/
heartTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
heartTimeoutReplayTimes?: number,
/**
* loadingTimeout loading之后自动再播放,
*/
loadingTimeoutReplay?: boolean,
/**
* heartTimeoutReplay
*/
loadingTimeoutReplayTimes?: number
/**
* wasm解码报错之后
*/
wasmDecodeErrorReplay?: boolean,
/**
* https://github.com/langhuihui/jessibuca/issues/152 解决方案
* WebGL图像预处理默认每次取4字节的数据540x960分辨率下的UV分量宽度是540/2=2704绿
*/
openWebglAlignment?: boolean
}
}
declare class Jessibuca {
constructor(config?: Jessibuca.Config);
/**
*
@example
// 开启
jessibuca.setDebug(true)
// 关闭
jessibuca.setDebug(false)
*/
setDebug(flag: boolean): void;
/**
*
@example
jessibuca.mute()
*/
mute(): void;
/**
*
@example
jessibuca.cancelMute()
*/
cancelMute(): void;
/**
*
*
* iPhonechrome等要求自动播放时使
*
* https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
*/
audioResume(): void;
/**
*
* ,
* ,,timeout事件
@example
jessibuca.setTimeout(10)
jessibuca.on('timeout',function(){
//
});
*/
setTimeout(): void;
/**
* @param mode
* 0 canvas区域, `isResize` false
*
* 1 ,canvas区域,, `isResize` true
*
* 2 ,canvas区域,,, `isFullResize` true
@example
jessibuca.setScaleMode(0)
jessibuca.setScaleMode(1)
jessibuca.setScaleMode(2)
*/
setScaleMode(mode: number): void;
/**
*
*
* pause `play()`
@example
jessibuca.pause().then(()=>{
console.log('pause success')
jessibuca.play().then(()=>{
}).catch((e)=>{
})
}).catch((e)=>{
console.log('pause error',e);
})
*/
pause(): Promise<void>;
/**
* ,
@example
jessibuca.close();
*/
close(): void;
/**
*
@example
jessibuca.destroy()
*/
destroy(): void;
/**
*
@example
jessibuca.clearView()
*/
clearView(): void;
/**
*
@example
jessibuca.play('url').then(()=>{
console.log('play success')
}).catch((e)=>{
console.log('play error',e)
})
//
jessibuca.play()
*/
play(url?: string): Promise<void>;
/**
*
*/
resize(): void;
/**
*
*
* `videoBuffer`
*
@example
// 设置 200ms 缓冲
jessibuca.setBufferTime(0.2)
*/
setBufferTime(time: number): void;
/**
* 0() 180270
*
* > iOS没有全屏API *
@example
jessibuca.setRotate(0)
jessibuca.setRotate(90)
jessibuca.setRotate(270)
*/
setRotate(deg: number): void;
/**
*
* 0 1
*
* > mute cancelMute setVolume(0) mute方法mute setVolume(0)0
* @param volume 0;1
@example
jessibuca.setVolume(0.2)
jessibuca.setVolume(0)
jessibuca.setVolume(1)
*/
setVolume(volume: number): void;
/**
*
@example
var result = jessibuca.hasLoaded()
console.log(result) // true
*/
hasLoaded(): boolean;
/**
* , canvas标签渲染视频并不会像video标签那样保持屏幕常亮
* H5目前在chrome\edge 84, android chrome 84API, https页面
*
@example
jessibuca.setKeepScreenOn()
*/
setKeepScreenOn(): boolean;
/**
* ()
@example
jessibuca.setFullscreen(true)
//
jessibuca.setFullscreen(false)
*/
setFullscreen(flag: boolean): void;
/**
*
*
* @param filename , , `时间戳`
* @param format , png或jpeg或者webp , `png`
* @param quality , jpeg或者webp时0 ~ 1 , `0.92`
* @param type , download或者base64或者blob`download`
@example
jessibuca.screenshot("test","png",0.5)
const base64 = jessibuca.screenshot("test","png",0.5,'base64')
const fileBlob = jessibuca.screenshot("test",'blob')
*/
screenshot(filename?: string, format?: string, quality?: number, type?: string): void;
/**
*
* @param fileName
* @param fileType webmwebm mp4
@example
jessibuca.startRecord('xxx','webm')
*/
startRecord(fileName: string, fileType: string): void;
/**
*
@example
jessibuca.stopRecordAndSave()
*/
stopRecordAndSave(): void;
/**
*
@example
var result = jessibuca.isPlaying()
console.log(result) // true
*/
isPlaying(): boolean;
/**
*
@example
var result = jessibuca.isMute()
console.log(result) // true
*/
isMute(): boolean;
/**
*
@example
var result = jessibuca.isRecording()
console.log(result) // true
*/
isRecording(): boolean;
/**
* jessibuca
* @example
* jessibuca.on("load",function(){console.log('load')})
*/
on(event: 'load', callback: () => void): void;
/**
* ms
* @example
* jessibuca.on('timeUpdate',function (ts) {console.log('timeUpdate',ts);})
*/
on(event: 'timeUpdate', callback: () => void): void;
/**
* 2
* @example
* jessibuca.on("videoInfo",function(data){console.log('width:',data.width,'height:',data.width)})
*/
on(event: 'videoInfo', callback: (data: {
/** 视频宽 */
width: number;
/** 视频高 */
height: number;
}) => void): void;
/**
* 2
* @example
* jessibuca.on("audioInfo",function(data){console.log('numOfChannels:',data.numOfChannels,'sampleRate',data.sampleRate)})
*/
on(event: 'audioInfo', callback: (data: {
/** 声频通道 */
numOfChannels: number;
/** 采样率 */
sampleRate: number;
}) => void): void;
/**
*
* @example
* jessibuca.on("log",function(data){console.log('data:',data)})
*/
on(event: 'log', callback: () => void): void;
/**
*
* @example
* jessibuca.on("error",function(error){
if(error === Jessibuca.ERROR.fetchError){
//
}
else if(error === Jessibuca.ERROR.webcodecsH265NotSupport){
//
}
console.log('error:',error)
})
*/
on(event: 'error', callback: (err: Jessibuca.ERROR) => void): void;
/**
* KB 1,
* @example
* jessibuca.on("kBps",function(data){console.log('kBps:',data)})
*/
on(event: 'kBps', callback: (value: number) => void): void;
/**
*
* @example
* jessibuca.on("start",function(){console.log('start render')})
*/
on(event: 'start', callback: () => void): void;
/**
* ,
* @example
* jessibuca.on("timeout",function(error){console.log('timeout:',error)})
*/
on(event: 'timeout', callback: (error: Jessibuca.TIMEOUT) => void): void;
/**
* play()
* @example
* jessibuca.on("loadingTimeout",function(){console.log('timeout')})
*/
on(event: 'loadingTimeout', callback: () => void): void;
/**
* timeout之后没有数据渲染
* @example
* jessibuca.on("delayTimeout",function(){console.log('timeout')})
*/
on(event: 'delayTimeout', callback: () => void): void;
/**
*
* @example
* jessibuca.on("fullscreen",function(flag){console.log('is fullscreen',flag)})
*/
on(event: 'fullscreen', callback: () => void): void;
/**
*
* @example
* jessibuca.on("play",function(flag){console.log('play')})
*/
on(event: 'play', callback: () => void): void;
/**
*
* @example
* jessibuca.on("pause",function(flag){console.log('pause')})
*/
on(event: 'pause', callback: () => void): void;
/**
* boolean值
* @example
* jessibuca.on("mute",function(flag){console.log('is mute',flag)})
*/
on(event: 'mute', callback: () => void): void;
/**
* 1
* @example
* jessibuca.on("stats",function(s){console.log("stats is",s)})
*/
on(event: 'stats', callback: (stats: {
/** 当前缓冲区时长,单位毫秒 */
buf: number;
/** 当前视频帧率 */
fps: number;
/** 当前音频码率单位bit */
abps: number;
/** 当前视频码率单位bit */
vbps: number;
/** 当前视频帧pts单位毫秒 */
ts: number;
}) => void): void;
/**
* 1
* @param performance 0: 表示卡顿,1: 表示流畅,2: 表示非常流程
* @example
* jessibuca.on("performance",function(performance){console.log("performance is",performance)})
*/
on(event: 'performance', callback: (performance: 0 | 1 | 2) => void): void;
/**
*
* @example
* jessibuca.on("recordStart",function(){console.log("record start")})
*/
on(event: 'recordStart', callback: () => void): void;
/**
*
* @example
* jessibuca.on("recordEnd",function(){console.log("record end")})
*/
on(event: 'recordEnd', callback: () => void): void;
/**
* 1s一次
* @example
* jessibuca.on("recordingTimestamp",function(timestamp){console.log("recordingTimestamp is",timestamp)})
*/
on(event: 'recordingTimestamp', callback: (timestamp: number) => void): void;
/**
* play方法 -> -> -> ->
* @param event
* @param callback
*/
on(event: 'playToRenderTimes', callback: (times: {
playInitStart: number, // 1 初始化
playStart: number, // 2 初始化
streamStart: number, // 3 网络请求
streamResponse: number, // 4 网络请求
demuxStart: number, // 5 解封装
decodeStart: number, // 6 解码
videoStart: number, // 7 渲染
playTimestamp: number,// playStart- playInitStart
streamTimestamp: number,// streamStart - playStart
streamResponseTimestamp: number,// streamResponse - streamStart
demuxTimestamp: number, // demuxStart - streamResponse
decodeTimestamp: number, // decodeStart - demuxStart
videoTimestamp: number,// videoStart - decodeStart
allTimestamp: number // videoStart - playInitStart
}) => void): void
/**
*
*
@example
jessibuca.on("load",function(){console.log('load')})
*/
on(event: string, callback: Function): void;
}
export default Jessibuca;

File diff suppressed because one or more lines are too long

12
bin/package.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 安装Web工程生成node_modules文件。
echo.
%~d0
cd %~dp0
cd ..
npm install --registry=https://registry.npmmirror.com
pause

12
bin/run-web.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 使用 Vue CLI 命令运行 Web 工程。
echo.
%~d0
cd %~dp0
cd ..
npm run dev
pause

35
build/index.js Normal file
View File

@ -0,0 +1,35 @@
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const rawArgv = process.argv.slice(2)
const args = rawArgv.join(' ')
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')
run(`vue-cli-service build ${args}`)
const port = 9526
const publicPath = config.publicPath
var connect = require('connect')
var serveStatic = require('serve-static')
const app = connect()
app.use(
publicPath,
serveStatic('./dist', {
index: ['index.html', '/']
})
)
app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}
})
} else {
run(`vue-cli-service build ${args}`)
}

113
build/lang.js Normal file
View File

@ -0,0 +1,113 @@
const ExcelJS = require('exceljs');
const fs = require('fs');
const path = require('path');
// example: npm run genrate:lang public/lang.xlsx(读取excel文件的路径) src/lang(输出文件路径)
function resolve(dir) {
return path.resolve(__dirname, '..', dir);
}
const rawArgv = process.argv.slice(2);
let excelFilePath;
let jsonFilePath;
if (rawArgv.length === 0) {
console.log('请输入Excel文件路径');
process.exit(1);
}
if (rawArgv.length === 1) {
console.log('请输入语言包导出的文件路径');
process.exit(1);
}
// 文件路径
excelFilePath = resolve(rawArgv[0]);
jsonFilePath = resolve(rawArgv[1]);
const langFileNameEnum = {
简体中文: 'zh-CN',
English: 'en-US',
};
const keyIndex = 1; // 键值所在列
const headerRowIndex = 1; // 标题行所在行索引
// 创建一个新的工作簿实例
const workbook = new ExcelJS.Workbook();
// 读取Excel文件
workbook.xlsx
.readFile(excelFilePath)
.then(async () => {
// 生成json映射文件new Map(){sheetName:{ lang:jsonData}}
const dataMap = getJsonDataMap(workbook)
// 生成json文件
await generateJsonFiles(dataMap)
})
.catch((error) => {
console.error('Error reading Excel file:', error);
});
/**
* 从工作簿中获取JSON数据映射表
* @param {object} workbook - Excel工作簿对象用于遍历工作表和工作表数据
* @returns {Map} dataMap - 包含工作表名称和对应数据对象的映射表其中数据对象是语言文件名枚举和其键值对的映射
*/
function getJsonDataMap(workbook) {
const dataMap = new Map();
workbook.eachSheet(function (worksheet) {
// 初始化工作表名和文件对象
const sheetName = worksheet._name;
const fileObjects = {};
const cellIndexMap = {};
// 遍历每一行,首先处理表头,然后处理数据行
worksheet.eachRow((row, rowNumber) => {
if (rowNumber === headerRowIndex) {
// 处理表头,建立语言文件名和列索引的映射
row.eachCell((cell, colNumber) => {
if (colNumber !== keyIndex) {
fileObjects[langFileNameEnum[cell.value]] = {};
cellIndexMap[colNumber] = langFileNameEnum[cell.value];
}
});
} else {
// 处理数据行,根据列索引映射填充语言文件的数据键值对
Object.keys(cellIndexMap)
.map((item) => Number(item))
.map((colNumber) => {
const key = row.getCell(keyIndex).value;
const value = row.getCell(colNumber).value || '';
const lang = cellIndexMap[colNumber];
fileObjects[lang][key] = value;
});
}
});
// 将工作表数据对象映射到工作表名称
dataMap.set(sheetName, fileObjects);
});
return dataMap;
}
// 导出语言包文件到指定目录
async function generateJsonFiles(dataMap) {
// 清空文件输出目录
const exist = fs.existsSync(jsonFilePath)
exist && await fs.rmSync(jsonFilePath, { recursive: true }, () => { })
// 逐个生成目录和文件
for (const [modules, objs] of dataMap.entries()) {
for (const [lang, jsonData] of Object.entries(objs)) {
const path = resolve(jsonFilePath + `/${lang}/${modules}.json`);
await writeJsonToFile(jsonData, path);
}
}
console.log('Excel file has been converted to JSON and saved to', jsonFilePath);
}
// 异步创建文件夹并写入JSON数据
async function writeJsonToFile(jsonData, filePath) {
const dirPath = path.dirname(filePath); // 获取文件路径的目录部分
try {
await fs.mkdirSync(dirPath, { recursive: true }, () => { }); // 如果目录不存在,会递归创建
await fs.writeFileSync(filePath, JSON.stringify(jsonData, null, 2), 'utf8', () => { }); // 异步写入JSON数据
console.log(`JSON data written to ${filePath}`);
} catch (err) {
console.error(`Error writing JSON data to ${filePath}:`, err);
}
}

133
package.json Normal file
View File

@ -0,0 +1,133 @@
{
"name": "fastbee",
"version": "2.5.2",
"description": "浙江超亿物联网平台",
"author": "kerwincui",
"license": "AGPL3.0",
"scripts": {
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"build:stage": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"genrate:lang": "node build/lang.js"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@easydarwin/easywasmplayer": "^4.0.7",
"@jiaminghi/data-view": "^2.10.0",
"@riophae/vue-treeselect": "0.4.0",
"animejs": "^3.2.1",
"axios": "0.24.0",
"clipboard": "2.0.8",
"codemirror": "^5.65.2",
"core-js": "3.25.3",
"echarts": "^5.5.1",
"echarts-liquidfill": "^3.1.0",
"element-china-area-data": "^4.1.1",
"element-ui": "2.15.10",
"ezuikit-js": "^7.7.10",
"file-saver": "2.0.5",
"flv.js": "^1.6.2",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"html2canvas": "^1.4.1",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"jshint": "^2.13.4",
"json-loader": "^0.5.7",
"jsonlint": "^1.6.3",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"minimatch": "^3.1.2",
"moment": "^2.29.4",
"monaco-editor": "0.27.0",
"monaco-editor-webpack-plugin": "4.2.0",
"mqtt": "^4.3.3",
"nprogress": "0.2.0",
"photo-sphere-viewer": "^4.8.1",
"quasar": "^2.14.0",
"quill": "1.3.7",
"screenfull": "5.0.2",
"script-loader": "^0.7.2",
"sortablejs": "1.10.2",
"speak-tts": "^2.0.8",
"sql-formatter": "^4.0.2",
"three": "^0.142.0",
"vue": "2.6.12",
"vue-3d-model": "^1.4.1",
"vue-axios": "^3.5.2",
"vue-baidu-map": "^0.21.22",
"vue-clipboard2": "^0.3.3",
"vue-codemirror": "^4.0.6",
"vue-contextmenujs": "^1.4.11",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-easytable": "^2.14.0",
"vue-i18n": "^8.28.2",
"vue-json-viewer": "^2.2.21",
"vue-meta": "2.4.0",
"vue-qr": "^4.0.9",
"vue-router": "3.4.9",
"vue-ruler-tool": "^1.2.4",
"vue-seamless-scroll": "^1.1.23",
"vue-video-player": "^5.0.2",
"vue2-ace-editor": "^0.0.15",
"vuedraggable": "2.24.3",
"vuex": "3.6.2",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6",
"@vue/runtime-dom": "^3.5.12",
"babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "^2.3.3",
"chalk": "4.1.0",
"code-inspector-plugin": "^0.20.9",
"compression-webpack-plugin": "5.0.2",
"connect": "3.6.6",
"eslint": "^7.28.0",
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"runjs": "4.4.2",
"sass": "1.32.13",
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

46
public/html/ie.html Normal file

File diff suppressed because one or more lines are too long

238
public/index.html Normal file
View File

@ -0,0 +1,238 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script src="/js/jessibuca-pro/jessibuca-pro.js"></script>
<script type="text/javascript" src="/js/ZLMRTCClient.js"></script>
<script type="text/javascript" src="/js/EasyWasmPlayer.js"></script>
<!-- 百度统计,不需要可以删除 -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?c870279332344add8698f874a34c0a15";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<title>
<%= webpackConfig.name %>
</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
}
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999;
}
#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 1001;
}
#loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}
#loader:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#loader-wrapper .loader-section.section-left {
left: 0;
}
#loader-wrapper .loader-section.section-right {
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}
.no-js #loader-wrapper {
display: none;
}
.no-js h1 {
color: #222222;
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
font-size: 19px;
width: 100%;
text-align: center;
z-index: 9999999999999;
position: absolute;
top: 60%;
opacity: 1;
line-height: 30px;
}
#loader-wrapper .load_title span {
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
opacity: 0.5;
}
/* 清除地图LOGO */
/* .BMap_cpyCtrl {
display: none!important;
}
.anchorBL {
display: none!important;
} */
</style>
</head>
<body>
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div>
</div>
</div>
</body>
</html>

BIN
public/js/EasyPlayer.swf Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

9466
public/js/ZLMRTCClient.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

168
public/js/player.css Normal file
View File

@ -0,0 +1,168 @@
html, body {
width: 100%;
height: 100%;
}
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
body {
line-height: 1.6;
position: relative;
font-family: "Microsoft Yahei", tahoma, arial, "Hiragino Sans GB";
}
.root {
display: flex;
place-content: center;
margin-top: 3rem;
}
.container-shell {
background: hsla(0, 0%, 50%, 0.5);
width: 100%;
position: relative;
border-radius: 5px;
}
.container-shell:before {
content: "jessibuca demo player";
position: absolute;
color: darkgray;
left: 10px;
text-shadow: 1px 1px black;
}
#container {
background: rgba(13, 14, 27, 0.7);
width: 960px;
height: 597px;
}
.container {
background: rgba(13, 14, 27, 0.7);
width: 320px;
height: 199px;
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
}
.input {
display: flex;
margin-top: 10px;
max-width: 960px;
color: white;
place-content: stretch;
}
.input2 {
bottom: 0px;
}
.input input {
flex: auto;
}
.err {
position: absolute;
top: 40px;
left: 10px;
color: red;
}
.option {
position: absolute;
top: 4px;
right: 10px;
display: flex;
place-content: center;
font-size: 12px;
}
.option span {
color: white;
}
.page {
background: url('./bg.jpg');
background-repeat: no-repeat;
background-position: top;
}
button{
font-size: 12px;
padding: 4px 8px;
border-radius: 4px;
}
.container-multi{
text-align: center;
}
.audio-container{
width: 960px;
}
@media (max-width: 720px) {
input {
outline: 0;
}
* {
margin: 0;
padding: 0;
}
* {
-webkit-tap-highlight-color: transparent
}
a img {
border: 0;
}
a {
text-decoration: none;
}
li {
list-style: none;
}
ol,
ul {
margin: 0;
padding: 0;
list-style: none;
}
#container {
width: 100%;
height: 52.7vw;
margin: 0 auto;
}
.input{
max-width: 95vw;
}
.audio-container{
width: 95vw;
}
.container {
width: 95vw;
height: 52.7vw;
margin: 0 auto;
margin-bottom: 10px;
display: block;
}
}

209
public/js/player.js Normal file
View File

@ -0,0 +1,209 @@
function getBrowser() {
const UserAgent = window.navigator.userAgent.toLowerCase() || '';
let browserInfo = {
type: '',
version: ''
};
var browserArray = {
IE: window.ActiveXObject || "ActiveXObject" in window, // IE
Chrome: UserAgent.indexOf('chrome') > -1 && UserAgent.indexOf('safari') > -1, // Chrome浏览器
Firefox: UserAgent.indexOf('firefox') > -1, // 火狐浏览器
Opera: UserAgent.indexOf('opera') > -1, // Opera浏览器
Safari: UserAgent.indexOf('safari') > -1 && UserAgent.indexOf('chrome') == -1, // safari浏览器
Edge: UserAgent.indexOf('edge') > -1, // Edge浏览器
QQBrowser: /qqbrowser/.test(UserAgent), // qq浏览器
WeixinBrowser: /MicroMessenger/i.test(UserAgent) // 微信浏览器
};
// console.log(browserArray)
for (let i in browserArray) {
if (browserArray[i]) {
let versions = '';
if (i === 'IE') {
const versionArray = UserAgent.match(/(msie\s|trident.*rv:)([\w.]+)/)
if (versionArray && versionArray.length > 2) {
versions = UserAgent.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];
}
} else if (i === 'Chrome') {
for (let mt in navigator.mimeTypes) {
//检测是否是360浏览器(测试只有pc端的360才起作用)
if (navigator.mimeTypes[mt]['type'] === 'application/360softmgrplugin') {
i = '360';
}
}
const versionArray = UserAgent.match(/chrome\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
} else if (i === 'Firefox') {
const versionArray = UserAgent.match(/firefox\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
} else if (i === 'Opera') {
const versionArray = UserAgent.match(/opera\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
} else if (i === 'Safari') {
const versionArray = UserAgent.match(/version\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
} else if (i === 'Edge') {
const versionArray = UserAgent.match(/edge\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
} else if (i === 'QQBrowser') {
const versionArray = UserAgent.match(/qqbrowser\/([\d.]+)/);
if (versionArray && versionArray.length > 1) {
versions = versionArray[1];
}
}
browserInfo.type = i;
browserInfo.version = parseInt(versions);
}
}
return browserInfo;
}
function checkSupportMSEHevc() {
return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="hev1.1.6.L123.b0"');
}
function checkSupportMSEH264() {
return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.64002A"');
}
function checkSupportWCSHevc() {
const browserInfo = getBrowser();
return browserInfo.type.toLowerCase() === 'chrome' && browserInfo.version >= 107 && (location.protocol === 'https:' || location.hostname === 'localhost');
}
function checkSupportWCS() {
return "VideoEncoder" in window;
}
function checkSupportWasm() {
try {
if (typeof window.WebAssembly === 'object' && typeof window.WebAssembly.instantiate === 'function') {
const module = new window.WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
if (module instanceof window.WebAssembly.Module) {
return new window.WebAssembly.Instance(module) instanceof window.WebAssembly.Instance;
}
}
return false;
} catch (e) {
return false;
}
}
function checkSupportSIMD() {
return WebAssembly && WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]));
}
function supportSharedArrayBuffer() {
try {
new SharedArrayBuffer(1);
return true;
} catch (e) {
return false;
}
}
let support = document.getElementById('mseSupport');
let notSupport = document.getElementById('mseNotSupport');
if (support && notSupport) {
if (checkSupportMSEHevc()) {
support.style.display = 'inline-block'
} else {
notSupport.style.display = 'inline-block'
}
}
let supportH264 = document.getElementById('mseSupport264');
let notSupportH264 = document.getElementById('mseNotSupport264');
if (supportH264 && notSupportH264) {
if (checkSupportMSEH264()) {
supportH264.style.display = 'inline-block'
} else {
notSupportH264.style.display = 'inline-block'
}
}
let supportWcsHevc = document.getElementById('wcsSupport');
let notSupportWcsHevc = document.getElementById('wcsNotSupport');
if (supportWcsHevc && notSupportWcsHevc) {
if (checkSupportWCSHevc()) {
supportWcsHevc.style.display = 'inline-block';
} else {
notSupportWcsHevc.style.display = 'inline-block'
}
}
let supportWcs = document.getElementById('wcsSupport264');
let notSupportWcs = document.getElementById('wcsNotSupport264');
if (supportWcs && notSupportWcs) {
if (checkSupportWCS()) {
supportWcs.style.display = 'inline-block';
} else {
notSupportWcs.style.display = 'inline-block'
}
}
let wasmSupport = document.getElementById('wasmSupport');
let wasmNotSupport = document.getElementById('wasmNotSupport');
if (wasmSupport && wasmNotSupport) {
if (checkSupportWasm()) {
wasmSupport.style.display = 'inline-block';
} else {
wasmNotSupport.style.display = 'inline-block';
}
}
let supportSimd = document.getElementById('simdSupport');
let notSupportSimd = document.getElementById('simdNotSupport');
if (supportSimd && notSupportSimd) {
if (checkSupportSIMD()) {
supportSimd.style.display = 'inline-block';
} else {
notSupportSimd.style.display = 'inline-block'
}
}
let supportSimdMtSupport = document.getElementById('simdMtSupport');
var notSupportSimdMtSupport = document.getElementById('simdMtNotSupport');
if (supportSimdMtSupport) {
if (supportSharedArrayBuffer()) {
supportSimdMtSupport.style.display = 'inline-block';
} else {
notSupportSimdMtSupport.style.display = 'inline-block';
}
}
function isMobile() {
return (/iphone|ipad|android.*mobile|windows.*phone|blackberry.*mobile/i.test(window.navigator.userAgent.toLowerCase()));
}
function isPad() {
return (/ipad|android(?!.*mobile)|tablet|kindle|silk/i.test(window.navigator.userAgent.toLowerCase()));
}
const useVconsole = isMobile() || isPad()
if (useVconsole && window.VConsole) {
new window.VConsole();
}

File diff suppressed because one or more lines are too long

10
public/js/vconsole.js Normal file

File diff suppressed because one or more lines are too long

340
public/js/video.html Normal file
View File

@ -0,0 +1,340 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>播放器</title>
<script src="./vconsole.js"></script>
<script src="./jessibuca-pro/jessibuca-pro.js"></script>
<link rel="stylesheet" href="./player.css">
<style>
.container-shell:before {
content: "";
}
</style>
</head>
<body class="page">
<div class="root">
<div class="container-shell">
<div id="container"></div>
</div>
<!-- <br/>-->
<!-- <br/>-->
<!-- <div class="post-message-section">-->
<!-- <p class="desc">网页向应用发送消息。test88</p>-->
<!-- <div class="btn-list">-->
<!-- <button class="btn btn-red" type="button" id="wxpostMessage">wxpostMessage</button>-->
<!--&lt;!&ndash; <button class="btn btn-red" type="button" id="unipostMessage">unipostMessage</button>&ndash;&gt;-->
<!-- </div>-->
<!-- </div>-->
</div>
</body>
<script src="./player.js"></script>
<!-- uni 的 SDK -->
<script src="./uni.webview.1.5.5.js"></script>
<script type="text/javascript">
var userAgent = navigator.userAgent;
console.log("userAgent");
console.log(userAgent);
if (userAgent.indexOf('AlipayClient') > -1) {
// 支付宝小程序的 JS-SDK 防止 404 需要动态加载,如果不需要兼容支付宝小程序,则无需引用此 JS 文件。
document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
} else if (/QQ/i.test(userAgent) && /miniProgram/i.test(userAgent)) {
// QQ 小程序
document.write(
'<script type="text/javascript" src="https://qqq.gtimg.cn/miniprogram/webview_jssdk/qqjssdk-1.0.0.js"><\/script>'
);
} else if (/miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent)) {
console.log("微信小程序 JS-SDK");
// 微信小程序 JS-SDK 如果不需要兼容微信小程序,则无需引用此 JS 文件。
document.write('<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"><\/script>');
wx.miniProgram.getEnv(function(res) {
console.log(res.miniprogram) // true
})// true
} else if (/toutiaomicroapp/i.test(userAgent)) {
// 头条小程序 JS-SDK 如果不需要兼容头条小程序,则无需引用此 JS 文件。
document.write(
'<script type="text/javascript" src="https://s3.pstatp.com/toutiao/tmajssdk/jssdk-1.0.1.js"><\/script>');
} else if (/swan/i.test(userAgent)) {
// 百度小程序 JS-SDK 如果不需要兼容百度小程序,则无需引用此 JS 文件。
document.write(
'<script type="text/javascript" src="https://b.bdstatic.com/searchbox/icms/searchbox/js/swan-2.0.18.js"><\/script>'
);
} else if (/quickapp/i.test(userAgent)) {
// quickapp
document.write('<script type="text/javascript" src="https://quickapp/jssdk.webview.min.js"><\/script>');
}
if (!/toutiaomicroapp/i.test(userAgent)) {
console.log("webview post-message-section");
//document.querySelector('.post-message-section').style.visibility = 'visible';
}
</script>
<script type="text/javascript">
var container = document.getElementById('container');
var showOperateBtns = true; // 是否显示按钮
var jessibuca = null;
var rotate = 90;
var playTimes = null;
var playUrl = null;
console.log("jessibuca webview");
var data = getQuery('data');
if (data != null) {
console.log(data);
var json = JSON.parse(data);
playurl(json, json.playUrl);
}
function getQuery(name) {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURIComponent(r[2]);
}
return null;
}
function replay() {
if (jessibuca != null) {
jessibuca.destroy();
}
create()
}
function setplayTimes(times) {
console.log("set playTimes:" + times);
playTimes = times;
}
function setplayUrl(url) {
console.log("set playUrl:" + url);
playUrl = url;
}
function playurl(json, url) {
setplayUrl(url);
replay();
console.log(json.type);
if (json.type == "play") {
play(url);
} else if (json.type == "playback"){
playback(url,json.playTimes);
}
}
function create() {
console.log("jessibuca create");
jessibuca = new JessibucaPro({
container: container,
videoBuffer: 0.2, // 缓存时长
decoder: './jessibuca-pro/decoder-pro.js',
useSIMD: true,
//useWCS: true,
//useMSE: true,
isResize: false,
isFullResize: false,
forceNoOffscreen: true,
useWebFullScreen: true,
useVideoRender: true,
useCanvasRender: false,
isNotMute: false,
text: "",
loadingText: "加载中",
debug: true,
debugLevel: 'debug',
showBandwidth: showOperateBtns, // 显示网速
operateBtns: {
fullscreen: showOperateBtns,
screenshot: showOperateBtns,
play: showOperateBtns,
audio: showOperateBtns,
fullscreenFn: function () {
console.log('fullscreenFn');
jessibuca.setFullscreen(true);
},
fullscreenExitFn: function () {
console.log('fullscreenExitFn');
jessibuca.setFullscreen(false);
jessibuca.setRotate(0);
rotate = 90;
},
},
extendOperateBtns: [{
name: '横竖屏切换',
index: 3,
icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFw2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgNzkuMTcxYzI3ZmFiLCAyMDIyLzA4LzE2LTIyOjM1OjQxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZ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xLOknmOt3av4R8Zu5l5T7gbF37TgTMsZyAbbbvAl6gtLMiyZIeJDu9dX6hR0lukZqPHDHGN0q6W9J7y4baPpGT2kG1jtiX67mtxp4V6HRO8IkQwpdsT5ZuXwXcB/wO+Cf5EtN2tL1YTPMKRHYatJH/NrAZuNp29fDugqTU9iGy/cBe0nQCbAGuo7Q9DiCpGWN8ok6oEwGztu8Hbq882ml7Z53MAJAAuyTto8dA2MldbN9vu9YFOjH8GjBt+7FeFFkjGsAmBngeKdd/msyeFVhtij0PfAI4LOlPg1JqGMj1PUym//Pt2nVTCL0o6aikR2KMB4Ddkq6y/WZJff2/wDpAtlNJJ23/AZgLITwG/LlyjqhWcDgqjik2VoOjVmDU2CBg1AqMGhsEjFqBUeO/kq69lHJMcToAAAAASUVORK5CYII=',
iconTitle: '横竖屏切换',
click: () => {
console.log('点击了横竖屏切换');
jessibuca.setRotate(rotate);
if (rotate == 90) {
rotate = 0
} else if (rotate == 0) {
rotate = 90
}
}
},],
},);
console.log("jessibuca create 22222");
jessibuca.on('error', function (error) {
console.log('error')
console.log(error)
})
jessibuca.on("fetchError", function (data) {
console.log('fetchError:', data)
})
jessibuca.on("start", function () {
console.log('start render')
})
jessibuca.on("play", function (flag) {
console.log('play')
})
jessibuca.on('crashLog', (data) => {
console.log('crashLog is', data);
})
jessibuca.onLog = msg => console.error(msg);
jessibuca.onRecord = (status) => console.log('onRecord', status);
jessibuca.onPause = () => console.log('onPause');
jessibuca.onPlay = () => console.log('onPlay');
jessibuca.onMute = msg => console.log('onMute', msg);
jessibuca.on("fullscreen", function (flag) {
console.log('is fullscreen', flag)
})
jessibuca.on("webFullscreen", function (flag) {
console.log('is webFullscreen', flag)
})
console.log("jessibuca create2");
}
function seekPlay(timeObj) {
uni.postMessage({
data: {
action: 'seekPlay',
msg: timeObj
}
});
}
function play(url) {
console.log("play");
console.log(url);
if (url) {
const status = jessibuca.getStatus();
console.log(status);
jessibuca.play(url).then(() => {
console.log('play success')
}).catch((e) => {
console.log('play error', e)
})
}
}
function playback(url, times) {
if (url) {
jessibuca.playback(url, {
playList: times,
fps: 20, //FPS定频(本地设置)生效)
showControl: true,
showRateBtn: true,
isUseFpsRender: true, // 是否使用固定的fps渲染如果设置的fps小于流推过来的会造成内存堆积甚至溢出
isCacheBeforeDecodeForFpsRender: false, // rfs渲染时是否在解码前缓存数据
supportWheel: true, // 是否支持滚动轴切换精度。
rateConfig: [
{label: '正常', value: 1},
{label: '2倍', value: 2},
{label: '4倍', value: 4},
{label: '8倍', value: 8},
],
})
}
}
function test() {
console.log("test");
}
function test2(msg) {
console.log("test1"+msg);
}
window.msgFromUniapp = (res) =>{
console.log("原生传递过来的数据:",res)
}
document.getElementById('wxpostMessage').addEventListener('click', function() {
console.log("wx postMessage");
wx.miniProgram.postMessage({
data: {
action: 'test'
}
});
console.log("wx navigateBack");
wx.miniProgram.navigateBack({delta: 1});
});
// document.getElementById('postMessage').addEventListener('click', function() {
// console.log("postMessage");
// //wx.miniProgram.navigateTo
// //wx.miniProgram.navigateBack
// //wx.miniProgram.switchTab
// });
// document.getElementById('unipostMessage').addEventListener('click', function() {
// console.log("uni postMessage");
// uni.postMessage({
// data: {
// action: 'test'
// }
// });
// });
document.addEventListener("UniAppJSBridgeReady", function () {
console.log("UniAppJSBridgeReady");
uni.postMessage({
data: {
action: 'message'
}
});
uni.getEnv(function(res) {
console.log('当前环境:' + JSON.stringify(res));
});
// uni.switchTab({
// url: '/pages/tabBar/API/API'
// });
// uni.reLaunch({
// url: '/pages/tabBar/component/component'
// });
// uni.navigateBack({
// delta: 1
// });
// uni[action]({
// url: '/pages/component/button/button'
// });
})
//微信小程序
function ready() {
console.log(window.__wxjs_environment === 'miniprogram')
}
if (!window.WeixinJSBridge || !WeixinJSBridge.invoke) {
document.addEventListener('WeixinJSBridgeReady', ready, false)
} else {
ready()
}
window.οnbefοreunlοad = function () {
alert("===οnbefοreunlοad===");
if (event.clientX > document.body.clientWidth && event.clientY < 0 || event.altKey) {
alert("你关闭了浏览器");
jessibuca.destroy();
} else {
alert("你正在刷新页面");
replay();
}
}
</script>
</html>

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /

94
src/App.vue Normal file
View File

@ -0,0 +1,94 @@
<template>
<div id="app" style="background-color: #0e2e87" v-if="$route.meta.bigScreen">
<router-view />
</div>
<div id="app" v-else>
<router-view :key="language" />
<!-- 告警提示框 -->
<Notification v-if="showNotification" :message="notificationMessage" :showTip="showNotification" />
<theme-picker />
</div>
</template>
<script>
import ThemePicker from '@/components/ThemePicker';
import Notification from '@/components/Notification/Notification';
import { getUserId } from '@/utils/auth';
export default {
name: 'App',
components: { ThemePicker, Notification },
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
titleTemplate: (title) => {
return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE;
},
};
},
data() {
return {
showNotification: false,
notificationMessage: null,
};
},
computed: {
language() {
return this.$store.state.settings.language;
},
token() {
return this.$store.state.user.token;
},
},
mounted() {
if (this.token) {
this.$nextTick(() => {
this.connectMqtt();
});
}
},
beforeDestroy() {
this.$mqttTool.unsubscribe('/notify/alert/web/push/' + getUserId());
},
watch: {
token(newToken) {
if (newToken) {
setTimeout(() => {
this.connectMqtt();
}, 2000);
}
},
},
methods: {
connectMqtt() {
if (this.$mqttTool.client == null) {
console.log('Connecting to MQTT...');
this.$mqttTool.connect();
}
this.mqttCallback();
this.$mqttTool.subscribe('/notify/alert/web/push/' + getUserId());
},
mqttCallback() {
this.$mqttTool.client.on('message', (topic, message) => {
message = JSON.parse(message.toString());
this.notificationMessage = message;
if (message.showDialog === 1) {
this.showNotification = true;
}
console.log('Received status', this.notificationMessage);
if (!message) {
return;
}
});
},
},
};
</script>
<style scoped>
#app .theme-picker {
display: none;
}
</style>

46
src/api/data/center.js Normal file
View File

@ -0,0 +1,46 @@
import request from '@/utils/request';
// 查询设备的历史数据
export function getDataCenterDeviceHistory(data) {
return request({
url: '/data/center/deviceHistory',
method: 'post',
data: data,
});
}
// 查询场景变量历史数据
export function getDataCenterSceneHistory(query) {
return request({
url: '/data/center/sceneHistory',
method: 'get',
params: query,
});
}
// 统计告警处理信息
export function getDataCenterCountAlertProcess(query) {
return request({
url: '/data/center/countAlertProcess',
method: 'get',
params: query,
});
}
// 统计告警级别信息
export function getDataCenterCountAlertLevel(query) {
return request({
url: '/data/center/countAlertLevel',
method: 'get',
params: query,
});
}
// 统计设备物模型指令下发数量
export function getDataCenterCountThingsModelInvoke(query) {
return request({
url: '/data/center/countThingsModelInvoke',
method: 'get',
params: query,
});
}

60
src/api/iot/alert.js Normal file
View File

@ -0,0 +1,60 @@
import request from '@/utils/request';
// 查询设备告警列表
export function listAlert(query) {
return request({
url: '/iot/alert/list',
method: 'get',
params: query,
});
}
// 查询设备告警关联的场景列表
export function getScenesByAlertId(alertId) {
return request({
url: '/iot/alert/getScenesByAlertId/' + alertId,
method: 'get',
});
}
// 查询设备告警关联的通知模板
export function listNotifyTemplate(alertId) {
return request({
url: '/iot/alert/listNotifyTemplate/' + alertId,
method: 'get',
});
}
// 查询设备告警详细
export function getAlert(alertId) {
return request({
url: '/iot/alert/' + alertId,
method: 'get',
});
}
// 新增设备告警
export function addAlert(data) {
return request({
url: '/iot/alert',
method: 'post',
data: data,
});
}
// 修改设备告警
export function updateAlert(data) {
return request({
url: '/iot/alert',
method: 'put',
data: data,
});
}
// 删除设备告警
export function delAlert(alertId) {
return request({
url: '/iot/alert/' + alertId,
method: 'delete',
});
}

44
src/api/iot/alertLog.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备告警列表
export function listAlertLog(query) {
return request({
url: '/iot/alertLog/list',
method: 'get',
params: query
})
}
// 查询设备告警详细
export function getAlertLog(alertLogId) {
return request({
url: '/iot/alertLog/' + alertLogId,
method: 'get'
})
}
// 新增设备告警
export function addAlertLog(data) {
return request({
url: '/iot/alertLog',
method: 'post',
data: data
})
}
// 修改设备告警
export function updateAlertLog(data) {
return request({
url: '/iot/alertLog',
method: 'put',
data: data
})
}
// 删除设备告警
export function delAlertLog(alertLogId) {
return request({
url: '/iot/alertLog/' + alertLogId,
method: 'delete'
})
}

36
src/api/iot/alertUser.js Normal file
View File

@ -0,0 +1,36 @@
import request from '@/utils/request';
// 查询用户列表
export function alertUserList(query) {
return request({
url: '/iot/deviceAlertUser/query',
method: 'get',
params: query,
});
}
// 查询告警用户列表
export function listUser(data) {
return request({
url: '/iot/deviceAlertUser/list',
method: 'get',
params: data,
});
}
// 新增告警用户
export function addAlertUser(data) {
return request({
url: '/iot/deviceAlertUser',
method: 'post',
data: data,
});
}
// 删除告警用户
export function delAlertUser(deviceId, userId) {
return request({
url: '/iot/deviceAlertUser?deviceId=' + deviceId + '&userId=' + userId,
method: 'delete',
});
}

52
src/api/iot/authorize.js Normal file
View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询产品授权码列表
export function listAuthorize(query) {
return request({
url: '/iot/authorize/list',
method: 'get',
params: query
})
}
// 查询产品授权码详细
export function getAuthorize(authorizeId) {
return request({
url: '/iot/authorize/' + authorizeId,
method: 'get'
})
}
// 新增产品授权码
export function addAuthorize(data) {
return request({
url: '/iot/authorize',
method: 'post',
data: data
})
}
//根据数量批量新增产品授权码
export function addProductAuthorizeByNum(data) {
return request({
url: '/iot/authorize/addProductAuthorizeByNum',
method: 'post',
data: data
})
}
// 修改产品授权码
export function updateAuthorize(data) {
return request({
url: '/iot/authorize',
method: 'put',
data: data
})
}
// 删除产品授权码
export function delAuthorize(authorizeId) {
return request({
url: '/iot/authorize/' + authorizeId,
method: 'delete'
})
}

52
src/api/iot/bridge.js Normal file
View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询数据桥接列表
export function listBridge(query) {
return request({
url: '/iot/bridge/list',
method: 'get',
params: query
})
}
// 查询数据桥接详细
export function getBridge(id) {
return request({
url: '/iot/bridge/' + id,
method: 'get'
})
}
// 新增数据桥接
export function addBridge(data) {
return request({
url: '/iot/bridge',
method: 'post',
data: data
})
}
// 修改数据桥接
export function updateBridge(data) {
return request({
url: '/iot/bridge',
method: 'put',
data: data
})
}
export function connectBridge(data) {
return request({
url: '/iot/bridge/connect',
method: 'post',
data: data
})
}
// 删除数据桥接
export function delBridge(id) {
return request({
url: '/iot/bridge/' + id,
method: 'delete'
})
}

53
src/api/iot/category.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询产品分类列表
export function listCategory(query) {
return request({
url: '/iot/category/list',
method: 'get',
params: query
})
}
// 查询产品简短分类列表
export function listShortCategory(query) {
return request({
url: '/iot/category/shortlist',
method: 'get',
params: query,
})
}
// 查询产品分类详细
export function getCategory(categoryId) {
return request({
url: '/iot/category/' + categoryId,
method: 'get'
})
}
// 新增产品分类
export function addCategory(data) {
return request({
url: '/iot/category',
method: 'post',
data: data
})
}
// 修改产品分类
export function updateCategory(data) {
return request({
url: '/iot/category',
method: 'put',
data: data
})
}
// 删除产品分类
export function delCategory(categoryId) {
return request({
url: '/iot/category/' + categoryId,
method: 'delete'
})
}

143
src/api/iot/channel.js Normal file
View File

@ -0,0 +1,143 @@
import request from '@/utils/request';
// 查询监控设备通道信息列表
export function listChannel(query) {
return request({
url: '/sip/channel/list',
method: 'get',
params: query,
});
}
// 查询监控设备通道信息详细
export function getChannel(channelId) {
return request({
url: '/sip/channel/' + channelId,
method: 'get',
});
}
// 新增监控设备通道信息
export function addChannel(createNum, data) {
return request({
url: '/sip/channel/' + createNum,
method: 'post',
data: data,
});
}
// 修改监控设备通道信息
export function updateChannel(data) {
return request({
url: '/sip/channel',
method: 'put',
data: data,
});
}
// 删除监控设备通道信息
export function delChannel(channelId) {
return request({
url: '/sip/channel/' + channelId,
method: 'delete',
});
}
// 开始播放
export function startPlay(deviceId, channelId) {
return request({
url: '/sip/player/play/' + deviceId + '/' + channelId,
method: 'get',
});
}
// 获取流信息
export function getStreaminfo(deviceId, channelId) {
return request({
url: '/sip/player/playstream/' + deviceId + '/' + channelId,
method: 'get',
});
}
export function playback(deviceId, channelId, query) {
return request({
url: '/sip/player/playback/' + deviceId + '/' + channelId,
method: 'get',
params: query,
});
}
export function closeStream(deviceId, channelId, streamId) {
return request({
url: '/sip/player/closeStream/' + deviceId + '/' + channelId + '/' + streamId,
method: 'get',
});
}
export function playbackPause(deviceId, channelId, streamId) {
return request({
url: '/sip/player/playbackPause/' + deviceId + '/' + channelId + '/' + streamId,
method: 'get',
});
}
export function playbackReplay(deviceId, channelId, streamId) {
return request({
url: '/sip/player/playbackReplay/' + deviceId + '/' + channelId + '/' + streamId,
method: 'get',
});
}
export function playbackSeek(deviceId, channelId, streamId, query) {
return request({
url: '/sip/player/playbackSeek/' + deviceId + '/' + channelId + '/' + streamId,
method: 'get',
params: query,
});
}
export function playbackSpeed(deviceId, channelId, streamId, query) {
return request({
url: '/sip/player/playbackSpeed/' + deviceId + '/' + channelId + '/' + streamId,
method: 'get',
params: query,
});
}
// 监控设备绑定设备或场景
export function binding(data) {
return request({
url: '/iot/relation/addOrUp',
method: 'post',
data: data,
});
}
// 通过设备或场景查询监控设备通道信息
export function listRelDeviceOrScene(query) {
return request({
url: '/sip/channel/listRelDeviceOrScene',
method: 'get',
params: query,
});
}
export function getPushUrl(deviceId, channelId) {
return request({
url: '/sip/talk/getPushUrl/' + deviceId + '/' + channelId,
method: 'get',
});
}
export function startBroadcast(deviceId, channelId) {
return request({
url: '/sip/talk/broadcast/' + deviceId + '/' + channelId,
method: 'get',
});
}
export function stopBroadcast(deviceId, channelId) {
return request({
url: '/sip/talk/broadcast/stop/' + deviceId + '/' + channelId,
method: 'get',
});
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询云云对接列表
export function listClientDetails(query) {
return request({
url: '/iot/clientDetails/list',
method: 'get',
params: query
})
}
// 查询云云对接详细
export function getClientDetails(clientId) {
return request({
url: '/iot/clientDetails/' + clientId,
method: 'get'
})
}
// 新增云云对接
export function addClientDetails(data) {
return request({
url: '/iot/clientDetails',
method: 'post',
data: data
})
}
// 修改云云对接
export function updateClientDetails(data) {
return request({
url: '/iot/clientDetails',
method: 'put',
data: data
})
}
// 删除云云对接
export function delClientDetails(clientId) {
return request({
url: '/iot/clientDetails/' + clientId,
method: 'delete'
})
}

52
src/api/iot/control.js Normal file
View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询指令权限控制列表
export function listControl(query) {
return request({
url: '/order/control/list',
method: 'get',
params: query
})
}
// 查询指令权限控制详细
export function getControl(id) {
return request({
url: '/order/control/' + id,
method: 'get'
})
}
// 新增指令权限控制
export function addControl(data) {
return request({
url: '/order/control',
method: 'post',
data: data
})
}
// 修改指令权限控制
export function updateControl(data) {
return request({
url: '/order/control',
method: 'put',
data: data
})
}
// 删除指令权限控制
export function delControl(id) {
return request({
url: '/order/control/' + id,
method: 'delete'
})
}
// 查询指令权限
export function getOrderControl(params) {
return request({
url: '/order/control/get',
method: 'get',
params: params
})
}

210
src/api/iot/device.js Normal file
View File

@ -0,0 +1,210 @@
import request from '@/utils/request';
// 查询设备列表
export function listDevice(query) {
return request({
url: '/iot/device/list',
method: 'get',
params: query,
});
}
// 查询未授权设备列表
export function listUnAuthDevice(query) {
return request({
url: '/iot/device/unAuthlist',
method: 'get',
params: query,
});
}
// 查询分组可添加设备分页列表
export function listDeviceByGroup(query) {
return request({
url: '/iot/device/listByGroup',
method: 'get',
params: query,
});
}
// 查询设备简短列表
export function listDeviceShort(query) {
return request({
url: '/iot/device/shortList',
method: 'get',
params: query,
});
}
// 查询所有设备简短列表
export function listAllDeviceShort(query) {
return request({
url: '/iot/device/all',
method: 'get',
params: query,
});
}
// 查询设备详细
export function getDevice(deviceId) {
return request({
url: '/iot/device/' + deviceId,
method: 'get',
});
}
// 设备数据同步
export function deviceSynchronization(serialNumber) {
return request({
url: '/iot/device/synchronization/' + serialNumber,
method: 'get',
});
}
// 根据设备编号查询设备详细
export function getDeviceBySerialNumber(serialNumber) {
return request({
url: '/iot/device/getDeviceBySerialNumber/' + serialNumber,
method: 'get',
});
}
// 查询设备统计信息
export function getDeviceStatistic() {
return request({
url: '/iot/device/statistic',
method: 'get',
});
}
// 选择分配设备
export function distributionDevice(deptId, deviceIds) {
return request({
url: '/iot/device/assignment?deptId=' + deptId + '&deviceIds=' + deviceIds,
method: 'post',
});
}
//回收设备
export function recycleDevice(deviceIds, recoveryDeptId) {
return request({
url: '/iot/device/recovery?deviceIds=' + deviceIds + '&recoveryDeptId=' + recoveryDeptId,
method: 'post',
});
}
//查询设备导入记录
export function listImportRecord(params) {
return request({
url: '/iot/record/list',
method: 'get',
params: params,
});
}
//查询设备回收记录
export function listRecycleRecord(params) {
return request({
url: '/iot/record/list',
method: 'get',
params: params,
});
}
//查询设备分配记录
export function listAllotRecord(params) {
return request({
url: '/iot/record/list',
method: 'get',
params: params,
});
}
// 查询设备运行状态详细
export function getDeviceRunningStatus(params) {
return request({
url: '/iot/device/runningStatus',
method: 'get',
params: params,
});
}
// 查询设备物模型的值
export function getDeviceThingsModelValue(deviceId) {
return request({
url: '/iot/device/thingsModelValue/' + deviceId,
method: 'get',
});
}
// 新增设备
export function addDevice(data) {
return request({
url: '/iot/device',
method: 'post',
data: data,
});
}
// 修改设备
export function updateDevice(data) {
return request({
url: '/iot/device',
method: 'put',
data: data,
});
}
// 删除设备
export function delDevice(deviceId) {
return request({
url: '/iot/device/' + deviceId,
method: 'delete',
});
}
// 生成设备编号
export function generatorDeviceNum(params) {
return request({
url: '/iot/device/generator',
method: 'get',
params: params,
});
}
export function getGwDevCode(params) {
return request({
url: '/iot/device/gwDevCount',
method: 'get',
params: params,
});
}
//mqtt连接参数查看
export function getMqttConnect(params) {
return request({
url: '/iot/device/getMqttConnectData',
method: 'get',
params: params,
});
}
//获取国标配置信息
export function getSipConfig(deviceSipId) {
return request({
url: '/sip/sipconfig/auth/' + deviceSipId,
method: 'get',
});
}
//获取HTTP协议配置信息
export function getHttpConfig(params) {
return request({
url: '/iot/device/getHttpAuthData',
method: 'get',
params: params,
});
}
// 查询设备变量概况
export function listThingsModel(query) {
return request({
url: '/iot/device/listThingsModel',
method: 'get',
params: query,
});
}

71
src/api/iot/deviceJob.js Normal file
View File

@ -0,0 +1,71 @@
import request from '@/utils/request'
// 查询定时任务调度列表
export function listJob(query) {
return request({
url: '/iot/job/list',
method: 'get',
params: query
})
}
// 查询定时任务调度详细
export function getJob(jobId) {
return request({
url: '/iot/job/' + jobId,
method: 'get'
})
}
// 新增定时任务调度
export function addJob(data) {
return request({
url: '/iot/job',
method: 'post',
data: data
})
}
// 修改定时任务调度
export function updateJob(data) {
return request({
url: '/iot/job',
method: 'put',
data: data
})
}
// 删除定时任务调度
export function delJob(jobId) {
return request({
url: '/iot/job/' + jobId,
method: 'delete'
})
}
// 任务状态修改
export function changeJobStatus(jobId, status) {
const data = {
jobId,
status
}
return request({
url: '/iot/job/changeStatus',
method: 'put',
data: data
})
}
// 定时任务立即执行一次
export function runJob(jobId, jobGroup) {
const data = {
jobId,
jobGroup
}
return request({
url: '/iot/job/run',
method: 'put',
data: data
})
}

62
src/api/iot/deviceLog.js Normal file
View File

@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询设备日志列表
export function listDeviceLog(query) {
return request({
url: '/iot/deviceLog/list',
method: 'get',
params: query
})
}
// 查询设备监测数据
export function listMonitor(query) {
return request({
url: '/iot/deviceLog/monitor',
method: 'get',
params: query
})
}
// 查询设备监测数据
export function listHistory(query) {
return request({
url: '/iot/deviceLog/history',
method: 'get',
params: query
})
}
// 查询设备日志详细
export function getDeviceLog(logId) {
return request({
url: '/iot/deviceLog/' + logId,
method: 'get'
})
}
// 新增设备日志
export function addDeviceLog(data) {
return request({
url: '/iot/deviceLog',
method: 'post',
data: data
})
}
// 修改设备日志
export function updateDeviceLog(data) {
return request({
url: '/iot/deviceLog',
method: 'put',
data: data
})
}
// 删除设备日志
export function delDeviceLog(logId) {
return request({
url: '/iot/deviceLog/' + logId,
method: 'delete'
})
}

63
src/api/iot/deviceuser.js Normal file
View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
// 查询设备用户列表
export function listDeviceUser(query) {
return request({
url: '/iot/deviceUser/list',
method: 'get',
params: query,
});
}
// 查询设备用户详细
export function getDeviceUser(deviceId, userId) {
return request({
url: '/iot/share/detail?deviceId=' + deviceId + '&userId=' + userId,
method: 'get',
});
}
// 查询用户
export function shareUser(query) {
return request({
url: '/iot/deviceUser/shareUser',
method: 'get',
params: query,
});
}
// 新增设备用户
export function addDeviceUser(data) {
return request({
url: '/iot/deviceUser',
method: 'post',
data: data,
});
}
// 新增多个设备用户
export function addDeviceUsers(data) {
return request({
url: '/iot/deviceUser/addDeviceUsers',
method: 'post',
data: data,
});
}
// 修改设备用户
export function updateDeviceUser(data) {
return request({
url: '/iot/deviceUser',
method: 'put',
data: data,
});
}
// 删除设备用户
export function delDeviceUser(device) {
return request({
url: '/iot/deviceUser',
method: 'delete',
data: device,
});
}

45
src/api/iot/eventLog.js Normal file
View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 查询事件日志列表
export function listEventLog(query) {
return request({
url: '/iot/event/list',
method: 'get',
params: query
})
}
// 查询事件日志详细
export function getEventLog(logId) {
return request({
url: '/iot/event/' + logId,
method: 'get'
})
}
// 新增事件日志
export function addEventLog(data) {
return request({
url: '/iot/event',
method: 'post',
data: data
})
}
// 修改事件日志
export function updateEventLog(data) {
return request({
url: '/iot/event',
method: 'put',
data: data
})
}
// 删除事件日志
export function delLog(logId) {
return request({
url: '/iot/event/' + logId,
method: 'delete'
})
}

61
src/api/iot/firmware.js Normal file
View File

@ -0,0 +1,61 @@
import request from '@/utils/request';
// 查询产品固件列表
export function listFirmware(query) {
return request({
url: '/iot/firmware/list',
method: 'get',
params: query,
});
}
// 查询待升级固件版本列表
export function upGradeVersionList(query) {
return request({
url: '/iot/firmware/upGradeVersionList',
method: 'get',
params: query,
});
}
// 查询设备最新固件
export function getLatestFirmware(deviceId, firmwareType) {
return request({
url: '/iot/firmware/getLatest?deviceId=' + deviceId + '&firmwareType=' + firmwareType,
method: 'get',
});
}
// 查询产品固件详细
export function getFirmware(firmwareId) {
return request({
url: '/iot/firmware/' + firmwareId,
method: 'get',
});
}
// 新增产品固件
export function addFirmware(data) {
return request({
url: '/iot/firmware',
method: 'post',
data: data,
});
}
// 修改产品固件
export function updateFirmware(data) {
return request({
url: '/iot/firmware',
method: 'put',
data: data,
});
}
// 删除产品固件
export function delFirmware(firmwareId) {
return request({
url: '/iot/firmware/' + firmwareId,
method: 'delete',
});
}

View File

@ -0,0 +1,74 @@
import request from '@/utils/request'
// 查询固件升级任务列表
export function listTask(query) {
return request({
url: '/iot/firmware/task/list',
method: 'get',
params: query
})
}
// 查询固件升级任务详细
export function getTask(id) {
return request({
url: '/iot/firmware/task/' + id,
method: 'get'
})
}
// 新增固件升级任务
export function addTask(data) {
return request({
url: '/iot/firmware/task',
method: 'post',
data: data
})
}
// 修改固件升级任务
export function updateTask(data) {
return request({
url: '/iot/firmware/task',
method: 'put',
data: data
})
}
// 删除固件升级任务
export function delTask(id) {
return request({
url: '/iot/firmware/task/' + id,
method: 'delete'
})
}
// 根据固件id查询下属设备列表
export function deviceList(query) {
return request({
url: '/iot/firmware/task/deviceList',
method: 'get',
params: query
})
}
// 固件升级设备统计
// 0:等待升级 1:已发送设备 2:设备收到 ===> 正在升级
// 3:升级成功 ===> 升级成功
// 4:升级失败 5:停止 ===> 升级失败
export function deviceStatistic(query) {
return request({
url: '/iot/firmware/task/deviceStatistic',
method: 'get',
params: query
})
}
// 固件重新升级
export function upgradeTask(data) {
return request({
url: '/iot/firmware/task/upgrade',
method: 'post',
data
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备服务下发日志列表
export function listLog(query) {
return request({
url: '/iot/log/list',
method: 'get',
params: query
})
}
// 查询设备服务下发日志详细
export function getLog(id) {
return request({
url: '/iot/log/' + id,
method: 'get'
})
}
// 新增设备服务下发日志
export function addLog(data) {
return request({
url: '/iot/log',
method: 'post',
data: data
})
}
// 修改设备服务下发日志
export function updateLog(data) {
return request({
url: '/iot/log',
method: 'put',
data: data
})
}
// 删除设备服务下发日志
export function delLog(id) {
return request({
url: '/iot/log/' + id,
method: 'delete'
})
}

108
src/api/iot/gateway.js Normal file
View File

@ -0,0 +1,108 @@
import request from '@/utils/request';
// 查询网关与子设备关联列表
export function listGateway(query) {
return request({
url: '/sub/gateway/list',
method: 'get',
params: query,
});
}
// 查询网关与子设备关联详细
export function getGateway(id) {
return request({
url: '/sub/gateway/' + id,
method: 'get',
});
}
// 新增网关与子设备关联
export function addGateway(data) {
return request({
url: '/sub/gateway',
method: 'post',
data: data,
});
}
// 修改网关与子设备关联
export function updateGateway(data) {
return request({
url: '/sub/gateway',
method: 'put',
data: data,
});
}
// 删除网关与子设备关联
export function delGateway(id) {
return request({
url: '/sub/gateway/' + id,
method: 'delete',
});
}
// 获取可选择的网关子设备列表
export function listSubGateway(query) {
return request({
url: '/sub/gateway/subDevice',
method: 'get',
params: query,
});
}
// 批量新增网关与子设备关联
export function addGatewayBatch(data) {
return request({
url: '/sub/gateway/addBatch',
method: 'post',
data: data,
});
}
// 批量新增网关与子设备关联
export function editGatewayBatch(data) {
return request({
url: '/sub/gateway/editBatch',
method: 'post',
data: data,
});
}
///产品///
// 查询网关与子产品关联列表
export function gatewayProductList(query) {
return request({
url: '/productModbus/gateway/list',
method: 'get',
params: query,
});
}
//新增网关与子产品关联
export function addProductGatewayBatch(data) {
return request({
url: 'productModbus/gateway/addBatch',
method: 'post',
data: data,
});
}
//修改网关与子产品关联
export function editProductGatewayBatch(data) {
return request({
url: '/productModbus/gateway/editBatch',
method: 'post',
data: data,
});
}
//删除
// 删除网关与子设备关联
export function delProductGateway(ids) {
return request({
url: '/productModbus/gateway/' + ids,
method: 'delete',
});
}

61
src/api/iot/group.js Normal file
View File

@ -0,0 +1,61 @@
import request from '@/utils/request'
// 查询设备分组列表
export function listGroup(query) {
return request({
url: '/iot/group/list',
method: 'get',
params: query
})
}
// 查询设备分组详细
export function getGroup(groupId) {
return request({
url: '/iot/group/' + groupId,
method: 'get'
})
}
// 查询分组下的关联设备ID数组
export function getDeviceIds(groupId) {
return request({
url: '/iot/group/getDeviceIds/' + groupId,
method: 'get'
})
}
// 新增设备分组
export function addGroup(data) {
return request({
url: '/iot/group',
method: 'post',
data: data
})
}
// 修改设备分组
export function updateGroup(data) {
return request({
url: '/iot/group',
method: 'put',
data: data
})
}
// 更新分组下的设备
export function updateDeviceGroups(data) {
return request({
url: '/iot/group/updateDeviceGroups',
method: 'put',
data: data
})
}
// 删除设备分组
export function delGroup(groupId) {
return request({
url: '/iot/group/' + groupId,
method: 'delete'
})
}

51
src/api/iot/httpClient.js Normal file
View File

@ -0,0 +1,51 @@
import request from '@/utils/request';
// 查询mqtt桥接http配置列表
export function httpClientList(query) {
return request({
url: '/iot/httpClient/list',
method: 'get',
params: query,
});
}
// 查询mqtt桥接http配置详细
export function getHttpClient(id) {
return request({
url: '/iot/httpClient/' + id,
method: 'get',
});
}
// 新增mqtt桥接http配置
export function addHttpClient(data) {
return request({
url: '/iot/httpClient',
method: 'post',
data: data,
});
}
// 修改mqtt桥接http配置
export function updateHttpClient(data) {
return request({
url: '/iot/httpClient',
method: 'put',
data: data,
});
}
// 删除mqtt桥接http配置
export function delHttpClient(id) {
return request({
url: '/iot/httpClient/' + id,
method: 'delete',
});
}
export function bridgeClient(data) {
return request({
url: '/iot/httpClient/bridge',
method: 'post',
data: data,
});
}

44
src/api/iot/log.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备日志列表
export function listLog(query) {
return request({
url: '/iot/log/list',
method: 'get',
params: query
})
}
// 查询设备日志详细
export function getLog(deviceLogId) {
return request({
url: '/iot/log/' + deviceLogId,
method: 'get'
})
}
// 新增设备日志
export function addLog(data) {
return request({
url: '/iot/log',
method: 'post',
data: data
})
}
// 修改设备日志
export function updateLog(data) {
return request({
url: '/iot/log',
method: 'put',
data: data
})
}
// 删除设备日志
export function delLog(deviceLogId) {
return request({
url: '/iot/log/' + deviceLogId,
method: 'delete'
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询流媒体服务器配置列表
export function listmediaServer(query) {
return request({
url: '/sip/mediaserver/list',
method: 'get',
params: query
})
}
// 查询流媒体服务器配置详细
export function getmediaServer() {
return request({
url: '/sip/mediaserver/',
method: 'get'
})
}
// 新增流媒体服务器配置
export function addmediaServer(data) {
return request({
url: '/sip/mediaserver',
method: 'post',
data: data
})
}
// 修改流媒体服务器配置
export function updatemediaServer(data) {
return request({
url: '/sip/mediaserver',
method: 'put',
data: data
})
}
// 删除流媒体服务器配置
export function delmediaServer(id) {
return request({
url: '/sip/mediaserver/' + id,
method: 'delete'
})
}
export function checkmediaServer(query) {
return request({
url: '/sip/mediaserver/check' ,
method: 'get',
params: query
})
}

View File

@ -0,0 +1,61 @@
import request from '@/utils/request'
// 查询modbus配置列表
export function listConfig(query) {
return request({
url: '/modbus/config/list',
method: 'get',
params: query
})
}
// 查询modbus配置详细
export function getConfig(id) {
return request({
url: '/modbus/config/' + id,
method: 'get'
})
}
// 新增modbus配置
export function addConfig(data) {
return request({
url: '/modbus/config',
method: 'post',
data: data
})
}
// 修改modbus配置
export function updateConfig(data) {
return request({
url: '/modbus/config',
method: 'put',
data: data
})
}
//批量新增modbus1配置
export function addBatch(data) {
return request({
url: '/modbus/config/addBatch',
method: 'post',
data: data
})
}
//批量更新modbus1配置
export function editBatch(data) {
return request({
url: '/modbus/config/editBatch',
method: 'post',
data: data
})
}
// 删除modbus配置
export function delConfig(id) {
return request({
url: '/modbus/config/' + id,
method: 'delete'
})
}

105
src/api/iot/modbusJob.js Normal file
View File

@ -0,0 +1,105 @@
import request from '@/utils/request';
// 查询轮训任务列列表
export function listJob(query) {
return request({
url: '/modbus/job/list',
method: 'get',
params: query,
});
}
// 查询轮训任务列详细
export function getJob(taskId) {
return request({
url: '/modbus/job/' + taskId,
method: 'get',
});
}
// 新增轮训任务列
export function addJob(data) {
return request({
url: '/modbus/job',
method: 'post',
data: data,
});
}
// 修改轮训任务列
export function updateJob(taskId, status) {
const data = {
taskId: taskId,
status: status,
};
return request({
url: '/modbus/job',
method: 'put',
data: data,
});
}
// 删除轮训任务列
export function delJob(data) {
return request({
url: '/modbus/job/del',
method: 'post',
data: data,
});
}
///产品///
// 查询产品轮训任务列列表
export function listProductJob(query) {
return request({
url: '/productModbus/job/list',
method: 'get',
params: query,
});
}
// 新增产品轮训任务列
export function addProductJob(data) {
return request({
url: '/productModbus/job',
method: 'post',
data: data,
});
}
// 修改产品轮训任务列
export function updateProductJob(taskId, status) {
const data = {
taskId: taskId,
status: status,
};
return request({
url: '/productModbus/job',
method: 'put',
data: data,
});
}
// 删除产品轮训任务列
export function delProductJob(ids) {
return request({
url: '/productModbus/job/' + ids,
method: 'delete',
});
}
// 获取产品轮训任务列详细信息
export function getProductJob(taskId) {
return request({
url: '/productModbus/job/' + taskId,
method: 'get',
});
}
//获取从机地址
export function getSlaveId(productId, deviceId) {
return request({
url: '/productModbus/job/getSlaveId?productId=' + productId + '&deviceId=' + deviceId,
method: 'get',
});
}

104
src/api/iot/model.js Normal file
View File

@ -0,0 +1,104 @@
import request from '@/utils/request';
// 查询物模型列表
export function listModel(query) {
return request({
url: '/iot/model/list',
method: 'get',
params: query,
});
}
// 查询物模型详细
export function getModel(modelId) {
return request({
url: '/iot/model/' + modelId,
method: 'get',
});
}
// 查询物模型对应分享设备用户权限列表
export function permListModel(productId) {
return request({
url: '/iot/model/permList/' + productId,
method: 'get',
});
}
// 新增物模型
export function addModel(data) {
return request({
url: '/iot/model',
method: 'post',
data: data,
});
}
// 导入通用物模型
export function importModel(data) {
return request({
url: '/iot/model/import',
method: 'post',
data: data,
});
}
// 修改物模型
export function updateModel(data) {
return request({
url: '/iot/model',
method: 'put',
data: data,
});
}
// 删除物模型
export function delModel(modelId) {
return request({
url: '/iot/model/' + modelId,
method: 'delete',
});
}
// 根据产品ID获取缓存的物模型
export function cacheJsonThingsModel(productId) {
return request({
url: '/iot/model/cache/' + productId,
method: 'get',
});
}
// 同步采集点模板到产品物模型
export function synchron(data) {
return request({
url: '/iot/model/synchron',
method: 'post',
data: data,
});
}
// 根据产品ID获取缓存的物模型
export function getlListModbus(query) {
return request({
url: '/iot/model/listModbus',
method: 'get',
params: query,
});
}
// 根据产品ID获取缓存的物模型
export function getWriteList(query) {
return request({
url: '/iot/model/write',
method: 'get',
params: query,
});
}
//同步旧物模型数据
export function syncModel(productId) {
return request({
url: '/iot/model/refresh?productId=' + productId,
method: 'post',
});
}

51
src/api/iot/mqttClient.js Normal file
View File

@ -0,0 +1,51 @@
import request from '@/utils/request';
// 查询mqtt桥接配置表列表
export function mqttClientList(query) {
return request({
url: '/iot/mqttClient/list',
method: 'get',
params: query,
});
}
// 查询mqtt桥接配置表详细
export function getClient(id) {
return request({
url: '/iot/mqttClient/' + id,
method: 'get',
});
}
// 新增mqtt桥接配置表
export function addClient(data) {
return request({
url: '/iot/mqttClient',
method: 'post',
data: data,
});
}
// 修改mqtt桥接配置表
export function updateClient(data) {
return request({
url: '/iot/mqttClient',
method: 'put',
data: data,
});
}
// 删除mqtt桥接配置表
export function delClient(id) {
return request({
url: '/iot/mqttClient/' + id,
method: 'delete',
});
}
export function bridgeClient(data) {
return request({
url: '/iot/mqttClient/bridge',
method: 'post',
data: data,
});
}

63
src/api/iot/mqttTest.js Normal file
View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
// 指令编码
export function encode(query) {
return request({
url: '/iot/message/encode',
method: 'get',
params: query,
});
}
// 指令解码
export function decode(query) {
return request({
url: '/iot/message/decode',
method: 'get',
params: query,
});
}
// 平台下发指令
export function messagePost(data) {
return request({
url: '/iot/message/post',
method: 'post',
data: data,
});
}
// 查询设备指令偏好设置列表
export function preferencesList(query) {
return request({
url: '/iot/preferences/list',
method: 'get',
params: query,
});
}
// 新增设备指令偏好设置
export function addPreferences(data) {
return request({
url: '/iot/preferences',
method: 'post',
data: data,
});
}
// 修改设备指令偏好设置
export function editPreferences(data) {
return request({
url: '/iot/preferences',
method: 'put',
data: data,
});
}
// 删除设备指令偏好设置
export function delPreferences(data) {
return request({
url: `/iot/preferences/${data.id}`,
method: 'DELETE'
});
}

36
src/api/iot/netty.js Normal file
View File

@ -0,0 +1,36 @@
import request from '@/utils/request'
// 集群下所有客户端列表
export function listNettyMqttClient(query) {
return request({
url: '/iot/mqtt/clients',
method: 'get',
params: query
})
}
export function clientOut(query) {
return request({
url: '/iot/mqtt/client/out',
method: 'get',
params: query
})
}
export function getNettyMqttStats() {
return request({
url: '/bashBoard/stats',
method: 'get',
})
}
export function statisticNettyMqtt(query) {
return request({
url: '/bashBoard/metrics',
method: 'get',
params: query
})
}

44
src/api/iot/news.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询新闻资讯列表
export function listNews(query) {
return request({
url: '/iot/news/list',
method: 'get',
params: query
})
}
// 查询新闻资讯详细
export function getNews(newsId) {
return request({
url: '/iot/news/' + newsId,
method: 'get'
})
}
// 新增新闻资讯
export function addNews(data) {
return request({
url: '/iot/news',
method: 'post',
data: data
})
}
// 修改新闻资讯
export function updateNews(data) {
return request({
url: '/iot/news',
method: 'put',
data: data
})
}
// 删除新闻资讯
export function delNews(newsId) {
return request({
url: '/iot/news/' + newsId,
method: 'delete'
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询新闻分类列表
export function listNewsCategory(query) {
return request({
url: '/iot/newsCategory/list',
method: 'get',
params: query
})
}
// 查询产品简短分类列表
export function listShortNewsCategory() {
return request({
url: '/iot/newsCategory/newsCategoryShortList',
method: 'get',
})
}
// 查询新闻分类详细
export function getNewsCategory(categoryId) {
return request({
url: '/iot/newsCategory/' + categoryId,
method: 'get'
})
}
// 新增新闻分类
export function addNewsCategory(data) {
return request({
url: '/iot/newsCategory',
method: 'post',
data: data
})
}
// 修改新闻分类
export function updateNewsCategory(data) {
return request({
url: '/iot/newsCategory',
method: 'put',
data: data
})
}
// 删除新闻分类
export function delNewsCategory(categoryId) {
return request({
url: '/iot/newsCategory/' + categoryId,
method: 'delete'
})
}

44
src/api/iot/params.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request';
// 查询产品modbus配置参数列表
export function listParams(query) {
return request({
url: '/modbus/params/list',
method: 'get',
params: query,
});
}
// 查询产品modbus配置参数详细
export function getParams(id) {
return request({
url: '/modbus/params/' + id,
method: 'get',
});
}
// 新增产品modbus配置参数
export function addOrUpdate(data) {
return request({
url: '/modbus/params/addOrUpdate',
method: 'post',
data: data,
});
}
// 删除产品modbus配置参数
export function delParams(id) {
return request({
url: '/modbus/params/' + id,
method: 'delete',
});
}
// 根据产品io获取modbus配置
export function getByProductId(params) {
return request({
url: '/modbus/params/getByProductId',
method: 'get',
params: params,
});
}

68
src/api/iot/platform.js Normal file
View File

@ -0,0 +1,68 @@
import request from '@/utils/request'
// 查询第三方登录平台控制列表
export function listPlatform(query) {
return request({
url: '/iot/platform/list',
method: 'get',
params: query
})
}
// 查询第三方登录平台控制详细
export function getPlatform(socialPlatformId) {
return request({
url: '/iot/platform/' + socialPlatformId,
method: 'get'
})
}
// 新增第三方登录平台控制
export function addPlatform(data) {
return request({
url: '/iot/platform',
method: 'post',
data: data
})
}
// 修改第三方登录平台控制
export function updatePlatform(data) {
return request({
url: '/iot/platform',
method: 'put',
data: data
})
}
// 删除第三方登录平台控制
export function delPlatform(socialPlatformId) {
return request({
url: '/iot/platform/' + socialPlatformId,
method: 'delete'
})
}
//解除绑定
export function unbind(socialUserId){
return request({
url: '/iot/social/unbind/' + socialUserId,
method: 'get'
})
}
//绑定跳转
export function bind(platform){
return request({
url: '/iot/social/bind/' + platform,
method: 'get'
})
}
//绑定
export function bindUser(bindId){
return request({
url: '/iot/social/bindId/' + bindId,
method: 'get'
})
}

62
src/api/iot/point.js Normal file
View File

@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询变量模板从机采集点列表
export function listPoint(query) {
return request({
url: '/iot/point/list',
method: 'get',
params: query
})
}
// 查询变量模板从机采集点详细
export function getPoint(id) {
return request({
url: '/iot/point/' + id,
method: 'get'
})
}
// 新增变量模板从机采集点
export function addPoint(data) {
return request({
url: '/iot/point',
method: 'post',
data: data
})
}
// 修改变量模板从机采集点
export function updatePoint(data) {
return request({
url: '/iot/point',
method: 'put',
data: data
})
}
// 删除变量模板从机采集点
export function delPoint(id) {
return request({
url: '/iot/point/' + id,
method: 'delete'
})
}
//根据从机id删除采集点数据
export function delBySlaveId(data){
return request({
url: '/iot/point/delBySlaveId',
method: 'delete',
data: data,
})
}
//..
export function selectByTemp(query){
return request({
url: '/iot/point/getPoints',
method: 'get',
params: query
})
}

87
src/api/iot/product.js Normal file
View File

@ -0,0 +1,87 @@
import request from '@/utils/request';
// 查询产品列表
export function listProduct(query) {
return request({
url: '/iot/product/list',
method: 'get',
params: query,
});
}
// 查询产品列表
export function listShortProduct(query) {
return request({
url: '/iot/product/shortList',
method: 'get',
params: query,
});
}
// 查询产品详细
export function getProduct(productId) {
return request({
url: '/iot/product/' + productId,
method: 'get',
});
}
// 新增产品
export function addProduct(data) {
return request({
url: '/iot/product',
method: 'post',
data: data,
});
}
// 修改产品
export function updateProduct(data) {
return request({
url: '/iot/product',
method: 'put',
data: data,
});
}
// 获取产品下设备的数量
export function deviceCount(productId) {
return request({
url: '/iot/product/deviceCount/' + productId,
method: 'get',
});
}
// 更新产品状态
export function changeProductStatus(data) {
return request({
url: '/iot/product/status',
method: 'put',
data: data,
});
}
// 删除产品
export function delProduct(productId) {
return request({
url: '/iot/product/' + productId,
method: 'delete',
});
}
// 根据采集点模板id查询所有产品
export function selectByTempleId(params) {
return request({
url: '/iot/product/queryByTemplateId',
method: 'get',
params: params,
});
}
// 复制产品
export function copyProduct(productId) {
return request({
url: '/iot/product/copy?productId=' + productId,
method: 'post',
});
}

44
src/api/iot/protocol.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询协议列表
export function listProtocol(query) {
return request({
url: '/iot/protocol/list',
method: 'get',
params: query
})
}
// 查询协议详细
export function getProtocol(id) {
return request({
url: '/iot/protocol/' + id,
method: 'get'
})
}
// 新增协议
export function addProtocol(data) {
return request({
url: '/iot/protocol',
method: 'post',
data: data
})
}
// 修改协议
export function updateProtocol(data) {
return request({
url: '/iot/protocol',
method: 'put',
data: data
})
}
// 删除协议
export function delProtocol(id) {
return request({
url: '/iot/protocol/' + id,
method: 'delete'
})
}

88
src/api/iot/record.js Normal file
View File

@ -0,0 +1,88 @@
import request from '@/utils/request'
export function getDevRecord(deviceId,channelId,query) {
return request({
url: '/sip/record/devquery/' + deviceId + "/" + channelId,
method: 'get',
params: query
})
}
export function getRecord(channelId,sn) {
return request({
url: '/sip/record/query/' + channelId + "/" + sn,
method: 'get',
})
}
export function getServerRecord(query) {
return request({
url: '/sip/record/serverRecord/list',
method: 'get',
params: query
})
}
export function getServerRecordByDate(query) {
return request({
url: '/sip/record/serverRecord/date/list',
method: 'get',
params: query
})
}
export function getServerRecordByStream(query) {
return request({
url: '/sip/record/serverRecord/stream/list',
method: 'get',
params: query
})
}
export function getServerRecordByApp(query) {
return request({
url: '/sip/record/serverRecord/app/list',
method: 'get',
params: query
})
}
export function getServerRecordByFile(query) {
return request({
url: '/sip/record/serverRecord/file/list',
method: 'get',
params: query
})
}
export function getServerRecordByDevice(query) {
return request({
url: '/sip/record/serverRecord/device/list',
method: 'get',
params: query
})
}
export function startPlayRecord(deviceId, channelId) {
return request({
url: '/sip/record/play/' + deviceId + "/" + channelId,
method: 'get'
})
}
export function startDownloadRecord(deviceId, channelId, query) {
return request({
url: '/sip/record/download/' + deviceId + "/" + channelId,
method: 'get',
params: query
})
}
export function uploadRecord(query) {
return request({
url: '/sip/record/upload',
method: 'get',
params: query
})
}

53
src/api/iot/runstatus.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/utils/request';
//查询设备实时数据
export function runStatus(params) {
return request({
url: '/iot/runtime/runState',
method: 'get',
params: params,
});
}
//服务调用,等待设备响应
export function serviceInvokeReply(data) {
return request({
url: '/iot/runtime/service/invokeReply',
method: 'post',
data: data,
});
}
//查询设备服务下发日志
export function funcLog(params) {
return request({
url: '/iot/runtime/funcLog',
method: 'get',
params: params,
});
}
export function runningStatus(params) {
return request({
url: '/iot/runtime/running',
method: 'get',
params: params,
});
}
export function propGet(params) {
return request({
url: '/iot/runtime/prop/get',
method: 'get',
params: params,
});
}
//服务调用,不等待设备响应
export function serviceInvoke(data) {
return request({
url: '/iot/runtime/service/invoke',
method: 'post',
data: data,
});
}

45
src/api/iot/salve.js Normal file
View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 查询变量模板设备从机列表
export function listSalve(query) {
return request({
url: '/iot/salve/list',
method: 'get',
params: query
})
}
// 查询变量模板设备从机详细
export function getSalve(id) {
return request({
url: '/iot/salve/' + id,
method: 'get'
})
}
// 新增变量模板设备从机
export function addSalve(data) {
return request({
url: '/iot/salve',
method: 'post',
data: data
})
}
// 修改变量模板设备从机
export function updateSalve(data) {
return request({
url: '/iot/salve',
method: 'put',
data: data
})
}
// 删除变量模板设备从机
export function delSalve(id) {
return request({
url: '/iot/salve/' + id,
method: 'delete'
})
}

60
src/api/iot/scene.js Normal file
View File

@ -0,0 +1,60 @@
import request from '@/utils/request';
// 查询场景联动列表
export function listScene(query) {
return request({
url: '/iot/scene/list',
method: 'get',
params: query,
});
}
// 查询场景联动详细
export function getScene(sceneId) {
return request({
url: '/iot/scene/' + sceneId,
method: 'get',
});
}
// 新增场景联动
export function addScene(data) {
return request({
url: '/iot/scene',
method: 'post',
data: data,
});
}
// 修改场景联动
export function updateScene(data) {
return request({
url: '/iot/scene',
method: 'put',
data: data,
});
}
// 删除场景联动
export function delScene(sceneId) {
return request({
url: '/iot/scene/' + sceneId,
method: 'delete',
});
}
// 执行场景
export function runScene(query) {
return request({
url: '/iot/runtime/runScene',
method: 'post',
params: query,
});
}
export function getSceneLog(chainName) {
return request({
url: '/iot/scene/log/' + chainName,
method: 'get',
});
}

61
src/api/iot/script.js Normal file
View File

@ -0,0 +1,61 @@
import request from '@/utils/request';
// 查询规则引擎脚本列表
export function listScript(query) {
return request({
url: '/iot/script/list',
method: 'get',
params: query,
});
}
// 查询规则引擎脚本详细
export function getScript(scriptId) {
return request({
url: '/iot/script/' + scriptId,
method: 'get',
});
}
// 查询规则引擎脚本日志
export function getScriptLog(scriptId) {
return request({
url: '/iot/script/log/' + scriptId,
method: 'get',
});
}
// 新增规则引擎脚本
export function addScript(data) {
return request({
url: '/iot/script',
method: 'post',
data: data,
});
}
// 修改规则引擎脚本
export function updateScript(data) {
return request({
url: '/iot/script',
method: 'put',
data: data,
});
}
// 删除规则引擎脚本
export function delScript(scriptId) {
return request({
url: '/iot/script/' + scriptId,
method: 'delete',
});
}
// 验证规则脚本
export function validateScript(scriptData) {
return request({
url: '/iot/script/validate',
method: 'post',
data: scriptData,
});
}

54
src/api/iot/share.js Normal file
View File

@ -0,0 +1,54 @@
import request from '@/utils/request';
// 查询设备分享列表
export function listShare(query) {
return request({
url: '/iot/share/list',
method: 'get',
params: query,
});
}
// 查询用户
export function shareUser(query) {
return request({
url: '/iot/share/shareUser',
method: 'get',
params: query,
});
}
// 查询设备分享详细
export function getShare(deviceId, userId) {
return request({
url: '/iot/share/detail?deviceId=' + deviceId + '&userId=' + userId,
method: 'get',
});
}
// 新增设备分享
export function addShare(data) {
return request({
url: '/iot/share',
method: 'post',
data: data,
});
}
// 修改设备分享
export function updateShare(data) {
return request({
url: '/iot/share',
method: 'put',
data: data,
});
}
// 删除设备分享
export function delShare(data) {
return request({
url: '/iot/share',
method: 'delete',
data: data,
});
}

10
src/api/iot/simulate.js Normal file
View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询模拟设备日志列表
export function listSimulateLog(query) {
return request({
url: '/iot/simulate/list',
method: 'get',
params: query
})
}

34
src/api/iot/sipConfig.js Normal file
View File

@ -0,0 +1,34 @@
import request from '@/utils/request'
// 查询sip系统配置详细
export function getSipconfig(productId) {
return request({
url: '/sip/sipconfig/' + productId,
method: 'get'
})
}
// 新增sip系统配置
export function addSipconfig(data) {
return request({
url: '/sip/sipconfig',
method: 'post',
data: data
})
}
// 修改sip系统配置
export function updateSipconfig(data) {
return request({
url: '/sip/sipconfig',
method: 'put',
data: data
})
}
export function delSipconfigByProductId(productId) {
return request({
url: '/sip/sipconfig/product/' + productId,
method: 'delete'
})
}

74
src/api/iot/sipdevice.js Normal file
View File

@ -0,0 +1,74 @@
import request from '@/utils/request'
// 查询监控设备列表
export function listSipDevice(query) {
return request({
url: '/sip/device/list',
method: 'get',
params: query
})
}
export function listSipDeviceChannel(deviceId) {
return request({
url: '/sip/device/listchannel/'+ deviceId,
method: 'get'
})
}
// 查询监控设备详细
export function getSipDevice(deviceId) {
return request({
url: '/sip/device/' + deviceId,
method: 'get'
})
}
// 新增监控设备
export function addSipDevice(data) {
return request({
url: '/sip/device',
method: 'post',
data: data
})
}
// 修改监控设备
export function updateSipDevice(data) {
return request({
url: '/sip/device',
method: 'put',
data: data
})
}
// 删除监控设备
export function delSipDevice(deviceId) {
return request({
url: '/sip/device/' + deviceId,
method: 'delete'
})
}
export function delSipDeviceBySipId(sipId) {
return request({
url: '/sip/device/sipid/' + sipId,
method: 'delete'
})
}
export function ptzdirection(deviceId,channelId,data) {
return request({
url: '/sip/ptz/direction/'+ deviceId + "/" + channelId,
method: 'post',
data: data
})
}
export function ptzscale(deviceId,channelId,data) {
return request({
url: '/sip/ptz/scale/'+ deviceId + "/" + channelId,
method: 'post',
data: data
})
}

44
src/api/iot/source.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询数据源配置列表
export function listSource(query) {
return request({
url: '/iot/source/list',
method: 'get',
params: query
})
}
// 查询数据源配置详细
export function getSource(id) {
return request({
url: '/iot/source/' + id,
method: 'get'
})
}
// 新增数据源配置
export function addSource(data) {
return request({
url: '/iot/source',
method: 'post',
data: data
})
}
// 修改数据源配置
export function updateSource(data) {
return request({
url: '/iot/source',
method: 'put',
data: data
})
}
// 删除数据源配置
export function delSource(id) {
return request({
url: '/iot/source/' + id,
method: 'delete'
})
}

62
src/api/iot/temp.js Normal file
View File

@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询设备采集变量模板列表
export function listTemp(query) {
return request({
url: '/iot/temp/list',
method: 'get',
params: query
})
}
// 查询设备采集变量模板详细
export function getTemp(templateId) {
return request({
url: '/iot/temp/' + templateId,
method: 'get'
})
}
// 新增设备采集变量模板
export function addTemp(data) {
return request({
url: '/iot/temp',
method: 'post',
data: data
})
}
// 修改设备采集变量模板
export function updateTemp(data) {
return request({
url: '/iot/temp',
method: 'put',
data: data
})
}
// 删除设备采集变量模板
export function delTemp(templateId) {
return request({
url: '/iot/temp/' + templateId,
method: 'delete'
})
}
//根据产品查询采集点关联
export function getDeviceTemp(params){
return request({
url: '/iot/temp/getTemp' ,
method: 'get',
params: params,
})
}
export function getTempByPId(params){
return request({
url: '/iot/temp/getTempByPid',
method: 'get',
params: params,
})
}

53
src/api/iot/template.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询通用物模型列表
export function listTemplate(query) {
return request({
url: '/iot/template/list',
method: 'get',
params: query
})
}
// 查询通用物模型详细
export function getTemplate(templateId) {
return request({
url: '/iot/template/' + templateId,
method: 'get'
})
}
// 新增通用物模型
export function addTemplate(data) {
return request({
url: '/iot/template',
method: 'post',
data: data
})
}
// 修改通用物模型
export function updateTemplate(data) {
return request({
url: '/iot/template',
method: 'put',
data: data
})
}
// 删除通用物模型
export function delTemplate(templateId) {
return request({
url: '/iot/template/' + templateId,
method: 'delete'
})
}
// 查询通用物模型详细
export function getAllPoints(params) {
return request({
url: '/iot/template/getPoints',
method: 'get',
params: params,
})
}

58
src/api/iot/tool.js Normal file
View File

@ -0,0 +1,58 @@
import request from '@/utils/request'
import axios from 'axios'
import { Message } from 'element-ui'
import { saveAs } from 'file-saver'
import { getToken } from '@/utils/auth'
import { blobValidate } from "@/utils/ruoyi";
const baseURL = process.env.VUE_APP_BASE_API;
// 注册方法
export function register(data) {
return request({
url: '/iot/tool/register',
headers: {
isToken: false
},
method: 'post',
data: data
})
}
// 查询用户列表
export function listUser(query) {
return request({
url: '/iot/tool/userList',
method: 'get',
params: query
})
}
// 获取所有下发的topic
export function getTopics(params){
return request({
url: '/iot/tool/getTopics',
method: 'get',
params: params,
})
}
// 获取所有下发的topic
export function decode(params){
return request({
url: '/iot/tool/decode',
method: 'get',
params: params,
})
}
// 获取所有下发的topic
export function simulateDown(params){
return request({
url: '/iot/tool/simulate',
method: 'get',
params: params,
})
}

26
src/api/license.js Normal file
View File

@ -0,0 +1,26 @@
import request from '@/utils/request';
// 获取证书有效期
export function getLicenseInfo() {
return request({
url: '/license/validate',
method: 'get',
});
}
//安装许可证
export function installLicense(data) {
return request({
url: '/license/install',
method: 'post',
data: data,
});
}
//获取服务器信息
export function getServerInfo(query) {
return request({
url: '/license/getServerInfo',
method: 'get',
params: query,
});
}

209
src/api/login.js Normal file
View File

@ -0,0 +1,209 @@
import request from '@/utils/request';
// 登录方法
export function login(username, password, code, uuid, sourceType) {
const data = {
username,
password,
code,
uuid,
sourceType,
};
return request({
url: '/login',
headers: {
isToken: false,
},
method: 'post',
data: data,
});
}
// 注册方法
export function register(data) {
return request({
url: '/register',
headers: {
isToken: false,
},
method: 'post',
data: data,
});
}
// 获取用户详细信息
export function getInfo() {
return request({
url: '/getInfo',
method: 'get',
});
}
// 检查BindID
export function checkBindId(bindId) {
return request({
url: '/auth/checkBindId/' + bindId,
method: 'get',
});
}
// 微信绑定获取结果信息
export function getWxBindMsg(wxBindMsgId) {
return request({
url: '/wechat/getWxBindMsg?wxBindMsgId=' + wxBindMsgId,
method: 'get',
});
}
// 退出方法
export function logout() {
return request({
url: '/logout',
method: 'post',
});
}
// 获取验证码
export function getCodeImg() {
return request({
url: '/captchaImage',
headers: {
isToken: false,
},
method: 'get',
timeout: 20000,
});
}
// 微信登录直接跳转登录
export function socialLogin(loginId) {
return request({
url: '/auth/login/' + loginId,
method: 'get',
});
}
// 微信登录绑定登录
export function bindLogin(data) {
return request({
url: '/auth/bind/login',
headers: {
isToken: false,
},
method: 'post',
data: data,
});
}
// 三方登录注册绑定
export function bindRegister(data) {
return request({
url: '/auth/bind/register',
headers: {
isToken: false,
},
method: 'post',
timeout: 20000,
data: data,
});
}
//短信登录获取验证码
export function getSmsLoginCaptcha(phoneNumber) {
return request({
url: '/notify/smsLoginCaptcha?phoneNumber=' + phoneNumber,
method: 'get',
});
}
// 短信登录
export function smsLogin(data) {
return request({
url: '/auth/sms/login',
method: 'post',
data: data,
});
}
export function getErrorMsg(errorId) {
return request({
url: '/auth/getErrorMsg/' + errorId,
method: 'get',
});
}
// 忘记密码发送短信
export function getSmsForgetPassword(phoneNumber) {
return request({
url: '/notify/smsForgetPassword?phoneNumber=' + phoneNumber,
method: 'get',
});
}
// 忘记密码重置用户密码
export function forgetPwdReset(data) {
return request({
url: '/system/user/forgetPwdReset',
method: 'put',
data: data,
});
}
// ========== OAUTH 2.0 相关 ==========
export function getAuthorize(clientId) {
return request({
url: '/oauth2/authorize?clientId=' + clientId,
method: 'get',
});
}
export function authorize(responseType, clientId, redirectUri, state, autoApprove, checkedScopes, uncheckedScopes) {
// 构建 scopes
const scopes = {};
for (const scope of checkedScopes) {
scopes[scope] = true;
}
for (const scope of uncheckedScopes) {
scopes[scope] = false;
}
// 发起请求
return request({
url: '/oauth2/authorize',
headers: {
'Content-type': 'application/x-www-form-urlencoded',
},
params: {
response_type: responseType,
client_id: clientId,
redirect_uri: redirectUri,
state: state,
auto_approve: autoApprove,
scope: JSON.stringify(scopes),
},
method: 'post',
});
}
//登录
export function oauthLogin(data) {
return request({
url: '/auth/ssoLogin',
method: 'post',
data: data,
});
}
//修改语言
export function changeLanguage(lang) {
return request({
url: '/changeLanguage',
method: 'get',
headers: {
isToken: false,
},
params: {
lang: lang,
},
});
}

9
src/api/menu.js Normal file
View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
// 获取路由
export const getRouters = () => {
return request({
url: '/getRouters',
method: 'get'
})
}

57
src/api/monitor/cache.js Normal file
View File

@ -0,0 +1,57 @@
import request from '@/utils/request'
// 查询缓存详细
export function getCache() {
return request({
url: '/monitor/cache',
method: 'get'
})
}
// 查询缓存名称列表
export function listCacheName() {
return request({
url: '/monitor/cache/getNames',
method: 'get'
})
}
// 查询缓存键名列表
export function listCacheKey(cacheName) {
return request({
url: '/monitor/cache/getKeys/' + cacheName,
method: 'get'
})
}
// 查询缓存内容
export function getCacheValue(cacheName, cacheKey) {
return request({
url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
method: 'get'
})
}
// 清理指定名称缓存
export function clearCacheName(cacheName) {
return request({
url: '/monitor/cache/clearCacheName/' + cacheName,
method: 'delete'
})
}
// 清理指定键名缓存
export function clearCacheKey(cacheKey) {
return request({
url: '/monitor/cache/clearCacheKey/' + cacheKey,
method: 'delete'
})
}
// 清理全部缓存
export function clearCacheAll() {
return request({
url: '/monitor/cache/clearCacheAll',
method: 'delete'
})
}

71
src/api/monitor/job.js Normal file
View File

@ -0,0 +1,71 @@
import request from '@/utils/request'
// 查询定时任务调度列表
export function listJob(query) {
return request({
url: '/monitor/job/list',
method: 'get',
params: query
})
}
// 查询定时任务调度详细
export function getJob(jobId) {
return request({
url: '/monitor/job/' + jobId,
method: 'get'
})
}
// 新增定时任务调度
export function addJob(data) {
return request({
url: '/monitor/job',
method: 'post',
data: data
})
}
// 修改定时任务调度
export function updateJob(data) {
return request({
url: '/monitor/job',
method: 'put',
data: data
})
}
// 删除定时任务调度
export function delJob(jobId) {
return request({
url: '/monitor/job/' + jobId,
method: 'delete'
})
}
// 任务状态修改
export function changeJobStatus(jobId, status) {
const data = {
jobId,
status
}
return request({
url: '/monitor/job/changeStatus',
method: 'put',
data: data
})
}
// 定时任务立即执行一次
export function runJob(jobId, jobGroup) {
const data = {
jobId,
jobGroup
}
return request({
url: '/monitor/job/run',
method: 'put',
data: data
})
}

Some files were not shown because too many files have changed in this diff Show More