This commit is contained in:
sjl
2025-01-22 12:09:32 +08:00
parent 400328d5fa
commit f22b4e7fb8
5 changed files with 38 additions and 15 deletions

View File

@@ -172,6 +172,19 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'createTime',
label: '创建时间',
width: 200,
render: scope => {
if (scope.row.createTime) {
const date = new Date(scope.row.createTime);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
return '';
}
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
])
@@ -193,20 +206,10 @@ const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
// 批量删除设备
const batchDelete = async (id: string[]) => {
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
const result = await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
console.log(result)
if(result.code != 'A0000'){
proTable.value?.clearSelection()
ElMessage.error('1')
console.log('1')
}else{
ElMessage.error('12')
console.log('12')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
// 删除设备
@@ -214,6 +217,7 @@ const handleDelete = async (params: Device.ResPqDev) => {
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
await useHandleData(deletePqDev, { 'ids': [params.id], 'pattern': patternId }, `删除【${params.name}】设备`)
proTable.value?.getTableList()
}
// 导出设备