From 26721a142e1e08e9d85fd5fc2ce42792857a2f17 Mon Sep 17 00:00:00 2001 From: oneao Date: Thu, 26 Mar 2026 21:43:19 +0800 Subject: [PATCH] u --- code/container-ocr/ocr-vue/components.d.ts | 7 - .../src/components/g3-detail/index.vue | 2 - .../ocr-vue/src/styles/element-plus.scss | 2 +- .../views/container/high-download-dialog.vue | 283 ++++++++++++++++++ .../ocr-vue/src/views/container/index.vue | 79 ++++- 5 files changed, 350 insertions(+), 23 deletions(-) create mode 100644 code/container-ocr/ocr-vue/src/views/container/high-download-dialog.vue diff --git a/code/container-ocr/ocr-vue/components.d.ts b/code/container-ocr/ocr-vue/components.d.ts index cdbb6b41..ab8d863d 100644 --- a/code/container-ocr/ocr-vue/components.d.ts +++ b/code/container-ocr/ocr-vue/components.d.ts @@ -18,7 +18,6 @@ declare module 'vue' { ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] - ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] @@ -28,21 +27,15 @@ declare module 'vue' { ElInput: typeof import('element-plus/es')['ElInput'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] - ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElResult: typeof import('element-plus/es')['ElResult'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] - ElSelect: typeof import('element-plus/es')['ElSelect'] ElSplitter: typeof import('element-plus/es')['ElSplitter'] ElSplitterPanel: typeof import('element-plus/es')['ElSplitterPanel'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] - ElTable: typeof import('element-plus/es')['ElTable'] - ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] G3Column: typeof import('./src/components/g3-table/g3-column.vue')['default'] diff --git a/code/container-ocr/ocr-vue/src/components/g3-detail/index.vue b/code/container-ocr/ocr-vue/src/components/g3-detail/index.vue index c0dd535c..12f3b537 100644 --- a/code/container-ocr/ocr-vue/src/components/g3-detail/index.vue +++ b/code/container-ocr/ocr-vue/src/components/g3-detail/index.vue @@ -13,8 +13,6 @@ const props = defineProps({ const dataList = ref([]); async function initData() { - console.log(props); - if (!props.viewName) return; loading.value = true; diff --git a/code/container-ocr/ocr-vue/src/styles/element-plus.scss b/code/container-ocr/ocr-vue/src/styles/element-plus.scss index d8d70926..a2908f78 100644 --- a/code/container-ocr/ocr-vue/src/styles/element-plus.scss +++ b/code/container-ocr/ocr-vue/src/styles/element-plus.scss @@ -22,7 +22,7 @@ .el-loading-mask { &.is-fullscreen { - background: "rgba(0, 0, 0, 0.5)"; + background: rgba(0, 0, 0, 0.5); .el-loading-spinner .path { stroke: #fff !important; diff --git a/code/container-ocr/ocr-vue/src/views/container/high-download-dialog.vue b/code/container-ocr/ocr-vue/src/views/container/high-download-dialog.vue new file mode 100644 index 00000000..0dfe19ab --- /dev/null +++ b/code/container-ocr/ocr-vue/src/views/container/high-download-dialog.vue @@ -0,0 +1,283 @@ + + + + + diff --git a/code/container-ocr/ocr-vue/src/views/container/index.vue b/code/container-ocr/ocr-vue/src/views/container/index.vue index 7060ee74..a9802387 100644 --- a/code/container-ocr/ocr-vue/src/views/container/index.vue +++ b/code/container-ocr/ocr-vue/src/views/container/index.vue @@ -15,6 +15,7 @@ import { saveAs } from "file-saver"; import JSZip from "jszip"; import { usePermissionStore } from "@/store/permission"; import { ExportVxeTableExcel, exportExcel } from "@/utils/excel"; +import HighDownloadDialog from "./high-download-dialog.vue"; const tableRef = ref(); @@ -28,6 +29,8 @@ const loading = reactive({ table: true, }); +const showHighDownload = ref(false); + const searchForm = ref({ startTime: "", endTime: "", @@ -57,7 +60,9 @@ const viewName = "v_container"; const showPreview = ref(false); const previewIndex = ref(-1); const previewImageList = computed(() => { - return tableData.value.map((item) => item.b_container_img).filter((img) => img); + return tableData.value + .map((item) => item.b_container_img) + .filter((img) => img); }); const currentRow = ref({}); @@ -190,9 +195,12 @@ async function deleteRows(rows = []) { const safeDeleteIds = deleteIds.map((id) => Number(id)); // 使用安全的 SQL 查询 - const fileRes = await loadDataApi("bf_file", `father IN (${safeDeleteIds.join(",")})`, "", [ - "subid", - ]); + const fileRes = await loadDataApi( + "bf_file", + `father IN (${safeDeleteIds.join(",")})`, + "", + ["subid"], + ); if (!fileRes.success) { return; @@ -268,7 +276,11 @@ async function handleDownloadOne(data) { }); try { - const fileRes = await loadDataApi("bf_file", `father = ${data.b_id}`, "mx_xh asc"); + const fileRes = await loadDataApi( + "bf_file", + `father = ${data.b_id}`, + "mx_xh asc", + ); if (!fileRes.success) { ElMessage.error("获取附件失败"); @@ -276,7 +288,11 @@ async function handleDownloadOne(data) { } const downloadFiles = fileRes.data.map((item, index) => ({ - mx_filename: buildFileName(data.b_container_no, index + 1, item.mx_filename), + mx_filename: buildFileName( + data.b_container_no, + index + 1, + item.mx_filename, + ), mx_mapfilename: item.mx_mapfilename, })); @@ -338,7 +354,11 @@ async function handleDownloadBatch() { let finished = 0; for (const item of records) { - const fileRes = await loadDataApi("bf_file", `father = '${item.b_id}'`, ""); + const fileRes = await loadDataApi( + "bf_file", + `father = '${item.b_id}'`, + "", + ); if (fileRes.success) { total += (fileRes.data || []).length; } @@ -349,7 +369,11 @@ async function handleDownloadBatch() { const folder = zip.folder(folderName); - const fileRes = await loadDataApi("bf_file", `father = '${item.b_id}'`, "mx_xh asc"); + const fileRes = await loadDataApi( + "bf_file", + `father = '${item.b_id}'`, + "mx_xh asc", + ); if (!fileRes.success) { ElMessage.error("获取附件失败"); @@ -365,7 +389,8 @@ async function handleDownloadBatch() { const blob = getAliyunFileBlob(fileUrl); const fileName = - buildFileName(item.b_container_no, index + 1, file.mx_filename) || "未命名文件"; + buildFileName(item.b_container_no, index + 1, file.mx_filename) || + "未命名文件"; folder.file(fileName, blob); } catch (e) { @@ -401,7 +426,6 @@ function buildFileName(containerNo, index, fileName) { } function testExport() { - const options = { columns: [ { @@ -575,6 +599,16 @@ function testExport() { 批量下载 + + + + + 高级下载 + 栏位保存 - 导出Execl + + 导出Execl + + + 高级导出 + @@ -644,7 +683,14 @@ function testExport() { show-overflow show-header-overflow > - + @@ -736,6 +787,8 @@ function testExport() { module-id="b_container" :categories="fileCategories" /> + +