From 15ff1c7759d3878615ebbf2e3228068a4ddfa1bf Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Fri, 24 Feb 2023 14:18:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E8=BF=9C=E7=A8=8B=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=20=E5=8D=87=E7=BA=A7=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AIcon/index.tsx | 3 +- .../Firmware/Task/Save/SelectDevices.vue | 35 +++- src/views/device/Firmware/Task/Save/index.vue | 170 ++++++------------ src/views/device/Firmware/Task/index.vue | 27 ++- src/views/link/AccessConfig/index.vue | 2 +- src/views/link/Certificate/index.vue | 4 +- src/views/link/Protocol/index.vue | 7 +- src/views/link/Type/index.vue | 2 +- 8 files changed, 101 insertions(+), 149 deletions(-) diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 1c119785..366a7b1c 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -55,7 +55,8 @@ const iconKeys = [ 'LikeOutlined', 'ArrowLeftOutlined', 'DownloadOutlined', - 'PauseOutlined' + 'PauseOutlined', + 'ControlOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/device/Firmware/Task/Save/SelectDevices.vue b/src/views/device/Firmware/Task/Save/SelectDevices.vue index e646a6d1..10657f29 100644 --- a/src/views/device/Firmware/Task/Save/SelectDevices.vue +++ b/src/views/device/Firmware/Task/Save/SelectDevices.vue @@ -5,7 +5,11 @@ :disabled="true" > {}, + }, +}); + const route = useRoute(); const params = ref>({}); const visible = ref(false); @@ -212,15 +223,18 @@ const cancelSelect = () => { }; const handleOk = () => { - checkLable.value = _selectedRowKeys.value - .map((item) => checkAllDataMap.has(item) && checkAllDataMap.get(item)) - .toString(); + checkLable.value = updateSelect(_selectedRowKeys.value); emit('update:modelValue', _selectedRowKeys.value); visible.value = false; }; +const updateSelect = (selectedRowKeys: T[]) => + selectedRowKeys + .map((item) => checkAllDataMap.has(item) && checkAllDataMap.get(item)) + .toString(); + const onVisible = () => { - visible.value = true; + !props.data.view && (visible.value = true); }; const handleCancel = () => { @@ -236,6 +250,10 @@ onMounted(() => { checkAllDataMap.set(item.id, item.name); return item.id; }); + if (props.data.id) { + checkLable.value = updateSelect(props.data.deviceId); + emit('update:modelValue', props.data.deviceId); + } } }, ); @@ -264,9 +282,8 @@ const handleSearch = (e: any) => { diff --git a/src/views/device/Firmware/Task/Save/index.vue b/src/views/device/Firmware/Task/Save/index.vue index 433b453e..2a096774 100644 --- a/src/views/device/Firmware/Task/Save/index.vue +++ b/src/views/device/Firmware/Task/Save/index.vue @@ -15,17 +15,20 @@ :model="formData" name="basic" autocomplete="off" + ref="formRef" + :rules="rules" > - + + > + > + > 所有设备 选择设备 - + + - - + - + diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index d4ddcd8d..851b6a78 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -188,7 +188,7 @@ + + diff --git a/src/views/device/Firmware/Task/index.vue b/src/views/device/Firmware/Task/index.vue index 82f69126..42e65021 100644 --- a/src/views/device/Firmware/Task/index.vue +++ b/src/views/device/Firmware/Task/index.vue @@ -58,12 +58,14 @@ - + + diff --git a/src/views/device/Firmware/Task/Detail/index.vue b/src/views/device/Firmware/Task/Detail/index.vue index 1ddc9b87..dc4f4d29 100644 --- a/src/views/device/Firmware/Task/Detail/index.vue +++ b/src/views/device/Firmware/Task/Detail/index.vue @@ -17,22 +17,27 @@
- - 批量重试 - - +
+ + 批量重试 + +
+ +
+ +
@@ -114,6 +119,7 @@ +
@@ -124,12 +130,14 @@ import { history, historyCount, queryProduct, + startTask, + startOneTask, } from '@/api/device/firmware'; import { message } from 'ant-design-vue'; import { getImage } from '@/utils/comm'; import moment from 'moment'; import { cloneDeep } from 'lodash-es'; - +import Save from './Save.vue'; const tableRef = ref>({}); const router = useRouter(); const route = useRoute(); @@ -276,22 +284,7 @@ const getActions = (data: Partial>): ActionsType[] => { if (!data) { return []; } - - const stop = data.waiting > 0 && data?.state?.value === 'processing'; - const pause = data?.state?.value === 'canceled'; - const Actions = [ - { - key: 'details', - text: '详情', - tooltip: { - title: '详情', - }, - icon: 'icon-details', - onClick: async () => { - handlDetails(data.id); - }, - }, { key: 'eye', text: '查看', @@ -300,45 +293,21 @@ const getActions = (data: Partial>): ActionsType[] => { }, icon: 'EyeOutlined', onClick: async () => { - handlEye(data); + handlEye(data.errorReason); + }, + }, + { + key: 'try', + text: '重试', + tooltip: { + title: '重试', + }, + icon: 'RedoOutlined', + onClick: async () => { + handlTry(data.id); }, }, ]; - - if (stop) { - Actions.push({ - key: 'actions', - text: '停止', - tooltip: { - title: '停止', - }, - onClick: async () => { - const res = await stopTask(data.id); - if (res.success) { - message.success('操作成功'); - tableRef.value.reload(); - } - }, - icon: 'StopOutlined', - }); - } else if (pause) { - Actions.push({ - key: 'actions', - text: '继续升级', - tooltip: { - title: '继续升级', - }, - onClick: async () => { - const res = await startTask(data.id, ['canceled']); - if (res.success) { - message.success('操作成功'); - tableRef.value.reload(); - } - }, - icon: 'ControlOutlined', - }); - } - return Actions; }; @@ -347,28 +316,29 @@ const handlAdd = () => { visible.value = true; }; -const handlEye = (data: object) => { - current.value = toRaw({ ...data, view: true }); +const handlEye = (data: string) => { + current.value = data || ''; visible.value = true; }; -const handlDetails = (id: string) => { - // router.push({ - // path: `/iot/link/certificate/detail/${id}`, - // query: { view: false }, - // }); -}; -const saveChange = (value: boolean) => { - visible.value = false; - current.value = {}; - if (value) { +const handlTry = async (id: string) => { + const res = await startOneTask([id]); + if (res.success) { message.success('操作成功'); tableRef.value.reload(); } }; -const confirm = (e: MouseEvent) => { - console.log(e); - message.success('Click on Yes'); +const saveChange = (value: boolean) => { + visible.value = false; + current.value = {}; +}; +const confirm = async (e: MouseEvent) => { + const res = await startTask(taskId, ['failed']); + if (res.success) { + message.success('操作成功'); + handleRefresh('failed'); + tableRef.value.reload(); + } }; const handleRefresh = async (key: string) => { @@ -416,6 +386,7 @@ const handleSearch = (e: any) => { rgba(255, 255, 255, 0.86) 91.82% ); min-width: 185px; + max-width: 580px; flex: 1px; margin: 0 12px; .state-content { @@ -430,12 +401,18 @@ const handleSearch = (e: any) => { height: 22px; .state-title-right { z-index: 1; - img { - margin: 0 10px; + display: flex; + .img { width: 22px; - // margin-top: -12px; - margin-top: -5px; + margin: 0 10px; cursor: pointer; + img { + width: 22px; + margin-top: -5px; + } + } + .img:active { + border: 1px #40a9ff solid; } } } From c60410c1d49bde6c50593457256a41da6d4e1808 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Mon, 27 Feb 2023 14:40:49 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E9=80=9A=E9=81=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/media/channel.ts | 15 ++ src/components/AIcon/index.tsx | 4 +- src/views/media/Device/Channel/index.vue | 254 ++++++++++++------- src/views/media/Device/Playback/index.vue | 7 + src/views/media/Device/Playback/typings.d.ts | 15 ++ 5 files changed, 200 insertions(+), 95 deletions(-) create mode 100644 src/api/media/channel.ts create mode 100644 src/views/media/Device/Playback/index.vue create mode 100644 src/views/media/Device/Playback/typings.d.ts diff --git a/src/api/media/channel.ts b/src/api/media/channel.ts new file mode 100644 index 00000000..3c4a67bd --- /dev/null +++ b/src/api/media/channel.ts @@ -0,0 +1,15 @@ +import server from '@/utils/request' + +export default { + // 列表 + list: (data: any, id: string) => server.post(`/media/device/${id}/channel/_query`, data), + // 详情 + detail: (id: string): any => server.get(`/media/channel/${id}`), + // 验证通道ID是否存在 + validateField: (params: string): any => server.get(`/media/channel/channelId/_validate`, params), + // 新增 + save: (data: any) => server.post(`/media/channel`, data), + // 修改 + update: (data: any) => server.put(`/media/channel`, data), + del: (id: string) => server.remove(`media/channel/${id}`), +} \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 1c119785..b723fbde 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -55,7 +55,9 @@ const iconKeys = [ 'LikeOutlined', 'ArrowLeftOutlined', 'DownloadOutlined', - 'PauseOutlined' + 'PauseOutlined', + 'VideoCameraOutlined', + 'HistoryOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/media/Device/Channel/index.vue b/src/views/media/Device/Channel/index.vue index 4ef66e6d..6ca977e2 100644 --- a/src/views/media/Device/Channel/index.vue +++ b/src/views/media/Device/Channel/index.vue @@ -8,106 +8,129 @@ /> - - - - + + - + /> + +