稽查文档管理新增文件夹
continuous-integration/drone/push Build is passing Details

uat
wangxiaoshuang 2025-04-08 17:28:40 +08:00
parent 91d31b4226
commit 318954b360
4 changed files with 105 additions and 15 deletions

View File

@ -29,7 +29,7 @@
<i class="icon icon_rename" /> <i class="icon icon_rename" />
<span>{{ $t('trials:trials-workbench:auditDocument:menu:rename') }}</span> <span>{{ $t('trials:trials-workbench:auditDocument:menu:rename') }}</span>
</div> </div>
<div class="contextmenu__item" @click="getDataPath('del')"> <div class="contextmenu__item" @click="handleMenu('del')">
<i class="icon icon_del" /> <i class="icon icon_del" />
<span>{{ $t('trials:trials-workbench:auditDocument:menu:del') }}</span> <span>{{ $t('trials:trials-workbench:auditDocument:menu:del') }}</span>
</div> </div>

View File

@ -5,6 +5,8 @@
<div class="header"> <div class="header">
<div class="file_icon"> <div class="file_icon">
<i class="name_folder" v-if="!rowData.AuditDocumentTypeEnum"></i> <i class="name_folder" v-if="!rowData.AuditDocumentTypeEnum"></i>
<img v-else-if="['png', 'jpg', 'jpeg'].includes(rowData.FileFormat.toLowerCase())"
:src="OSSclientConfig.basePath + rowData.FilePath" alt="" class="name_image">
<i :class="`name_${rowData.FileFormat}`" v-else></i> <i :class="`name_${rowData.FileFormat}`" v-else></i>
</div> </div>
<div class="file_name"> <div class="file_name">
@ -200,6 +202,8 @@ export default {
.file_icon { .file_icon {
width: 50px; width: 50px;
height: 50px; height: 50px;
display: flex;
align-items: center;
i { i {
display: inline-block; display: inline-block;
@ -214,7 +218,11 @@ export default {
font-style: normal; font-style: normal;
pointer-events: none; pointer-events: none;
} }
.name_image{
max-width:90%;
max-height:100%;
}
.name_pdf { .name_pdf {
background-image: url(@/assets/file_icon/pdf.png); background-image: url(@/assets/file_icon/pdf.png);
} }

View File

@ -27,7 +27,7 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary"> <el-button type="primary" @click.stop="addFolder">
{{ $t('trials:trials-workbench:auditDocument:button:addFolder') }} {{ $t('trials:trials-workbench:auditDocument:button:addFolder') }}
</el-button> </el-button>
<el-button type="primary" @click.stop="openFile(false)"> <el-button type="primary" @click.stop="openFile(false)">
@ -54,8 +54,8 @@
</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<el-table id="auditDocumentTable" :data="tableData" style="width: 99%" row-key="Id" :loading="loading" <el-table id="auditDocumentTable" ref="auditDocumentTable" :data="tableData" style="width: 99%" row-key="Id"
:row-style="setRowStyle" v-adaptive="{ bottomOffset: 75 }" height="100" :border="true" :loading="loading" :row-style="setRowStyle" v-adaptive="{ bottomOffset: 75 }" height="100" :border="true"
:expand-row-keys="expandedRows" :tree-props="{ children: 'Children', hasChildren: 'hasChildren' }" :expand-row-keys="expandedRows" :tree-props="{ children: 'Children', hasChildren: 'hasChildren' }"
@expand-change="handleExpandChange" @row-click="handleRowClick" @cell-mouse-enter="handleCellMouseEnter" @expand-change="handleExpandChange" @row-click="handleRowClick" @cell-mouse-enter="handleCellMouseEnter"
@cell-mouse-leave="handleCellMouseLeave" @row-contextmenu="handleRowContextmenu" @cell-mouse-leave="handleCellMouseLeave" @row-contextmenu="handleRowContextmenu"
@ -105,6 +105,7 @@
<detail ref="versionDetail" v-if="visible" :visible.sync="visible" :rowData="rowData" <detail ref="versionDetail" v-if="visible" :visible.sync="visible" :rowData="rowData"
@openContextmenu="openContextmenu" @openFileNewVersion="openFileNewVersion" @delData="delData" /> @openContextmenu="openContextmenu" @openFileNewVersion="openFileNewVersion" @delData="delData" />
<viewer ref="picture_perview" style="margin: 0 10px" <viewer ref="picture_perview" style="margin: 0 10px"
v-if="rowData.FileFormat && ['png', 'jpg', 'jpeg'].includes(rowData.FileFormat.toLowerCase())"
:images="[`${OSSclientConfig.basePath}${rowData.FilePath}`]"> :images="[`${OSSclientConfig.basePath}${rowData.FilePath}`]">
<img v-show="false" crossorigin="anonymous" :src="`${OSSclientConfig.basePath}${rowData.FilePath}`" <img v-show="false" crossorigin="anonymous" :src="`${OSSclientConfig.basePath}${rowData.FilePath}`"
@ -180,6 +181,71 @@ export default {
} }
}, },
methods: { methods: {
//
addFolder() {
let parentData = {}, data = {
ParentId: null,
repeat: 0,
Type: "addFolder",
Name: this.$t("trials:trials-workbench:auditDocument:opt:addFloder"),
IsAuthorization: false,
AuditDocumentTypeEnum: 0,
Id: `addFolder_${Date.now()}`,
Children: []
}
if (!this.rowData || !this.rowData.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 {
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() { async getBreadcrumbData() {
if (!this.Id) return this.catalogueData = [] if (!this.Id) return this.catalogueData = []
@ -398,9 +464,23 @@ export default {
} }
}) })
}, },
rename(row) { async rename(row) {
try {
this.renameId = null 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) this.updateData(row)
}
} catch (err) {
console.log(rtt)
}
}, },
handleExpandChange(row, expanded) { handleExpandChange(row, expanded) {
if (expanded && !this.expandedRows.find(Id => Id === row.Id)) { if (expanded && !this.expandedRows.find(Id => Id === row.Id)) {
@ -421,6 +501,7 @@ export default {
this.renameId = null this.renameId = null
this.copyList = [] this.copyList = []
this.shearList = [] this.shearList = []
this.rowData = {}
}, },
// //
toCatalogue(row) { toCatalogue(row) {
@ -784,7 +865,8 @@ export default {
console.log(key, row) console.log(key, row)
this.type = key; this.type = key;
if (key === 'rename') { if (key === 'rename') {
this.renameId = this.checkList[0] // this.renameId = this.checkList[0]
this.addRenameId(row)
} }
if (key === 'version') { if (key === 'version') {
this.visible = true this.visible = true
@ -1024,12 +1106,12 @@ export default {
} }
.icon_image { .icon_image {
height: 20px; max-height: 20px;
width: 20px; max-width: 20px;
padding: 0px; padding: 0px;
line-height: 20px; line-height: 20px;
margin-right: 6px; margin-right: 6px;
margin-top: 6px; // margin-top: 6px;
} }
.icon { .icon {

View File

@ -24,10 +24,10 @@ module.exports = defineConfig({
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
port: '8080', port: '8080',
headers: { // headers: {
'Cross-Origin-Opener-Policy': 'same-origin', // 'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp' // 'Cross-Origin-Embedder-Policy': 'require-corp'
}, // },
// open: true, // open: true,
client: { client: {
overlay: { overlay: {