bug调整

This commit is contained in:
2024-12-07 14:01:40 +08:00
parent e56f01db93
commit b6ec3f3f6a

View File

@@ -1,41 +1,41 @@
<template>
<el-dialog
draggable
class="cn-operate-dialog"
v-model="eventDataUploadVisible"
:title="title"
style="width: 415px"
top="25vh"
class='cn-operate-dialog'
v-model='eventDataUploadVisible'
:title='title'
style='width: 415px'
top='25vh'
>
<el-scrollbar>
<el-form :inline="false" :model="form" label-width="120px" ref="formRef">
<el-form-item label="用户数据文件">
<el-form :inline='false' :model='form' label-width='120px' ref='formRef'>
<el-form-item label='用户数据文件'>
<el-upload
v-model:file-list="fileList"
ref="uploadEventData"
action=""
:limit="1"
:on-exceed="handleExceed"
:auto-upload="false"
:on-change="choose"
v-model:file-list='fileList'
ref='uploadEventData'
action=''
:limit='1'
:on-exceed='handleExceed'
:auto-upload='false'
:on-change='choose'
>
<template #trigger>
<el-button type="primary">选择数据文件</el-button>
<el-button type='primary'>选择数据文件</el-button>
</template>
</el-upload>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<span class="dialog-footer">
<el-button @click="eventDataUploadVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<span class='dialog-footer'>
<el-button @click='eventDataUploadVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'>确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts">
<script setup lang='ts'>
import { ref, reactive, inject } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus'
@@ -95,6 +95,11 @@ const submit = async () => {
if (valid) {
let data = new FormData()
data.append('file', form.file)
const allowedTypes = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
if (!allowedTypes.includes(form.file.type)) {
return ElMessage.warning('只能上传 Excel 文件 (.xls 或 .xlsx)!')
}
if (title.value === '导入干扰源用户') {
await importSensitiveReportData(data)
.then(res => handleImportResponse(title.value, res))