123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <j-modal
- :title="title"
- :width="modelStyle.width"
- :visible="visible"
- :bodyStyle ="bodyStyle"
- :switchFullscreen="switchFullscreen"
- @cancel="handleCancel"
- >
- <template slot="footer">
- <a-button key="back" @click="handleCancel">关闭</a-button>
- <a-button v-if="record.openType==='url'" type="primary" @click="toHandle">去处理</a-button>
- </template>
- <a-card class="daily-article" :loading="loading">
- <a-card-meta
- :title="record.titile"
- :description="'发布人:'+record.sender + ' 发布时间: ' + record.sendTime">
- </a-card-meta>
- <a-divider />
- <span v-html="record.msgContent" class="article-content"></span>
- <span v-if="record.file==null||record.file==''" style="font-size: 12px;font-style: italic;">无文件</span>
- <span v-else>
- <div style="font-size: 12px;font-style: italic; color:blue" >{{ record.file}}</div>
- <a-button
- :ghost="true"
- type="primary"
- icon="download"
- size="small"
- @click="downloadFile(record.file)">
- 下载
- </a-button>
- </span>
- </a-card>
- </j-modal>
- </template>
- <script>
- import {JeecgListMixin} from "@/mixins/JeecgListMixin";
- import {getFileAccessHttpUrl} from "@api/manage";
- export default {
- name: "SysAnnouncementModal",
- mixins: [JeecgListMixin],
- components: {
- },
- data () {
- return {
- title:"通知消息",
- record: {},
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- visible: false,
- switchFullscreen: true,
- loading: false,
- bodyStyle:{
- padding: "0",
- height:(window.innerHeight*0.8)+"px",
- "overflow-y":"auto",
- },
- modelStyle:{
- width: '60%',
- style: { top: '20px' },
- fullScreen: false
- }
- }
- },
- created () {
- },
- methods: {
- downloadFile(text) {
- if (!text) {
- this.$message.warning("未知的文件")
- return;
- }
- if (text.indexOf(",") > 0) {
- text = text.substring(0, text.indexOf(","))
- }
- let url = getFileAccessHttpUrl(text)
- window.open(url);
- },
- detail (record) {
- this.visible = true;
- this.record = record;
- },
- handleCancel () {
- this.visible = false;
- },
- /** 切换全屏显示 */
- handleClickToggleFullScreen() {
- let mode = !this.modelStyle.fullScreen
- if (mode) {
- this.modelStyle.width = '100%'
- this.modelStyle.style.top = '20px'
- } else {
- this.modelStyle.width = '60%'
- this.modelStyle.style.top = '50px'
- }
- this.modelStyle.fullScreen = mode
- },
- toHandle(){
- if(this.record.openType==='url'){
- this.visible = false;
- //链接跳转
- this.$router.push({path: this.record.openPage})
- }
- },
- }
- }
- </script>
- <style lang="less">
- .announcementCustomModal{
- .ant-modal-header {
- border: none;
- display: inline-block;
- position: absolute;
- z-index: 1;
- right: 56px;
- padding: 0;
- .ant-modal-title{
- .custom-btn{
- width: 56px;
- height: 56px;
- border: none;
- box-shadow: none;
- }
- }
- }
- .daily-article{
- border-bottom: 0;
- }
- }
- </style>
- <style scoped lang="less">
- .daily-article {
- .article-button {
- font-size: 1.2rem !important;
- }
- .ant-card-body {
- padding: 18px !important;
- }
- .ant-card-head {
- padding: 0 1rem;
- }
- .ant-card-meta {
- margin-bottom: 1rem;
- }
- .article-content {
- p {
- word-wrap: break-word;
- word-break: break-all;
- text-overflow: initial;
- white-space: normal;
- font-size: .9rem !important;
- margin-bottom: .8rem;
- }
- }
- }
- </style>
|