[update] 修改证书模板信息样式
This commit is contained in:
@@ -12,25 +12,52 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24" class="basic-info-item"><label>提醒消息:</label><span>{{ detail.promptMessage }}</span>
|
||||
</a-col>
|
||||
<a-col :span="24" class="basic-info-item"><label>附件:</label><span><a @click="lookFile">查看</a></span>
|
||||
<a-col :span="24">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
bordered
|
||||
:columns="fileColumns"
|
||||
:dataSource="fileList"
|
||||
:pagination="false"
|
||||
:loading="confirmLoading"
|
||||
class="j-table-force-nowrap file-table">
|
||||
|
||||
<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.toString().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>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="handleCancel">关闭</a-button>
|
||||
</template>
|
||||
<certificate-model-info-file ref="filesModal" :columns="fileColumns" :isCommittee="false"></certificate-model-info-file>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CertificateModelInfoFile from './CertificateModelInfoFile'
|
||||
import { getFilesByIds } from '@api/standardsAssociationApi'
|
||||
import { getAction } from '@/api/memberManage'
|
||||
import { getAction, downloadFile } from '@/api/memberManage'
|
||||
import { processingTimestamp } from '@/utils/util'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'CertificateModeInfoModal',
|
||||
components: {CertificateModelInfoFile},
|
||||
data () {
|
||||
return {
|
||||
title: '查看',
|
||||
@@ -65,6 +92,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
processingTimestamp,
|
||||
look () {
|
||||
this.visible = true
|
||||
getAction(this.url.queryById).then(res => {
|
||||
@@ -74,11 +102,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
lookFile () {
|
||||
this.$refs.filesModal.title = '文件'
|
||||
this.$refs.filesModal.dataSource = this.fileList
|
||||
this.$refs.filesModal.visible = true
|
||||
},
|
||||
/*
|
||||
* 通过文件id获取文件的相关信息
|
||||
* */
|
||||
@@ -115,15 +138,35 @@ export default {
|
||||
this.fileLoading = false
|
||||
console.log(this.fileList)
|
||||
},
|
||||
/**
|
||||
* 下载
|
||||
* @param record
|
||||
*/
|
||||
handleDownload(record) {
|
||||
downloadFile(`sys/common/static/${record.id}`, record.fileName)
|
||||
},
|
||||
/**
|
||||
* 预览
|
||||
* @param record
|
||||
*/
|
||||
handlePreview(record) {
|
||||
if (record && record.id) {
|
||||
const fileFullUrl = `${window._CONFIG['memberDomianWebSocketURL']}/sys/common/static/${record.id}?type=view&token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${record.fileName}`
|
||||
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
|
||||
window.open(url)
|
||||
}
|
||||
},
|
||||
handleCancel () {
|
||||
this.visible = false
|
||||
this.detail = {}
|
||||
this.fileList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
.basic-info-item {
|
||||
display: flex;
|
||||
|
||||
@@ -133,4 +176,7 @@ export default {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
.file-table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,102 +0,0 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<!-- table表格区域-->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
rowKey="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.toString().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/memberManage'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { processingTimestamp } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
name: 'CertificateModelInfoFile',
|
||||
props: {
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '文件',
|
||||
width: 800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
dataSource: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
processingTimestamp,
|
||||
/**
|
||||
* 下载
|
||||
* @param record
|
||||
*/
|
||||
handleDownload(record) {
|
||||
downloadFile(`sys/common/static/${record.id}`, record.fileName)
|
||||
},
|
||||
/**
|
||||
* 预览
|
||||
* @param record
|
||||
*/
|
||||
handlePreview(record) {
|
||||
if (record && record.id) {
|
||||
const fileFullUrl = `${window._CONFIG['memberDomianWebSocketURL']}/sys/common/static/${record.id}?type=view&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>
|
||||
Reference in New Issue
Block a user