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