From 1f0efc9e26aaec937d9f6989f85126fc8365fa64 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Wed, 26 Mar 2025 08:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E6=B5=93=E5=BA=A6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/UploadExcel.vue | 24 +---- src/components/UploadFile/src/useUpload.ts | 6 +- src/views/airqualitycollection/index.vue | 88 ++++++++++++------- src/views/system/role/index.vue | 9 +- src/views/system/user/examine.vue | 11 ++- src/views/system/user/index.vue | 36 ++++---- src/views/task/index.vue | 28 +----- 7 files changed, 90 insertions(+), 112 deletions(-) diff --git a/src/components/UploadFile/src/UploadExcel.vue b/src/components/UploadFile/src/UploadExcel.vue index 91c45b1..85f3acb 100644 --- a/src/components/UploadFile/src/UploadExcel.vue +++ b/src/components/UploadFile/src/UploadExcel.vue @@ -25,25 +25,6 @@  上传Excel - @@ -89,9 +70,9 @@ const uploadList = ref([]) const fileList = ref([]) const uploadNumber = ref(0) -console.log('props.type', props.type) -const { uploadUrl, httpRequest } = useExcelUpload(props.type) + +const { uploadUrl, httpRequest } = useExcelUpload() // 文件上传之前判断 const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { @@ -126,6 +107,7 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { // 文件上传成功 const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { message.success('上传成功') + emit('success') // 删除自身 const index = fileList.value.findIndex((item) => item.response?.data === res.data) fileList.value.splice(index, 1) diff --git a/src/components/UploadFile/src/useUpload.ts b/src/components/UploadFile/src/useUpload.ts index 356da3a..591b916 100644 --- a/src/components/UploadFile/src/useUpload.ts +++ b/src/components/UploadFile/src/useUpload.ts @@ -67,7 +67,7 @@ export const useUpload = () => { } -export const useExcelUpload = (type: any) => { +export const useExcelUpload = () => { //excel 上传地址 const uploadUrl = getImportExcel() // 是否使用前端直连上传 @@ -94,11 +94,11 @@ export const useExcelUpload = (type: any) => { return { data: presignedInfo.url } }) } else { + // 模式二:后端上传 // 重写 el-upload httpRequest 文件上传成功会走成功的钩子,失败走失败的钩子 - return new Promise((resolve, reject) => { - QualityCollectionApi.exportQualityCollection({ file: options.file, type: type }) + QualityCollectionApi.exportQualityCollection({ file: options.file}) .then((res) => { if (res.code === 0) { resolve(res) diff --git a/src/views/airqualitycollection/index.vue b/src/views/airqualitycollection/index.vue index 8368321..1fd28be 100644 --- a/src/views/airqualitycollection/index.vue +++ b/src/views/airqualitycollection/index.vue @@ -2,20 +2,37 @@
- - - + + + + + + +
+ +
+
+ + + 搜索 查询 重置 - + - + + - - - - + @@ -97,8 +103,8 @@ @change="getList" class="ml-auto" /> - - + +
@@ -113,6 +119,7 @@ import download from '@/utils/download' import { QualityCollectionApi, QualityCollectionVO } from '@/api/airqualitycollection' import QualityCollectionForm from './QualityCollectionForm.vue' const activeName = ref(1) + import { UploadExcel } from '@/components/UploadFile' /** 空气质量采集 列表 */ @@ -124,12 +131,12 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 -const queryParams = reactive({ +const queryParams:any = reactive({ pageNo: 1, pageSize: 10, siteName: undefined, city: undefined, - type: undefined, + type: 1, pm25: undefined, pm10: undefined, so2: undefined, @@ -140,7 +147,8 @@ const queryParams = reactive({ o3: undefined, remark: undefined, remark2: undefined, - createTime: [] + createTime: [], + times: [] }) const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 @@ -159,8 +167,15 @@ const getList = async () => { } } +const currentActiveType = computed(() => activeName.value) + + const handleClick = (tab: TabsPaneContext, event: Event) => { - console.log(tab.props, event) + + queryParams.type = tab.props.name + activeName.value = Number(tab.props.name) // 确保类型一致 + nextTick(getList) + } /** 搜索按钮操作 */ @@ -224,6 +239,13 @@ onMounted(() => { } } +.content { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + .demo-tabs > .el-tabs__content { color: #6b778c; font-size: 32px; diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index e926e96..711e671 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -1,8 +1,6 @@ @@ -204,12 +203,17 @@ - + + + @@ -237,12 +241,6 @@ defineOptions({ name: 'SystemUser' }) const closeParent = inject('closeParent') -const props = defineProps({ - isInset: { - type: Boolean, - default: false - } -}) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 diff --git a/src/views/task/index.vue b/src/views/task/index.vue index 259520e..381a3bb 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -65,7 +65,7 @@ > 新增 - + @@ -164,7 +164,6 @@ const { push } = useRouter() const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 -const taskTypeMap = ref() const queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -191,8 +190,6 @@ const exportLoading = ref(false) // 导出的加载中 const taskTypeList: any = ref([]) -const mydateFormatter3 = () => {} - /** 查询列表 */ const getList = async () => { loading.value = true @@ -214,22 +211,6 @@ const getList = async () => { } } -// 立即执行 -const taskExec = async (data) => { - loading.value = true - - try { - await TaskInfoApi.taskExec(data) - message.success(t('common.createSuccess')) - getList() - } finally { - loading.value = false - } -} - -//选择任务中企业范围 -const selectEnterprise = async (id: number) => {} - /** 搜索按钮操作 */ const handleQuery = () => { queryParams.pageNo = 1 @@ -244,9 +225,6 @@ const resetQuery = () => { /** 添加/修改操作 */ const formRef = ref() -const openForm = (type: string, id?: number) => { - formRef.value.open(type, id) -} /** 删除按钮操作 */ const handleDelete = async (id: number) => {