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