From 318954b36027ee738e4b500a95641de76ec3f9e9 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Tue, 8 Apr 2025 17:28:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E6=96=87=E6=A1=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/auditDocument/contextmenu.vue | 2 +- .../components/auditDocument/detail.vue | 8 ++ .../components/auditDocument/index.vue | 102 ++++++++++++++++-- vue.config.js | 8 +- 4 files changed, 105 insertions(+), 15 deletions(-) diff --git a/src/views/trials/trials-workbench/components/auditDocument/contextmenu.vue b/src/views/trials/trials-workbench/components/auditDocument/contextmenu.vue index 6a995a3d..5b5183ae 100644 --- a/src/views/trials/trials-workbench/components/auditDocument/contextmenu.vue +++ b/src/views/trials/trials-workbench/components/auditDocument/contextmenu.vue @@ -29,7 +29,7 @@ {{ $t('trials:trials-workbench:auditDocument:menu:rename') }} -
+
{{ $t('trials:trials-workbench:auditDocument:menu:del') }}
diff --git a/src/views/trials/trials-workbench/components/auditDocument/detail.vue b/src/views/trials/trials-workbench/components/auditDocument/detail.vue index c3c99f64..a2616395 100644 --- a/src/views/trials/trials-workbench/components/auditDocument/detail.vue +++ b/src/views/trials/trials-workbench/components/auditDocument/detail.vue @@ -5,6 +5,8 @@
+
@@ -200,6 +202,8 @@ export default { .file_icon { width: 50px; height: 50px; + display: flex; + align-items: center; i { display: inline-block; @@ -214,7 +218,11 @@ export default { font-style: normal; pointer-events: none; } +.name_image{ + max-width:90%; + max-height:100%; +} .name_pdf { background-image: url(@/assets/file_icon/pdf.png); } diff --git a/src/views/trials/trials-workbench/components/auditDocument/index.vue b/src/views/trials/trials-workbench/components/auditDocument/index.vue index 4b4d0da4..e01d7915 100644 --- a/src/views/trials/trials-workbench/components/auditDocument/index.vue +++ b/src/views/trials/trials-workbench/components/auditDocument/index.vue @@ -27,7 +27,7 @@ - + {{ $t('trials:trials-workbench:auditDocument:button:addFolder') }} @@ -54,8 +54,8 @@
- { + if (item.Name === data.Name) { + data.repeat++; + data.Name = `${this.$t("trials:trials-workbench:auditDocument:opt:addFloder")}(${data.repeat})` + } + }) + this.tableData.unshift(data) + this.addRenameId(data) + } else { + if (!this.rowData.AuditDocumentTypeEnum) { + parentData = this.getData(this.tableData, this.rowData.Id) + data.ParentId = parentData.Id + parentData.Children.forEach(item => { + if (item.Name === data.Name) { + data.repeat++; + data.Name = `${this.$t("trials:trials-workbench:auditDocument:opt:addFloder")}(${data.repeat})` + } + }) + if (!this.expandedRows.includes(parentData.Id)) { + this.expandedRows.push(parentData.Id) + this.$refs.auditDocumentTable.toggleRowExpansion(parentData, true) + } + parentData.Children.unshift(data) + this.addRenameId(data) + } else { + let fileData = this.getData(this.tableData, this.rowData.Id) + if (fileData.ParentId === this.Id) { + data.ParentId = this.Id + this.tableData.forEach(item => { + if (item.Name === data.Name) { + data.repeat++; + data.Name = `${this.$t("trials:trials-workbench:auditDocument:opt:addFloder")}(${data.repeat})` + } + }) + this.tableData.unshift(data) + this.addRenameId(data) + } else { + parentData = this.getData(this.tableData, this.fileData.ParentId) + data.ParentId = parentData.Id + parentData.Children.forEach(item => { + if (item.Name === data.Name) { + data.repeat++; + data.Name = `${this.$t("trials:trials-workbench:auditDocument:opt:addFloder")}(${data.repeat})` + } + }) + parentData.Children.unshift(data) + this.addRenameId(data) + } + } + } + }, // 获取当前目录层级 async getBreadcrumbData() { if (!this.Id) return this.catalogueData = [] @@ -398,9 +464,23 @@ export default { } }) }, - rename(row) { - this.renameId = null - this.updateData(row) + async rename(row) { + try { + this.renameId = null + if (row.Type === 'addFolder') { + delete row.Id + let data = [row] + let res = await addAuditDocument(JSON.stringify(data)) + if (res.IsSuccess) { + this.getList() + } + } else { + this.updateData(row) + } + } catch (err) { + console.log(rtt) + } + }, handleExpandChange(row, expanded) { if (expanded && !this.expandedRows.find(Id => Id === row.Id)) { @@ -421,6 +501,7 @@ export default { this.renameId = null this.copyList = [] this.shearList = [] + this.rowData = {} }, // 跳转至目录 toCatalogue(row) { @@ -784,7 +865,8 @@ export default { console.log(key, row) this.type = key; if (key === 'rename') { - this.renameId = this.checkList[0] + // this.renameId = this.checkList[0] + this.addRenameId(row) } if (key === 'version') { this.visible = true @@ -1024,12 +1106,12 @@ export default { } .icon_image { - height: 20px; - width: 20px; + max-height: 20px; + max-width: 20px; padding: 0px; line-height: 20px; margin-right: 6px; - margin-top: 6px; + // margin-top: 6px; } .icon { diff --git a/vue.config.js b/vue.config.js index b2790c5d..382970be 100644 --- a/vue.config.js +++ b/vue.config.js @@ -24,10 +24,10 @@ module.exports = defineConfig({ productionSourceMap: false, devServer: { port: '8080', - headers: { - 'Cross-Origin-Opener-Policy': 'same-origin', - 'Cross-Origin-Embedder-Policy': 'require-corp' - }, + // headers: { + // 'Cross-Origin-Opener-Policy': 'same-origin', + // 'Cross-Origin-Embedder-Policy': 'require-corp' + // }, // open: true, client: { overlay: {