稽查文档管理
continuous-integration/drone/push Build is failing
Details
|
@ -56,7 +56,6 @@
|
||||||
"pdfobject": "^2.3.0",
|
"pdfobject": "^2.3.0",
|
||||||
"qrcodejs2": "^0.0.2",
|
"qrcodejs2": "^0.0.2",
|
||||||
"screenfull": "^6.0.2",
|
"screenfull": "^6.0.2",
|
||||||
"sortablejs": "^1.15.5",
|
|
||||||
"streamsaver": "^2.0.6",
|
"streamsaver": "^2.0.6",
|
||||||
"svg-sprite-loader": "^4.1.3",
|
"svg-sprite-loader": "^4.1.3",
|
||||||
"svgo": "^1.2.2",
|
"svgo": "^1.2.2",
|
||||||
|
|
|
@ -3995,3 +3995,35 @@ export function deleteTrialFileType(id) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 工作台-获取稽查文档
|
||||||
|
export function getAuditDocumentData(data) {
|
||||||
|
return request({
|
||||||
|
url: `/AuditDocument/getAuditDocumentData`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工作台-新增稽查文档
|
||||||
|
export function addAuditDocument(data) {
|
||||||
|
return request({
|
||||||
|
url: `/AuditDocument/addAuditDocument`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工作台-获取当前目录层级
|
||||||
|
export function getBreadcrumbData(data) {
|
||||||
|
return request({
|
||||||
|
url: `/AuditDocument/getBreadcrumbData`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工作台-修改稽查文档
|
||||||
|
export function updateAuditDocument(data) {
|
||||||
|
return request({
|
||||||
|
url: `/AuditDocument/updateAuditDocument`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 7.2 KiB |
|
@ -10,43 +10,20 @@
|
||||||
)
|
)
|
||||||
}}</el-divider>
|
}}</el-divider>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div
|
<div class="upload" style="margin-right: 10px" :disabled="limitLength" v-if="!limitLength">
|
||||||
class="upload"
|
<input multiple="multiple" webkitdirectory="" directory accept="*/*" type="file" name="uploadFolder"
|
||||||
style="margin-right: 10px"
|
class="select-file" title="" @change="beginScanFiles($event)" v-if="
|
||||||
:disabled="limitLength"
|
|
||||||
v-if="!limitLength"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
multiple="multiple"
|
|
||||||
webkitdirectory=""
|
|
||||||
directory
|
|
||||||
accept="*/*"
|
|
||||||
type="file"
|
|
||||||
name="uploadFolder"
|
|
||||||
class="select-file"
|
|
||||||
title=""
|
|
||||||
@change="beginScanFiles($event)"
|
|
||||||
v-if="
|
|
||||||
!loading &&
|
!loading &&
|
||||||
(!limitLength ||
|
(!limitLength ||
|
||||||
(fileList.length < limitLength && limitLength > 1))
|
(fileList.length < limitLength && limitLength > 1))
|
||||||
"
|
" />
|
||||||
/>
|
|
||||||
<div class="btn-select">
|
<div class="btn-select">
|
||||||
{{ $t('trials:trialDocument:button:selectFolder') }}
|
{{ $t('trials:trialDocument:button:selectFolder') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
<input
|
<input class="select-file" multiple="" :accept="faccept.join(',')" type="file" name="uploadFile" title=""
|
||||||
class="select-file"
|
@change="beginScanFiles($event)" v-if="!loading && (!limitLength || fileList.length < limitLength)" />
|
||||||
multiple=""
|
|
||||||
:accept="faccept.join(',')"
|
|
||||||
type="file"
|
|
||||||
name="uploadFile"
|
|
||||||
title=""
|
|
||||||
@change="beginScanFiles($event)"
|
|
||||||
v-if="!loading && (!limitLength || fileList.length < limitLength)"
|
|
||||||
/>
|
|
||||||
<div class="btn-select">
|
<div class="btn-select">
|
||||||
{{ $t('trials:trialDocument:button:select') }}
|
{{ $t('trials:trialDocument:button:select') }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,30 +31,14 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<!-- 文件列表 -->
|
<!-- 文件列表 -->
|
||||||
<el-table
|
<el-table ref="filesTable" :data="fileList" class="dicomFiles-table" height="300"
|
||||||
ref="filesTable"
|
@selection-change="handleSelectionChange">
|
||||||
:data="fileList"
|
<el-table-column type="selection" width="55" :selectable="(row, index) => row.status !== 2 && !loading" />
|
||||||
class="dicomFiles-table"
|
|
||||||
height="300"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
type="selection"
|
|
||||||
width="55"
|
|
||||||
:selectable="(row, index) => row.status !== 2 && !loading"
|
|
||||||
/>
|
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<!-- 文件名称 -->
|
<!-- 文件名称 -->
|
||||||
<el-table-column
|
<el-table-column prop="name" :label="$t('trials:trialDocument:table:fileName')" min-width="100" />
|
||||||
prop="name"
|
|
||||||
:label="$t('trials:trialDocument:table:fileName')"
|
|
||||||
min-width="100"
|
|
||||||
/>
|
|
||||||
<!-- 文件大小 -->
|
<!-- 文件大小 -->
|
||||||
<el-table-column
|
<el-table-column prop="size" :label="$t('trials:trialDocument:table:fileSize')">
|
||||||
prop="size"
|
|
||||||
:label="$t('trials:trialDocument:table:fileSize')"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{
|
<span>{{
|
||||||
scope.row.size && scope.row.size > 0
|
scope.row.size && scope.row.size > 0
|
||||||
|
@ -87,49 +48,27 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- 文件类型 -->
|
<!-- 文件类型 -->
|
||||||
<el-table-column
|
<el-table-column prop="type" :label="$t('trials:trialDocument:table:fileType')" />
|
||||||
prop="type"
|
|
||||||
:label="$t('trials:trialDocument:table:fileType')"
|
|
||||||
/>
|
|
||||||
<!-- 上传状态 -->
|
<!-- 上传状态 -->
|
||||||
<el-table-column
|
<el-table-column prop="status" :label="$t('trials:trialDocument:table:uploadStatus')" min-width="100">
|
||||||
prop="status"
|
|
||||||
:label="$t('trials:trialDocument:table:uploadStatus')"
|
|
||||||
min-width="100"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag :type="['warning', 'info', 'success', 'danger'][scope.row.status]"
|
||||||
:type="['warning', 'info', 'success', 'danger'][scope.row.status]"
|
v-if="scope.row.status || scope.row.status === 0">{{ $fd('NoneDicomUploadStatus', scope.row.status) }}
|
||||||
v-if="scope.row.status || scope.row.status === 0"
|
|
||||||
>{{ $fd('NoneDicomUploadStatus', scope.row.status) }}
|
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column :label="$t('trials:trialDocument:table:failedFileCount')" min-width="150"
|
||||||
:label="$t('trials:trialDocument:table:failedFileCount')"
|
show-overflow-tooltip>
|
||||||
min-width="150"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-progress
|
<el-progress color="#409eff" :percentage="((scope.row.uploadFileSize * 100) / scope.row.size).toFixed(2) *
|
||||||
color="#409eff"
|
1
|
||||||
:percentage="
|
" />
|
||||||
((scope.row.uploadFileSize * 100) / scope.row.size).toFixed(2) *
|
|
||||||
1
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('common:action:action')">
|
<el-table-column :label="$t('common:action:action')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" icon="el-icon-delete" circle :disabled="loading"
|
||||||
size="mini"
|
:title="$t('trials:trialDocument:action:delete')" @click="handleRemoveFile(scope.row)" />
|
||||||
icon="el-icon-delete"
|
|
||||||
circle
|
|
||||||
:disabled="loading"
|
|
||||||
:title="$t('trials:trialDocument:action:delete')"
|
|
||||||
@click="handleRemoveFile(scope.row)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -139,13 +78,8 @@
|
||||||
<span style="margin-right: 10px">{{
|
<span style="margin-right: 10px">{{
|
||||||
$store.state.trials.uploadTip
|
$store.state.trials.uploadTip
|
||||||
}}</span>
|
}}</span>
|
||||||
<el-button
|
<el-button size="small" type="primary" :disabled="selectArr.length == 0" :loading="loading"
|
||||||
size="small"
|
@click="beginUpload">
|
||||||
type="primary"
|
|
||||||
:disabled="selectArr.length == 0"
|
|
||||||
:loading="loading"
|
|
||||||
@click="beginUpload"
|
|
||||||
>
|
|
||||||
{{ $t('trials:trialDocument:action:upload') }}
|
{{ $t('trials:trialDocument:action:upload') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -265,11 +199,11 @@ export default {
|
||||||
type: extendName.split('.')[1],
|
type: extendName.split('.')[1],
|
||||||
status: 0,
|
status: 0,
|
||||||
file: files[i],
|
file: files[i],
|
||||||
id: `${files[i].lastModified}${
|
id: `${files[i].lastModified}${files[i].name
|
||||||
files[i].name
|
}${new Date().getTime()}${i + 1}`,
|
||||||
}${new Date().getTime()}${i + 1}`,
|
|
||||||
fileType: files[i].type,
|
fileType: files[i].type,
|
||||||
uploadFileSize: 0,
|
uploadFileSize: 0,
|
||||||
|
webkitRelativePath: files[i].webkitRelativePath
|
||||||
}
|
}
|
||||||
this.fileList.push(obj)
|
this.fileList.push(obj)
|
||||||
this.$refs.filesTable.toggleRowSelection(obj, true)
|
this.$refs.filesTable.toggleRowSelection(obj, true)
|
||||||
|
@ -300,7 +234,7 @@ export default {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => { })
|
||||||
},
|
},
|
||||||
// 开始上传文件
|
// 开始上传文件
|
||||||
async beginUpload() {
|
async beginUpload() {
|
||||||
|
@ -348,7 +282,8 @@ export default {
|
||||||
FileName: file.name,
|
FileName: file.name,
|
||||||
FilePath: this.$getObjectName(res.url),
|
FilePath: this.$getObjectName(res.url),
|
||||||
FileSize: file.size,
|
FileSize: file.size,
|
||||||
FileFormat: fileType,
|
FileFormat: fileType.split('.')[1],
|
||||||
|
catalogue: file.webkitRelativePath
|
||||||
})
|
})
|
||||||
let flag = arr.every((item) => item.status === 2)
|
let flag = arr.every((item) => item.status === 2)
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
@ -431,7 +366,6 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.fileInput.accept = this.faccept.join(',')
|
this.fileInput.accept = this.faccept.join(',')
|
||||||
}
|
}
|
||||||
console.log(this.fileInput)
|
|
||||||
this.fileInput.click()
|
this.fileInput.click()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -481,6 +415,7 @@ export default {
|
||||||
background: #428bca;
|
background: #428bca;
|
||||||
border-color: #428bca;
|
border-color: #428bca;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
.select-file {
|
.select-file {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
|
@ -491,6 +426,7 @@ export default {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-select {
|
.btn-select {
|
||||||
//给显示在页面上的按钮写样式
|
//给显示在页面上的按钮写样式
|
||||||
width: 90px;
|
width: 90px;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="contextmenu" class="contextmenu" v-show="visible">
|
<div id="contextmenu" class="contextmenu" v-show="visible" :style="{
|
||||||
|
'z-index': zIndex
|
||||||
|
}">
|
||||||
|
|
||||||
<div class="contextmenu__item" @click="handleMenu('open')" v-show="checkList.length <= 1">
|
<div class="contextmenu__item" @click="handleMenu('open')" v-show="checkList.length <= 1">
|
||||||
<i class="icon el-icon-right icon_open" />
|
<i class="icon el-icon-right icon_open" />
|
||||||
|
@ -9,28 +11,47 @@
|
||||||
<i class="icon icon_download" />
|
<i class="icon icon_download" />
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:download') }}</span>
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:download') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line"></div>
|
<template v-if="type === 'file'">
|
||||||
<div class="contextmenu__item" @click="handleMenu('copy')">
|
<div class="line"></div>
|
||||||
<i class="icon icon_copy" />
|
<div class="contextmenu__item" @click="handleMenu('copy')">
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:copy') }}</span>
|
<i class="icon icon_copy" />
|
||||||
</div>
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:copy') }}</span>
|
||||||
<div class="contextmenu__item" @click="handleMenu('shear')">
|
</div>
|
||||||
<i class="icon icon_shear" />
|
<div class="contextmenu__item" @click="handleMenu('shear')">
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:shear') }}</span>
|
<i class="icon icon_shear" />
|
||||||
</div>
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:shear') }}</span>
|
||||||
<div class="contextmenu__item" @click="handleMenu('rename')" v-show="checkList.length <= 1">
|
</div>
|
||||||
<i class="icon icon_rename" />
|
<div class="contextmenu__item" @click="handleMenu('rename')" v-show="checkList.length <= 1">
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:rename') }}</span>
|
<i class="icon icon_rename" />
|
||||||
</div>
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:rename') }}</span>
|
||||||
<div class="contextmenu__item" @click="handleMenu('del')">
|
</div>
|
||||||
<i class="icon icon_del" />
|
<div class="contextmenu__item" @click="handleMenu('del')">
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:del') }}</span>
|
<i class="icon icon_del" />
|
||||||
</div>
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:del') }}</span>
|
||||||
<div class="line" v-show="checkList.length <= 1"></div>
|
</div>
|
||||||
<div class="contextmenu__item" @click="handleMenu('Stats')" v-show="checkList.length <= 1">
|
</template>
|
||||||
<i class="icon el-icon-warning-outline icon_Stats" />
|
<template v-if="checkList.length <= 1 && type === 'file'">
|
||||||
<span>{{ $t('trials:trials-workbench:auditDocument:menu:Stats') }}</span>
|
<div class="line"></div>
|
||||||
</div>
|
<div class="contextmenu__item" @click="handleMenu('Stats')">
|
||||||
|
<i class="icon el-icon-warning-outline icon_Stats" />
|
||||||
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:Stats') }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="type === 'version' || type === 'c_version'">
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="contextmenu__item" @click="handleMenu('setVersion')" v-if="type === 'version'">
|
||||||
|
<i class="icon el-icon-document-checked icon_Stats" />
|
||||||
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:setVersion') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="contextmenu__item" @click="handleMenu('delVersion')">
|
||||||
|
<i class="icon el-icon-delete icon_Stats" />
|
||||||
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:delVersion') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="contextmenu__item" @click="handleMenu('delAllVersion')">
|
||||||
|
<i class="icon el-icon-delete-solid icon_Stats" />
|
||||||
|
<span>{{ $t('trials:trials-workbench:auditDocument:menu:delAllVersion') }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -43,15 +64,19 @@ export default {
|
||||||
default: () => {
|
default: () => {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false
|
visible: false,
|
||||||
|
type: 'file',
|
||||||
|
zIndex: 9
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(row, column, event) {
|
init(event, row, type, zIndex = 9) {
|
||||||
|
this.type = type
|
||||||
|
this.zIndex = zIndex
|
||||||
// 设置菜单出现的位置
|
// 设置菜单出现的位置
|
||||||
// 具体显示位置根据自己需求进行调节
|
// 具体显示位置根据自己需求进行调节
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
@ -121,7 +146,6 @@ export default {
|
||||||
background-position: top 0 right 0;
|
background-position: top 0 right 0;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
box-shadow: 0 0 0 .5px #88888830, 0 10px 40px 0 #88888840;
|
box-shadow: 0 0 0 .5px #88888830, 0 10px 40px 0 #88888840;
|
||||||
z-index: 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.contextmenu__item:hover {
|
.contextmenu__item:hover {
|
||||||
|
|
|
@ -0,0 +1,370 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="" :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false"
|
||||||
|
:before-close="handleClose" width="450px" center>
|
||||||
|
<div class="auditDocumentDetail">
|
||||||
|
<div class="header">
|
||||||
|
<div class="file_icon">
|
||||||
|
<i class="name_docx"></i>
|
||||||
|
</div>
|
||||||
|
<div class="file_name">
|
||||||
|
<div class="name">
|
||||||
|
<span class="name-text">但是决定把尖酸刻薄的喀巴水电局咯不到就案板白沙卡萨丁你卢卡斯拿到了看到了上的尽快把世界第八款不打瞌睡的</span>
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
<span class="size">100kb</span>
|
||||||
|
<span>, </span>
|
||||||
|
<span class="time">2025-03-31 15:36</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="main">
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane :label="$t('trials:trials-workbench:auditDocument:detail:tabs:Stats')" name="Stats">
|
||||||
|
<div class="p">
|
||||||
|
<div class="title">{{ $t('trials:trials-workbench:auditDocument:detail:title:path') }}</div>
|
||||||
|
<div class="content">{shareItem:8}/周会/20250324-工作总结及后续工作.pptx</div>
|
||||||
|
</div>
|
||||||
|
<div class="p">
|
||||||
|
<div class="title">{{ $t('trials:trials-workbench:auditDocument:detail:title:contain') }}
|
||||||
|
</div>
|
||||||
|
<div class="content">4项 (2文件, 2文件夹)</div>
|
||||||
|
</div>
|
||||||
|
<div class="p">
|
||||||
|
<div class="title">{{ $t('trials:trials-workbench:auditDocument:detail:title:size') }}</div>
|
||||||
|
<div class="content">123333</div>
|
||||||
|
</div>
|
||||||
|
<div class="p">
|
||||||
|
<div class="title">{{ $t('trials:trials-workbench:auditDocument:detail:title:updateTime') }}
|
||||||
|
</div>
|
||||||
|
<div class="content">123333</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane :label="$t('trials:trials-workbench:auditDocument:detail:tabs:versions')"
|
||||||
|
name="versions">
|
||||||
|
<div class="versions_top">
|
||||||
|
<div class="title">{{
|
||||||
|
$t('trials:trials-workbench:auditDocument:detail:title:historicalVersion') }}
|
||||||
|
</div>
|
||||||
|
<div class="btnBox">
|
||||||
|
<el-button icon="el-icon-refresh" circle size="small" />
|
||||||
|
<el-button icon="el-icon-upload2" plain size="small">{{
|
||||||
|
$t('trials:trials-workbench:auditDocument:detail:title:uploadNewVersion')
|
||||||
|
}}</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="versions_content">
|
||||||
|
<div class="item">
|
||||||
|
<div class="item_line">
|
||||||
|
<div class="version current_version">
|
||||||
|
<span>{{
|
||||||
|
$t('trials:trials-workbench:auditDocument:detail:title:currentVersion')
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="mtime">2025-03-31 15:36</div>
|
||||||
|
<div class="size">375KB</div>
|
||||||
|
<div class="add_desc" @click.stop="openMenu($event, {}, 'c_version')">
|
||||||
|
<i class="el-icon-more" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="item_line">
|
||||||
|
<div class="version">
|
||||||
|
<span>v1</span>
|
||||||
|
</div>
|
||||||
|
<div class="mtime">2025-03-31 15:36</div>
|
||||||
|
<div class="size">375KB</div>
|
||||||
|
<div class="add_desc" @click.stop="openMenu($event, {}, 'version')">
|
||||||
|
<i class="el-icon-more" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "auditDocumentDetail",
|
||||||
|
props: {
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
rowData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: 'Stats'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick() { },
|
||||||
|
openMenu(e, row, type) {
|
||||||
|
this.$emit('openContextmenu', { e, row, type, zIndex: 3000 })
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.$emit("update:visible", false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__header {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-tabs__nav-wrap::after {
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auditDocumentDetail {
|
||||||
|
.header {
|
||||||
|
padding: 0 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-bottom: 1px solid #f6f8ff;
|
||||||
|
|
||||||
|
.file_icon {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 42px;
|
||||||
|
line-height: 60px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
background-size: cover;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-style: normal;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_pdf {
|
||||||
|
background-image: url(@/assets/file_icon/pdf.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_docx {
|
||||||
|
background-image: url(@/assets/file_icon/docx.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_doc {
|
||||||
|
background-image: url(@/assets/file_icon/doc.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_zip {
|
||||||
|
background-image: url(@/assets/file_icon/zip.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_pptx {
|
||||||
|
background-image: url(@/assets/file_icon/pptx.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_ppt {
|
||||||
|
background-image: url(@/assets/file_icon/ppt.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_xlsx {
|
||||||
|
background-image: url(@/assets/file_icon/xlsx.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_xls {
|
||||||
|
background-image: url(@/assets/file_icon/xls.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.name_folder {
|
||||||
|
background-image: url(@/assets/file_icon/folder.png);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.file_name {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
word-break: break-word;
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 18px;
|
||||||
|
margin-top: 7px;
|
||||||
|
width: calc(100% - 170px);
|
||||||
|
|
||||||
|
.name {
|
||||||
|
max-height: 35px;
|
||||||
|
line-height: 18px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
.name-text {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #aaa;
|
||||||
|
padding-top: 1px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
max-height: 500px;
|
||||||
|
|
||||||
|
.p {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: #999;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 25px;
|
||||||
|
width: 27%;
|
||||||
|
margin-right: 1%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
word-break: break-word;
|
||||||
|
color: #444;
|
||||||
|
width: 72%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 0 0 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.versions_top {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 40px;
|
||||||
|
border-bottom: 1px solid #f3f3f3;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnBox {
|
||||||
|
flex: 1 0 0%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.versions_content {
|
||||||
|
max-height: calc(100% - 50px);
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: 0;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: all .2s;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: #91d5ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item_line {
|
||||||
|
background: #fafafa;
|
||||||
|
padding: 5px 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
transition: all .2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #e6f7ff;
|
||||||
|
border-color: #e6f7ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
span {
|
||||||
|
background: #22b66c;
|
||||||
|
border-color: #1c9458;
|
||||||
|
color: #fff;
|
||||||
|
padding: 3px 4px;
|
||||||
|
min-width: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.current_version {
|
||||||
|
span {
|
||||||
|
background: #1890ff;
|
||||||
|
border-color: #007cee;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mtime {
|
||||||
|
color: #999;
|
||||||
|
margin-right: 0;
|
||||||
|
line-height: 22px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.size {
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 1px 1px 1px 5px;
|
||||||
|
font-size: 12px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add_desc {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 3px;
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
color: #666;
|
||||||
|
background: #77777715;
|
||||||
|
border-radius: 2px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #c3e2ff;
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -16,7 +16,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form :inline="true" class="base-search-form">
|
<el-form :inline="true" class="base-search-form">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="str" clearable></el-input>
|
<el-input v-model="searchData.Name" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
||||||
|
@ -30,10 +30,10 @@
|
||||||
<el-button type="primary">
|
<el-button type="primary">
|
||||||
{{ $t('trials:trials-workbench:auditDocument:button:addFolder') }}
|
{{ $t('trials:trials-workbench:auditDocument:button:addFolder') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary">
|
<el-button type="primary" @click.stop="openFile(false)">
|
||||||
{{ $t('trials:trials-workbench:auditDocument:button:uploadFile') }}
|
{{ $t('trials:trials-workbench:auditDocument:button:uploadFile') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary">
|
<el-button type="primary" @click.stop="openFile(true)">
|
||||||
{{ $t('trials:trials-workbench:auditDocument:button:uploadFolder') }}
|
{{ $t('trials:trials-workbench:auditDocument:button:uploadFolder') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary">
|
<el-button type="primary">
|
||||||
|
@ -44,20 +44,28 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="tableData" style="width: 99%" row-key="Id" :row-style="setRowStyle"
|
<div class="catalogue">
|
||||||
v-adaptive="{ bottomOffset: 75 }" height="100"
|
<span>{{ $t('trials:trials-workbench:auditDocument:catalogue:title') }}</span>
|
||||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @row-click="handleRowClick"
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||||
@cell-mouse-enter="handleCellMouseEnter" @cell-mouse-leave="handleCellMouseLeave"
|
<el-breadcrumb-item v-for="item of catalogueData" :key="item.Id"><span class="catalogue_name"
|
||||||
@row-contextmenu="handleRowContextmenu" @row-dblclick="handleRowDblclick">
|
@click.stop="toCatalogue(item)">{{ item.Name }}</span></el-breadcrumb-item>
|
||||||
<el-table-column prop="date" label="日期" sortable width="300" class-name="catalogue_box">
|
</el-breadcrumb>
|
||||||
|
</div>
|
||||||
|
<el-table :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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="name_layout_box">
|
<div class="name_layout_box">
|
||||||
<div class="name_layout" v-if="renameId !== scope.row.Id">
|
<div class="name_layout" v-if="renameId !== scope.row.Id">
|
||||||
<span class="name_box">
|
<span class="name_box">
|
||||||
<i class="icon icon_folder"
|
<i class="icon icon_folder" v-if="!scope.row.AuditDocumentTypeEnum" />
|
||||||
v-if="scope.row.children && scope.row.children.length > 0" />
|
<i v-else :class="`icon icon_file icon_${scope.row.FileFormat}`" />
|
||||||
<i v-else :class="`icon icon_file icon_${scope.row.type}`" />
|
<span class="name">{{ scope.row.Name }}</span>
|
||||||
<span class="name">{{ scope.row.date }}</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"
|
||||||
@click="addRenameId(scope.row)"
|
@click="addRenameId(scope.row)"
|
||||||
:title="$t('trials:trials-workbench:auditDocument:icon:rename')" />
|
:title="$t('trials:trials-workbench:auditDocument:icon:rename')" />
|
||||||
|
@ -66,33 +74,50 @@
|
||||||
@click.stop="addCheck(scope.row)"
|
@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)" />
|
||||||
</div>
|
</div>
|
||||||
<el-input v-model="scope.row.date" :ref="`renameInp_${scope.row.Id}`" :autofocus="true"
|
<el-input v-model="scope.row.Name" :ref="`renameInp_${scope.row.Id}`" :autofocus="true"
|
||||||
class="renameInp" @blur="rename(scope.row)" v-else />
|
class="renameInp" @blur="rename(scope.row)" v-else />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" label="姓名" sortable width="180">
|
<el-table-column prop="FileFormat" :label="$t('trials:trials-workbench:auditDocument:table:fileType')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ formatFileType(scope.row) }}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="address" label="地址">
|
<el-table-column prop="FileSize" :label="$t('trials:trials-workbench:auditDocument:table:fileSize')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<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>
|
||||||
|
<el-table-column prop="CreateTime" :label="$t('trials:trials-workbench:auditDocument:table:createTime')">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<contextmenu ref="contextmenu" :checkList="checkList" @handleMenu="handleMenu" />
|
<contextmenu ref="contextmenu" :checkList="checkList" @handleMenu="handleMenu" />
|
||||||
|
<upload-files :config="config" :faccept="faccept" :uploadPath="uploadPath" :limitLength="limitLength"
|
||||||
|
v-if="config.visible" @close="close" @uplaodFile="uplaodFile" />
|
||||||
|
<detail v-if="visible" :visible.sync="visible" :rowData="rowData" @openContextmenu="openContextmenu" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { getAuditDocumentData, addAuditDocument, getBreadcrumbData, updateAuditDocument } from '@/api/trials'
|
||||||
import Pagination from '@/components/Pagination'
|
import Pagination from '@/components/Pagination'
|
||||||
import contextmenu from './contextmenu.vue'
|
import contextmenu from './contextmenu.vue'
|
||||||
|
import uploadFiles from '@/views/trials/trials-panel/trial-summary/trial-document/components/uploadFiles.vue'
|
||||||
|
import detail from './detail.vue'
|
||||||
const searchDataDefault = () => {
|
const searchDataDefault = () => {
|
||||||
return {
|
return {
|
||||||
|
Name: null,
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
asc: false,
|
asc: false,
|
||||||
sortField: 'CreateTime'
|
sortField: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: "auditDocument",
|
name: "auditDocument",
|
||||||
components: { Pagination, contextmenu },
|
components: { Pagination, contextmenu, uploadFiles, detail },
|
||||||
props: {
|
props: {
|
||||||
isManage: {
|
isManage: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -103,176 +128,27 @@ export default {
|
||||||
return {
|
return {
|
||||||
searchData: searchDataDefault(),
|
searchData: searchDataDefault(),
|
||||||
total: 0,
|
total: 0,
|
||||||
str: null, // 查询条件
|
Id: null,
|
||||||
tableData: [{
|
loading: false,
|
||||||
Id: 1,
|
expandedRows: [],
|
||||||
date: '2016-05-02',
|
tableData: [],
|
||||||
name: '王小虎',
|
catalogueData: [], // 目录层级
|
||||||
address: '上海市普陀区金沙江路 1518 弄',
|
|
||||||
type: 'ppt',
|
visible: false, // 属性详情弹框
|
||||||
}, {
|
rowData: {}, // 属性详情数据
|
||||||
Id: 2,
|
|
||||||
date: '2016-05-04',
|
config: {
|
||||||
name: '王小虎',
|
visible: false,
|
||||||
address: '上海市普陀区金沙江路 1517 弄',
|
showClose: true,
|
||||||
type: 'pdf',
|
width: '800px',
|
||||||
}, {
|
title: '',
|
||||||
Id: 3,
|
appendToBody: false,
|
||||||
date: '2016-05-01',
|
isFolder: false,
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄',
|
|
||||||
type: 'floder',
|
|
||||||
children: [{
|
|
||||||
Id: 31,
|
|
||||||
date: '2016-05-31',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄',
|
|
||||||
children: [{
|
|
||||||
Id: 311,
|
|
||||||
date: '2016-05-311',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄',
|
|
||||||
children: [{
|
|
||||||
Id: 3111,
|
|
||||||
date: '2016-05-311',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
Id: 32,
|
|
||||||
date: '2016-05-32',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄'
|
|
||||||
}]
|
|
||||||
},
|
},
|
||||||
{
|
uploadPath: '/System/AuditDocument',
|
||||||
Id: 4,
|
faccept: ['.pdf'],
|
||||||
date: '2016-05-03',
|
limitLength: 0,
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 5,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 6,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 7,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 8,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 9,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 10,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 11,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 12,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 13,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 14,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 15,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 16,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 17,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 18,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 19,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 20,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 21,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 22,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 23,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Id: 24,
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
checkList: [], // 选中的数据
|
checkList: [], // 选中的数据
|
||||||
hoverId: null, // hover中的数据
|
hoverId: null, // hover中的数据
|
||||||
renameId: null, // 选中重命名的数据
|
renameId: null, // 选中重命名的数据
|
||||||
|
@ -285,10 +161,39 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
// 获取当前目录层级
|
||||||
|
async getBreadcrumbData() {
|
||||||
|
if (!this.Id) return false
|
||||||
|
try {
|
||||||
|
let data = {
|
||||||
|
Id: this.Id
|
||||||
|
}
|
||||||
|
let res = await getBreadcrumbData(data)
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.catalogueData = res.Result
|
||||||
|
}
|
||||||
|
} catch (err) { console.log(err) }
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
try {
|
||||||
|
if (this.Id) {
|
||||||
|
this.searchData.Id = this.Id
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
let res = await getAuditDocumentData(this.searchData)
|
||||||
|
this.loading = false
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.tableData = res.Result.CurrentPageData
|
||||||
|
this.total = res.Result.TotalCount
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this.loading = false
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSearch() {
|
||||||
|
this.getList()
|
||||||
},
|
},
|
||||||
handleSearch() { },
|
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.searchData = searchDataDefault()
|
this.searchData = searchDataDefault()
|
||||||
this.getList()
|
this.getList()
|
||||||
|
@ -299,7 +204,6 @@ export default {
|
||||||
addRenameId(row) {
|
addRenameId(row) {
|
||||||
this.renameId = row.Id
|
this.renameId = row.Id
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
console.log(this.$refs[`renameInp_${row.Id}`].focus())
|
|
||||||
if (this.$refs[`renameInp_${row.Id}`]) {
|
if (this.$refs[`renameInp_${row.Id}`]) {
|
||||||
this.$refs[`renameInp_${row.Id}`].focus()
|
this.$refs[`renameInp_${row.Id}`].focus()
|
||||||
}
|
}
|
||||||
|
@ -307,15 +211,208 @@ export default {
|
||||||
},
|
},
|
||||||
rename(row) {
|
rename(row) {
|
||||||
this.renameId = null
|
this.renameId = null
|
||||||
|
this.updateData(row)
|
||||||
|
},
|
||||||
|
handleExpandChange(row, expanded) {
|
||||||
|
console.log(this.expandedRows)
|
||||||
|
if (expanded && !this.expandedRows.find(Id => Id === row.Id)) {
|
||||||
|
this.expandedRows.push(row.Id)
|
||||||
|
}
|
||||||
|
if (!expanded) {
|
||||||
|
let index = this.expandedRows.indexOf(row.Id)
|
||||||
|
if (!!~index) {
|
||||||
|
this.expandedRows.splice(index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 跳转至目录
|
||||||
|
toCatalogue(row) {
|
||||||
|
this.Id = row.Id
|
||||||
|
this.expandedRows = []
|
||||||
|
this.getList()
|
||||||
|
this.getBreadcrumbData()
|
||||||
|
},
|
||||||
|
// 修改数据
|
||||||
|
async updateData(row) {
|
||||||
|
try {
|
||||||
|
let data = {
|
||||||
|
AuditDocumentTypeEnum: row.AuditDocumentTypeEnum,
|
||||||
|
FileFormat: row.FileFormat,
|
||||||
|
FilePath: row.FilePath,
|
||||||
|
FileSize: row.FileSize,
|
||||||
|
Id: row.Id,
|
||||||
|
IsAuthorization: row.IsAuthorization,
|
||||||
|
Name: row.Name,
|
||||||
|
ParentId: row.ParentId
|
||||||
|
|
||||||
|
}
|
||||||
|
let res = await updateAuditDocument(row);
|
||||||
|
} catch (err) {
|
||||||
|
this.getList()
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 新增列表数据
|
||||||
|
async uplaodFile(list) {
|
||||||
|
let data = this.formatData(list)
|
||||||
|
console.log(data, 'data')
|
||||||
|
try {
|
||||||
|
let res = await addAuditDocument(JSON.stringify(data))
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 格式化上传数据
|
||||||
|
formatData(arr) {
|
||||||
|
let list = [], strObj = {}
|
||||||
|
arr.forEach(item => {
|
||||||
|
if (item.catalogue) {
|
||||||
|
let catalogueStr = item.catalogue.split("/")
|
||||||
|
catalogueStr.pop()
|
||||||
|
let obj = {}, strKey = []
|
||||||
|
catalogueStr.forEach((str, index) => {
|
||||||
|
strKey.forEach((key, i) => {
|
||||||
|
if (i === 0) {
|
||||||
|
obj = strObj[key]
|
||||||
|
} else {
|
||||||
|
obj = obj[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
if (index === 0) {
|
||||||
|
if (!strObj[str]) {
|
||||||
|
strObj[str] = {
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!obj[str]) {
|
||||||
|
obj[str] = {
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
obj = obj[str]
|
||||||
|
strKey.push(str)
|
||||||
|
|
||||||
|
})
|
||||||
|
obj.children.push({
|
||||||
|
ParentId: null,
|
||||||
|
Name: item.FileName,
|
||||||
|
IsAuthorization: false,
|
||||||
|
FileSize: item.FileSize,
|
||||||
|
filePath: item.FilePath,
|
||||||
|
FileFormat: item.FileFormat,
|
||||||
|
AuditDocumentTypeEnum: 1
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
list.push({
|
||||||
|
ParentId: null,
|
||||||
|
Name: item.FileName,
|
||||||
|
IsAuthorization: false,
|
||||||
|
FileSize: item.FileSize,
|
||||||
|
filePath: item.FilePath,
|
||||||
|
FileFormat: item.FileFormat,
|
||||||
|
AuditDocumentTypeEnum: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let ARRAY = this.objToArr(strObj)
|
||||||
|
list = list.concat(ARRAY)
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
objToArr(obj, list = []) {
|
||||||
|
Object.keys(obj).forEach(key => {
|
||||||
|
if (key !== 'children') {
|
||||||
|
let item = list.find(d => d.Name === key)
|
||||||
|
if (!item) {
|
||||||
|
let data = {
|
||||||
|
ParentId: null,
|
||||||
|
Name: key,
|
||||||
|
IsAuthorization: false,
|
||||||
|
AuditDocumentTypeEnum: 0,
|
||||||
|
children: obj[key].children
|
||||||
|
}
|
||||||
|
list.push(data)
|
||||||
|
}
|
||||||
|
this.objToArr(obj[key], obj[key].children)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
return list;
|
||||||
|
},
|
||||||
|
// 格式化文件类型
|
||||||
|
formatFileType(row) {
|
||||||
|
if (!row.AuditDocumentTypeEnum) {
|
||||||
|
return this.$t('trials:trials-workbench:auditDocument:fileType:folder')
|
||||||
|
} else {
|
||||||
|
return `${row.FileFormat}${this.$t('trials:trials-workbench:auditDocument:fileType:file')}`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 格式化文件大小
|
||||||
|
formatFileSize(row) {
|
||||||
|
if (!row.FileSize) return ''
|
||||||
|
if (row.FileSize < 1000) {
|
||||||
|
return row.FileSize + "B"
|
||||||
|
}
|
||||||
|
if (row.FileSize < 1000 * 1024) {
|
||||||
|
return (row.FileSize / 1024).toFixed(2) + "KB"
|
||||||
|
}
|
||||||
|
if (row.FileSize < 1000 * 1000 * 1024) {
|
||||||
|
return (row.FileSize / 1000 / 1024).toFixed(2) + "MB"
|
||||||
|
}
|
||||||
|
if (row.FileSize < 1000 * 1000 * 1000 * 1024) {
|
||||||
|
return (row.FileSize / 1000 / 1000 / 1024).toFixed(2) + "GB"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openFile(isFolder = false) {
|
||||||
|
this.faccept = [
|
||||||
|
'.jpg',
|
||||||
|
'.jpeg',
|
||||||
|
'.png',
|
||||||
|
'.pdf',
|
||||||
|
'.ppt',
|
||||||
|
'.pptx',
|
||||||
|
'.zip',
|
||||||
|
'.doc',
|
||||||
|
'.docx',
|
||||||
|
'.xls',
|
||||||
|
'.xlsx',
|
||||||
|
]
|
||||||
|
this.limitLength = 0
|
||||||
|
this.config.title = this.$t(
|
||||||
|
'trials:trials-workbench:auditDocument:form:title:uploadFile'
|
||||||
|
)
|
||||||
|
this.config.visible = true
|
||||||
|
this.config.isFolder = isFolder
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.config.visible = false
|
||||||
|
this.faccept = ['.pdf']
|
||||||
|
this.limitLength = 0
|
||||||
|
},
|
||||||
|
// 版本记录(右键菜单)
|
||||||
|
openContextmenu(data) {
|
||||||
|
let { e, row, type, zIndex } = data
|
||||||
|
this.$refs.contextmenu.init(e, row, type, zIndex)
|
||||||
},
|
},
|
||||||
// 单行右键单击(右键菜单)
|
// 单行右键单击(右键菜单)
|
||||||
handleRowContextmenu(row, column, e) {
|
handleRowContextmenu(row, column, e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!this.checkList.includes(row.Id)) this.handleRowClick(row)
|
if (!this.checkList.includes(row.Id)) this.handleRowClick(row)
|
||||||
this.$refs.contextmenu.init(row, column, e)
|
this.$refs.contextmenu.init(e, row, 'file')
|
||||||
},
|
},
|
||||||
// 单行左键双击(进入文件夹或者预览文件)
|
// 单行左键双击(进入文件夹或者预览文件)
|
||||||
handleRowDblclick(row) { },
|
handleRowDblclick(row) {
|
||||||
|
if (!row.AuditDocumentTypeEnum) {
|
||||||
|
this.Id = row.Id
|
||||||
|
this.getList()
|
||||||
|
this.getBreadcrumbData()
|
||||||
|
}
|
||||||
|
},
|
||||||
// 单行左键单击
|
// 单行左键单击
|
||||||
handleRowClick(row) {
|
handleRowClick(row) {
|
||||||
if (this.ctrlKey) {
|
if (this.ctrlKey) {
|
||||||
|
@ -337,6 +434,10 @@ export default {
|
||||||
if (key === 'rename') {
|
if (key === 'rename') {
|
||||||
this.renameId = this.checkList[0]
|
this.renameId = this.checkList[0]
|
||||||
}
|
}
|
||||||
|
if (key === 'Stats') {
|
||||||
|
this.rowData = this.tableData.find(item => item.Id === this.checkList[0])
|
||||||
|
this.visible = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
setRowStyle({ row, rowIndex }) {
|
setRowStyle({ row, rowIndex }) {
|
||||||
if (this.checkList.includes(row.Id)) {
|
if (this.checkList.includes(row.Id)) {
|
||||||
|
@ -381,6 +482,8 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
document.addEventListener('keydown', this.keydown);
|
document.addEventListener('keydown', this.keydown);
|
||||||
document.addEventListener('keyup', this.keyup);
|
document.addEventListener('keyup', this.keyup);
|
||||||
|
this.getList()
|
||||||
|
this.getBreadcrumbData()
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
document.removeEventListener('keydown', this.keydown);
|
document.removeEventListener('keydown', this.keydown);
|
||||||
|
@ -413,8 +516,24 @@ export default {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.width100 {
|
|
||||||
width: 100%;
|
.catalogue {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0 0 22px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.catalogue_name {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #3b8cff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.name_layout {
|
.name_layout {
|
||||||
|
@ -472,7 +591,7 @@ export default {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
min-width: 20px;
|
// min-width: 20px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
|
@ -484,8 +603,13 @@ export default {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
background-size: inherit;
|
background-size: inherit;
|
||||||
background-image: url(@/assets/0.file-16.png);
|
background-image: url(@/assets/0.file-16.png);
|
||||||
background-position: 3px 0;
|
background-position: 0 0;
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
font-style: normal;
|
||||||
|
display: inline-block;
|
||||||
|
pointer-events: none;
|
||||||
|
font-size: 85%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*文件夹*/
|
/*文件夹*/
|
||||||
|
@ -494,6 +618,7 @@ export default {
|
||||||
margin-top: -6px;
|
margin-top: -6px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*docx*/
|
/*docx*/
|
||||||
|
@ -533,7 +658,7 @@ export default {
|
||||||
|
|
||||||
/*zip*/
|
/*zip*/
|
||||||
.icon_zip {
|
.icon_zip {
|
||||||
background-position: 3px 0 !important;
|
background-position: 0 0 !important;
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,509 +0,0 @@
|
||||||
<template>
|
|
||||||
<base-model :config="config">
|
|
||||||
<div slot="dialog-body">
|
|
||||||
<!-- 多文件上传 -->
|
|
||||||
<form id="inputForm" ref="uploadForm">
|
|
||||||
<el-divider content-position="left">{{
|
|
||||||
$t('trials:trialDocument:label:fileType').replace(
|
|
||||||
'xxx',
|
|
||||||
faccept.join('/')
|
|
||||||
)
|
|
||||||
}}</el-divider>
|
|
||||||
<div class="form-group">
|
|
||||||
<div
|
|
||||||
class="upload"
|
|
||||||
style="margin-right: 10px"
|
|
||||||
:disabled="limitLength"
|
|
||||||
v-if="!limitLength"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
multiple="multiple"
|
|
||||||
webkitdirectory=""
|
|
||||||
directory
|
|
||||||
accept="*/*"
|
|
||||||
type="file"
|
|
||||||
name="uploadFolder"
|
|
||||||
class="select-file"
|
|
||||||
title=""
|
|
||||||
@change="beginScanFiles($event)"
|
|
||||||
v-if="
|
|
||||||
!loading &&
|
|
||||||
(!limitLength ||
|
|
||||||
(fileList.length < limitLength && limitLength > 1))
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<div class="btn-select">
|
|
||||||
{{ $t('trials:trialDocument:button:selectFolder') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="upload">
|
|
||||||
<input
|
|
||||||
class="select-file"
|
|
||||||
multiple=""
|
|
||||||
:accept="faccept.join(',')"
|
|
||||||
type="file"
|
|
||||||
name="uploadFile"
|
|
||||||
title=""
|
|
||||||
@change="beginScanFiles($event)"
|
|
||||||
v-if="!loading && (!limitLength || fileList.length < limitLength)"
|
|
||||||
/>
|
|
||||||
<div class="btn-select">
|
|
||||||
{{ $t('trials:trialDocument:button:select') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<!-- 文件列表 -->
|
|
||||||
<el-table
|
|
||||||
ref="filesTable"
|
|
||||||
:data="fileList"
|
|
||||||
class="dicomFiles-table"
|
|
||||||
height="300"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
type="selection"
|
|
||||||
width="55"
|
|
||||||
:selectable="(row, index) => row.status !== 2 && !loading"
|
|
||||||
/>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<!-- 文件名称 -->
|
|
||||||
<el-table-column
|
|
||||||
prop="name"
|
|
||||||
:label="$t('trials:trialDocument:table:fileName')"
|
|
||||||
min-width="100"
|
|
||||||
/>
|
|
||||||
<!-- 文件大小 -->
|
|
||||||
<el-table-column
|
|
||||||
prop="size"
|
|
||||||
:label="$t('trials:trialDocument:table:fileSize')"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{
|
|
||||||
scope.row.size && scope.row.size > 0
|
|
||||||
? `${(scope.row.size / 1024 / 1024).toFixed(3)}MB`
|
|
||||||
: ''
|
|
||||||
}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- 文件类型 -->
|
|
||||||
<el-table-column
|
|
||||||
prop="type"
|
|
||||||
:label="$t('trials:trialDocument:table:fileType')"
|
|
||||||
/>
|
|
||||||
<!-- 上传状态 -->
|
|
||||||
<el-table-column
|
|
||||||
prop="status"
|
|
||||||
:label="$t('trials:trialDocument:table:uploadStatus')"
|
|
||||||
min-width="100"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag
|
|
||||||
:type="['warning', 'info', 'success', 'danger'][scope.row.status]"
|
|
||||||
v-if="scope.row.status || scope.row.status === 0"
|
|
||||||
>{{ $fd('NoneDicomUploadStatus', scope.row.status) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('trials:trialDocument:table:failedFileCount')"
|
|
||||||
min-width="150"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-progress
|
|
||||||
color="#409eff"
|
|
||||||
:percentage="
|
|
||||||
((scope.row.uploadFileSize * 100) / scope.row.size).toFixed(2) *
|
|
||||||
1
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('common:action:action')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
circle
|
|
||||||
:disabled="loading"
|
|
||||||
:title="$t('trials:trialDocument:action:delete')"
|
|
||||||
@click="handleRemoveFile(scope.row)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div slot="dialog-footer">
|
|
||||||
<div style="text-align: right; padding: 10px 0px">
|
|
||||||
<span style="margin-right: 10px">{{
|
|
||||||
$store.state.trials.uploadTip
|
|
||||||
}}</span>
|
|
||||||
<el-button
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
:disabled="selectArr.length == 0"
|
|
||||||
:loading="loading"
|
|
||||||
@click="beginUpload"
|
|
||||||
>
|
|
||||||
{{ $t('trials:trialDocument:action:upload') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</base-model>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import baseModel from '@/components/BaseModel'
|
|
||||||
import { deepClone } from '@/utils/index.js'
|
|
||||||
import store from '@/store'
|
|
||||||
export default {
|
|
||||||
name: 'uploadFiles',
|
|
||||||
props: {
|
|
||||||
config: {
|
|
||||||
required: true,
|
|
||||||
default: () => {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
faccept: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
},
|
|
||||||
},
|
|
||||||
uploadPath: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
limitLength: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
'base-model': baseModel,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
fileList: [],
|
|
||||||
selectArr: [],
|
|
||||||
isFail: false,
|
|
||||||
successFileList: [],
|
|
||||||
fileInput: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取待上传文件信息
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.selectArr = selection
|
|
||||||
},
|
|
||||||
// 扫描待上传文件
|
|
||||||
beginScanFiles(e) {
|
|
||||||
if (this.fileInput) {
|
|
||||||
this.fileInput = null
|
|
||||||
}
|
|
||||||
var files = [...e.target.files]
|
|
||||||
if (this.limitLength && this.fileList.length >= this.limitLength)
|
|
||||||
return this.$message.warning(
|
|
||||||
this.$t('trials:trialDocument:message:limitLength')
|
|
||||||
)
|
|
||||||
var sameFiles = []
|
|
||||||
files.forEach((file) => {
|
|
||||||
var extendName = file.name
|
|
||||||
.substring(file.name.lastIndexOf('.'))
|
|
||||||
.toLocaleLowerCase()
|
|
||||||
if (
|
|
||||||
this.faccept.indexOf(extendName) !== -1 &&
|
|
||||||
this.fileList.findIndex((v) => v.name === file.name) > -1
|
|
||||||
) {
|
|
||||||
sameFiles.push(file.name)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
var scope = this
|
|
||||||
if (sameFiles.length > 0) {
|
|
||||||
const h = this.$createElement
|
|
||||||
var msg = this.$t('trials:trialDocument:message:exsitSameFile').replace(
|
|
||||||
'xxx',
|
|
||||||
sameFiles.join(', ')
|
|
||||||
)
|
|
||||||
this.$msgbox({
|
|
||||||
message: h('div', { style: 'maxHeight:300px;overflow: auto;' }, [
|
|
||||||
h('p', null, msg),
|
|
||||||
h(
|
|
||||||
'p',
|
|
||||||
null,
|
|
||||||
this.$t('trials:trialDocument:message:isContinueUpload')
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
type: 'warning',
|
|
||||||
showCancelButton: true,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
scope.pendingUploadQuene(files)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
scope.resetUploadForm()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
scope.pendingUploadQuene(files)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pendingUploadQuene(files) {
|
|
||||||
for (var i = 0; i < files.length; ++i) {
|
|
||||||
const fileName = files[i].name
|
|
||||||
var extendName = fileName
|
|
||||||
.substring(fileName.lastIndexOf('.'))
|
|
||||||
.toLocaleLowerCase()
|
|
||||||
if (this.faccept.indexOf(extendName) !== -1) {
|
|
||||||
files[i].id = `${files[i].lastModified}${files[i].name}`
|
|
||||||
let obj = {
|
|
||||||
name: files[i].name,
|
|
||||||
size: files[i].size,
|
|
||||||
type: extendName.split('.')[1],
|
|
||||||
status: 0,
|
|
||||||
file: files[i],
|
|
||||||
id: `${files[i].lastModified}${
|
|
||||||
files[i].name
|
|
||||||
}${new Date().getTime()}${i + 1}`,
|
|
||||||
fileType: files[i].type,
|
|
||||||
uploadFileSize: 0,
|
|
||||||
}
|
|
||||||
this.fileList.push(obj)
|
|
||||||
this.$refs.filesTable.toggleRowSelection(obj, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.resetUploadForm()
|
|
||||||
},
|
|
||||||
resetUploadForm() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.uploadForm.reset()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleRemoveFile(row) {
|
|
||||||
this.$confirm(this.$t('trials:trialDocument:message:delete'), {
|
|
||||||
type: 'warning',
|
|
||||||
distinguishCancelAndClose: true,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.fileList.splice(
|
|
||||||
this.fileList.findIndex((item) => item.id === row.id),
|
|
||||||
1
|
|
||||||
)
|
|
||||||
let flag = this.successFileList.some((item) => item.id === row.id)
|
|
||||||
if (flag) {
|
|
||||||
this.successFileList.splice(
|
|
||||||
this.successFileList.findIndex((item) => item.id === row.id),
|
|
||||||
1
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
},
|
|
||||||
// 开始上传文件
|
|
||||||
async beginUpload() {
|
|
||||||
this.loading = true
|
|
||||||
this.isFail = false
|
|
||||||
const fileMaxSize = 1024 * 1024 * 1024 * 2 // 1G
|
|
||||||
var currentFilesSize = 0
|
|
||||||
this.selectArr.forEach((item) => {
|
|
||||||
currentFilesSize += item.size
|
|
||||||
})
|
|
||||||
if (currentFilesSize / fileMaxSize > 1) {
|
|
||||||
// 'Upload file size cannot exceed 1G'
|
|
||||||
this.$alert(this.$t('trials:trialDocument:message:uploadSize'))
|
|
||||||
this.loading = false
|
|
||||||
} else {
|
|
||||||
this.selectArr.forEach((item) => (item.status = 0))
|
|
||||||
let num = this.selectArr.length > 6 ? 6 : this.selectArr.length
|
|
||||||
let funArr = []
|
|
||||||
for (let i = 0; i < num; i++) {
|
|
||||||
funArr.push(this.handleUploadTask(this.selectArr, i))
|
|
||||||
}
|
|
||||||
if (funArr.length > 0) {
|
|
||||||
let res = await Promise.all(funArr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 并发上传
|
|
||||||
async handleUploadTask(arr, index) {
|
|
||||||
if (!this.config.visible) return
|
|
||||||
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
|
||||||
file.status = 1
|
|
||||||
let fileType = file.name
|
|
||||||
.substring(file.name.lastIndexOf('.'))
|
|
||||||
.toLocaleLowerCase()
|
|
||||||
// let fileName = file.name
|
|
||||||
// .substring(0, file.name.lastIndexOf('.'))
|
|
||||||
// .toLocaleLowerCase()
|
|
||||||
let path = `${this.uploadPath}/${this.$guid()}${fileType}`
|
|
||||||
file.curPath = path
|
|
||||||
const fileData = await this.fileToBlob(file.file)
|
|
||||||
let res = await this.fileToOss(path, fileData, file)
|
|
||||||
if (res) {
|
|
||||||
file.status = 2
|
|
||||||
this.successFileList.push({
|
|
||||||
FileName: file.name,
|
|
||||||
FilePath: this.$getObjectName(res.url),
|
|
||||||
FileSize: file.size,
|
|
||||||
FileFormat: fileType,
|
|
||||||
})
|
|
||||||
let flag = arr.every((item) => item.status === 2)
|
|
||||||
if (flag) {
|
|
||||||
return this.submitFile(this.successFileList)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
file.status = 3
|
|
||||||
}
|
|
||||||
let flag = arr.every((item) => item.status > 1)
|
|
||||||
if (flag) {
|
|
||||||
let failFileList = arr.filter((item) => item.status === 3)
|
|
||||||
if (failFileList && failFileList.length > 0) {
|
|
||||||
this.$refs.filesTable.clearSelection()
|
|
||||||
failFileList.forEach((row) => {
|
|
||||||
row.uploadFileSize = 0
|
|
||||||
this.$refs.filesTable.toggleRowSelection(row)
|
|
||||||
})
|
|
||||||
this.isFail = true
|
|
||||||
this.submitFile(this.successFileList, true)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let ind = arr.findIndex((item) => item.status === 0)
|
|
||||||
if (ind >= 0) {
|
|
||||||
return this.handleUploadTask(arr, ind)
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// file上传到oss
|
|
||||||
async fileToOss(path, file, item) {
|
|
||||||
try {
|
|
||||||
let res = await this.OSSclient.multipartUpload(
|
|
||||||
{
|
|
||||||
path,
|
|
||||||
file,
|
|
||||||
speed: true,
|
|
||||||
},
|
|
||||||
(percentage, checkpoint, lastPer) => {
|
|
||||||
item.uploadFileSize += checkpoint.size * (percentage - lastPer)
|
|
||||||
if (item.uploadFileSize > file.fileSize) {
|
|
||||||
item.uploadFileSize = file.fileSize
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (res) {
|
|
||||||
return res
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitFile(list, isReLoad = false) {
|
|
||||||
if (!this.config.visible) return
|
|
||||||
if (!isReLoad) {
|
|
||||||
this.reset()
|
|
||||||
}
|
|
||||||
let arr = deepClone(list)
|
|
||||||
this.$emit('uplaodFile', arr)
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.loading = false
|
|
||||||
this.selectArr = []
|
|
||||||
this.successFileList = []
|
|
||||||
this.OSSclient.close()
|
|
||||||
this.$emit('close')
|
|
||||||
},
|
|
||||||
openFile(isFolder = false) {
|
|
||||||
this.fileInput = document.createElement('input')
|
|
||||||
this.fileInput.type = 'file'
|
|
||||||
this.fileInput.addEventListener('change', this.beginScanFiles)
|
|
||||||
if (isFolder) {
|
|
||||||
this.fileInput.accept = '*/*'
|
|
||||||
//webkitdirectory directory
|
|
||||||
this.fileInput.webkitdirectory = 'webkitdirectory'
|
|
||||||
this.fileInput.directory = 'directory'
|
|
||||||
} else {
|
|
||||||
this.fileInput.accept = this.faccept.join(',')
|
|
||||||
}
|
|
||||||
console.log(this.fileInput)
|
|
||||||
this.fileInput.click()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
isFail() {
|
|
||||||
if (this.isFail) {
|
|
||||||
this.$confirm(this.$t('trials:trialDocument:failUpload'), {
|
|
||||||
type: 'warning',
|
|
||||||
distinguishCancelAndClose: true,
|
|
||||||
confirmButtonText: this.$t('common:button:confirm'),
|
|
||||||
cancelButtonText: this.$t('common:button:cancel'),
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.beginUpload()
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
this.loading = false
|
|
||||||
console.log(err)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
loading() {
|
|
||||||
store.dispatch('trials/setUnLock', this.loading)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.openFile(this.config.isFolder)
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
store.dispatch('trials/setUnLock', false)
|
|
||||||
this.OSSclient.close()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.upload {
|
|
||||||
display: inline-block;
|
|
||||||
height: 30px;
|
|
||||||
width: 90px;
|
|
||||||
padding: 2px 10px;
|
|
||||||
line-height: 23px;
|
|
||||||
position: relative;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 3px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: center;
|
|
||||||
background: #428bca;
|
|
||||||
border-color: #428bca;
|
|
||||||
color: #fff;
|
|
||||||
.select-file {
|
|
||||||
height: 30px;
|
|
||||||
width: 90px;
|
|
||||||
position: absolute;
|
|
||||||
overflow: hidden;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
opacity: 0;
|
|
||||||
font-size: 0;
|
|
||||||
}
|
|
||||||
.btn-select {
|
|
||||||
//给显示在页面上的按钮写样式
|
|
||||||
width: 90px;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 24px;
|
|
||||||
overflow: hidden;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
pointer-events: none; //pointer-events:none用来控制该标签的点击穿透事件
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -238,7 +238,7 @@
|
||||||
:reading-id="selected.ReadingId"
|
:reading-id="selected.ReadingId"
|
||||||
:clinical-form-id="selected.ClinicalFormId"
|
:clinical-form-id="selected.ClinicalFormId"
|
||||||
:open-type="'look'"
|
:open-type="'look'"
|
||||||
@close=""
|
@close="false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|