Blame view

antis-ncc-admin/src/views/extend/zyOaArticle/View.vue 1.86 KB
4aba9b59   wwk   1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  <template>
    <el-dialog title="查看详情" :close-on-press-escape="false" :close-on-click-modal="false"
      :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="80%">
      <div class="notice-wapper">
        <h1 class="title">{{dataForm.title}}</h1>
        <div class="info">
          <span>{{dateFormat(dataForm.createTime)}}</span><span>{{dataForm.creater}}</span>
        </div>
        <div class="main" v-html="dataForm.bodyContent"></div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false">{{$t('common.cancelButton')}}</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  import request from '@/utils/request'
  
  export default {
    data() {
      return {
        visible: false,
        loading: false,
        dataForm: {
          id: '',
          title: '',
          creatorUser: '',
          creatorTime: Number,
          bodyText: ''
        }
      }
    },
    methods: {
      init(id) {
        this.dataForm.id = id
        this.visible = true
        this.loading = true
        this.$nextTick(() => {
           request({
  							url: '/api/SubDev/ZyOaArticle/' + this.dataForm.id,
  							method: 'get'
  						}).then(res => {
            this.dataForm = res.data
            this.loading = false
          }).catch(() => {
            this.loading = false
          })
        })
      },
      dateFormat(date) {
        return this.ncc.dateFormat(date)
      },
    }
  }
  </script>
  <style lang="scss" scoped>
  .NCC-dialog {
    >>> .el-dialog__body {
      min-height: 500px;
      padding: 0 20px !important;
    }
    .notice-wapper {
      .title {
        font-size: 18px;
        font-weight: normal;
        text-align: center;
      }
      .info {
        line-height: 35px;
        border-bottom: 1px solid #dcdfe6;
        text-align: center;
        span {
          padding: 0 10px;
        }
      }
      .main {
        padding: 20px 10px 0 10px;
        line-height: 22px;
      }
    }
  }
  </style>