稽查文档排序、新增文件夹更换接口
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0d446746e6
commit
ab058d6659
|
@ -4101,4 +4101,12 @@ export function setIsAuthorization(data) {
|
|||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 工作台-稽查文档新增文件夹
|
||||
export function addFolder(data) {
|
||||
return request({
|
||||
url: `/AuditDocument/addFolder`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
|
@ -61,11 +61,11 @@
|
|||
<el-table id="auditDocumentTable" ref="auditDocumentTable" :data="tableData" style="width: 99%" row-key="Id"
|
||||
:loading="loading" :row-style="setRowStyle" v-adaptive="{ bottomOffset: 75 }" height="100" :border="true"
|
||||
:expand-row-keys="expandedRows" :tree-props="{ children: 'Children', hasChildren: 'hasChildren' }"
|
||||
@expand-change="handleExpandChange" @row-click="handleRowClick" @cell-mouse-enter="handleCellMouseEnter"
|
||||
@cell-mouse-leave="handleCellMouseLeave" @row-contextmenu="handleRowContextmenu"
|
||||
@row-dblclick="handleRowDblclick">
|
||||
<el-table-column prop="date" :label="$t('trials:trials-workbench:auditDocument:table:name')" sortable
|
||||
min-width="300" class-name="catalogue_box">
|
||||
@sort-change="handleSortByColumn" @expand-change="handleExpandChange" @row-click="handleRowClick"
|
||||
@cell-mouse-enter="handleCellMouseEnter" @cell-mouse-leave="handleCellMouseLeave"
|
||||
@row-contextmenu="handleRowContextmenu" @row-dblclick="handleRowDblclick">
|
||||
<el-table-column prop="Name" :label="$t('trials:trials-workbench:auditDocument:table:name')"
|
||||
sortable="custom" min-width="300" class-name="catalogue_box">
|
||||
<template slot-scope="scope">
|
||||
<div class="name_layout_box">
|
||||
<div class="name_layout" v-if="renameId !== scope.row.Id">
|
||||
|
@ -100,7 +100,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="IsAuthorization"
|
||||
:label="$t('trials:trials-workbench:auditDocument:table:IsAuthorization')" show-overflow-tooltip
|
||||
sortable="custom" v-if="isManage">
|
||||
v-if="isManage">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.IsAuthorization" @change="(val) => auth(false, scope.row, val)"
|
||||
:active-value="true" :inactive-value="false" :active-text="$fd('YesOrNo', true)"
|
||||
|
@ -130,7 +130,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getAuditDocumentData, addAuditDocument, getBreadcrumbData, updateAuditDocument, deleteAuditDocument, setCurrentVersion, movieFileOrFolder, copyFileOrFolder, setIsAuthorization } from '@/api/trials'
|
||||
import { getAuditDocumentData, addAuditDocument, getBreadcrumbData, updateAuditDocument, deleteAuditDocument, setCurrentVersion, movieFileOrFolder, copyFileOrFolder, setIsAuthorization, addFolder } from '@/api/trials'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import contextmenu from './contextmenu.vue'
|
||||
import uploadFiles from '@/views/trials/trials-panel/trial-summary/trial-document/components/uploadFiles.vue'
|
||||
|
@ -139,10 +139,10 @@ import { downLoadFile } from '@/utils/stream.js'
|
|||
const searchDataDefault = () => {
|
||||
return {
|
||||
Name: null,
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
asc: false,
|
||||
sortField: ''
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
Asc: false,
|
||||
SortField: ''
|
||||
}
|
||||
}
|
||||
export default {
|
||||
|
@ -240,7 +240,7 @@ export default {
|
|||
// 新建文件夹
|
||||
addFolder() {
|
||||
if (!this.isManage) return false
|
||||
let parentData = {}, data = {
|
||||
let data = {
|
||||
ParentId: null,
|
||||
repeat: 0,
|
||||
Type: "addFolder",
|
||||
|
@ -250,58 +250,68 @@ export default {
|
|||
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)
|
||||
}
|
||||
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)
|
||||
// let parentData = {}
|
||||
// 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() {
|
||||
|
@ -340,6 +350,16 @@ export default {
|
|||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 排序
|
||||
handleSortByColumn(column) {
|
||||
if (column.order === 'ascending') {
|
||||
this.searchData.asc = true
|
||||
} else {
|
||||
this.searchData.asc = false
|
||||
}
|
||||
this.searchData.sortField = column.prop
|
||||
this.getList()
|
||||
},
|
||||
// 下载
|
||||
async downLoad(list) {
|
||||
if (!this.isManage) return false
|
||||
|
@ -532,11 +552,15 @@ export default {
|
|||
async rename(row) {
|
||||
if (!this.isManage) return false
|
||||
try {
|
||||
if (!row.Name) {
|
||||
this.$message.warning(this.$t("trials:trials-workbench:auditDocument:noFolderName"))
|
||||
return this.addRenameId(row)
|
||||
}
|
||||
this.renameId = null
|
||||
if (row.Type === 'addFolder') {
|
||||
delete row.Id
|
||||
let data = [row]
|
||||
let res = await addAuditDocument(JSON.stringify(data))
|
||||
let data = row
|
||||
let res = await addFolder(data)
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
}
|
||||
|
@ -544,7 +568,10 @@ export default {
|
|||
this.updateData(row)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(rtt)
|
||||
if (row.Type === 'addFolder') {
|
||||
this.getList()
|
||||
}
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -696,13 +723,13 @@ export default {
|
|||
} else {
|
||||
data = this.formatData(list)
|
||||
let ParentId = this.Id
|
||||
if (this.rowData && this.rowData.Id) {
|
||||
if (this.rowData.AuditDocumentTypeEnum) {
|
||||
ParentId = this.rowData.ParentId
|
||||
} else {
|
||||
ParentId = this.rowData.Id
|
||||
}
|
||||
}
|
||||
// if (this.rowData && this.rowData.Id) {
|
||||
// if (this.rowData.AuditDocumentTypeEnum) {
|
||||
// ParentId = this.rowData.ParentId
|
||||
// } else {
|
||||
// ParentId = this.rowData.Id
|
||||
// }
|
||||
// }
|
||||
data.forEach(item => {
|
||||
item.ParentId = ParentId
|
||||
})
|
||||
|
@ -866,8 +893,7 @@ export default {
|
|||
},
|
||||
// 预览文件
|
||||
perview(data) {
|
||||
if (['.pdf',
|
||||
'.ppt',
|
||||
if (['.ppt',
|
||||
'.pptx',
|
||||
'.doc',
|
||||
'.docx',
|
||||
|
@ -884,6 +910,13 @@ export default {
|
|||
'.png'].includes(`.${data.FileFormat.toLowerCase()}`)) {
|
||||
this.$refs['picture_perview'].$viewer.show()
|
||||
}
|
||||
if (['.pdf'].includes(`.${data.FileFormat.toLowerCase()}`)) {
|
||||
this.$preview({
|
||||
path: data.Path || data.FilePath,
|
||||
type: 'pdf',
|
||||
title: data.Name,
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 版本记录(右键菜单)
|
||||
|
|
Loading…
Reference in New Issue