From cfc16a0559ea80211bbb03caef23d4adfd996e8b Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Sun, 28 Apr 2024 19:37:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86/=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BA=86=E8=AE=BE=E5=A4=87=E8=BF=9B=E8=A1=8C=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=AF=BC=E5=87=BA=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=88=90=E5=8A=9F=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 优化部分文件对TOKEN_KEY的使用 * fix: 优化系统管理/用户管理的逻辑问题;修复了设备进行批量导出时,无法导出成功;系统管理/日志/详情的异常信息文本框可输入的问题(样式问题) * fix:还原优化物联卡/物联卡管理/详细信息的更改 * fix: NO1:系统管理/日志/详情的异常信息文本框可输入的问题(样式问题) NO2:视频中心/国标级联/新增的SIP本地地址端口的逻辑问题 --- src/components/NormalUpload/index.vue | 4 +- src/components/Upload/index.vue | 2 +- .../Point/components/Import/index.vue | 4 +- src/views/Log/Access/index.vue | 1 + .../Center/components/UploadAvatar/index.vue | 2 +- .../Instance/Detail/Diagnose/Status/index.tsx | 28 +++++------ src/views/device/Instance/Export/index.vue | 19 ++++++-- src/views/device/Instance/Import/file.vue | 8 ++-- .../device/components/InklingDevice/index.vue | 17 +++---- .../components/Metadata/Import/index.vue | 2 +- src/views/init-home/Basic/index.vue | 2 +- .../iot-card/CardManagement/Detail/index.vue | 48 +++++++------------ .../iot-card/CardManagement/UploadFile.vue | 2 +- src/views/iot-card/Dashboard/index.vue | 17 +++---- src/views/media/Cascade/Save/index.vue | 5 +- .../Save/components/ApplyList/MUpload.vue | 2 +- .../system/User/components/EditUserDialog.vue | 4 +- 17 files changed, 83 insertions(+), 84 deletions(-) diff --git a/src/components/NormalUpload/index.vue b/src/components/NormalUpload/index.vue index d1106a43..c45ca7e6 100644 --- a/src/components/NormalUpload/index.vue +++ b/src/components/NormalUpload/index.vue @@ -5,7 +5,7 @@ name="file" :action="FILE_UPLOAD" :headers="{ - 'X-Access-Token': LocalStore.get(TOKEN_KEY), + [TOKEN_KEY]: LocalStore.get(TOKEN_KEY), }" :maxCount="1" :showUploadList="false" @@ -165,4 +165,4 @@ const uploadChange = async (info: Record) => { await submitData(resp?.result || ''); } }; - \ No newline at end of file + diff --git a/src/components/Upload/index.vue b/src/components/Upload/index.vue index 276a4691..eae8807f 100644 --- a/src/components/Upload/index.vue +++ b/src/components/Upload/index.vue @@ -10,7 +10,7 @@ @change="handleChange" :action="FILE_UPLOAD" :headers="{ - 'X-Access-Token': LocalStore.get(TOKEN_KEY), + [TOKEN_KEY]: LocalStore.get(TOKEN_KEY), }" v-bind="props" > diff --git a/src/views/DataCollect/Collector/Point/components/Import/index.vue b/src/views/DataCollect/Collector/Point/components/Import/index.vue index ee71e70d..df3387ff 100644 --- a/src/views/DataCollect/Collector/Point/components/Import/index.vue +++ b/src/views/DataCollect/Collector/Point/components/Import/index.vue @@ -6,7 +6,7 @@
@@ -203,4 +203,4 @@ const handleImport = async (file: any) => { width: 152px; color: #666666; } -} \ No newline at end of file +} diff --git a/src/views/Log/Access/index.vue b/src/views/Log/Access/index.vue index a237a81b..a5ad700d 100644 --- a/src/views/Log/Access/index.vue +++ b/src/views/Log/Access/index.vue @@ -115,6 +115,7 @@ v-model:value="descriptionsData.exception" placeholder="暂无数据" :auto-size="{ minRows: 3, maxRows: 20 }" + readonly /> diff --git a/src/views/account/Center/components/UploadAvatar/index.vue b/src/views/account/Center/components/UploadAvatar/index.vue index 6ba4dfa0..5a8a8ed3 100644 --- a/src/views/account/Center/components/UploadAvatar/index.vue +++ b/src/views/account/Center/components/UploadAvatar/index.vue @@ -10,7 +10,7 @@ @change="handleChange" :action="FILE_UPLOAD" :headers="{ - 'X-Access-Token': LocalStore.get(TOKEN_KEY), + [TOKEN_KEY]: LocalStore.get(TOKEN_KEY), }" v-bind="props" > diff --git a/src/views/device/Instance/Detail/Diagnose/Status/index.tsx b/src/views/device/Instance/Detail/Diagnose/Status/index.tsx index dee5a549..9ef361c1 100644 --- a/src/views/device/Instance/Detail/Diagnose/Status/index.tsx +++ b/src/views/device/Instance/Detail/Diagnose/Status/index.tsx @@ -791,7 +791,7 @@ const Status = defineComponent({ { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'loading', text: '正在诊断中...', info: null, @@ -805,7 +805,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, @@ -822,7 +822,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'error', text: '异常', info: ( @@ -849,7 +849,7 @@ const Status = defineComponent({ { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, @@ -873,7 +873,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'warning', text: '可能存在异常', info: ( @@ -890,7 +890,7 @@ const Status = defineComponent({ type: 'product', key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, data: { ...item }, configuration: _configuration, productId: unref(device).productId, @@ -909,7 +909,7 @@ const Status = defineComponent({ { key: `product-auth${i}`, name: `产品-${item?.name}`, - desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断产品${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, @@ -952,7 +952,7 @@ const Status = defineComponent({ { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'loading', text: '正在诊断中...', info: null, @@ -966,7 +966,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, @@ -983,7 +983,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'error', text: '异常', info: ( @@ -1010,7 +1010,7 @@ const Status = defineComponent({ { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, @@ -1034,7 +1034,7 @@ const Status = defineComponent({ list.value = modifyArrayList(list.value, { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'warning', text: '可能存在异常', info: ( @@ -1051,7 +1051,7 @@ const Status = defineComponent({ type: 'device', key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, data: { ...item }, configuration: _configuration, productId: unref(device).productId, @@ -1070,7 +1070,7 @@ const Status = defineComponent({ { key: `device-auth${i}`, name: `设备-${item?.name}`, - desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败', + desc: `诊断设备${item?.name}认证配置是否正确,错误的配置将导致连接失败`, status: 'success', text: '正常', info: null, diff --git a/src/views/device/Instance/Export/index.vue b/src/views/device/Instance/Export/index.vue index 784e8fe3..5ec0a935 100644 --- a/src/views/device/Instance/Export/index.vue +++ b/src/views/device/Instance/Export/index.vue @@ -53,6 +53,8 @@ import { downloadFileByUrl } from '@/utils/utils'; import { paramsEncodeQuery } from '@/utils/encodeQuery'; import { deviceExport , deviceExportPath} from '@/api/device/instance'; import { getToken } from '@/utils/comm'; +import { TOKEN_KEY } from '@/utils/variable'; +import { LocalStore, onlyMessage } from '@/utils/comm'; const emit = defineEmits(['close']); const props = defineProps({ @@ -82,10 +84,17 @@ watch( }); }, { immediate: true, deep: true }, + + ); const productName = computed(() => { + console.log(modelRef.product); return productList.value.find(item => item.id === modelRef.product)?.name || '' + // console.log(item.id); + + + }) const handleOk = async () => { @@ -98,13 +107,17 @@ const handleOk = async () => { modelRef.product || '', modelRef.fileType, params + + ); if (res) { - const blob = new Blob([res], { type: modelRef.fileType }); - const url = URL.createObjectURL(blob); - downloadFileByUrl(url, `${productName.value ? (productName.value + '下设备') : '设备实例'}`, modelRef.fileType); + // const blob = new Blob([res], { type: modelRef.fileType }); + // const url = URL.createObjectURL(blob); + // downloadFileByUrl(url, `${productName.value ? (productName.value + '下设备') : '设备实例'}`, modelRef.fileType); + window.open(`${origin}/api/device-instance/${modelRef.product}/export.xlsx?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`) emit('close'); } + }; const handleCancel = () => { diff --git a/src/views/device/Instance/Import/file.vue b/src/views/device/Instance/Import/file.vue index 6340dcfe..2fac763d 100644 --- a/src/views/device/Instance/Import/file.vue +++ b/src/views/device/Instance/Import/file.vue @@ -8,13 +8,13 @@
导入系统已存在的设备数据,不会更改已存在设备的所属产品信息
- + ) => { color: #666666; .icon { - font-size: 30px; + font-size: 30px; color: @primary-color; } } @@ -250,4 +250,4 @@ const uploadChange = async (info: Record) => { } } } - \ No newline at end of file + diff --git a/src/views/device/components/InklingDevice/index.vue b/src/views/device/components/InklingDevice/index.vue index 11291122..401c4d93 100644 --- a/src/views/device/components/InklingDevice/index.vue +++ b/src/views/device/components/InklingDevice/index.vue @@ -239,16 +239,17 @@ const pageChange = (page: number, pageSize: number) => { const init = async () => { if (props.accessId) { const resp = await getCommandsByAccess(props.accessId); - if (resp.success) { - const item = resp.result?.[0]; + if (resp.success && resp.result?.length) { + // 获取分页查询条件 + const item = resp.result.find(item => item.id === 'QueryDevicePage'); if (item) { - showPage.value = item.id === 'QueryDevicePage'; // 分页 + showPage.value = true columns.value = item.expands?.terms?.map((t) => ({ - title: t.name, - dataIndex: t.id, - search: { - type: t.valueType.type, - }, + title: t.name, + dataIndex: t.id, + search: { + type: t.valueType.type, + }, })); } } diff --git a/src/views/device/components/Metadata/Import/index.vue b/src/views/device/components/Metadata/Import/index.vue index bd2fe3d7..c6dfa7bb 100644 --- a/src/views/device/components/Metadata/Import/index.vue +++ b/src/views/device/components/Metadata/Import/index.vue @@ -139,7 +139,7 @@ :show-upload-list="false" :action="FILE_UPLOAD" @change="fileChange" - :headers="{ 'X-Access-Token': getToken() }" + :headers="{ [TOKEN_KEY]: getToken() }" >