[add] 工作组在研项目,工作组详情

This commit is contained in:
zhaoxiao
2021-12-14 20:30:39 +08:00
parent d46e53c0da
commit c5a40fd92c
7 changed files with 383 additions and 42 deletions
@@ -0,0 +1,123 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@cancel="handleCancel"
cancelText="关闭">
<!-- table表格区域-->
<div>
<a-table
ref="table"
size="middle"
:rowKey="record => record.FILE_ID"
bordered
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="confirmLoading"
class="j-table-force-nowrap">
<template slot="text" slot-scope="text">
<j-ellipsis :value="text" :length="18"></j-ellipsis>
</template>
<!-- 时间戳转时间-->
<template slot="time" slot-scope="text">
<j-ellipsis :value="text.indexOf('-') === -1 ? processingTimestamp(text) : text" :length="20"></j-ellipsis>
</template>
<!-- 操作-->
<span slot="action" class="action-span-cell" slot-scope="text, record">
<a @click="handleDownload(record)">下载</a>
<a @click="handlePreview(record)">查看</a>
</span>
</a-table>
</div>
<template slot="footer">
<a-button key="back" @click="handleCancel">关闭</a-button>
</template>
</j-modal>
</template>
<script>
import { downloadFile } from '@api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { processingTimestamp } from '@/utils/util'
export default {
name: 'UnderStudyFilesModal',
props: {
columns: {
type: Array,
default: () => {
return []
}
},
// 是否为在分标委在研项目,默认是
isCommittee: {
type: Boolean,
default: true
}
},
data() {
return {
title: '操作',
width: 800,
visible: false,
confirmLoading: false,
dataSource: []
}
},
methods: {
processingTimestamp,
/**
* 下载
* @param record
*/
handleDownload(record) {
if (this.isCommittee) {
let param = {
fileId: record.FILE_ID,
fileName: record.FILE_NAME
}
downloadFile(`/payResearchProject/payResearchProject/downLoad`, record.FILE_NAME, param)
} else {
downloadFile(`sys/common/download/${record.fileId}`, record.fileName)
}
},
/**
* 预览
* @param record
*/
handlePreview(record) {
if (this.isCommittee) {
if (record && record.FILE_ID) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ record.FILE_ID }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ record.FILE_NAME }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
window.open(url)
}
} else {
if (record && record.fileId) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ record.fileId }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ record.fileName }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
window.open(url)
}
}
},
handleCancel() {
this.dataSource = []
this.visible = false
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>