diff --git a/src/views/system/fileConfiguration/addDDialog.vue b/src/views/system/fileConfiguration/addDDialog.vue index 2900af9..42113b4 100644 --- a/src/views/system/fileConfiguration/addDDialog.vue +++ b/src/views/system/fileConfiguration/addDDialog.vue @@ -110,6 +110,10 @@ if (!checkFile(type)) { return } + if (ruleForm.value.minioFileName.length > 30) { + ElMessage.warning('文件名长度超出最大限制') + return + } if (title.value === '新增') { addeFileListPage(ruleForm.value).then((res) => { ElMessage({ diff --git a/src/views/system/fileConfiguration/addDDialog.vue b/src/views/system/fileConfiguration/addDDialog.vue index 2900af9..42113b4 100644 --- a/src/views/system/fileConfiguration/addDDialog.vue +++ b/src/views/system/fileConfiguration/addDDialog.vue @@ -110,6 +110,10 @@ if (!checkFile(type)) { return } + if (ruleForm.value.minioFileName.length > 30) { + ElMessage.warning('文件名长度超出最大限制') + return + } if (title.value === '新增') { addeFileListPage(ruleForm.value).then((res) => { ElMessage({ diff --git a/src/views/system/fileConfiguration/configuration.vue b/src/views/system/fileConfiguration/configuration.vue index 84661e4..27cb401 100644 --- a/src/views/system/fileConfiguration/configuration.vue +++ b/src/views/system/fileConfiguration/configuration.vue @@ -116,41 +116,42 @@ const selectList = ref([]) // 表格多选 const multiSelect = (e: any) => { + console.log(e, 'eeee') selectList.value = e.map((item: { id: string }) => item.id) } // 导出 const exportExcelBtn = () => { + if (!selectList.value.length) { + ElMessage.warning('请选择需要导出的数据') + } const loading = ElLoading.service({ lock: true, text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (list.value.length > 0) { - const param = { - fileName: searchQuery.fileName, // 文件名称 - moduleName: searchQuery.moduleName, // 模块名 - downloadNo: searchQuery.downloadNo, - limit: 20, - offset: 1, - ids: selectList.value, - } - exportFileListPage(param).then((res) => { - exportFile(res.data, '文件配置管理') + const param = { + fileName: searchQuery.fileName, // 文件名称 + moduleName: searchQuery.moduleName, // 模块名 + downloadNo: searchQuery.downloadNo, + limit: 20, + offset: 1, + ids: selectList.value, + } + exportFileListPage(param).then((res) => { + exportFile(res.data, '文件配置管理') + loading.close() + // searchQuery.ids = [] + }) + .catch((_) => { loading.close() - searchQuery.ids = [] }) - .catch((_) => { - loading.close() - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() } // 打印 function printList() { - const selectIds = selectList.value.map((item: any) => item.id) + if (!selectList.value.length) { + ElMessage.warning('请选择需要打印的数据') + } + const selectIds = selectList.value // 打印列 const properties = columns.value.map((item) => { return { @@ -158,16 +159,8 @@ displayName: item.text, } }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '文件配置管理') - } - else if (selectIds.length > 0) { - const printList = list.value.filter((item: any) => selectIds.includes(item.id)) - printJSON(printList, properties, '文件配置管理') - } - else { - ElMessage('无可打印内容') - } + const printList = list.value.filter((item: any) => selectIds.includes(item.id)) + printJSON(printList, properties, '文件配置管理') } @@ -197,7 +190,7 @@