diff --git a/src/api/device/firmware.ts b/src/api/device/firmware.ts index a21e948a..19e3c7b0 100644 --- a/src/api/device/firmware.ts +++ b/src/api/device/firmware.ts @@ -49,8 +49,10 @@ export const queryProduct = (data?: any) => 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`); +export const validateVersion = ( + productId: string, + versionOrder: number | string, +) => server.get(`/firmware/${productId}/${versionOrder}/exists`); export const queryDetailList = (data: Record) => server.post(`/device-instance/detail/_query`, data); diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 5148bca8..d9290b4b 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -482,4 +482,19 @@ export const getPropertiesInfo = (deviceId: string, data: Record) => server.post(`/device-instance/${deviceId}/property/${property}/_query`, data) \ No newline at end of file +export const getPropertiesList = (deviceId: string, property: string, data: Record) => server.post(`/device-instance/${deviceId}/property/${property}/_query`, data) + +/** + * 查询设备日志 + * @param deviceId + * @param data + * @returns + */ +export const queryLog = (deviceId: string, data: Record) => server.post(`/device-instance/${deviceId}/logs`, data) + +/** + * 查询设备日志类型 + * @returns + */ +export const queryLogsType = () => server.get(`/dictionary/device-log-type/items`) + diff --git a/src/api/link/dashboard.ts b/src/api/link/dashboard.ts new file mode 100644 index 00000000..0d1920cc --- /dev/null +++ b/src/api/link/dashboard.ts @@ -0,0 +1,11 @@ +import server from '@/utils/request'; + +export const dashboard = (data: object) => + server.post(`/dashboard/_multi`, data); +export const productCount = (data: object) => + server.post(`/device-product/_count`, data); +export const getGeo = (data: object) => + server.post(`/geo/object/device/_search/geo.json`, data); +export const deviceCount = (data: object) => + server.get(`/device/instance/_count`, data); +export const serverNode = () => server.get(`/dashboard/cluster/nodes`); diff --git a/src/api/media/cascade.ts b/src/api/media/cascade.ts new file mode 100644 index 00000000..c0b71ded --- /dev/null +++ b/src/api/media/cascade.ts @@ -0,0 +1,29 @@ +import server from '@/utils/request' +import type { CascadeItem } from '@/views/media/Cascade/typings' + +export default { + // 列表 + list: (data: any) => server.post(`/media/gb28181-cascade/_query`, data), + // 列表字段通道数量, 来自下面接口的total + queryCount: (id: string) => server.post(`/media/gb28181-cascade/${id}/bindings/_query`), + // 详情 + detail: (id: string): any => server.get(`/media/gb28181-cascade/${id}`), + // 新增 + save: (data: any) => server.post(`/media/gb28181-cascade`, data), + // 修改 + // update: (id: string, data: any) => server.put(`/media/gb28181-cascade/${id}`, data), + update: (data: any) => server.patch(`/media/gb28181-cascade`, data), + // 删除 + del: (id: string) => server.remove(`media/gb28181-cascade/${id}`), + // 禁用 + disabled: (id: string) => server.post(`/media/gb28181-cascade/${id}/_disabled`), + // 启用 + enabled: (id: string) => server.post(`/media/gb28181-cascade/${id}/_enabled`), + + // 新增/编辑 + // 获取集群节点 + clusters: () => server.get(`/network/resources/clusters`), + // SIP本地地址 + all: () => server.get(`/network/resources/alive/_all`), + +} \ No newline at end of file diff --git a/src/api/media/channel.ts b/src/api/media/channel.ts index 3c4a67bd..da64173a 100644 --- a/src/api/media/channel.ts +++ b/src/api/media/channel.ts @@ -6,10 +6,11 @@ export default { // 详情 detail: (id: string): any => server.get(`/media/channel/${id}`), // 验证通道ID是否存在 - validateField: (params: string): any => server.get(`/media/channel/channelId/_validate`, params), + validateField: (params: any): any => server.get(`/media/channel/channelId/_validate`, params), // 新增 save: (data: any) => server.post(`/media/channel`, data), // 修改 - update: (data: any) => server.put(`/media/channel`, data), + update: (id: string, data: any) => server.put(`/media/channel/${id}`, data), + // 删除 del: (id: string) => server.remove(`media/channel/${id}`), } \ No newline at end of file diff --git a/src/api/rule-engine/scene.ts b/src/api/rule-engine/scene.ts index 0ae3e8dd..4c00c1ba 100644 --- a/src/api/rule-engine/scene.ts +++ b/src/api/rule-engine/scene.ts @@ -7,4 +7,15 @@ export const save = (data: any) => server.post(`/scene`, data) export const detail = (id: string) => server.get(`/scene/${id}`) -export const query = (data: any) => server.post('/scene/_query/',data); \ No newline at end of file +export const query = (data: any) => server.post('/scene/_query/',data); + +export const _delete = (id: string) => server.remove(`/scene/${id}/`); + +export const _action = (id: string, type: '_disable' | '_enable') => server.put(`/scene/${id}/${type}`); + +/** + * 手动触发 + * @param id + * @returns + */ +export const _execute = (id: string) => server.post(`/scene/${id}/_execute`); \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index d80de076..a0c7f27a 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -48,7 +48,7 @@ const iconKeys = [ 'ClockCircleOutlined', 'PartitionOutlined', 'ShareAltOutlined', - 'playCircleOutlined', + 'PlayCircleOutlined', 'RightOutlined', 'FileTextOutlined', 'UploadOutlined', @@ -62,6 +62,7 @@ const iconKeys = [ 'HistoryOutlined', 'ToolOutlined', 'FileOutlined', + 'LikeOutlined' ] const Icon = (props: {type: string}) => { diff --git a/src/components/AMapComponent/PathSimplifier.vue b/src/components/AMapComponent/PathSimplifier.vue new file mode 100644 index 00000000..a34d05d1 --- /dev/null +++ b/src/components/AMapComponent/PathSimplifier.vue @@ -0,0 +1,106 @@ + + + \ No newline at end of file diff --git a/src/components/AMapComponent/index.vue b/src/components/AMapComponent/index.vue new file mode 100644 index 00000000..03e9befd --- /dev/null +++ b/src/components/AMapComponent/index.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/src/components/AMapComponent/types.d.ts b/src/components/AMapComponent/types.d.ts new file mode 100644 index 00000000..db4f66b6 --- /dev/null +++ b/src/components/AMapComponent/types.d.ts @@ -0,0 +1,130 @@ +export type PathDataType = number[][]; + +export type PathSimplifierOptions = { + map?: any; + zIndex?: number; + data?: number[][]; + getPath?: (pathData: {}, pathIndex: number) => PathDataType; + getZIndex?: (pathData: any, pathIndex: number) => number; + getHoverTitle?: (pathData: any, pathIndex: number, pointIndex: number) => string; + autoSetFitView?: boolean; + clickToSelectPath?: boolean; + onTopWhenSelected?: boolean; + renderConstructor?: Function; + renderOptions?: {}; +}; + +export type PathDataItemType = { + name?: string; + path: PathDataType; +}; + +export interface PathSimplifier { + new (options: PathSimplifierOptions); + + readonly supportCanvas: boolean; + + getZIndexOfPath: (pathIndex: number) => number; + + setZIndexOfPath: (pathIndex: number, zIndex: number) => void; + + /** + * 是否置顶显示pathIndex对应的轨迹 + * @param pathIndex + * @param isTop isTop为真,设置 zIndex 为 现存最大zIndex+1; isTop为假,设置 zIndex 为 构造参数中 getZIndex 的返回值 + */ + toggleTopOfPath: (pathIndex: number, isTop: boolean) => void; + + getPathData: (pathIndex: number) => any; + + createPathNavigator: (pathIndex: number, options: {}) => PathNavigator; + + getPathNavigators: () => any[]; + + clearPathNavigators: () => void; + + getSelectedPathData: () => any; + + getSelectedPathIndex: () => number; + + isSelectedPathIndex: (pathIndex: number) => boolean; + + setSelectedPathIndex: (pathIndex: number) => void; + + render: () => void; + + renderLater: (delay: number[]) => void; + + setData: (data: any[]) => void; + + setFitView: (pathIndex: number) => void; + + on: (eventName: string, handler: Function) => void; + + off: (eventName: string, handler: Function) => void; + + hide: () => void; + + show: () => void; + + isHidden: () => boolean; + + getRender: () => boolean; + + getRenderOptions: () => any; +} + +export interface PathNavigatorOptions { + loop?: boolean; + speed?: number; + pathNavigatorStyle?: {}; + animInterval?: number; + dirToPosInMillsecs?: number; + range?: [number, number]; +} + +export interface PathNavigator { + new (options: PathNavigatorOptions); + + start: (pointIndex?: number) => void; + + pause: () => void; + + resume: () => void; + + stop: () => void; + + destroy: () => void; + + getCursor: () => any; + + getNaviStatus: () => string; + + getPathIndex: () => number; + + getPosition: () => [number, number]; + + getSpeed: () => number; + + getMovedDistance: () => number; + + getPathStartIdx: () => number; + + getPathEndIdx: () => number; + + moveByDistance: (distance: number) => void; + + moveToPoint: (idx: number, tail: number) => void; + + isCursorAtPathEnd: () => boolean; + + isCursorAtPathStart: () => boolean; + + setSpeed: (speed: number) => void; + + setRange: (startIndex: number, endIndex: number) => void; + + on: (eventName: string, handler: Function) => void; + + off: (eventName: string, handler: Function) => void; +} diff --git a/src/components/AMapComponent/utils.ts b/src/components/AMapComponent/utils.ts new file mode 100644 index 00000000..dd7f91ec --- /dev/null +++ b/src/components/AMapComponent/utils.ts @@ -0,0 +1,26 @@ +const protocol = window.location.protocol; + +const buildScriptTag = (src: string): HTMLScriptElement => { + const script = document.createElement('script'); + script.type = 'text/javascript'; + script.async = true; + script.defer = true; + script.src = src; + return script; +}; + +export const getAMapUiPromise = (version: string = '1.0'): Promise => { + if ((window as any).AMapUI) { + return Promise.resolve(); + } + const script = buildScriptTag(`${protocol}//webapi.amap.com/ui/${version}/main-async.js`); + const pro = new Promise((resolve) => { + script.onload = () => { + (window as any).initAMapUI(); + resolve(true); + }; + }); + + document.body.append(script); + return pro; +}; \ No newline at end of file diff --git a/src/components/Metadata/ArrayParam/index.vue b/src/components/Metadata/ArrayParam/index.vue index 576c63fa..53410132 100644 --- a/src/components/Metadata/ArrayParam/index.vue +++ b/src/components/Metadata/ArrayParam/index.vue @@ -3,30 +3,29 @@ - 配置元素 + 配置元素 + - + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/AMap.vue b/src/views/device/Instance/Detail/Running/Property/Detail/AMap.vue deleted file mode 100644 index e0656cec..00000000 --- a/src/views/device/Instance/Detail/Running/Property/Detail/AMap.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue b/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue index b7860f91..e6380a17 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue @@ -3,12 +3,14 @@
- 开始动画 - 停止动画 + 开始动画 + 停止动画
- + + + @@ -16,7 +18,6 @@ import { getPropertyData } from '@/api/device/instance'; import { useInstanceStore } from '@/store/instance'; import encodeQuery from '@/utils/encodeQuery'; -import AMap from './AMap.vue'; const instanceStore = useInstanceStore(); @@ -33,6 +34,15 @@ const prop = defineProps({ const geoList = ref([]); const loading = ref(false); +const amapPath = ref() + +const onStart = () => { + amapPath.value.start() +} + +const onStop = () => { + amapPath.value.stop() +} const query = async () => { loading.value = true; @@ -53,7 +63,10 @@ const query = async () => { ((resp.result as any)?.data || []).forEach((item: any) => { list.push([item.value.lon, item.value.lat]); }); - geoList.value = list + geoList.value = [{ + name: prop?.data?.name, + path: list + }] } }; diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/index.vue b/src/views/device/Instance/Detail/Running/Property/Detail/index.vue index 6bdb9c4b..39d3d376 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/index.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/index.vue @@ -2,7 +2,7 @@
- + diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index f775e847..e42f0687 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -116,6 +116,7 @@ import Function from './Function/index.vue'; import Modbus from './Modbus/index.vue'; import OPCUA from './OPCUA/index.vue'; import EdgeMap from './EdgeMap/index.vue'; +import Log from './Log/index.vue' import { _deploy, _disconnect } from '@/api/device/instance'; import { message } from 'ant-design-vue'; import { getImage } from '@/utils/comm'; @@ -147,6 +148,10 @@ const list = ref([ key: 'Metadata', tab: '物模型', }, + { + key: 'Log', + tab: '日志管理', + }, { key: 'Function', tab: '设备功能', @@ -167,6 +172,7 @@ const tabs = { Modbus, OPCUA, EdgeMap, + Log }; const getStatus = (id: string) => { diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index bf1e1393..cfa46224 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -694,7 +694,6 @@ const saveBtn = () => { }; const handleSearch = (_params: any) => { - console.log(_params); params.value = _params; }; diff --git a/src/views/device/components/Metadata/Base/Edit/PropertyForm.vue b/src/views/device/components/Metadata/Base/Edit/BaseForm.vue similarity index 69% rename from src/views/device/components/Metadata/Base/Edit/PropertyForm.vue rename to src/views/device/components/Metadata/Base/Edit/BaseForm.vue index 3a8c4464..e780808e 100644 --- a/src/views/device/components/Metadata/Base/Edit/PropertyForm.vue +++ b/src/views/device/components/Metadata/Base/Edit/BaseForm.vue @@ -7,7 +7,7 @@ message: 'ID只能由数字、字母、下划线、中划线组成', }, ]"> - + - {{ modelType }} @@ -37,11 +35,22 @@ ]"> - - - - + + + + - \ No newline at end of file diff --git a/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue b/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue index d4061d54..5fa96daa 100644 --- a/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue +++ b/src/views/device/components/Metadata/Base/Edit/ExpandsForm.vue @@ -10,7 +10,7 @@ - + @@ -19,12 +19,12 @@ - + - \ No newline at end of file diff --git a/src/views/device/components/Metadata/Base/index.vue b/src/views/device/components/Metadata/Base/index.vue index 04be78d2..c7cae06d 100644 --- a/src/views/device/components/Metadata/Base/index.vue +++ b/src/views/device/components/Metadata/Base/index.vue @@ -9,7 +9,7 @@ title: operateLimits('add', type) ? '当前的存储方式不支持新增' : '新增', }"> 新增 @@ -38,7 +38,7 @@ :udisabled="operateLimits('updata', type)" @click="handleEditClick(slotProps)" :tooltip="{ title: operateLimits('updata', type) ? '当前的存储方式不支持编辑' : '编辑', }"> - + - + @@ -62,7 +62,6 @@ import { useInstanceStore } from '@/store/instance' import { useProductStore } from '@/store/product' import { useMetadataStore } from '@/store/metadata' import PermissionButton from '@/components/PermissionButton/index.vue' -import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue/es' import { SystemConst } from '@/utils/consts' import { Store } from 'jetlinks-store' diff --git a/src/views/device/components/Metadata/Cat/index.vue b/src/views/device/components/Metadata/Cat/index.vue index bde3f7fd..a9bafd58 100644 --- a/src/views/device/components/Metadata/Cat/index.vue +++ b/src/views/device/components/Metadata/Cat/index.vue @@ -122,7 +122,7 @@ watch( ) watch( - [props.visible, props.type], + () => [props.visible, props.type], () => { if (props.visible) { loading.value = true @@ -136,7 +136,7 @@ watch( } else { productDetail(id as string).then((resp) => { loading.value = false - // productStore.setCurrent(resp.result) + productStore.setCurrent(resp.result) value.value = resp.result.metadata }); } diff --git a/src/views/device/components/Metadata/Import/index.vue b/src/views/device/components/Metadata/Import/index.vue index eb5de412..7d8867b1 100644 --- a/src/views/device/components/Metadata/Import/index.vue +++ b/src/views/device/components/Metadata/Import/index.vue @@ -3,7 +3,7 @@ @ok="handleImport" :confirm-loading="loading">

- + 导入的物模型会覆盖原来的属性、功能、事件、标签,请谨慎操作。

@@ -37,8 +37,7 @@ - - + @@ -62,9 +61,8 @@ import { Store } from 'jetlinks-store'; import { SystemConst } from '@/utils/consts'; import { useInstanceStore } from '@/store/instance' import { useProductStore } from '@/store/product'; -import { UploadOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { FILE_UPLOAD } from '@/api/comm'; -import { LocalStore, getToken } from '@/utils/comm'; +import { getToken } from '@/utils/comm'; import MonacoEditor from '@/components/MonacoEditor/index.vue' const route = useRoute() @@ -258,13 +256,15 @@ const handleImport = async () => { if (resp.status === 200) { if (props?.type === 'device') { const metadata: DeviceMetadata = JSON.parse(paramsDevice || '{}') + // TODO导入 // MetadataAction.insert(metadata); - instanceStore.setCurrent(metadata) + // instanceStore.setCurrent(metadata) message.success('导入成功') } else { const metadata: ProductItem = JSON.parse(params?.metadata || '{}') + // TODO导入 // MetadataAction.insert(metadata); - productStore.setCurrent(metadata) + // productStore.setCurrent(metadata) message.success('导入成功') } } diff --git a/src/views/device/components/Metadata/index.vue b/src/views/device/components/Metadata/index.vue index 42f3d46d..36ea3747 100644 --- a/src/views/device/components/Metadata/index.vue +++ b/src/views/device/components/Metadata/index.vue @@ -6,7 +6,7 @@ ? '该设备已脱离产品物模型,修改产品物模型对该设备无影响' : '设备会默认继承产品的物模型,修改设备物模型后将脱离产品物模型'">
- + {{ instanceStore.detail?.independentMetadata && type === 'device' ? '该设备已脱离产品物模型,修改产品物模型对该设备无影响' @@ -47,7 +47,6 @@ diff --git a/src/views/link/AccessConfig/components/Channel/index.vue b/src/views/link/AccessConfig/components/Channel/index.vue index 08340b9b..f4e5d0d9 100644 --- a/src/views/link/AccessConfig/components/Channel/index.vue +++ b/src/views/link/AccessConfig/components/Channel/index.vue @@ -39,12 +39,16 @@ /> - 保存 + 保存 +
@@ -86,10 +90,9 @@ diff --git a/src/views/link/AccessConfig/components/Network/index.vue b/src/views/link/AccessConfig/components/Network/index.vue new file mode 100644 index 00000000..6d72b9e7 --- /dev/null +++ b/src/views/link/AccessConfig/components/Network/index.vue @@ -0,0 +1,701 @@ + + + + + diff --git a/src/views/link/AccessConfig/components/Provider/index.vue b/src/views/link/AccessConfig/components/Provider/index.vue index 3412f3f2..04390ba4 100644 --- a/src/views/link/AccessConfig/components/Provider/index.vue +++ b/src/views/link/AccessConfig/components/Provider/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/link/DashBoard/components/Jvm.vue b/src/views/link/DashBoard/components/Jvm.vue new file mode 100644 index 00000000..f876e0ae --- /dev/null +++ b/src/views/link/DashBoard/components/Jvm.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/views/link/DashBoard/components/Network.vue b/src/views/link/DashBoard/components/Network.vue new file mode 100644 index 00000000..2db01cc6 --- /dev/null +++ b/src/views/link/DashBoard/components/Network.vue @@ -0,0 +1,219 @@ + + + + + diff --git a/src/views/link/DashBoard/components/TopCard.vue b/src/views/link/DashBoard/components/TopCard.vue new file mode 100644 index 00000000..9ff956cd --- /dev/null +++ b/src/views/link/DashBoard/components/TopCard.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/src/views/link/DashBoard/components/TopEchartsItemNode.vue b/src/views/link/DashBoard/components/TopEchartsItemNode.vue new file mode 100644 index 00000000..dafbad67 --- /dev/null +++ b/src/views/link/DashBoard/components/TopEchartsItemNode.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/src/views/link/DashBoard/components/tool.ts b/src/views/link/DashBoard/components/tool.ts new file mode 100644 index 00000000..cb337a31 --- /dev/null +++ b/src/views/link/DashBoard/components/tool.ts @@ -0,0 +1,220 @@ +import moment from 'moment'; +import * as echarts from 'echarts'; + +export const getInterval = (type) => { + switch (type) { + case 'year': + return '30d'; + case 'month': + case 'week': + return '1d'; + case 'hour': + return '1m'; + default: + return '1h'; + } +}; +export const getTimeFormat = (type) => { + switch (type) { + case 'year': + return 'YYYY-MM-DD'; + case 'month': + case 'week': + return 'MM-DD'; + case 'hour': + return 'HH:mm'; + default: + return 'HH'; + } +}; + +export const getTimeByType = (type) => { + switch (type) { + case 'hour': + return moment().subtract(1, 'hours'); + case 'week': + return moment().subtract(6, 'days'); + case 'month': + return moment().subtract(29, 'days'); + case 'year': + return moment().subtract(365, 'days'); + default: + return moment().startOf('day'); + } +}; + +export const arrayReverse = (data) => { + const newArray = []; + for (let i = data.length - 1; i >= 0; i--) { + newArray.push(data[i]); + } + return newArray; +}; + +export const networkParams = (val) => [ + { + dashboard: 'systemMonitor', + object: 'network', + measurement: 'traffic', + dimension: 'agg', + group: 'network', + params: { + type: val.type, + interval: getInterval(val.time.type), + from: moment(val.time.time[0]).valueOf(), + to: moment(val.time.time[1]).valueOf(), + }, + }, +]; +export const defulteParamsData = (group, val) => [ + { + dashboard: 'systemMonitor', + object: 'stats', + measurement: 'info', + dimension: 'history', + group, + params: { + from: moment(val.time[0]).valueOf(), + to: moment(val.time[1]).valueOf(), + }, + }, +]; + +export const areaStyle = { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 1, + color: 'rgba(151, 154, 255, 0)', + }, + { + offset: 0, + color: 'rgba(151, 154, 255, .24)', + }, + ]), +}; +export const areaStyleCpu = { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 1, + color: 'rgba(44, 182, 224, 0)', + }, + { + offset: 0, + color: 'rgba(44, 182, 224, .24)', + }, + ]), +}; +export const areaStyleJvm = { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 1, + color: 'rgba(96, 223, 199, 0)', + }, + { + offset: 0, + color: 'rgba(96, 223, 199, .24)', + }, + ]), +}; + +export const typeDataLine = [ + { + data: [], + type: 'line', + }, +]; + +export const topOptionsSeries = { + type: 'gauge', + min: 0, + startAngle: 200, + endAngle: -20, + center: ['50%', '67%'], + title: { + show: false, + }, + axisTick: { + distance: -20, + lineStyle: { + width: 1, + color: 'rgba(0,0,0,0.15)', + }, + }, + splitLine: { + distance: -22, + length: 9, + lineStyle: { + width: 1, + color: '#000', + }, + }, + pointer: { + length: '80%', + width: 4, + itemStyle: { + color: 'auto', + }, + }, + anchor: { + show: true, + showAbove: true, + size: 20, + itemStyle: { + borderWidth: 3, + borderColor: '#fff', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, .25)', + color: 'auto', + }, + }, + axisLine: { + lineStyle: { + width: 10, + color: [ + [0.25, 'rgba(36, 178, 118, 1)'], + [ + 0.4, + new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: 'rgba(66, 147, 255, 1)', + }, + { + offset: 1, + color: 'rgba(36, 178, 118, 1)', + }, + ]), + ], + [ + 0.5, + new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: 'rgba(250, 178, 71, 1)', + }, + { + offset: 1, + color: 'rgba(66, 147, 255, 1)', + }, + ]), + ], + [ + 1, + new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: 'rgba(250, 178, 71, 1)', + }, + { + offset: 1, + color: 'rgba(247, 111, 93, 1)', + }, + ]), + ], + ], + }, + }, + detail: { + show: false, + }, +}; diff --git a/src/views/link/DashBoard/index.vue b/src/views/link/DashBoard/index.vue new file mode 100644 index 00000000..010bafd0 --- /dev/null +++ b/src/views/link/DashBoard/index.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/src/views/link/Protocol/index.vue b/src/views/link/Protocol/index.vue index 03e34035..6a772dcb 100644 --- a/src/views/link/Protocol/index.vue +++ b/src/views/link/Protocol/index.vue @@ -159,7 +159,7 @@ import _ from 'lodash'; const tableRef = ref>({}); const params = ref>({}); - +const route = useRoute(); const visible = ref(false); const current = ref({}); @@ -276,6 +276,14 @@ const saveChange = (value: object) => { } }; +watch( + () => route.query?.save, + (value) => { + value === 'true' && handlAdd(); + }, + { deep: true, immediate: true }, +); + /** * 搜索 * @param params diff --git a/src/views/link/Type/Detail/index.vue b/src/views/link/Type/Detail/index.vue index 6150e5ae..c56ded01 100644 --- a/src/views/link/Type/Detail/index.vue +++ b/src/views/link/Type/Detail/index.vue @@ -1032,11 +1032,10 @@ import { Store } from 'jetlinks-store'; import MonacoEditor from '@/components/MonacoEditor/index.vue'; const route = useRoute(); -const view = route.query.view as string; +const NetworkType = route.query.type as string; +const view = NetworkType ? 'false' : (route.query.view as string); const id = route.params.id as string; - const activeKey = ref(['1']); - const loading = ref(false); const formRef1 = ref(); const formRef2 = ref(); @@ -1250,7 +1249,6 @@ watch( } }, { deep: true }, - // { deep: true, immediate: true }, ); watch( @@ -1263,7 +1261,6 @@ watch( updateClustersListIndex(); }, { deep: true }, - // { deep: true, immediate: true }, ); watch( () => dynamicValidateForm.cluster?.length, @@ -1272,6 +1269,17 @@ watch( }, { deep: true, immediate: true }, ); +watch( + () => NetworkType, + (value) => { + if (value) { + const { cluster } = dynamicValidateForm; + formData.value.type = value; + cluster[0].configuration.host = '0.0.0.0'; + } + }, + { deep: true, immediate: true }, +); diff --git a/src/views/media/Cascade/index.vue b/src/views/media/Cascade/index.vue new file mode 100644 index 00000000..21ac2e94 --- /dev/null +++ b/src/views/media/Cascade/index.vue @@ -0,0 +1,430 @@ + + + diff --git a/src/views/media/Cascade/typings.d.ts b/src/views/media/Cascade/typings.d.ts new file mode 100644 index 00000000..7d2f6fb8 --- /dev/null +++ b/src/views/media/Cascade/typings.d.ts @@ -0,0 +1,41 @@ +type BaseItem = { + id: string; + name: string; +}; + +type State = { + value: string; + text: string; +}; + +type SipConfig = { + catalogEach: number; + charset: string; + clusterNodeId: string; + domain: string; + firmware: string; + hostAndPort: string; + keepaliveInterval: number; + keepaliveTimeoutTimes: number; + localAddress: string; + localSipId: string; + manufacturer: string; + model: string; + name: string; + password: string; + port: number; + publicAddress: string; + publicPort: number; + sipId: string; + stackName: string; + transport: string; + user: string; +}; +export type CascadeItem = { + mediaServerId: string; + onlineStatus: State; + proxyStream: boolean; + sipConfigs: Partial[]; + status: State; + count?: number; +} & BaseItem; diff --git a/src/views/media/Device/Channel/Save.vue b/src/views/media/Device/Channel/Save.vue index 51762e16..3a6de43c 100644 --- a/src/views/media/Device/Channel/Save.vue +++ b/src/views/media/Device/Channel/Save.vue @@ -12,7 +12,18 @@ - + - + - + - - - - - - + + + + + + - + @@ -88,13 +128,18 @@ - - diff --git a/src/views/media/Device/Channel/index.vue b/src/views/media/Device/Channel/index.vue index 0e17cec7..a01bb5ae 100644 --- a/src/views/media/Device/Channel/index.vue +++ b/src/views/media/Device/Channel/index.vue @@ -1,3 +1,4 @@ + diff --git a/src/views/rule-engine/Scene/Save/components/TriggerWay.vue b/src/views/rule-engine/Scene/Save/components/TriggerWay.vue index 51d4aa5f..f0de0a66 100644 --- a/src/views/rule-engine/Scene/Save/components/TriggerWay.vue +++ b/src/views/rule-engine/Scene/Save/components/TriggerWay.vue @@ -28,7 +28,7 @@ type Emit = { const options = [ { value: 'device', label: '设备触发', tip: '适用于设备数据或行为满足触发条件时,执行指定的动作', image: getImage('/device-trigger.png') }, { value: 'manual', label: '手动触发', tip: '适用于第三方平台向物联网平台下发指令控制设备', image: getImage('/manual-trigger.png') }, - { value: 'timing', label: '定时触发', tip: '适用于定期执行固定任务', image: getImage('/timing-trigger.png') }, + { value: 'timer', label: '定时触发', tip: '适用于定期执行固定任务', image: getImage('/timing-trigger.png') }, ] const props = defineProps({ diff --git a/src/views/rule-engine/Scene/Save/save.vue b/src/views/rule-engine/Scene/Save/save.vue index ffb36c4f..59a041c8 100644 --- a/src/views/rule-engine/Scene/Save/save.vue +++ b/src/views/rule-engine/Scene/Save/save.vue @@ -66,6 +66,10 @@ const props = defineProps({ } }) +watchEffect(() => { + Object.assign(formModel, props.data) +}) + const emit = defineEmits() const title = computed(() => { diff --git a/src/views/rule-engine/Scene/SceneCard.vue b/src/views/rule-engine/Scene/SceneCard.vue new file mode 100644 index 00000000..a47d582c --- /dev/null +++ b/src/views/rule-engine/Scene/SceneCard.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/src/views/rule-engine/Scene/index.vue b/src/views/rule-engine/Scene/index.vue index e317f0ce..093f192c 100644 --- a/src/views/rule-engine/Scene/index.vue +++ b/src/views/rule-engine/Scene/index.vue @@ -1,68 +1,340 @@ \ 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 deleted file mode 100644 index 69283f0f..00000000 --- a/src/views/system/Apply/Api/components/ApiDoes.vue +++ /dev/null @@ -1,380 +0,0 @@ - - - - - diff --git a/src/views/system/Apply/Api/components/ApiTest.vue b/src/views/system/Apply/Api/components/ApiTest.vue deleted file mode 100644 index 58241d93..00000000 --- a/src/views/system/Apply/Api/components/ApiTest.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - - - diff --git a/src/views/system/Apply/Api/components/ChooseApi.vue b/src/views/system/Apply/Api/components/ChooseApi.vue deleted file mode 100644 index dbf13a39..00000000 --- a/src/views/system/Apply/Api/components/ChooseApi.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/src/views/system/Apply/Api/components/InputCard.vue b/src/views/system/Apply/Api/components/InputCard.vue deleted file mode 100644 index c1742737..00000000 --- a/src/views/system/Apply/Api/components/InputCard.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/src/views/system/Apply/Api/components/LeftTree.vue b/src/views/system/Apply/Api/components/LeftTree.vue deleted file mode 100644 index b4b6e4f3..00000000 --- a/src/views/system/Apply/Api/components/LeftTree.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/src/views/system/Apply/Api/index.vue b/src/views/system/Apply/Api/index.vue index 95ab2522..f42c9b7c 100644 --- a/src/views/system/Apply/Api/index.vue +++ b/src/views/system/Apply/Api/index.vue @@ -1,95 +1,12 @@ - + diff --git a/src/views/system/Apply/Api/typing.d.ts b/src/views/system/Apply/Api/typing.d.ts deleted file mode 100644 index 7937398b..00000000 --- a/src/views/system/Apply/Api/typing.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -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; -} \ No newline at end of file diff --git a/src/views/system/Apply/Save/components/EditForm.vue b/src/views/system/Apply/Save/components/EditForm.vue index 2e0be394..1146df17 100644 --- a/src/views/system/Apply/Save/components/EditForm.vue +++ b/src/views/system/Apply/Save/components/EditForm.vue @@ -1022,9 +1022,9 @@ .logoUrl " alt="avatar" - width="100%" + style="width: 150px;" /> -
+
+ + + + + + + diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index d5b557f9..967e61de 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -1,5 +1,5 @@