diff --git a/public/images/access-icon.png b/public/images/access-media.png similarity index 100% rename from public/images/access-icon.png rename to public/images/access-media.png diff --git a/public/images/access-network.png b/public/images/access-network.png index 90828abe..2bd14ec6 100644 Binary files a/public/images/access-network.png and b/public/images/access-network.png differ diff --git a/public/images/access-protocol.png b/public/images/access-protocol.png index 37b8158e..628ec99b 100644 Binary files a/public/images/access-protocol.png and b/public/images/access-protocol.png differ diff --git a/src/App.vue b/src/App.vue index b61b8ee9..1206b11a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,10 @@ diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 841f2229..9562fd06 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -107,7 +107,7 @@ export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boo * @param type 文件类型 * @returns */ -export const deviceExport = (productId: string, type: string) => `${BASE_API_PATH}/device-instance${!!productId ? `/${productId}` : ''}/export.${type}` +export const deviceExport = (productId: string, type: string, params?: any) => server.get(`/device-instance${!!productId ? `/${productId}` : ''}/export.${type}`, params, {responseType: 'blob'}) /** * 验证设备ID是否重复 diff --git a/src/api/iot-card/cardManagement.ts b/src/api/iot-card/cardManagement.ts index 4b7441bc..ed75ce6e 100644 --- a/src/api/iot-card/cardManagement.ts +++ b/src/api/iot-card/cardManagement.ts @@ -97,7 +97,7 @@ export const _import = (configId: any, params: any) => server.get(`/network/card * @param format 类型 xlsx、csv * @param params */ -export const _export = (format: string, data: any) => server.post(`/network/card/download.${format}/_query`, data, { responseType: 'blob' }); +export const _export = (format: string, data: any) => server.postStream(`/network/card/download.${format}/_query`, data); /** * 下载模板 diff --git a/src/api/system/department.ts b/src/api/system/department.ts index 565db91f..c7f4103a 100644 --- a/src/api/system/department.ts +++ b/src/api/system/department.ts @@ -18,6 +18,8 @@ export const getDeviceOrProductList_api = (data: object) => server.post(`/device export const getDeviceList_api = (data: object) => server.post(`/device/instance/_query`, data); // 根据产品的id获取产品的权限 export const getPermission_api = (type: 'device' | 'product', ids: object, id: string) => server.post(`/assets/bindings/${type}/org/${id}/_query`, ids); +// 获取绑定的权限 +export const getBindingsPermission = (type: 'device' | 'product', ids: string[]) => server.post(`/assets/bindings/${type}`, ids); // 获取产品的权限字典 export const getPermissionDict_api = () => server.get(`/assets/bindings/product/permissions`); diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 7a7ca687..1119f7f6 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -6,6 +6,7 @@ v-model:selectedKeys="state.selectedKeys" :pure="state.pure" :breadcrumb="{ routes: breadcrumb }" + @back='routerBack' > + - + {{ descriptionsData?.url }} @@ -112,6 +110,9 @@ /> + diff --git a/src/views/device/Firmware/Save/index.vue b/src/views/device/Firmware/Save/index.vue index c7209f7f..331bba0e 100644 --- a/src/views/device/Firmware/Save/index.vue +++ b/src/views/device/Firmware/Save/index.vue @@ -237,6 +237,8 @@ const emit = defineEmits(['change']); const id = props.data.id; const VersionOrder = props.data.versionOrder; +const VersionSign = props.data.sign; +const VersionUrl = props.data.url; const formData: any = ref({ name: '', @@ -254,12 +256,14 @@ const extraValue: any = ref({}); const validatorSign = async (_: Record, value: string) => { const { signMethod, url } = formData.value; - if (value && !!signMethod && !!url && !extraValue.value) { - return extraValue.value[signMethod] !== value - ? Promise.reject('签名不一致,请检查文件是否上传正确') - : Promise.resolve(); - } else { + if (id && VersionSign === value && VersionUrl === url) { return Promise.resolve(); + } else { + if (value && !!signMethod && !!url && !!extraValue.value) { + return extraValue.value[signMethod] !== value + ? Promise.reject('签名不一致,请检查文件是否上传正确') + : Promise.resolve(); + } } }; const validatorVersionOrder = async (_: Record, value: string) => { @@ -270,7 +274,9 @@ const validatorVersionOrder = async (_: Record, value: string) => { if (value && !!signMethod && productId) { const res = await validateVersion(productId, value); if (res.status === 200) { - return Promise.reject(res.result ? '版本序号已存在' : ''); + return res.result + ? Promise.reject('版本序号已存在') + : Promise.resolve(); } } } diff --git a/src/views/device/Firmware/Task/Detail/index.vue b/src/views/device/Firmware/Task/Detail/index.vue index 7eec3d8e..e677650a 100644 --- a/src/views/device/Firmware/Task/Detail/index.vue +++ b/src/views/device/Firmware/Task/Detail/index.vue @@ -280,7 +280,7 @@ const getActions = (data: Partial>): ActionsType[] => { if (!data) { return []; } - const Actions = [ + const Actions: any = [ { key: 'view', text: '查看', @@ -292,7 +292,11 @@ const getActions = (data: Partial>): ActionsType[] => { handlEye(data.errorReason); }, }, - { + ]; + + const { state, mode } = data; + if (mode.value === 'push' && state.value === 'failed') { + Actions.push({ key: 'update', text: '重试', tooltip: { @@ -305,8 +309,9 @@ const getActions = (data: Partial>): ActionsType[] => { handlTry(data.id); }, }, - }, - ]; + }); + } + return Actions; }; diff --git a/src/views/device/Firmware/Task/Save/index.vue b/src/views/device/Firmware/Task/Save/index.vue index 89bdb16b..b4658025 100644 --- a/src/views/device/Firmware/Task/Save/index.vue +++ b/src/views/device/Firmware/Task/Save/index.vue @@ -208,10 +208,4 @@ watch( ); - + diff --git a/src/views/device/Firmware/index.vue b/src/views/device/Firmware/index.vue index 8d2f406d..7260fe16 100644 --- a/src/views/device/Firmware/index.vue +++ b/src/views/device/Firmware/index.vue @@ -143,7 +143,7 @@ const columns = [ key: 'createTime', dataIndex: 'createTime', search: { - type: 'time', + type: 'date', }, width: 200, scopedSlots: true, @@ -197,6 +197,9 @@ const getActions = (data: Partial>): ActionsType[] => { { key: 'delete', text: '删除', + tooltip: { + title: '删除', + }, popConfirm: { title: '确认删除?', okText: ' 确定', diff --git a/src/views/device/Instance/Export/index.vue b/src/views/device/Instance/Export/index.vue index 1a14d9dd..87cf1672 100644 --- a/src/views/device/Instance/Export/index.vue +++ b/src/views/device/Instance/Export/index.vue @@ -49,7 +49,7 @@ diff --git a/src/views/iot-card/components/TimeSelect.vue b/src/views/iot-card/components/TimeSelect.vue index de656b5e..6e785fff 100644 --- a/src/views/iot-card/components/TimeSelect.vue +++ b/src/views/iot-card/components/TimeSelect.vue @@ -16,8 +16,9 @@ diff --git a/src/views/link/AccessConfig/components/AccessCard/index.vue b/src/views/link/AccessConfig/components/AccessCard/index.vue index 7ce0183d..a82aa6a7 100644 --- a/src/views/link/AccessConfig/components/AccessCard/index.vue +++ b/src/views/link/AccessConfig/components/AccessCard/index.vue @@ -3,7 +3,7 @@ hoverable :class="[ 'card-render', - 'container', + `access-${data.type || 'network'}`, checked === data.id ? 'checked' : '', ]" @click="checkedChange(data.id)" @@ -106,8 +106,16 @@ const checkedChange = (id: string) => { } } } -.container { - background: url('/public/images/access-icon.png') no-repeat; +.access-media { + background: url('/public/images/access-media.png') no-repeat; + background-position: bottom right; +} +.access-network { + background: url('/public/images/access-network.png') no-repeat; + background-position: bottom right; +} +.access-protocol { + background: url('/public/images/access-protocol.png') no-repeat; background-position: bottom right; } diff --git a/src/views/link/AccessConfig/components/Channel/index.vue b/src/views/link/AccessConfig/components/Channel/index.vue index 01a37d29..a22f6776 100644 --- a/src/views/link/AccessConfig/components/Channel/index.vue +++ b/src/views/link/AccessConfig/components/Channel/index.vue @@ -20,7 +20,11 @@ message: '请输入名称', trigger: 'blur', }, - { max: 64, message: '最多可输入64个字符' }, + { + max: 64, + message: '最多可输入64个字符', + trigger: 'blur', + }, ]" > { }; onMounted(() => { - if (id === ':id') { + if (id !== ':id') { formState.value = { name: props.data.name, description: props.data?.description || '', diff --git a/src/views/link/AccessConfig/components/Cloud/Ctwing.vue b/src/views/link/AccessConfig/components/Cloud/Ctwing.vue index 22d34c9f..2eccd985 100644 --- a/src/views/link/AccessConfig/components/Cloud/Ctwing.vue +++ b/src/views/link/AccessConfig/components/Cloud/Ctwing.vue @@ -1,7 +1,7 @@