diff --git a/src/api/device/firmware.ts b/src/api/device/firmware.ts new file mode 100644 index 00000000..f0108f98 --- /dev/null +++ b/src/api/device/firmware.ts @@ -0,0 +1,53 @@ +import server from '@/utils/request'; +import { BASE_API_PATH } from '@/utils/variable'; + +export const FIRMWARE_UPLOAD = `${BASE_API_PATH}/file/upload`; + +export const save = (data: object) => server.post(`/firmware`, data); + +export const update = (data: object) => server.patch(`/firmware`, data); + +export const remove = (id: string) => server.remove(`/firmware/${id}`); + +export const query = (data: object) => server.post(`/firmware/_query/`, data); + +export const querySystemApi = (data?: object) => + server.post(`/system/config/scopes`, data); + +export const task = (data: Record) => + server.post(`/firmware/upgrade/task/detail/_query`, data); + +export const taskById = (id: string) => + server.get(`/firmware/upgrade/task/${id}`); + +export const saveTask = (data: Record) => + server.post(`/firmware/upgrade/task`, data); + +export const deleteTask = (id: string) => + server.remove(`/firmware/upgrade/task/${id}`); + +export const history = (data: Record) => + server.post(`/firmware/upgrade/history/_query`, data); + +export const historyCount = (data: Record) => + server.post(`/firmware/upgrade/history/_count`, data); + +export const startTask = (id: string, data: string[]) => + server.post(`/firmware/upgrade/task/${id}/_start`, data); + +export const stopTask = (id: string) => + server.post(`/firmware/upgrade/task/${id}/_stop`); + +export const startOneTask = (data: string[]) => + server.post(`/firmware/upgrade/task/_start`, data); + +// export const queryProduct = (data?: any) => +// server.post(`/device-product/_query/no-paging`, data); +export const queryProduct = (data?: any) => + server.post(`/device-product/detail/_query/no-paging`, data); + +export const queryDevice = () => + server.get(`/device/instance/_query/no-paging?paging=false`); + +export const validateVersion = (productId: string, versionOrder: number) => + server.get(`/firmware/${productId}/${versionOrder}/exists`); diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index cac9e9c2..35907a23 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -83,22 +83,22 @@ export const batchDeleteDevice = (data: string[]) => server.put(`/device-instanc * @param type 文件类型 * @returns */ - export const deviceTemplateDownload = (productId: string, type: string) => `${BASE_API_PATH}/device-instance/${productId}/template.${type}` +export const deviceTemplateDownload = (productId: string, type: string) => `${BASE_API_PATH}/device-instance/${productId}/template.${type}` - /** - * 设备导入 - * @param productId 产品id - * @param type 文件类型 - * @returns - */ - export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boolean) => `${BASE_API_PATH}/device-instance/${productId}/import?fileUrl=${fileUrl}&autoDeploy=${autoDeploy}&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}` - - /** - * 设备导出 - * @param productId 产品id - * @param type 文件类型 - * @returns - */ +/** + * 设备导入 + * @param productId 产品id + * @param type 文件类型 + * @returns + */ +export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boolean) => `${BASE_API_PATH}/device-instance/${productId}/import?fileUrl=${fileUrl}&autoDeploy=${autoDeploy}&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}` + +/** + * 设备导出 + * @param productId 产品id + * @param type 文件类型 + * @returns + */ export const deviceExport = (productId: string, type: string) => `${BASE_API_PATH}/device-instance${!!productId ? '/' + productId : ''}/export.${type}` /** @@ -143,7 +143,7 @@ export const _disconnect = (id: string) => server.post(`/device-instance/${id}/d */ export const queryUserListNoPaging = () => server.post(`/user/_query/no-paging`, { paging: false, - sorts: [{name: 'name', order: "asc"}] + sorts: [{ name: 'name', order: "asc" }] }) /** @@ -347,4 +347,59 @@ export const settingProperties = (deviceId: string, data: any) => server.put(`/d * @param data * @returns */ - export const execute = (id: string, action: string, data: any) => server.post(`/device/invoked/${id}/function/${action}`, data) +export const execute = (id: string, action: string, data: any) => server.post(`/device/invoked/${id}/function/${action}`, data) + +/** + * 查询通道列表不分页 + * @param data + * @returns + */ +export const queryChannelNoPaging = (data: any) => server.post(`data-collect/channel/_query/no-paging`, data) + +/** + * 查询采集器列表不分页 + * @param data + * @returns + */ +export const queryCollectorNoPaging = (data: any) => server.post(`/data-collect/collector/_query/no-paging`, data) + +/** + * 查询点位列表不分页 + * @param data + * @returns + */ +export const queryPointNoPaging = (data: any) => server.post(`/data-collect/point/_query/no-paging`, data) + +/** + * 查询映射列表 + * @param thingType + * @param thingId + * @param params + * @returns + */ +export const queryMapping = (thingType: string, thingId: any, params?: any) => server.get(`/things/collector/${thingType}/${thingId}/_query`, params) + +/** + * 删除映射 + * @param thingType + * @param thingId + * @param data + * @returns + */ +export const removeMapping = (thingType: string, thingId: any, data?: any) => server.post(`/things/collector/${thingType}/${thingId}/_delete`, data) + +/** + * 映射树 + * @param data + * @returns + */ +export const treeMapping = (data?: any) => server.post(`/data-collect/channel/_all/tree`, data) + +/** + * 保存映射 + * @param thingId + * @param provider + * @param data + * @returns + */ +export const saveMapping = (thingId: any, provider: string, data?: any) => server.patch(`/things/collector/device/${thingId}/${provider}`, data) \ No newline at end of file diff --git a/src/api/rule-engine/config.ts b/src/api/rule-engine/config.ts index 51a9495e..f088f631 100644 --- a/src/api/rule-engine/config.ts +++ b/src/api/rule-engine/config.ts @@ -1,5 +1,18 @@ import server from '@/utils/request'; +import { LevelItem } from '@/views/rule-engine/Alarm/Config/typing'; /** * 查询等级 */ -export const queryLevel = () => server.get('/alarm/config/default/level'); \ No newline at end of file +export const queryLevel = () => server.get('/alarm/config/default/level'); +/** + * 保存告警等级 + */ +export const saveLevel = (data:LevelItem[]) => server.patch('/alarm/config/default/level',data); +/** + * 获取数据流转数据 + */ +export const getDataExchange = (type:'consume' | 'producer') => server.get(`/alarm/config/${type}/data-exchange`); +/** + * 保存告警数据输出 + */ +export const saveOutputData = (data:any) => server.patch('/alarm/config/data-exchange',data); \ No newline at end of file diff --git a/src/api/system/apiPage.ts b/src/api/system/apiPage.ts index e2031d7e..9d0d3a8f 100644 --- a/src/api/system/apiPage.ts +++ b/src/api/system/apiPage.ts @@ -3,4 +3,24 @@ import server from '@/utils/request'; // 获取tree数据-第一层 export const getTreeOne_api = () => server.get(`/v3/api-docs/swagger-config`); // 获取tree数据-第二层 -export const getTreeTwo_api = (name:string) => server.get(`/v3/api-docs/${name}`); \ No newline at end of file +export const getTreeTwo_api = (name: string) => server.get(`/v3/api-docs/${name}`); + + +/** + * 获取已授权的接口ID + * @param id 第三方平台的ID + */ +export const getApiGranted_api = (id: string) => server.get(`/application/${id}/granted`); +/** + * 获取可授权的接口ID + */ +export const apiOperations_api = () => server.get(`/application/operations`); + +/** + * 新增可授权的接口ID + */ +export const addOperations_api = (data:object) => server.patch(`/application/operations/_batch`,data); +/** + * 删除可授权的接口ID + */ +export const delOperations_api = (data:object) => server.remove(`/application/operations/_batch`,{},{data}); \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 4ebea3b2..35221782 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -49,6 +49,9 @@ const iconKeys = [ 'PartitionOutlined', 'ShareAltOutlined', 'playCircleOutlined', + 'RightOutlined', + 'FileTextOutlined', + 'UploadOutlined' ] const Icon = (props: {type: string}) => { diff --git a/src/components/FRuleEditor/Advance/index.vue b/src/components/FRuleEditor/Advance/index.vue new file mode 100644 index 00000000..5990edea --- /dev/null +++ b/src/components/FRuleEditor/Advance/index.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue new file mode 100644 index 00000000..14257edb --- /dev/null +++ b/src/components/FRuleEditor/Debug/index.vue @@ -0,0 +1,266 @@ + + + \ No newline at end of file diff --git a/src/components/FRuleEditor/Editor/index.vue b/src/components/FRuleEditor/Editor/index.vue new file mode 100644 index 00000000..8d6ed3f0 --- /dev/null +++ b/src/components/FRuleEditor/Editor/index.vue @@ -0,0 +1,211 @@ + + + \ No newline at end of file diff --git a/src/components/FRuleEditor/Operator/index.vue b/src/components/FRuleEditor/Operator/index.vue new file mode 100644 index 00000000..39accbf5 --- /dev/null +++ b/src/components/FRuleEditor/Operator/index.vue @@ -0,0 +1,119 @@ + + + \ No newline at end of file diff --git a/src/components/FRuleEditor/Operator/typings.d.ts b/src/components/FRuleEditor/Operator/typings.d.ts new file mode 100644 index 00000000..3ab4a5cd --- /dev/null +++ b/src/components/FRuleEditor/Operator/typings.d.ts @@ -0,0 +1,10 @@ +import type { TreeNode } from '@/utils/tree'; + +interface OperatorItem extends TreeNode { + id: string; + name: string; + key: string; + description: string; + code: string; + children: OperatorItem[]; +} diff --git a/src/components/FRuleEditor/index.vue b/src/components/FRuleEditor/index.vue new file mode 100644 index 00000000..c53f55f1 --- /dev/null +++ b/src/components/FRuleEditor/index.vue @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/src/components/Metadata/VirtualRuleParam/index.vue b/src/components/Metadata/VirtualRuleParam/index.vue new file mode 100644 index 00000000..94d078f4 --- /dev/null +++ b/src/components/Metadata/VirtualRuleParam/index.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index 094f23e8..1a6698ce 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -73,6 +73,27 @@ watchEffect(() => { editorFormat(); }, 300); }); + +const insert = (val) => { + if (!instance) return + const position = instance.getPosition(); + instance.executeEdits(instance.getValue(), [ + { + range: new monaco.Range( + position?.lineNumber, + position?.column, + position?.lineNumber, + position?.column, + ), + text: val, + }, + ]); +} + +defineExpose({ + editorFormat, + insert, +}) diff --git a/src/views/device/Firmware/Save/index.vue b/src/views/device/Firmware/Save/index.vue new file mode 100644 index 00000000..ead74d77 --- /dev/null +++ b/src/views/device/Firmware/Save/index.vue @@ -0,0 +1,388 @@ + + + + diff --git a/src/views/device/Firmware/index.vue b/src/views/device/Firmware/index.vue new file mode 100644 index 00000000..d8c34292 --- /dev/null +++ b/src/views/device/Firmware/index.vue @@ -0,0 +1,268 @@ + + + + diff --git a/src/views/device/Firmware/type.d.ts b/src/views/device/Firmware/type.d.ts new file mode 100644 index 00000000..80a289c0 --- /dev/null +++ b/src/views/device/Firmware/type.d.ts @@ -0,0 +1,23 @@ +export type FormDataType = { + description: string; + name: string; + productId: string | undefined; + version: undefined; + versionOrder: undefined; + signMethod: string | undefined; + sign: string; + url: string; + size: number; + properties: Array; + id?: string; + format?: string; + mode?: object; + creatorId?: string; + createTime?: number; +}; + +export interface Properties { + id: string; + value: any; + keyid: number; +} diff --git a/src/views/device/Instance/Detail/Diagnose/Message/Dialog/index.vue b/src/views/device/Instance/Detail/Diagnose/Message/Dialog/index.vue index 1e4d60f2..1da53219 100644 --- a/src/views/device/Instance/Detail/Diagnose/Message/Dialog/index.vue +++ b/src/views/device/Instance/Detail/Diagnose/Message/Dialog/index.vue @@ -1,20 +1,47 @@ diff --git a/src/views/device/components/Metadata/Base/Edit/index.vue b/src/views/device/components/Metadata/Base/Edit/index.vue index d783b65e..bca2a281 100644 --- a/src/views/device/components/Metadata/Base/Edit/index.vue +++ b/src/views/device/components/Metadata/Base/Edit/index.vue @@ -4,7 +4,7 @@ - + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Config/Io/Save/output.vue b/src/views/rule-engine/Alarm/Config/Io/Save/output.vue new file mode 100644 index 00000000..a9eff425 --- /dev/null +++ b/src/views/rule-engine/Alarm/Config/Io/Save/output.vue @@ -0,0 +1,109 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Config/Io/index.vue b/src/views/rule-engine/Alarm/Config/Io/index.vue new file mode 100644 index 00000000..d1799f52 --- /dev/null +++ b/src/views/rule-engine/Alarm/Config/Io/index.vue @@ -0,0 +1,532 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Config/index.vue b/src/views/rule-engine/Alarm/Config/index.vue index 6f89fc35..c5e38ce7 100644 --- a/src/views/rule-engine/Alarm/Config/index.vue +++ b/src/views/rule-engine/Alarm/Config/index.vue @@ -1,10 +1,14 @@ \ No newline at end of file diff --git a/src/views/system/Apply/Api/components/ApiDoes.vue b/src/views/system/Apply/Api/components/ApiDoes.vue index b7f8f8f3..69283f0f 100644 --- a/src/views/system/Apply/Api/components/ApiDoes.vue +++ b/src/views/system/Apply/Api/components/ApiDoes.vue @@ -84,6 +84,7 @@ import type { apiDetailsType } from '../typing'; import InputCard from './InputCard.vue'; import { PropType } from 'vue'; +const emit = defineEmits(['update:paramsTable']) const props = defineProps({ selectApi: { type: Object as PropType, @@ -216,6 +217,7 @@ const respParamsCard = reactive({ const tableData = findData(schemaName); const codeText = getCodeText(tableData, 3); + emit('update:paramsTable', tableData) respParamsCard.tableData = tableData; respParamsCard.codeText = JSON.stringify(codeText); diff --git a/src/views/system/Apply/Api/components/ApiTest.vue b/src/views/system/Apply/Api/components/ApiTest.vue index 9587ce3e..58241d93 100644 --- a/src/views/system/Apply/Api/components/ApiTest.vue +++ b/src/views/system/Apply/Api/components/ApiTest.vue @@ -12,16 +12,16 @@
请求参数
- - + --> + />
@@ -47,21 +47,34 @@ import VueJsoneditor from 'vue3-ts-jsoneditor'; import MonacoEditor from '@/components/MonacoEditor/index.vue'; import type { apiDetailsType } from '../typing'; import InputCard from './InputCard.vue'; -import { PropType } from 'vue'; -const props = defineProps({ - selectApi: { - type: Object as PropType, - required: true, - }, -}); +const props = defineProps<{ + selectApi: apiDetailsType; + paramsTable: any[]; +}>(); const requestBody = reactive({ - paramsTable: [], + paramsTable: [] as requestObj[], paramsText: '', }); const responsesContent = ref('{"a":123}'); + +watch( + () => props.paramsTable, + (n) => { + const table = n?.map((item: any) => ({ + paramsName: item.paramsName, + value: '', + })); + requestBody.paramsTable = table; + }, +); + +type requestObj = { + paramsName: string; + value: string; +}; \ No newline at end of file diff --git a/src/views/system/Platforms/Api/components/ApiDoes.vue b/src/views/system/Platforms/Api/components/ApiDoes.vue new file mode 100644 index 00000000..b7f8f8f3 --- /dev/null +++ b/src/views/system/Platforms/Api/components/ApiDoes.vue @@ -0,0 +1,378 @@ + + + + + diff --git a/src/views/system/Platforms/Api/components/ApiTest.vue b/src/views/system/Platforms/Api/components/ApiTest.vue new file mode 100644 index 00000000..161c135d --- /dev/null +++ b/src/views/system/Platforms/Api/components/ApiTest.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/src/views/system/Platforms/Api/components/ChooseApi.vue b/src/views/system/Platforms/Api/components/ChooseApi.vue new file mode 100644 index 00000000..66103ba8 --- /dev/null +++ b/src/views/system/Platforms/Api/components/ChooseApi.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/views/system/Platforms/Api/components/InputCard.vue b/src/views/system/Platforms/Api/components/InputCard.vue new file mode 100644 index 00000000..c1742737 --- /dev/null +++ b/src/views/system/Platforms/Api/components/InputCard.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/views/system/Platforms/Api/components/LeftTree.vue b/src/views/system/Platforms/Api/components/LeftTree.vue new file mode 100644 index 00000000..63d31d99 --- /dev/null +++ b/src/views/system/Platforms/Api/components/LeftTree.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/src/views/system/Platforms/Api/index.vue b/src/views/system/Platforms/Api/index.vue new file mode 100644 index 00000000..622da6f5 --- /dev/null +++ b/src/views/system/Platforms/Api/index.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/views/system/Platforms/Api/typing.d.ts b/src/views/system/Platforms/Api/typing.d.ts new file mode 100644 index 00000000..0fb45159 --- /dev/null +++ b/src/views/system/Platforms/Api/typing.d.ts @@ -0,0 +1,27 @@ +export type treeNodeTpye = { + name: string; + key: string; + schemas?:object; + link?: string; + apiList?: object[]; + children?: treeNodeTpye[]; + +}; +export type methodType = { + [key: string]: object +} +export type apiObjType = { + url: string, + method: methodType +} + +export type apiDetailsType = { + url: string; + method: string; + summary: string; + parameters: any[]; + requestBody?: any; + responses:object; +} + +export type modeType = 'api'| 'appManger' | 'home' \ No newline at end of file diff --git a/src/views/system/Platforms/index.vue b/src/views/system/Platforms/index.vue new file mode 100644 index 00000000..0abee066 --- /dev/null +++ b/src/views/system/Platforms/index.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/vite.config.ts b/vite.config.ts index 7048d340..aa5f4420 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -86,8 +86,8 @@ export default defineConfig(({ mode}) => { // target: 'http://192.168.32.244:8881', // target: 'http://47.112.135.104:5096', // opcua // target: 'http://120.77.179.54:8844', // 120测试 - // target: 'http://47.108.63.174:8845', // 测试 - target: 'http://120.77.179.54:8844', + target: 'http://47.108.63.174:8845', // 测试 + // target: 'http://120.77.179.54:8844', ws: 'ws://120.77.179.54:8844', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '')