parent
832bf3bf66
commit
f1f6d2415c
@ -0,0 +1,111 @@ |
|||||||
|
<template> |
||||||
|
<div class="app-container"> |
||||||
|
<el-card shadow="never"> |
||||||
|
<template #header> |
||||||
|
<div class="flex justify-between"> |
||||||
|
<div style="display: flex; align-items: center"> |
||||||
|
<el-icon size="15"><Grid /></el-icon> <span |
||||||
|
style="font-weight: 700; font-size: 14px; line-height: 16px" |
||||||
|
>厂商配置文件列表</span |
||||||
|
> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<el-button type="primary" :icon="Position" @click="submit" |
||||||
|
>执行</el-button |
||||||
|
> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
<div class="any-table"> |
||||||
|
<el-table |
||||||
|
:data="tableData" |
||||||
|
v-loading="loading" |
||||||
|
highlight-current-row |
||||||
|
@row-click="handleCurrentChange" |
||||||
|
> |
||||||
|
<el-table-column width="55"> |
||||||
|
<template #default="scope"> |
||||||
|
<el-radio :label="scope.row.fileId" v-model="fileId"> |
||||||
|
{{ "" }} |
||||||
|
</el-radio> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
<el-table-column |
||||||
|
label="厂商配置文件" |
||||||
|
prop="fileName" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="文件创建时间" |
||||||
|
prop="fileCreateTime" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="文件描述内容" |
||||||
|
prop="fileDesc" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
</el-table> |
||||||
|
</div> |
||||||
|
</el-card> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script setup lang="ts"> |
||||||
|
import { Grid, Position } from "@element-plus/icons-vue"; |
||||||
|
import { FileListVO } from "@/api/file-list/types"; |
||||||
|
import { listVendorProfile } from "@/api/device-type-ver"; |
||||||
|
import { ElTable } from "element-plus"; |
||||||
|
import { SoftVersionUpgradeVO } from "@/api/device-type-ver/types"; |
||||||
|
import { remoteVendorProfile } from "@/api/remote"; |
||||||
|
const route = useRoute(); |
||||||
|
let devId: number = parseInt(<string>route.params.devId); |
||||||
|
let typeAndVerId: number = parseInt(<string>route.params.typeAndVerId); |
||||||
|
const tableData = ref<FileListVO[]>([]); |
||||||
|
const loading = ref<boolean>(false); |
||||||
|
const fileId = ref<number>(); |
||||||
|
const handleCurrentChange = (val: SoftVersionUpgradeVO) => { |
||||||
|
fileId.value = val.fileId; |
||||||
|
}; |
||||||
|
const getData = () => { |
||||||
|
loading.value = true; |
||||||
|
listVendorProfile(typeAndVerId) |
||||||
|
.then(({ data }) => { |
||||||
|
tableData.value = data; |
||||||
|
}) |
||||||
|
.finally(() => { |
||||||
|
loading.value = false; |
||||||
|
}); |
||||||
|
}; |
||||||
|
const submit = () => { |
||||||
|
if (fileId.value === undefined) { |
||||||
|
ElMessage({ |
||||||
|
message: "请选择一个设备厂商文件", |
||||||
|
duration: 1000, |
||||||
|
type: "error", |
||||||
|
}); |
||||||
|
return; |
||||||
|
} |
||||||
|
loading.value = true; |
||||||
|
remoteVendorProfile(devId, fileId.value) |
||||||
|
.then(() => { |
||||||
|
ElMessage({ |
||||||
|
message: "操作成功", |
||||||
|
type: "success", |
||||||
|
duration: 1000, |
||||||
|
}); |
||||||
|
}) |
||||||
|
.finally(() => { |
||||||
|
loading.value = false; |
||||||
|
}); |
||||||
|
}; |
||||||
|
onMounted(() => { |
||||||
|
getData(); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped> |
||||||
|
:deep(.el-card__body) { |
||||||
|
padding: 10px 0 0 0; |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue