diff --git a/package.json b/package.json index 7174015a..78feb7a7 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "unplugin-vue-components": "^0.22.12", "vite-plugin-monaco-editor": "^1.1.0", "vue": "^3.2.45", + "vue-json-viewer": "^3.0.4", "vue-router": "^4.1.6", "vue3-markdown-it": "^1.0.10", "vue3-ts-jsoneditor": "^2.7.1" diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 2ea8aef8..5148bca8 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -466,4 +466,20 @@ export const saveEdgeMap = (deviceId: string, data?: any) => server.post(`/edge/ * @param params * @returns */ -export const getPropertyData = (deviceId: string, params: Record) => server.get(`/device-instance/${deviceId}/properties/_query`, params) \ No newline at end of file +export const getPropertyData = (deviceId: string, params: Record) => server.get(`/device-instance/${deviceId}/properties/_query`, params) + +/** + * 聚合查询设备属性 + * @param deviceId + * @param data + * @returns + */ +export const getPropertiesInfo = (deviceId: string, data: Record) => server.post(`/device-instance/${deviceId}/agg/_query`, data) + +/** + * 聚合查询设备属性 + * @param deviceId + * @param data + * @returns + */ +export const getPropertiesList = (deviceId: string, property: string, data: Record) => server.post(`/device-instance/${deviceId}/property/${property}/_query`, data) \ No newline at end of file diff --git a/src/api/notice/config.ts b/src/api/notice/config.ts index bbb21c3d..467455d6 100644 --- a/src/api/notice/config.ts +++ b/src/api/notice/config.ts @@ -16,21 +16,21 @@ export default { debug: (data: any, configId: string, templateId: string) => post(`/notifier/${configId}/${templateId}/_send`, data), getHistory: (data: any, id: string) => post(`/notify/history/config/${id}/_query`, data), // 获取所有平台用户 - getPlatformUsers: () => post(`/user/_query/no-paging`, { paging: false }), + getPlatformUsers: (data: any) => post(`/user/_query/no-paging`, data), // 钉钉部门 dingTalkDept: (id: string) => get(`/notifier/dingtalk/corp/${id}/departments/tree`), // 钉钉部门人员 - getDingTalkUsers: (configId: string, deptId: string) => get(`/notifier/dingtalk/corp/${configId}/${deptId}/users`), + getDingTalkUsers: (configId: string, deptId: string) => get(`/notifier/dingtalk/corp/${configId}/${deptId}/users`), // 钉钉已经绑定的人员 - getDingTalkBindUsers: (id: string) => get(`/user/third-party/dingTalk_dingTalkMessage/${id}`), + getDingTalkBindUsers: (id: string) => get(`/user/third-party/dingTalk_dingTalkMessage/${id}`), // 钉钉绑定用户 - dingTalkBindUser: (data: any, id: string) => patch(`/user/third-party/dingTalk_dingTalkMessage/${id}`, data), + dingTalkBindUser: (data: { userId: string; providerName: string; thirdPartyUserId: string }[], id: string) => patch(`/user/third-party/dingTalk_dingTalkMessage/${id}`, data), // 微信部门 weChatDept: (id: string) => get(`/notifier/wechat/corp/${id}/departments`), // 微信部门人员 - getWeChatUsers: (configId: string, deptId: string) => get(`/notifier/wechat/corp/${configId}/${deptId}/users`), + getWeChatUsers: (configId: string, deptId: string) => get(`/notifier/wechat/corp/${configId}/${deptId}/users`), // 微信已经绑定的人员 - getWeChatBindUsers: (id: string) => get(`/user/third-party/weixin_corpMessage/${id}`), + getWeChatBindUsers: (id: string) => get(`/user/third-party/weixin_corpMessage/${id}`), // 微信绑定用户 weChatBindUser: (data: any, id: string) => patch(`/user/third-party/weixin_corpMessage/${id}`, data), // 解绑 diff --git a/src/api/rule-engine/configuration.ts b/src/api/rule-engine/configuration.ts index 08017c2e..1d31bcef 100644 --- a/src/api/rule-engine/configuration.ts +++ b/src/api/rule-engine/configuration.ts @@ -18,4 +18,20 @@ export const remove = (id:string) => server.remove(`/alarm/config/${id}`); /** * 手动触发告警 */ -export const _execute = (data:any) => server.post('/scene/batch/_execute',data) \ No newline at end of file +export const _execute = (data:any) => server.post('/scene/batch/_execute',data); +/** + * 下拉框场景数据 + */ +export const getScene = (params:Record) => server.get('/scene/_query/no-paging?paging=false',params); +/** + * 获取配置类型 + */ +export const getTargetTypes = () => server.get('/alarm/config/target-type/supports'); +/** + * 保存基本设置 + */ +export const save = (data:any) =>server.post('/alarm/config',data); +/** + * 获取基础设置数据 + */ +export const detail = (id:string) => server.get(`/alarm/config/${id}`); \ No newline at end of file diff --git a/src/api/rule-engine/scene.ts b/src/api/rule-engine/scene.ts index 28cd4b71..0ae3e8dd 100644 --- a/src/api/rule-engine/scene.ts +++ b/src/api/rule-engine/scene.ts @@ -5,4 +5,6 @@ export const modify = (id: string, data: any) => server.put(`/scene/${id}`, data export const save = (data: any) => server.post(`/scene`, data) -export const detail = (id: string) => server.get(`/scene/${id}`) \ No newline at end of file +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 diff --git a/src/api/system/apply.ts b/src/api/system/apply.ts index f1e30331..9bf97443 100644 --- a/src/api/system/apply.ts +++ b/src/api/system/apply.ts @@ -7,3 +7,14 @@ export const getApplyList_api = (data: any) => server.post(`/application/_query/ export const changeApplyStatus_api = (id:string,data: any) => server.put(`/application/${id}`, data) // 删除应用 export const delApply_api = (id:string) => server.remove(`/application/${id}`) + + + +// 获取组织列表 +export const getDepartmentList_api = () => server.get(`/organization/_all/tree`); +// 获取组织列表 +export const getAppInfo_api = (id:string) => server.get(`/application/${id}`); +// 新增应用 +export const addApp_api = (data:object) => server.post(`/application`, data); +// 更新应用 +export const updateApp_api = (id:string, data:object) => server.put(`/application/${id}`, data); \ No newline at end of file diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index b0b2bf94..14d4af0f 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -98,7 +98,11 @@ const props = defineProps({ class: { type: String, default: '' - } + }, + // defaultTerms: { + // type: Object, + // default: () => ({}) + // } }) const searchRef = ref(null) @@ -223,6 +227,7 @@ const handleParamsFormat = () => { */ const searchSubmit = () => { emit('search', handleParamsFormat()) + console.log('searchSubmit') if (props.type === 'advanced') { addUrlParams() } diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index e3c69329..ff88911e 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -144,6 +144,10 @@ const JTable = defineComponent({ pageSize: 12 } } + }, + scroll: { + type: Object, + default: () => { x: 1366 } } } as any, setup(props: JTableProps, { slots, emit, expose }) { @@ -260,7 +264,7 @@ const JTable = defineComponent({ /** * 导出方法 */ - expose({ reload }) + expose({ reload, _dataSource }) return () =>
@@ -331,7 +335,7 @@ const JTable = defineComponent({ pagination={false} rowKey="id" rowSelection={props.rowSelection} - scroll={{ x: 1366 }} + scroll={props.scroll} v-slots={{ bodyCell: (dt: Record) => { const { column, record } = dt; diff --git a/src/store/menu.ts b/src/store/menu.ts index 44c0d9fe..49445fb8 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -4,6 +4,8 @@ import { filterAsnycRouter, MenuItem } from '@/utils/menu' import { isArray } from 'lodash-es' import { usePermissionStore } from './permission' import router from '@/router' +import { message } from 'ant-design-vue' +import { onlyMessage } from '@/utils/comm' const defaultOwnParams = [ { @@ -77,6 +79,7 @@ export const useMenuStore = defineStore({ name, params, query }) } else { + onlyMessage('暂无权限,请联系管理员', 'error') console.warn(`没有找到对应的页面: ${name}`) } }, diff --git a/src/store/scene.ts b/src/store/scene.ts index b5c9dc5f..c25514b2 100644 --- a/src/store/scene.ts +++ b/src/store/scene.ts @@ -68,7 +68,7 @@ const defaultOptions = { }; export const useSceneStore = defineStore('scene', () => { - const data = reactive({ + const data = reactive({ trigger: { type: ''}, options: defaultOptions, branches: defaultBranches, @@ -116,67 +116,3 @@ export const useSceneStore = defineStore('scene', () => { getDetail } }) -// -// export const useSceneStore = defineStore({ -// id: 'scene', -// state: (): DataType => { -// return { -// data: { -// trigger: { type: ''}, -// options: defaultOptions, -// branches: defaultBranches, -// description: '' -// }, -// productCache: {} -// } -// }, -// actions: { -// /** -// * 初始化数据 -// */ -// initData() { -// -// }, -// /** -// * 获取详情 -// * @param id -// */ -// async getDetail(id: string) { -// const resp = await detail(id) -// if (resp.success) { -// const result = resp.result as SceneItem -// const triggerType = result.triggerType -// let branches: any[] = result.branches -// -// if (!branches) { -// branches = cloneDeep(defaultBranches) -// if (triggerType === 'device') { -// branches.push(null) -// } -// } else { -// const branchesLength = branches.length; -// if ( -// triggerType === 'device' && -// ((branchesLength === 1 && !!branches[0]?.when?.length) || // 有一组数据并且when有值 -// (branchesLength > 1 && !branches[branchesLength - 1]?.when?.length)) // 有多组否则数据,并且最后一组when有值 -// ) { -// branches.push(null); -// } -// } -// -// this.data = { -// ...result, -// trigger: result.trigger || {}, -// branches: cloneDeep(assignmentKey(branches)), -// options: {...defaultOptions, ...result.options }, -// } -// } -// }, -// getProduct() { -// -// } -// }, -// getters: { -// -// } -// }) \ No newline at end of file diff --git a/src/utils/regular.ts b/src/utils/regular.ts index 7e7fa9cc..c98f5d64 100644 --- a/src/utils/regular.ts +++ b/src/utils/regular.ts @@ -7,4 +7,12 @@ export const isUrl = (path: string): boolean => urlReg.test(path) export const inputReg = /^[a-zA-Z0-9_\-]+$/ -export const isInput = (value: string) => inputReg.test(value) \ No newline at end of file +export const isInput = (value: string) => inputReg.test(value) + +// cron 表达式 + +export const CronRegEx = new RegExp( + '^\\s*($|#|\\w+\\s*=|(\\?|\\*|(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?(?:,(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?)*)\\s+(\\?|\\*|(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?(?:,(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?)*)\\s+(\\?|\\*|(?:[01]?\\d|2[0-3])(?:(?:-|\\/|\\,)(?:[01]?\\d|2[0-3]))?(?:,(?:[01]?\\d|2[0-3])(?:(?:-|\\/|\\,)(?:[01]?\\d|2[0-3]))?)*)\\s+(\\?|\\*|(?:0?[1-9]|[12]\\d|3[01])(?:(?:-|\\/|\\,)(?:0?[1-9]|[12]\\d|3[01]))?(?:,(?:0?[1-9]|[12]\\d|3[01])(?:(?:-|\\/|\\,)(?:0?[1-9]|[12]\\d|3[01]))?)*)\\s+(\\?|\\*|(?:[1-9]|1[012])(?:(?:-|\\/|\\,)(?:[1-9]|1[012]))?(?:L|W)?(?:,(?:[1-9]|1[012])(?:(?:-|\\/|\\,)(?:[1-9]|1[012]))?(?:L|W)?)*|\\?|\\*|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:-)(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?(?:,(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:-)(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?)*)\\s+(\\?|\\*|(?:[0-6])(?:(?:-|\\/|\\,|#)(?:[0-6]))?(?:L)?(?:,(?:[0-6])(?:(?:-|\\/|\\,|#)(?:[0-6]))?(?:L)?)*|\\?|\\*|(?:MON|TUE|WED|THU|FRI|SAT|SUN)(?:(?:-)(?:MON|TUE|WED|THU|FRI|SAT|SUN))?(?:,(?:MON|TUE|WED|THU|FRI|SAT|SUN)(?:(?:-)(?:MON|TUE|WED|THU|FRI|SAT|SUN))?)*)(|\\s)+(\\?|\\*|(?:|\\d{4})(?:(?:-|\\/|\\,)(?:|\\d{4}))?(?:,(?:|\\d{4})(?:(?:-|\\/|\\,)(?:|\\d{4}))?)*))$', +); + +export const isCron = (value: string) => CronRegEx.test(value) \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Diagnose/Status/ManualInspection.tsx b/src/views/device/Instance/Detail/Diagnose/Status/ManualInspection.tsx index 5482befe..6bec31e0 100644 --- a/src/views/device/Instance/Detail/Diagnose/Status/ManualInspection.tsx +++ b/src/views/device/Instance/Detail/Diagnose/Status/ManualInspection.tsx @@ -1,4 +1,6 @@ import AIcon from "@/components/AIcon"; +import { useInstanceStore } from "@/store/instance"; +import { useMenuStore } from "@/store/menu"; import { Button, Descriptions, Modal } from "ant-design-vue" import styles from './index.module.less' @@ -14,6 +16,10 @@ const ManualInspection = defineComponent({ const { data } = props + const instanceStore = useInstanceStore(); + + const menuStory = useMenuStore(); + const dataRender = () => { if (data.type === 'device' || data.type === 'product') { return ( @@ -207,7 +213,13 @@ const ManualInspection = defineComponent({ emit('save', data) }} onCancel={() => { - // TODO 跳转设备和产品 + if (data.type === 'device') { + instanceStore.tabActiveKey = 'Info' + } else if (data.type === 'product') { + menuStory.jumpPage('device/Product/Detail', { id: data.productId, tab: 'access' }); + } else { + menuStory.jumpPage('link/AccessConfig/Detail', { id: data.configuration?.id }); + } }}>
{dataRender()}
diff --git a/src/views/device/Instance/Detail/Diagnose/Status/index.tsx b/src/views/device/Instance/Detail/Diagnose/Status/index.tsx index f075aea9..3dbc27d2 100644 --- a/src/views/device/Instance/Detail/Diagnose/Status/index.tsx +++ b/src/views/device/Instance/Detail/Diagnose/Status/index.tsx @@ -11,6 +11,8 @@ import _ from "lodash" import DiagnosticAdvice from './DiagnosticAdvice' import ManualInspection from './ManualInspection' import { deployDevice } from "@/api/initHome" +import PermissionButton from '@/components/PermissionButton/index.vue' +import { useMenuStore } from "@/store/menu" type TypeProps = 'network' | 'child-device' | 'media' | 'cloud' | 'channel' @@ -41,6 +43,7 @@ const Status = defineComponent({ const diagnoseData = ref>>() const bindParentVisible = ref(false) + const menuStory = useMenuStore(); const configuration = reactive<{ product: Record, @@ -57,19 +60,8 @@ const Status = defineComponent({ artificialData.value = params } - // TODO const jumpAccessConfig = () => { - // const purl = getMenuPathByCode(MENUS_CODE['device/Product/Detail']); - // if (purl) { - // history.push( - // `${getMenuPathByParams(MENUS_CODE['device/Product/Detail'], device.productId)}`, - // { - // tab: 'access', - // }, - // ); - // } else { - // message.error('规则可能有加密处理,请联系管理员'); - // } + menuStory.jumpPage('device/Product/Detail', { id: unref(device).productId, tab: 'access' }); }; const jumpDeviceConfig = () => { @@ -123,34 +115,40 @@ const Status = defineComponent({ 网络组件已禁用,请先 { - const res = await startNetwork( - unref(gateway)?.channelId, - ); - if (res.status === 200) { - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'network', - name: '网络组件', - desc: '诊断网络组件配置是否正确,配置错误将导致设备连接失败', - status: 'success', - text: '正常', - info: null, - }, - ); - } - }} - > - - + 网络组件已禁用,请先 + { + const res = await startNetwork( + unref(gateway)?.channelId, + ); + if (res.status === 200) { + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'network', + name: '网络组件', + desc: '诊断网络组件配置是否正确,配置错误将导致设备连接失败', + status: 'success', + text: '正常', + info: null, + }, + ); + } + } + }} + > + 启用 + + } />
- + ) : (
@@ -287,28 +285,31 @@ const Status = defineComponent({ 设备接入网关已禁用,请先 - { - const resp = await startGateway(unref(device).accessId || ''); - if (resp.status === 200) { - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'gateway', - name: '设备接入网关', - desc: desc, - status: 'success', - text: '正常', - info: null, - }, - ); + { + const resp = await startGateway(unref(device).accessId || ''); + if (resp.status === 200) { + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'gateway', + name: '设备接入网关', + desc: desc, + status: 'success', + text: '正常', + info: null, + }, + ); + } } }} > - - + 启用 + } />
@@ -411,28 +412,32 @@ const Status = defineComponent({ status="default" text={ - 设备接入网关已禁用,请先 { - const resp = await startGateway(unref(device).accessId || ''); - if (resp.status === 200) { - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'gateway', - name: '设备接入网关', - desc: desc, - status: 'success', - text: '正常', - info: null, - }, - ); + 设备接入网关已禁用,请先 + { + const resp = await startGateway(unref(device).accessId || ''); + if (resp.status === 200) { + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'gateway', + name: '设备接入网关', + desc: desc, + status: 'success', + text: '正常', + info: null, + }, + ); + } } }} > - - + 启用 + } /> @@ -519,28 +524,32 @@ const Status = defineComponent({ status="default" text={ - 网关父设备已禁用,请先 { - const resp = await _deploy(response?.result?.id || ''); - if (resp.status === 200) { - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'parent-device', - name: '网关父设备', - desc: '诊断网关父设备状态是否正常,禁用或离线将导致连接失败', - status: 'success', - text: '正常', - info: null, - }, - ); + 网关父设备已禁用,请先 + { + const resp = await _deploy(response?.result?.id || ''); + if (resp.status === 200) { + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'parent-device', + name: '网关父设备', + desc: '诊断网关父设备状态是否正常,禁用或离线将导致连接失败', + status: 'success', + text: '正常', + info: null, + }, + ); + } } }} > - - + 启用 + } /> @@ -623,28 +632,32 @@ const Status = defineComponent({ status="default" text={ - 产品已禁用,请 { - const resp = await _deployProduct(unref(device).productId || ''); - if (resp.status === 200) { - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'product', - name: '产品状态', - desc: '诊断产品状态是否正常,禁用状态将导致设备连接失败', - status: 'success', - text: '正常', - info: null, - }, - ); + 产品已禁用,请 + { + const resp = await _deployProduct(unref(device).productId || ''); + if (resp.status === 200) { + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'product', + name: '产品状态', + desc: '诊断产品状态是否正常,禁用状态将导致设备连接失败', + status: 'success', + text: '正常', + info: null, + }, + ); + } } }} > - - + 启用 + 产品 } @@ -695,29 +708,34 @@ const Status = defineComponent({ status="default" text={ - 设备已禁用,请 { - const resp = await _deploy(unref(device)?.id || ''); - if (resp.status === 200) { - instanceStore.current.state = { value: 'offline', text: '离线' } - message.success('操作成功!'); - list.value = modifyArrayList( - list.value, - { - key: 'device', - name: '设备状态', - desc: '诊断设备状态是否正常,禁用状态将导致设备连接失败', - status: 'success', - text: '正常', - info: null, - }, - ); + 设备已禁用,请 + { + const resp = await _deploy(unref(device)?.id || ''); + if (resp.status === 200) { + instanceStore.current.state = { value: 'offline', text: '离线' } + message.success('操作成功!'); + list.value = modifyArrayList( + list.value, + { + key: 'device', + name: '设备状态', + desc: '诊断设备状态是否正常,禁用状态将导致设备连接失败', + status: 'success', + text: '正常', + info: null, + }, + ); + } } }} > - - 设备 + 启用 + + 设备 } /> diff --git a/src/views/device/Instance/Detail/Running/Event/index.vue b/src/views/device/Instance/Detail/Running/Event/index.vue index ec35af49..a9e169ad 100644 --- a/src/views/device/Instance/Detail/Running/Event/index.vue +++ b/src/views/device/Instance/Detail/Running/Event/index.vue @@ -5,7 +5,7 @@ :columns="columns" :request="_getEventList" model="TABLE" - :bodyStyle="{padding: '0 24px'}" + :bodyStyle="{ padding: '0 24px' }" > \ 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 index db5458d2..e0656cec 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/AMap.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/AMap.vue @@ -1,3 +1,54 @@ + \ No newline at end of file +
+
+
+ + 开始动画 + 停止动画 + +
+
+ +
+ + + + + diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/Chart.vue b/src/views/device/Instance/Detail/Running/Property/Detail/Chart.vue new file mode 100644 index 00000000..9c5a4031 --- /dev/null +++ b/src/views/device/Instance/Detail/Running/Property/Detail/Chart.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue index f54b82c5..57c25647 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue @@ -1,3 +1,218 @@ \ No newline at end of file + +
+ +
+ 统计周期: + + 实际值 + 按分钟统计 + 按小时统计 + 按天统计 + 按周统计 + 按月统计 + +
+
+ 统计规则: + + 平均值 + 最大值 + 最小值 + 总数 + +
+
+
+
+ + +
+
+ + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue b/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue new file mode 100644 index 00000000..b7860f91 --- /dev/null +++ b/src/views/device/Instance/Detail/Running/Property/Detail/PropertyAMap.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/Property/Detail/Table.vue b/src/views/device/Instance/Detail/Running/Property/Detail/Table.vue index bc945471..83bba809 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/Table.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/Table.vue @@ -18,6 +18,13 @@ +
+ +
自定义属性
+ + + +
\ No newline at end of file + + + \ No newline at end of file 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 6ba7173e..6bdb9c4b 100644 --- a/src/views/device/Instance/Detail/Running/Property/Detail/index.vue +++ b/src/views/device/Instance/Detail/Running/Property/Detail/index.vue @@ -2,15 +2,15 @@
- + - + - - + + @@ -21,7 +21,7 @@ import type { Dayjs } from 'dayjs'; import TimeComponent from './TimeComponent.vue' import Charts from './Charts.vue' -import AMap from './AMap.vue' +import PropertyAMap from './PropertyAMap.vue' import Table from './Table.vue' const props = defineProps({ diff --git a/src/views/device/Instance/Detail/Running/Property/PropertyCard.vue b/src/views/device/Instance/Detail/Running/Property/PropertyCard.vue index 220765b2..8ad0c5ef 100644 --- a/src/views/device/Instance/Detail/Running/Property/PropertyCard.vue +++ b/src/views/device/Instance/Detail/Running/Property/PropertyCard.vue @@ -1,15 +1,15 @@ diff --git a/src/views/media/Device/Channel/index.vue b/src/views/media/Device/Channel/index.vue new file mode 100644 index 00000000..4ef66e6d --- /dev/null +++ b/src/views/media/Device/Channel/index.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/src/views/media/Device/Channel/typings.d.ts b/src/views/media/Device/Channel/typings.d.ts new file mode 100644 index 00000000..09d659aa --- /dev/null +++ b/src/views/media/Device/Channel/typings.d.ts @@ -0,0 +1,114 @@ +export type CatalogItemType = { + district?: string; + device?: string; + platform?: string; + user?: string; + platform_outer?: string; + ext?: string; +}; + +export interface CatalogItem { + id: string; + channelId: string; + deviceId: string; + name: string; + type: CatalogItemType; + createTime: number; + modifyTime: number; + children?: CatalogItem[]; +} + +export type ChannelStatusType = + | 'online' + | 'lost' + | 'defect' + | 'add' + | 'delete' + | 'update' + | 'offline'; + +export type PtzType = 'unknown' | 'ball' | 'hemisphere' | 'fixed' | 'remoteControl'; + +export type CatalogType = keyof CatalogItemType; + +export type ChannelType = + | 'dv_no_storage' + | 'dv_has_storage' + | 'dv_decoder' + | 'networking_monitor_server' + | 'media_proxy' + | 'web_access_server' + | 'video_management_server' + | 'network_matrix' + | 'network_controller' + | 'network_alarm_machine' + | 'dvr' + | 'video_server' + | 'encoder' + | 'decoder' + | 'video_switching_matrix' + | 'audio_switching_matrix' + | 'alarm_controller' + | 'nvr' + | 'hvr' + | 'camera' + | 'ipc' + | 'display' + | 'alarm_input' + | 'alarm_output' + | 'audio_input' + | 'audio_output' + | 'mobile_trans' + | 'other_outer' + | 'center_server' + | 'web_server' + | 'media_dispatcher' + | 'proxy_server' + | 'secure_server' + | 'alarm_server' + | 'database_server' + | 'gis_server' + | 'management_server' + | 'gateway_server' + | 'media_storage_server' + | 'signaling_secure_gateway' + | 'business_group' + | 'virtual_group' + | 'center_user' + | 'end_user' + | 'media_iap' + | 'media_ops' + | 'district' + | 'other'; + +export interface ChannelItem { + id: string; + deviceId: string; + deviceName: string; + channelId: string; + name: string; + manufacturer: string; + model: string; + address: string; + provider: string; + status: { + value: string; + text: string; + }; + others: object; + description: string; + parentChannelId: string; + subCount: integer; + civilCode: string; + ptzType: PtzType; + catalogType: CatalogType; + channelType: ChannelType; + catalogCode: string; + longitude: number; + latitude: number; + createTime: number; + modifyTime: number; + parentId: string; + gb28181ProxyStream: boolean; + gb28181ChannelId: string; +} diff --git a/src/views/media/Device/Save/index.vue b/src/views/media/Device/Save/index.vue index 760a4216..5f5e3397 100644 --- a/src/views/media/Device/Save/index.vue +++ b/src/views/media/Device/Save/index.vue @@ -51,7 +51,7 @@ v-bind="validateInfos.productId" > - + - + - + 保存 @@ -356,6 +355,8 @@ const getDetail = async () => { // formData.value = res.result; Object.assign(formData.value, res.result); formData.value.channel = res.result.provider; + + console.log('formData.value: ', formData.value); }; onMounted(() => { @@ -367,6 +368,7 @@ onMounted(() => { */ const btnLoading = ref(false); const handleSubmit = () => { + // console.log('formData.value: ', formData.value); validate() .then(async () => { btnLoading.value = true; diff --git a/src/views/media/Device/index.vue b/src/views/media/Device/index.vue index 39ad6b8c..bfdb016a 100644 --- a/src/views/media/Device/index.vue +++ b/src/views/media/Device/index.vue @@ -261,9 +261,13 @@ const getActions = ( }, icon: 'EditOutlined', onClick: () => { - menuStory.jumpPage('media/Device/Save', { - id: data.id, - }); + menuStory.jumpPage( + 'media/Device/Save', + {}, + { + id: data.id, + }, + ); }, }, { @@ -277,10 +281,14 @@ const getActions = ( // router.push( // `/media/device/Channel?id=${data.id}&type=${data.provider}`, // ); - menuStory.jumpPage('media/Device/Channel', { - id: data.id, - type: data.provider, - }); + menuStory.jumpPage( + 'media/Device/Channel', + {}, + { + id: data.id, + type: data.provider, + }, + ); }, }, { diff --git a/src/views/notice/Config/Detail/index.vue b/src/views/notice/Config/Detail/index.vue index 293cb17a..88a92a1e 100644 --- a/src/views/notice/Config/Detail/index.vue +++ b/src/views/notice/Config/Detail/index.vue @@ -333,23 +333,9 @@ watch( msgType.value = MSG_TYPE[val]; formData.value.provider = - formData.value.provider !== ':id' + route.params.id !== ':id' ? formData.value.provider : msgType.value[0].value; - - // formData.value.configuration = - // CONFIG_FIELD_MAP[val][formData.value.provider]; - - // clearValid(); - }, -); - -watch( - () => formData.value.provider, - (val) => { - // formData.value.configuration = - // CONFIG_FIELD_MAP[formData.value.type][val]; - // clearValid(); }, ); @@ -421,12 +407,6 @@ const { resetFields, validate, validateInfos, clearValidate } = useForm( formRules.value, ); -const clearValid = () => { - setTimeout(() => { - clearValidate(); - }, 200); -}; - const getDetail = async () => { if (route.params.id === ':id') return; const res = await configApi.detail(route.params.id as string); @@ -444,7 +424,7 @@ const handleTypeChange = () => { setTimeout(() => { formData.value.configuration = CONFIG_FIELD_MAP[formData.value.type][formData.value.provider]; - // resetPublicFiles(); + resetPublicFiles(); }, 0); }; @@ -454,7 +434,48 @@ const handleTypeChange = () => { const handleProviderChange = () => { formData.value.configuration = CONFIG_FIELD_MAP[formData.value.type][formData.value.provider]; - // resetPublicFiles(); + resetPublicFiles(); +}; + +/** + * 重置字段值 + */ +const resetPublicFiles = () => { + switch (formData.value.provider) { + case 'dingTalkMessage': + formData.value.configuration.appKey = ''; + formData.value.configuration.appSecret = ''; + break; + case 'dingTalkRobotWebHook': + formData.value.configuration.url = ''; + break; + case 'corpMessage': + formData.value.configuration.corpId = ''; + formData.value.configuration.corpSecret = ''; + break; + case 'embedded': + formData.value.configuration.host = ''; + formData.value.configuration.port = 25; + formData.value.configuration.ssl = false; + formData.value.configuration.sender = ''; + formData.value.configuration.username = ''; + formData.value.configuration.password = ''; + break; + case 'aliyun': + formData.value.configuration.regionId = ''; + formData.value.configuration.accessKeyId = ''; + formData.value.configuration.secret = ''; + break; + case 'aliyunSms': + formData.value.configuration.regionId = ''; + formData.value.configuration.accessKeyId = ''; + formData.value.configuration.secret = ''; + break; + case 'http': + formData.value.configuration.url = undefined; + formData.value.configuration.headers = []; + break; + } }; /** diff --git a/src/views/notice/Config/SyncUser/index.vue b/src/views/notice/Config/SyncUser/index.vue index 1fc23686..cd985723 100644 --- a/src/views/notice/Config/SyncUser/index.vue +++ b/src/views/notice/Config/SyncUser/index.vue @@ -7,7 +7,7 @@ @cancel="_vis = false" width="80%" > - +