style:设备模型/物联设备-导出按钮添加deviceModelId/deviceId入参

main
黄伟杰 6 days ago
parent f22a5c9a11
commit 5f453af4d2

@ -220,7 +220,7 @@ const total = ref(0) // 列表的总页数
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
deviceId: undefined as unknown,
deviceId: undefined as number | undefined,
attributeCode: undefined,
attributeName: undefined,
attributeType: undefined
@ -263,6 +263,8 @@ watch(
return
}
queryParams.deviceId = val
selectedIds.value = []
tableRef.value?.clearSelection?.()
handleQuery()
},
{ immediate: true, deep: true }
@ -350,10 +352,16 @@ const handleImport = () => {
/** 导出按钮操作 */
const handleExport = async () => {
if (!props.deviceId) {
message.error(t('DataCollection.Device.messageSelectDeviceRequired'))
return
}
try {
await message.exportConfirm()
exportLoading.value = true
const params: any = {}
const params: any = {
deviceId: props.deviceId
}
if (selectedIds.value.length) {
params.ids = selectedIds.value.join(',')
}

@ -175,7 +175,7 @@ const queryParams = reactive({
dataUnit: undefined,
ratio: undefined,
remark: undefined,
deviceModelId: undefined,
deviceModelId: undefined as number | undefined,
createTime: [],
})
const queryFormRef = ref() //
@ -212,6 +212,9 @@ watch(
return
}
queryParams.id = val
queryParams.deviceModelId = val
selectedIds.value = []
tableRef.value?.clearSelection?.()
handleQuery()
},
{ immediate: true, deep: true }
@ -298,8 +301,8 @@ const handleBatchDelete = async () => {
/** 导出按钮操作 */
const handleExport = async () => {
if (!selectedIds.value.length) {
message.error('请选择需要导出的数据')
if (!props.id) {
message.error('请选择一个采集设备模型')
return
}
try {
@ -307,7 +310,10 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeviceModelAttributeApi.exportDeviceModelAttribute({ ids: selectedIds.value.join(',') })
const data = await DeviceModelAttributeApi.exportDeviceModelAttribute({
deviceModelId: props.id,
ids: selectedIds.value.length ? selectedIds.value.join(',') : undefined,
})
download.excel(data, '采集设备模型-点位管理.xls')
} catch {
} finally {

Loading…
Cancel
Save