工作台稽查文档
continuous-integration/drone/push Build is passing Details

uat
wangxiaoshuang 2025-04-09 10:05:30 +08:00
parent 318954b360
commit 236a565250
4 changed files with 110 additions and 16 deletions

View File

@ -4067,3 +4067,11 @@ export function copyFileOrFolder(data) {
data
})
}
// 工作台-稽查文档授权
export function setIsAuthorization(data) {
return request({
url: `/AuditDocument/setIsAuthorization`,
method: 'post',
data
})
}

View File

@ -218,11 +218,13 @@ 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);
}

View File

@ -26,7 +26,7 @@
{{ $t('common:button:reset') }}
</el-button>
</el-form-item>
<el-form-item>
<el-form-item v-if="isManage">
<el-button type="primary" @click.stop="addFolder">
{{ $t('trials:trials-workbench:auditDocument:button:addFolder') }}
</el-button>
@ -36,6 +36,9 @@
<el-button type="primary" @click.stop="openFile(true)">
{{ $t('trials:trials-workbench:auditDocument:button:uploadFolder') }}
</el-button>
<el-button type="primary" :disabled="checkList.length <= 0" @click.stop="auth(true)">
{{ $t('trials:trials-workbench:auditDocument:button:auth') }}
</el-button>
<el-button type="primary" :disabled="checkList.length <= 0" @click.stop="downLoad(checkList)">
{{ $t('trials:trials-workbench:auditDocument:button:download') }}
</el-button>
@ -71,13 +74,13 @@
:src="OSSclientConfig.basePath + scope.row.FilePath" alt="" class="icon_image">
<i v-else :class="`icon icon_file icon_${scope.row.FileFormat}`" />
<span class="name" :title="scope.row.Name">{{ scope.row.Name }}</span>
<i class="el-icon-edit icon_edit" v-if="hoverId === scope.row.Id"
<i class="el-icon-edit icon_edit" v-if="(hoverId === scope.row.Id) && isManage"
@click="addRenameId(scope.row)"
:title="$t('trials:trials-workbench:auditDocument:icon:rename')" />
</span>
<i :class="{ 'el-icon-circle-check': true, 'icon_check': true, isCheck: checkList.includes(scope.row.Id) }"
@click.stop="addCheck(scope.row)"
v-if="hoverId === scope.row.Id || checkList.includes(scope.row.Id)" />
v-if="(hoverId === scope.row.Id || checkList.includes(scope.row.Id)) && isManage" />
</div>
<el-input v-model="scope.row.Name" :ref="`renameInp_${scope.row.Id}`" :autofocus="true"
class="renameInp" @blur="rename(scope.row)" v-else />
@ -94,9 +97,21 @@
<span>{{ formatFileSize(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="UpdateTime" :label="$t('trials:trials-workbench:auditDocument:table:updateTime')">
<el-table-column prop="IsAuthorization"
:label="$t('trials:trials-workbench:auditDocument:table:IsAuthorization')" show-overflow-tooltip
sortable="custom" 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)"
:inactive-text="$fd('YesOrNo', false)">
</el-switch>
</template>
</el-table-column>
<el-table-column prop="CreateTime" :label="$t('trials:trials-workbench:auditDocument:table:createTime')">
<el-table-column prop="UpdateTime" show-overflow-tooltip
:label="$t('trials:trials-workbench:auditDocument:table:updateTime')">
</el-table-column>
<el-table-column prop="CreateTime" show-overflow-tooltip
:label="$t('trials:trials-workbench:auditDocument:table:createTime')">
</el-table-column>
</el-table>
<contextmenu ref="contextmenu" :isCopy="isCopy" :checkList="checkList" @handleMenu="handleMenu" />
@ -114,7 +129,7 @@
</div>
</template>
<script>
import { getAuditDocumentData, addAuditDocument, getBreadcrumbData, updateAuditDocument, deleteAuditDocument, setCurrentVersion, movieFileOrFolder, copyFileOrFolder } from '@/api/trials'
import { getAuditDocumentData, addAuditDocument, getBreadcrumbData, updateAuditDocument, deleteAuditDocument, setCurrentVersion, movieFileOrFolder, copyFileOrFolder, setIsAuthorization } 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'
@ -180,9 +195,50 @@ export default {
ctrlKey: false, // ctrl
}
},
watch: {
isManage() {
this.Id = null;
this.resetOpt()
this.getBreadcrumbData()
this.getList()
}
},
methods: {
async auth(isArray = true, row, IsAuthorization) {
if (!this.isManage) return false
try {
let data = {}
if (isArray) {
data = {
Ids: this.checkList,
IsAuthorization: true,
}
} else {
data = {
Ids: [row.Id],
IsAuthorization,
}
}
this.loading = true
let res = await setIsAuthorization(data)
this.loading = false
if (res.IsSuccess) {
this.$t('trials:trials-workbench:auditDocument:message:authSuccessfully')
if (isArray) {
this.getList()
}
}
} catch (err) {
this.loading = false
if (!isArray) {
row.IsAuthorizedView = !row.IsAuthorizedView
}
console.log(err)
}
},
//
addFolder() {
if (!this.isManage) return false
let parentData = {}, data = {
ParentId: null,
repeat: 0,
@ -263,6 +319,11 @@ export default {
try {
this.searchData.Id = this.Id
this.loading = true
if (!this.isManage) {
this.searchData.IsAuthorization = true
} else {
this.searchData.IsAuthorization = null
}
let res = await getAuditDocumentData(this.searchData)
this.loading = false
if (res.IsSuccess) {
@ -280,6 +341,7 @@ export default {
},
//
async downLoad(list) {
if (!this.isManage) return false
try {
let arr = this.filterExternalIds(this.tableData, list)
if (arr && arr.length === 1) {
@ -448,6 +510,7 @@ export default {
this.getList()
},
addCheck(row) {
if (!this.isManage) return false
let index = this.checkList.indexOf(row.Id)
if (!!~index) {
this.checkList.splice(index, 1)
@ -457,6 +520,7 @@ export default {
},
addRenameId(row) {
if (!this.isManage) return false
this.renameId = row.Id
this.$nextTick(() => {
if (this.$refs[`renameInp_${row.Id}`]) {
@ -465,6 +529,7 @@ export default {
})
},
async rename(row) {
if (!this.isManage) return false
try {
this.renameId = null
if (row.Type === 'addFolder') {
@ -521,6 +586,7 @@ export default {
},
//
async setCurrentVersion(Id) {
if (!this.isManage) return false
try {
let data = {
Id
@ -535,6 +601,7 @@ export default {
},
//
async copyData(list) {
if (!this.isManage) return false
try {
let DATA = this.getData(this.tableData, this.checkList[0])
let Ids = this.filterExternalIds(this.tableData, list)
@ -553,6 +620,7 @@ export default {
},
//
async moveData(list) {
if (!this.isManage) return false
try {
let DATA = this.getData(this.tableData, this.checkList[0])
let Ids = this.filterExternalIds(this.tableData, list)
@ -571,6 +639,7 @@ export default {
},
//
async delData(Ids) {
if (!this.isManage) return false
try {
let data = { Ids }
let res = await deleteAuditDocument(data)
@ -588,6 +657,7 @@ export default {
},
//
async updateData(row) {
if (!this.isManage) return false
try {
let data = {
AuditDocumentTypeEnum: row.AuditDocumentTypeEnum,
@ -608,6 +678,7 @@ export default {
},
//
async uplaodFile(list) {
if (!this.isManage) return false
let data = []
if (this.config.isVersion) {
data.push({
@ -740,6 +811,7 @@ export default {
}
},
openFileNewVersion(faccept) {
if (!this.isManage) return false
this.faccept = [faccept]
this.limitLength = 1
this.config.title = this.$t(
@ -750,6 +822,7 @@ export default {
this.config.isFolder = false
},
openFile(isFolder = false) {
if (!this.isManage) return false
this.faccept = [
'.jpg',
'.jpeg',
@ -800,11 +873,13 @@ export default {
},
//
openContextmenu(data) {
if (!this.isManage) return false
let { e, row, type, zIndex } = data
this.$refs.contextmenu.init(e, row, type, zIndex)
},
//
handleRowContextmenu(row, column, e) {
if (!this.isManage) return false
e.preventDefault();
if (!this.checkList.includes(row.Id)) this.handleRowClick(row, {}, e)
if (this.checkList.length > 1) return this.$refs.contextmenu.init(e, row, 'files')
@ -861,6 +936,7 @@ export default {
handleCellMouseLeave() { this.hoverId = null },
//
handleMenu(data) {
if (!this.isManage) return false
let { key, row } = data
console.log(key, row)
this.type = key;
@ -938,6 +1014,7 @@ export default {
//
keydown(e) {
if (!this.isManage) return false
this.ctrlKey = e.ctrlKey
if (e.key === 'Control') {
e.preventDefault();
@ -960,6 +1037,7 @@ export default {
},
//
keyup(e) {
if (!this.isManage) return false
this.ctrlKey = e.ctrlKey
},
docClick() {

View File

@ -331,7 +331,7 @@
</div>
<!-- 稽查文档 -->
<div class="my_select_box" :class="{ selected: selected === 'viewAuditDocument' }"
tab-data="viewAuditDocument" @click="selected = 'viewAuditDocument'"
tab-data="viewAuditDocument" @click="handleClick('viewAuditDocument')"
v-if="hasPermi(['trials:trials-workbench:viewAuditDocument'])">
<div class="my_select_box_content">
<span class="el-icon-folder-checked" style="padding: 4px;margin: 4px;color: #6698ff"></span>
@ -349,7 +349,7 @@
</div>
<!-- 稽查文档管理 -->
<div class="my_select_box" :class="{ selected: selected === 'updateAuditDocument' }"
tab-data="updateAuditDocument" @click="selected = 'updateAuditDocument'"
tab-data="updateAuditDocument" @click="handleClick('updateAuditDocument')"
v-if="hasPermi(['trials:trials-workbench:updateAuditDocument'])">
<div class="my_select_box_content">
<span class="el-icon-folder-checked" style="padding: 4px;margin: 4px;color: #6698ff"></span>
@ -634,6 +634,12 @@ export default {
});
},
methods: {
handleClick(key) {
this.selected = null;
this.$nextTick(() => {
this.selected = key
})
},
getUserInfo() {
getUser().then(async res => {
this.user = res.Result