diff --git a/package.json b/package.json index 54eea6b5..387d6753 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "0.0.0", "scripts": { "dev": "vite --mode develop", + "dev:force": "vite --force --mode develop", "build": "node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build", "preview": "vite preview", "eslint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", @@ -23,7 +24,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.0", + "jetlinks-ui-components": "^1.0.1", "js-cookie": "^3.0.1", "less": "^4.1.3", "less-loader": "^11.1.0", @@ -42,7 +43,8 @@ "vue-router": "^4.1.6", "vue3-json-viewer": "^2.2.2", "vue3-markdown-it": "^1.0.10", - "vue3-ts-jsoneditor": "^2.7.1" + "vue3-ts-jsoneditor": "^2.7.1", + "vue3-video-play": "^1.3.1-beta.6" }, "devDependencies": { "@commitlint/cli": "^17.4.1", diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 4e6f07c4..db7583ec 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -85,6 +85,7 @@ export const batchDeleteDevice = (data: string[]) => server.put(`/device-instanc */ export const deviceTemplateDownload = (productId: string, type: string) => `${BASE_API_PATH}/device-instance/${productId}/template.${type}` +export const templateDownload = (productId: string, type: string) => server.get(`/device-instance/${productId}/template.${type}`,{},{responseType: 'blob'}) /** * 设备导入 * @param productId 产品id diff --git a/src/api/iot-card/cardManagement.ts b/src/api/iot-card/cardManagement.ts index 4c038b9f..4b7441bc 100644 --- a/src/api/iot-card/cardManagement.ts +++ b/src/api/iot-card/cardManagement.ts @@ -99,6 +99,12 @@ export const _import = (configId: any, params: any) => server.get(`/network/card */ export const _export = (format: string, data: any) => server.post(`/network/card/download.${format}/_query`, data, { responseType: 'blob' }); +/** + * 下载模板 + * @param format 类型 xlsx、csv + */ +export const exportCard = (format: string) => server.get(`/network/card/template.${format}`,{},{responseType: 'blob'}); + /** * 验证iccid * @param id diff --git a/src/api/media/cascade.ts b/src/api/media/cascade.ts index 77e0b5ac..c8ba0a56 100644 --- a/src/api/media/cascade.ts +++ b/src/api/media/cascade.ts @@ -36,5 +36,7 @@ export default { updateGbChannelId: (id: string, data: any): any => server.put(`/media/gb28181-cascade/binding/${id}`, data), // 查询通道分页列表 queryChannelList: (data: any): any => server.post(`media/channel/_query`, data), + // 推送 + publish: (id: string, params: any) => server.get(`/media/gb28181-cascade/${id}/bindings/publish`, params) } \ No newline at end of file diff --git a/src/api/media/channel.ts b/src/api/media/channel.ts index da64173a..027faf8c 100644 --- a/src/api/media/channel.ts +++ b/src/api/media/channel.ts @@ -1,4 +1,6 @@ -import server from '@/utils/request' +import server from '@/utils/request'; +import { LocalStore } from '@/utils/comm'; +import { TOKEN_KEY } from '@/utils/variable'; export default { // 列表 @@ -12,5 +14,54 @@ export default { // 修改 update: (id: string, data: any) => server.put(`/media/channel/${id}`, data), // 删除 - del: (id: string) => server.remove(`media/channel/${id}`), + del: (id: string) => server.remove(`/media/channel/${id}`), + + // ========== 视频播放 ========== + // 开始直播 + ptzStart: (deviceId: string, channelId: string, type: string) => + `/media/device/${deviceId}/${channelId}/live.${type}?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`, + + // 云台控制-停止 + ptzStop: (deviceId: string, channelId: string) => server.post(`/media/device/${deviceId}/${channelId}/_ptz/STOP`), + + // 云台控制-缩放、转向等 + ptzTool: (deviceId: string, channelId: string, direct: string, speed: number = 90) => + server.post(`/media/device/${deviceId}/${channelId}/_ptz/${direct}/${speed}`), + + // 重置 + mediaStop: (deviceId: string, channelId: string) => server.post(`/media/device/${deviceId}/${channelId}/_stop`), + + // 查询是否正在录像 + ptzIsRecord: (deviceId: string, channelId: string) => server.get(`/media/device/${deviceId}/${channelId}/live/recording`), + + // 开始录像 + recordStart: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/_record`, data), + + // 停止录像 + recordStop: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/_stop-record`, data), + + // 查询本地回放记录 + queryRecordLocal: (deviceId: string, channelId: string, data: any) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-local`, data), + + // 播放本地回放 + playbackLocal: (deviceId: string, channelId: string, suffix: string) => + server.get(`/media/device/${deviceId}/${channelId}/playback.${suffix}`), + + // 本地录像播放控制 + playbackControl: (deviceId: string, channelId: string) => + server.post(`/media/device/${deviceId}/${channelId}/stream-control`), + + // 查询云端回放记录 + recordsInServer: (deviceId: string, channelId: string) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-server`), + + // 查询云端回放文件信息 + recordsInServerFiles: (deviceId: string, channelId: string) => + server.post(`/media/device/${deviceId}/${channelId}/records/in-server/files`), + + // 播放云端回放 + playbackStart: (recordId: string) => server.get(`/media/record/${recordId}.mp4`), } \ No newline at end of file diff --git a/src/api/rule-engine/log.ts b/src/api/rule-engine/log.ts index 77cc3dbe..cd9530c1 100644 --- a/src/api/rule-engine/log.ts +++ b/src/api/rule-engine/log.ts @@ -23,4 +23,19 @@ export const query = (data:any) => server.post('/alarm/record/_query/',data); /** * 告警处理 */ -export const handleLog = (data:any) => server.post('/alarm/record/_handle',data) \ No newline at end of file +export const handleLog = (data:any) => server.post('/alarm/record/_handle',data); + +/** + * 告警记录 + */ +export const detail = (id:string) => server.get(`/alarm/record/${id}`); + +/** + * 告警历史记录 + */ +export const queryHistoryList = (data:any) => server.post('/alarm/history/_query',data); + +/** + * 获取告警处理结果 + */ +export const queryHandleHistory = (data:any) => server.post('/alarm/record/handle-history/_query',data); \ No newline at end of file diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index d748341b..83f9b48b 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -74,6 +74,10 @@ watchEffect(() => { }, 300); }); +/** + * 光标位置插入内容 + * @param {String} val + */ const insert = (val) => { if (!instance) return; const position = instance.getPosition(); @@ -90,12 +94,18 @@ const insert = (val) => { ]); }; -// watch( -// () => props.modelValue, -// (val) => { -// instance.setValue(val); -// }, -// ); +watch( + () => props.modelValue, + (val) => { + if (!instance) return; + // setValue之前获取光标位置 + const position = instance.getPosition(); + // setValue之后光标位置改变 + instance.setValue(val); + // 设置光标位置为setValue之前的位置 + instance.setPosition(position); + }, +); defineExpose({ editorFormat, diff --git a/src/components/NormalUpload/index.vue b/src/components/NormalUpload/index.vue index 6eb48c6d..2e3eac41 100644 --- a/src/components/NormalUpload/index.vue +++ b/src/components/NormalUpload/index.vue @@ -36,8 +36,8 @@ import { FILE_UPLOAD } from '@/api/comm' import { TOKEN_KEY } from '@/utils/variable'; import { LocalStore } from '@/utils/comm'; -import { downloadFile } from '@/utils/utils'; -import { deviceImport, deviceTemplateDownload } from '@/api/device/instance' +import { downloadFile, downloadFileByUrl } from '@/utils/utils'; +import { deviceImport, deviceTemplateDownload ,templateDownload} from '@/api/device/instance' import { EventSourcePolyfill } from 'event-source-polyfill' import { message } from 'ant-design-vue'; @@ -72,8 +72,20 @@ const flag = ref(false) const count = ref(0) const errMessage = ref('') -const downFile = (type: string) => { - downloadFile(deviceTemplateDownload(props.product, type)); +const downFile =async (type: string) => { + // downloadFile(deviceTemplateDownload(props.product, type)); + const res:any =await templateDownload(props.product, type) + if(res){ + const blob = new Blob([res], { type: type }); + const url = URL.createObjectURL(blob); + console.log(url); + downloadFileByUrl( + url, + `设备导入模版`, + type, + ); + } + } const submitData = async (fileUrl: string) => { diff --git a/src/components/Player/index.vue b/src/components/Player/index.vue new file mode 100644 index 00000000..9a8ec8bc --- /dev/null +++ b/src/components/Player/index.vue @@ -0,0 +1,41 @@ + + + + + + diff --git a/src/components/Player/mediaTool.vue b/src/components/Player/mediaTool.vue new file mode 100644 index 00000000..40538e8f --- /dev/null +++ b/src/components/Player/mediaTool.vue @@ -0,0 +1,8 @@ + + + + + + diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 5ed7fd38..b274153c 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -337,6 +337,14 @@ const JTable = defineComponent({ rowSelection={props.rowSelection} scroll={props.scroll} v-slots={{ + headerCell: (dt: Record) => { + const { column, title } = dt; + if (column?.headerCell) { + return slots?.[column?.headerCell]!(column.title) + } else { + return title || '' + } + }, bodyCell: (dt: Record) => { const { column, record } = dt; if ((column?.key || column?.dataIndex) && column?.scopedSlots && (slots?.[column?.dataIndex] || slots?.[column?.key])) { diff --git a/src/utils/encodeQuery.ts b/src/utils/encodeQuery.ts index 748bba26..f3a15a81 100644 --- a/src/utils/encodeQuery.ts +++ b/src/utils/encodeQuery.ts @@ -1,4 +1,14 @@ -import { isObject } from 'lodash-es' +import { isObject, isArray } from 'lodash-es' + +const encodeParams = (params: Record) => { + const _params = new URLSearchParams() + for (const key in params) { + const _value = params[key] + const isArrOrObj = isObject(_value) || isArray(_value) + _params.set(key, isArrOrObj ? encodeParams(_value) : _value) + } + return _params.toString() +} export default function encodeQuery(params: any) { if (!params) return {}; diff --git a/src/views/device/Instance/Detail/Parsing/index.vue b/src/views/device/Instance/Detail/Parsing/index.vue index 5aebe4e2..c69af54a 100644 --- a/src/views/device/Instance/Detail/Parsing/index.vue +++ b/src/views/device/Instance/Detail/Parsing/index.vue @@ -146,12 +146,6 @@ const rest = async () => { getDeviceCode(); message.success('操作成功') } - // service.delDeviceCode(productId, deviceId).then((res) => { - // if (res.status === 200) { - // getDeviceCode(productId, deviceId); - // onlyMessage('操作成功'); - // } - // }); }; //获取topic const getTopic = async () => { @@ -285,7 +279,7 @@ onMounted(() => { display: flex; justify-content: space-between; padding: 10px; - background-color: '#f7f7f7'; + background-color: #f7f7f7; .bottom-title { display: flex; diff --git a/src/views/device/Product/Detail/DataAnalysis/index.vue b/src/views/device/Product/Detail/DataAnalysis/index.vue index 07deadd9..4fbe01a1 100644 --- a/src/views/device/Product/Detail/DataAnalysis/index.vue +++ b/src/views/device/Product/Detail/DataAnalysis/index.vue @@ -60,7 +60,7 @@ - diff --git a/src/views/media/Device/Channel/index.vue b/src/views/media/Device/Channel/index.vue index a01bb5ae..ee54a902 100644 --- a/src/views/media/Device/Channel/index.vue +++ b/src/views/media/Device/Channel/index.vue @@ -83,6 +83,7 @@ :channelData="channelData" @submit="listRef.reload()" /> + @@ -92,6 +93,7 @@ import type { ActionsType } from '@/components/Table/index.vue'; import { useMenuStore } from 'store/menu'; import { message } from 'ant-design-vue'; import Save from './Save.vue'; +import Live from './Live/index.vue'; import { cloneDeep } from 'lodash-es'; const menuStory = useMenuStore(); @@ -169,7 +171,7 @@ const handleAdd = () => { }; const listRef = ref(); -const playVis = ref(false); +const playerVis = ref(false); const channelData = ref(); /** @@ -203,7 +205,7 @@ const getActions = ( }, icon: 'VideoCameraOutlined', onClick: () => { - playVis.value = true; + playerVis.value = true; }, }, { diff --git a/src/views/rule-engine/Alarm/Configuration/index.vue b/src/views/rule-engine/Alarm/Configuration/index.vue index ef5424b2..8517b1bf 100644 --- a/src/views/rule-engine/Alarm/Configuration/index.vue +++ b/src/views/rule-engine/Alarm/Configuration/index.vue @@ -10,6 +10,7 @@ :columns="columns" :request="queryList" :gridColumn="3" + :gridColumns="[1,2,3]" ref="tableRef" :defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }], diff --git a/src/views/rule-engine/Alarm/Log/Detail/index.vue b/src/views/rule-engine/Alarm/Log/Detail/index.vue index 4980305b..cba14fdb 100644 --- a/src/views/rule-engine/Alarm/Log/Detail/index.vue +++ b/src/views/rule-engine/Alarm/Log/Detail/index.vue @@ -1,37 +1,182 @@ \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Log/SolveComponent/index.vue b/src/views/rule-engine/Alarm/Log/SolveComponent/index.vue new file mode 100644 index 00000000..61b34dd0 --- /dev/null +++ b/src/views/rule-engine/Alarm/Log/SolveComponent/index.vue @@ -0,0 +1,79 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Log/SolveLog/index.vue b/src/views/rule-engine/Alarm/Log/SolveLog/index.vue index 61b34dd0..303343f6 100644 --- a/src/views/rule-engine/Alarm/Log/SolveLog/index.vue +++ b/src/views/rule-engine/Alarm/Log/SolveLog/index.vue @@ -1,78 +1,130 @@