irc_web/.svn/pristine/cb/cb41c7ead539b4af84e00cb1409...

86 lines
2.2 KiB
Plaintext

<template>
<div class="preview-clinical-data">
<el-table
v-loading="loading"
:data="fileList"
stripe
style="width: 100%"
height="500"
>
<el-table-column type="index" width="40" />
<!-- 文件名称 -->
<el-table-column
prop="FileName"
:label="$t('trials:readingPeriod:cd:table:fileName')"
/>
<el-table-column
:label="$t('common:action:action')"
width="120"
>
<template slot-scope="scope">
<!-- 预览 -->
<el-button
circle
:title="$t('trials:readingPeriod:cd:action:viewFile')"
icon="el-icon-view"
@click="handlePreview(scope.row)"
/>
<!-- 删除 -->
<el-button
v-if="(!data.IsSign && !data.IsCRCUpload)"
circle
:title="$t('trials:readingPeriod:cd:action:deleteFile')"
icon="el-icon-delete"
@click="handleDelete(scope.$index,scope.row)"
/>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { deleteReadingClinicalDataPDF } from '@/api/trials'
export default {
name: 'PreviewCD',
props: {
data: {
type: Object,
default() { return {} }
}
},
data() {
return {
fileList: [],
loading: false
}
},
mounted() {
this.fileList = this.data.FileList
},
methods: {
handlePreview(row) {
if (row.Path) {
window.open(row.Path, '_blank')
}
},
handleDelete(index, row) {
this.$confirm(this.$t('trials:readingPeriod:cd:message:delete'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.loading = true
deleteReadingClinicalDataPDF(row.Id).then(res => {
this.fileList.splice(index, 1)
this.$emit('getList')
this.loading = false
this.$message.success(this.$t('common:message:deletedSuccessfully'))
}).catch(() => { this.loading = false })
}).catch(() => {})
}
}
}
</script>