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
| <template>
| <el-dialog
| title="详情"
| :visible="value"
| width="50%"
| :modal="false"
| :show-close="false"
| :before-close="onCancel"
| >
|
| <div class="detalis-content">
| <p class="title">{{item.title}}</p>
| <div class="lie">
| <span>发布时间:{{item.createdAt}}</span> <span>{{item.scholars}}人参与学习</span> <span>{{item.viewNum}}次浏览</span>
| </div>
| <div class="content" v-html="item.content"></div>
| </div>
| <!-- 底部按钮 -->
| <span slot="footer" class="dialog-footer">
| <el-button type="primary" @click="onOk">确 定</el-button>
| </span>
| </el-dialog>
| </template>
|
| <script>
|
| export default {
| props: {
| value: { type: Boolean },
| editId: { type:Number}
| },
| data() {
| return {
| item:{}
| }
| },
| watch: {
| editId (val) {
| this.getDetail(val);
| }
| },
|
| methods: {
| getDetail(id) {
| this.$api.get("fms/classroom/detail",{ id: id },e => {
| this.item =e;
| }
| );
| },
|
| /** 确认 */
| onOk() {
| this.$emit('change', false);
| },
|
|
| }
|
| }
| </script>
|
| <style lang="less" scoped>
| .detalis-content {
| max-height: 500px;
| overflow: auto;
| .title {
| font-size: 18px;
| color: #333;
| padding-bottom: 10px;
| }
| .lie {
| display: flex;
| justify-content: space-between;
| padding-bottom: 10px;
| }
| .content {
| color: #333;
| line-height: 20px;
| }
| }
| </style>
|
|