解析列表表格高度修改

This commit is contained in:
zhujiyan
2024-10-30 16:49:08 +08:00
parent 3e5f396f0e
commit 92f7aee017

View File

@@ -1,6 +1,6 @@
<!-- 离线数据导入 -->
<template>
<el-dialog v-model="dialogVisible" title="文件列表" width="70%" :destroy-on-close="true" draggable @closed="close">
<el-dialog v-model="dialogVisible" title="文件列表" width="70%" :destroy-on-close="true" draggable @closed="close">
<!-- 上传文件列表 -->
<div class="offline_data">
<div class="offline_data_btn">
@@ -34,37 +34,32 @@
上传离线数据
</el-button>
<div>
<el-table v-if="offLineFileList&&offLineFileList.length!=0" :data="offLineFileList" style="width: 100%" height="280" border stripe :key="updateKey">
<el-table-column prop="name" label="文件名" align="center"></el-table-column>
<el-table-column prop="webkitRelativePath" label="文件地址" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center" width="250">
<template #default="{ row }">
<el-progress v-if="row.status == 0" :percentage="0">
<el-button text>等待上传</el-button>
</el-progress>
<el-progress v-if="row.status == -1" :percentage="30" :indeterminate="true">
<el-button text>上传中...</el-button>
</el-progress>
<el-progress v-if="row.status == 1" status="success" :percentage="100">
<el-button text>上传成功</el-button>
</el-progress>
</template>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right" align="center">
<template #default="{ row }">
<!-- <el-button size="small" @click="previewFile(row)">预览</el-button> -->
<el-button
size="small"
:disabled="row.status == -1"
type="danger"
text
@click="removeFile(row)"
>
移除
</el-button>
</template>
</el-table-column>
</el-table>
<div :style="tableHeight">
<vxe-table border auto-resize height="auto" :data="offLineFileList" v-bind="defaultAttribute">
<vxe-column field="name" align="center" title="文件名"></vxe-column>
<vxe-column field="webkitRelativePath" align="center" title="文件地址"></vxe-column>
<vxe-column field="status" align="center" title="状态" width="250">
<template v-slot:default="scoped">
<el-progress v-if="scoped.row.status == 0" :percentage="0">
<el-button text>等待上传</el-button>
</el-progress>
<el-progress v-if="scoped.row.status == -1" :percentage="30" :indeterminate="true">
<el-button text>上传中...</el-button>
</el-progress>
<el-progress v-if="scoped.row.status == 1" status="success" :percentage="100">
<el-button text>上传成功</el-button>
</el-progress>
</template>
</vxe-column>
<vxe-column title="操作" width="200px">
<template v-slot:default="scoped">
<el-button link size="small" type="danger" @click="removeFile(scoped.row)">
移除
</el-button>
</template>
</vxe-column>
</vxe-table>
</div>
</div>
</div>
</div>
@@ -77,17 +72,17 @@
</el-dialog>
</template>
<script lang="ts" setup>
import { ref, onMounted, nextTick, watch } from 'vue'
import JSZip from 'jszip'
import { saveAs } from 'file-saver'
import { ElMessageBox } from 'element-plus'
import { ref } from 'vue'
import { uploadOffLineDataFile } from '@/api/cs-device-boot/EquipmentDelivery.ts'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
const dialogVisible = ref(false)
const loading = ref(false)
const offLineFileList: any = ref([])
const disableHandleUpload = ref(true)
const tableHeight = mainHeight(550)
//上传离线数据
const submitUpload = (e:any) => {
const submitUpload = (e: any) => {
const input = document.createElement('input')
input.type = 'file'
input.setAttribute('allowdirs', 'true')
@@ -161,7 +156,7 @@ const open = (devId: any, lineIds: any) => {
dialogVisible.value = true
}
const close = () => {
offLineFileList.value=[]
offLineFileList.value = []
dialogVisible.value = false
}
defineExpose({ open })
@@ -169,7 +164,7 @@ defineExpose({ open })
<style lang="scss" scoped>
.offline_data {
width: 100%;
height: 400px;
height: 500px;
.offline_data_btn {
width: 100%;
height: 40px;