From 3fdfa001bf0517550c7b01b5baef1e476fd2d110 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 22 Mar 2023 21:06:28 +0800 Subject: [PATCH 01/26] =?UTF-8?q?fix:=20=E8=BF=90=E7=BB=B4=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BB=AA=E8=A1=A8=E7=9B=98=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E7=BD=91=E7=BB=9C=E6=B5=81=E9=87=8FY=E8=BD=B4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/link/DashBoard/components/Cpu.vue | 2 -- .../link/DashBoard/components/Network.vue | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/link/DashBoard/components/Cpu.vue b/src/views/link/DashBoard/components/Cpu.vue index fd11d632..33d4e0ac 100644 --- a/src/views/link/DashBoard/components/Cpu.vue +++ b/src/views/link/DashBoard/components/Cpu.vue @@ -75,8 +75,6 @@ const pickerTimeChange = () => { const getCPUEcharts = async (val: any) => { loading.value = true; - console.log(224, val); - const res: any = await dashboard(defulteParamsData('cpu', val)); if (res.success) { const _cpuOptions = {}; diff --git a/src/views/link/DashBoard/components/Network.vue b/src/views/link/DashBoard/components/Network.vue index 070a563d..e470644e 100644 --- a/src/views/link/DashBoard/components/Network.vue +++ b/src/views/link/DashBoard/components/Network.vue @@ -114,8 +114,8 @@ const getNetworkEcharts = async (val: any) => { loading.value = false; }, 300); }; -const networkValueRender = (obj: any) => { - const { value } = obj; + +const formatterData = (value: any) => { let _data = ''; if (value >= 1024 && value < 1024 * 1024) { _data = `${Number((value / 1024).toFixed(2))}KB`; @@ -124,7 +124,14 @@ const networkValueRender = (obj: any) => { } else { _data = `${value}B`; } - return `${obj?.axisValueLabel}
${obj?.marker}${obj?.seriesName}: ${_data}`; + return _data; +}; + +const networkValueRender = (obj: any) => { + const { value } = obj; + return `${obj?.axisValueLabel}
${obj?.marker}${ + obj?.seriesName + }   ${formatterData(value)}`; }; const setOptions = (data: any, key: string) => ({ @@ -149,9 +156,12 @@ const handleNetworkOptions = (optionsData: any, xAxis: any) => { }, yAxis: { type: 'value', + axisLabel: { + formatter: (_value: any) => formatterData(_value), + }, }, grid: { - left: '100px', + left: '70px', right: '50px', }, tooltip: { From 0e09858d3802b98de1021a0ea070048f9cd40e39 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Thu, 23 Mar 2023 11:47:58 +0800 Subject: [PATCH 02/26] =?UTF-8?q?fix:=20bug#10706=E3=80=8110678?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AddDeviceOrProductDialog.vue | 8 +++- .../components/EditDepartmentDialog.vue | 45 ++++++++++++------- src/views/system/Department/device/index.vue | 2 +- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/views/system/Department/components/AddDeviceOrProductDialog.vue b/src/views/system/Department/components/AddDeviceOrProductDialog.vue index 6481f03e..6fbea17b 100644 --- a/src/views/system/Department/components/AddDeviceOrProductDialog.vue +++ b/src/views/system/Department/components/AddDeviceOrProductDialog.vue @@ -259,8 +259,10 @@ const table: any = { // 选中 onSelectChange: (row: any) => { // 若该项的可选权限中没有分享权限,则不支持任何操作 - if (!row.permissionList.find((item: any) => item.value === 'share')) + if (!row.permissionList.find((item: any) => item.value === 'share')) { + message.warning('该资产不支持共享'); return; + } const selectedRowKeys = table._selectedRowKeys.value; const index = selectedRowKeys.indexOf(row.id); @@ -330,7 +332,9 @@ const table: any = { resolve({ code: 200, result: { - data: data.sort((a, b) => a.createTime - b.createTime), + data: data.sort( + (a, b) => a.createTime - b.createTime, + ), pageIndex, pageSize, total, diff --git a/src/views/system/Department/components/EditDepartmentDialog.vue b/src/views/system/Department/components/EditDepartmentDialog.vue index ea145c5c..d6b6f0a4 100644 --- a/src/views/system/Department/components/EditDepartmentDialog.vue +++ b/src/views/system/Department/components/EditDepartmentDialog.vue @@ -18,6 +18,7 @@ placeholder="请选择上级组织" :tree-data="treeData" :field-names="{ value: 'id' }" + @change="handleTreeSelectChange" > @@ -60,6 +61,21 @@ import { updateDepartment_api, } from '@/api/system/department'; +type treeType = { + id: string; + parentId?: string; + name: string; + sortIndex: string | number; + children?: treeType[]; + disabled?: boolean; +}; +type formType = { + id?: string; + parentId?: string; + name: string; + sortIndex: string | number; +}; + const emits = defineEmits(['refresh', 'update:visible']); const props = defineProps<{ treeData: any[]; @@ -91,8 +107,8 @@ const treeData = computed(() => { }); /** * 在给定的树中通过id匹配 - * @param node - * @param id + * @param node + * @param id */ const findItemById = (node: treeType[], id: string): treeType | null => { let result = null; @@ -107,7 +123,7 @@ const findItemById = (node: treeType[], id: string): treeType | null => { }; /** * 将此树下的所有节点禁用 - * @param treeNode + * @param treeNode */ const filterTree = (treeNode: treeType[]) => { if (treeNode.length < 1) return; @@ -160,18 +176,15 @@ const form = reactive({ }); form.init(); -type treeType = { - id: string; - parentId?: string; - name: string; - sortIndex: string | number; - children?: treeType[]; - disabled?: boolean; -}; -type formType = { - id?: string; - parentId?: string; - name: string; - sortIndex: string | number; +/** + * 上级组织选择改变 + */ +const handleTreeSelectChange = () => { + // 上级组织 + const parent = treeData.value.find((f: any) => f.id === form.data.parentId); + // 当前编辑的组织排序, 为选择上级组织的最大排序+1, 如上级组织没有自组织, 则默认为1 + form.data.sortIndex = parent?.children + ? parent.children[parent.children.length - 1].sortIndex + 1 + : 1; }; diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue index 1d1f076e..7769eb1b 100644 --- a/src/views/system/Department/device/index.vue +++ b/src/views/system/Department/device/index.vue @@ -520,7 +520,7 @@ const dialogs = reactive({ }); table.init(); -nextTick(() => { +watchEffect(() => { props.bindBool && table.clickAdd(); emits('update:bindBool', false); }); From 0a33ca67ab3ed549a1dceeb2925805abe3f5112f Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Thu, 23 Mar 2023 14:33:17 +0800 Subject: [PATCH 03/26] =?UTF-8?q?fix:=20bug#10802=E3=80=8110799=E3=80=8110?= =?UTF-8?q?798=E3=80=8110796=E3=80=8110791=20=E4=BF=AE=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8E=A5=E5=85=A5=E7=BD=91=E5=85=B3=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccessConfig/components/Media/GB28181.vue | 54 ++++++++++++------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/src/views/link/AccessConfig/components/Media/GB28181.vue b/src/views/link/AccessConfig/components/Media/GB28181.vue index c44876b7..6da76ce8 100644 --- a/src/views/link/AccessConfig/components/Media/GB28181.vue +++ b/src/views/link/AccessConfig/components/Media/GB28181.vue @@ -482,6 +482,7 @@ type="primary" style="margin-right: 8px" @click="saveData" + :loading="loading" :hasPermission="`link/AccessConfig:${ id === ':id' ? 'add' : 'update' }`" @@ -534,7 +535,7 @@ const props = defineProps({ const route = useRoute(); const view = route.query.view as string; const id = route.params.id as string; - +const loading = ref(false); const activeKey: any = ref([]); const clientHeight = document.body.clientHeight; @@ -638,10 +639,17 @@ const saveData = () => { transport: 'SIP', channel: 'gb28181', }; - params.configuration.sipId = Number(params.configuration?.sipId); + loading.value = true; const resp = - id === ':id' ? await save(params) : await update({ ...params, id }); - if (resp.status === 200) { + id === ':id' + ? await save(params).catch(() => { + loading.value = false; + }) + : await update({ ...params, id }).catch(() => { + loading.value = false; + }); + + if (resp?.status === 200) { onlyMessage('操作成功', 'success'); history.back(); } @@ -667,12 +675,14 @@ const next = async () => { ...data1, ...data2, }; + } else { + return onlyMessage('请新增或完善配置', 'error'); } current.value = current.value + 1; params.configuration = data1; }) .catch((err) => { - err.errorFields.forEach((item: any) => { + err.errorFields?.forEach((item: any) => { const activeId: any = dynamicValidateForm.cluster[item.name[1]].id; if (!activeKey.value.includes(activeId)) { @@ -680,10 +690,24 @@ const next = async () => { } }); }); + } else { + current.value = current.value + 1; + params.configuration = data1; } }; const prev = () => { current.value = current.value - 1; + develop(); +}; + +const develop = () => { + if (dynamicValidateForm.cluster.length !== 0) { + dynamicValidateForm.cluster.forEach((item) => { + const id: any = JSON.stringify(Date.now() + Math.random()); + item.id = id; + activeKey.value.push(id); + }); + } }; onMounted(() => { @@ -723,21 +747,13 @@ onMounted(() => { const { configuration, name, description = '' } = props.data; formData.value = { name, description }; - if (configuration?.shareCluster) { - formState.value = { - ...formState.value, - ...props.data.configuration, - }; - } else { - formState.value = { - ...formState.value, - ...props.data.configuration, - }; + formState.value = { + ...formState.value, + ...props.data.configuration, + }; + if (!configuration?.shareCluster) { dynamicValidateForm.cluster = configuration.cluster; - if (dynamicValidateForm.cluster.length === 1) { - activeKey.value = ['1']; - dynamicValidateForm.cluster[0].id = 1; - } + develop(); } } }); From e97255d08872a9fa6fa3fa04d71707e3e9a874c1 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Thu, 23 Mar 2023 14:41:35 +0800 Subject: [PATCH 04/26] =?UTF-8?q?fix:=20bug#10721=E3=80=8110714=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=81=E4=B9=A6=E7=AE=A1=E7=90=86=E9=83=A8?= =?UTF-8?q?=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/link/Certificate/Detail/index.vue | 4 ++-- src/views/link/Certificate/index.vue | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/link/Certificate/Detail/index.vue b/src/views/link/Certificate/Detail/index.vue index e6d5aa16..470d0222 100644 --- a/src/views/link/Certificate/Detail/index.vue +++ b/src/views/link/Certificate/Detail/index.vue @@ -41,7 +41,7 @@ diff --git a/src/views/link/Certificate/index.vue b/src/views/link/Certificate/index.vue index 43d90035..8a29ae29 100644 --- a/src/views/link/Certificate/index.vue +++ b/src/views/link/Certificate/index.vue @@ -96,6 +96,7 @@ const columns = [ ellipsis: true, search: { type: 'string', + first: true, }, }, { From d04e69ba1bc23fd939c67e0e09fc6ef56b3bff62 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Thu, 23 Mar 2023 14:54:44 +0800 Subject: [PATCH 05/26] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E7=BD=91=E5=85=B3=20=E5=B1=8F=E8=94=BD=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/link/AccessConfig/index.vue | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index 5cfdbea5..1be02296 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -13,6 +13,17 @@ :request="list" :defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }], + terms: [ + { + terms: [ + { + termType: 'nin', + column: 'provider', + value: 'plugin_gateway', //todo 暂时不做插件接入 + }, + ], + }, + ], }" gridColumn="2" :gridColumns="[1, 2]" @@ -310,10 +321,12 @@ const getActions = (data: Partial>): ActionsType[] => { const getProvidersList = async () => { const res: any = await getProviders(); providersList.value = res.result; - providersOptions.value = (res?.result || [])?.map((item: any) => ({ - label: item.name, - value: item.id, - })); + providersOptions.value = (res?.result || []) + ?.map((item: any) => ({ + label: item.name, + value: item.id, + })) + .filter((item: any) => item.value !== 'plugin_gateway'); // todo 暂时不做插件接入 }; getProvidersList(); From 73351235cef5b9c006f3ccb34c94007b1774425d Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Thu, 23 Mar 2023 15:08:36 +0800 Subject: [PATCH 06/26] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/Instance/index.vue | 4 +++ src/views/edge/Device/index.vue | 40 ++++++++++++------------ src/views/edge/Resource/Issue/Result.vue | 4 +-- src/views/edge/Resource/Issue/index.vue | 3 +- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 30270b39..2d3b82b7 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -328,6 +328,7 @@ const columns = [ title: 'ID', dataIndex: 'id', key: 'id', + ellipsis: true, search: { type: 'string', defaultTermType: 'eq', @@ -337,6 +338,7 @@ const columns = [ title: '设备名称', dataIndex: 'name', key: 'name', + ellipsis: true, search: { type: 'string', first: true, @@ -346,6 +348,7 @@ const columns = [ title: '产品名称', dataIndex: 'productName', key: 'productName', + ellipsis: true, search: { type: 'select', rename: 'productId', @@ -367,6 +370,7 @@ const columns = [ dataIndex: 'createTime', key: 'createTime', scopedSlots: true, + width: 200, search: { type: 'date', }, diff --git a/src/views/edge/Device/index.vue b/src/views/edge/Device/index.vue index 9d9bc8cb..116442f4 100644 --- a/src/views/edge/Device/index.vue +++ b/src/views/edge/Device/index.vue @@ -267,26 +267,26 @@ const columns = [ }), }, }, - { - key: 'productId$product-info', - dataIndex: 'productId$product-info', - title: '接入方式', - hideInTable: true, - search: { - type: 'select', - options: () => - new Promise((resolve) => { - queryGatewayList({}).then((resp: any) => { - resolve( - resp.result.map((item: any) => ({ - label: item.name, - value: `accessId is ${item.id}`, - })), - ); - }); - }), - }, - }, + // { + // key: 'productId$product-info', + // dataIndex: 'productId$product-info', + // title: '接入方式', + // hideInTable: true, + // search: { + // type: 'select', + // options: () => + // new Promise((resolve) => { + // queryGatewayList({}).then((resp: any) => { + // resolve( + // resp.result.map((item: any) => ({ + // label: item.name, + // value: `accessId is ${item.id}`, + // })), + // ); + // }); + // }), + // }, + // }, { dataIndex: 'deviceType', title: '设备类型', diff --git a/src/views/edge/Resource/Issue/Result.vue b/src/views/edge/Resource/Issue/Result.vue index 52589e13..339ddb2d 100644 --- a/src/views/edge/Resource/Issue/Result.vue +++ b/src/views/edge/Resource/Issue/Result.vue @@ -20,7 +20,7 @@ 已下发数量:{{ countErr + count }}
- +
@@ -86,7 +86,7 @@ const getData = () => { et += 1; countErr.value = et; flag.value = false; - if (errMessages.length <= 5) { + if (errMessages.length < 5) { errMessages.push({ ...res }); errMessage.value = [...errMessages]; } diff --git a/src/views/edge/Resource/Issue/index.vue b/src/views/edge/Resource/Issue/index.vue index 5bab28ac..b12f7554 100644 --- a/src/views/edge/Resource/Issue/index.vue +++ b/src/views/edge/Resource/Issue/index.vue @@ -169,7 +169,8 @@ const onCancel = () => { diff --git a/src/views/device/Product/Detail/index.vue b/src/views/device/Product/Detail/index.vue index 1622bd3f..49aa107b 100644 --- a/src/views/device/Product/Detail/index.vue +++ b/src/views/device/Product/Detail/index.vue @@ -1,7 +1,6 @@ From 4b84614f82701dfec13e8a228216691ffec21c35 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Thu, 23 Mar 2023 17:18:01 +0800 Subject: [PATCH 19/26] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E7=BB=B4=E7=AE=A1=E7=90=86=20=E6=95=B0=E6=8D=AE=E9=87=87?= =?UTF-8?q?=E9=9B=86=20=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/DataCollect/Collector/Tree/index.vue | 1 + src/views/device/Firmware/index.vue | 2 +- src/views/link/Certificate/index.vue | 1 + src/views/link/Type/index.vue | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/DataCollect/Collector/Tree/index.vue b/src/views/DataCollect/Collector/Tree/index.vue index 851c4b95..32c12a46 100644 --- a/src/views/DataCollect/Collector/Tree/index.vue +++ b/src/views/DataCollect/Collector/Tree/index.vue @@ -81,6 +81,7 @@ ? '正常的采集器不能删除' : '删除', }" + :danger="data?.state?.value === 'disabled'" hasPermission="DataCollect/Collector:delete" :popConfirm="{ title: `该操作将会删除下属点位,确定删除?`, diff --git a/src/views/device/Firmware/index.vue b/src/views/device/Firmware/index.vue index 7260fe16..dc87eb89 100644 --- a/src/views/device/Firmware/index.vue +++ b/src/views/device/Firmware/index.vue @@ -51,6 +51,7 @@ style="padding: 0px" @click="i.onClick" type="link" + :danger="i.key === 'delete'" :hasPermission="'device/Firmware:' + i.key" >