|
1 | 1 | <template> |
2 | | - <a-comment> |
3 | | - <div> |
4 | | - <a-spin :spinning="loading"> |
5 | | - <a-skeleton active :loading="loading"> |
6 | | - <div :style="{'--coll': this.coll}" class="basic"> |
| 2 | + <div> |
| 3 | + <a-spin :spinning="loading"> |
| 4 | + <a-skeleton active :loading="loading"> |
| 5 | + <div :style="{'--coll': this.coll}" class="basic"> |
7 | 6 |
|
8 | | - <div style="margin-up:5pt; margin-left:2pt;margin-right:2pt;"> |
9 | | - <div> |
10 | | - <a-row justify="space-between"> |
11 | | - <span><avatar size="large" :user="this.comment.User"></avatar></span> |
12 | | - <span>{{ this.comment.User.nickname }}</span> <span |
13 | | - v-if="this.comment.User.nickname===this.$store.state.user.info.nickname">(你)</span> |
14 | | - <span> #{{ this.comment.ID }}</span> |
15 | | - </a-row> |
| 7 | + <div style="margin-top:5pt; margin-left:2pt;margin-right:2pt;"> |
| 8 | + <div> |
| 9 | + <a-row justify="space-between"> |
| 10 | + <span><avatar size="large" :user="this.comment.User"></avatar></span> |
| 11 | + <span>{{ this.comment.User.nickname }}</span> <span |
| 12 | + v-if="this.comment.User.nickname===this.$store.state.user.info.nickname">(你)</span> |
| 13 | + <span> #{{ this.comment.ID }}</span> |
| 14 | + </a-row> |
| 15 | + <br> |
| 16 | + <a-row> |
| 17 | + <markdown v-model="this.comment.Content"></markdown> |
16 | 18 | <br> |
17 | | - <a-row> |
18 | | - <markdown v-model="this.comment.Content"></markdown> |
19 | | - <br> |
20 | | - <div style="margin-right:20pt"> |
21 | | - <span key="comment-basic-like"> |
22 | | - <a-tooltip title="Like"> |
23 | | - <a-icon type="like" :theme="this.actions['👍'] === 1 ? 'filled' : 'outlined'" @click="active('👍')" /> |
24 | | - </a-tooltip> |
25 | | - <span style="padding-left: '8px'; cursor: 'auto'"> |
26 | | - :{{ actionCount['👍'] }} |
27 | | - </span> |
| 19 | + <div style="margin-right:20pt"> |
| 20 | + <span> |
| 21 | + <a-tooltip title="Like"> |
| 22 | + <a-icon type="like" :theme="this.actions['👍'] === 1 ? 'filled' : 'outlined'" @click="active('👍')" /> |
| 23 | + </a-tooltip> |
| 24 | + <span style="padding-left: '8px'; cursor: 'auto'"> |
| 25 | + :{{ actionCount['👍'] }} |
28 | 26 | </span> |
29 | | - <span key="comment-basic-dislike"> |
30 | | - <a-tooltip title="Dislike"> |
31 | | - <a-icon |
32 | | - type="dislike" |
33 | | - :theme="this.actions['👎'] === 1 ? 'filled' : 'outlined'" |
34 | | - @click="active('👎')" /> |
35 | | - </a-tooltip> |
36 | | - <span style="padding-left: '8px'; cursor: 'auto'"> |
37 | | - :{{ actionCount['👎'] }} |
38 | | - </span> |
| 27 | + </span> |
| 28 | + <span> |
| 29 | + <a-tooltip title="Dislike"> |
| 30 | + <a-icon |
| 31 | + type="dislike" |
| 32 | + :theme="this.actions['👎'] === 1 ? 'filled' : 'outlined'" |
| 33 | + @click="active('👎')" /> |
| 34 | + </a-tooltip> |
| 35 | + <span style="padding-left: '8px'; cursor: 'auto'"> |
| 36 | + :{{ actionCount['👎'] }} |
39 | 37 | </span> |
40 | | - <span v-if="!this.canEdit"><a-button @click="reply()"> 回复</a-button></span> |
41 | | - <span |
42 | | - v-if="this.canDeleteComment || (this.comment.User.nickname===this.$store.state.user.info.nickname)"> |
43 | | - <a-popconfirm |
44 | | - title="确定删除此评论吗" |
45 | | - ok-text="删除" |
46 | | - cancel-text="再想想" |
47 | | - @confirm="deleteTargetComment()" |
48 | | - > |
49 | | - <a-icon slot="icon" type="question-circle-o" style="color: red" /> |
50 | | - <a-button> 删除评论</a-button> |
51 | | - </a-popconfirm> |
52 | | - </span> |
53 | | - <span style="float:right"> |
54 | | - <a-tooltip slot="datetime" :title="moment(this.comment.created_at).format('YYYY-MM-DD HH:mm:ss')"> |
55 | | - <span>{{ moment(this.comment.created_at).fromNow() }}</span> |
56 | | - </a-tooltip> |
57 | | - </span> |
58 | | - </div> |
59 | | - <div v-if="this.canEdit"> |
60 | | - <span><avatar size="large" :user="this.$store.state.user.info"></avatar></span> |
61 | | - <span> 你的发言</span> |
62 | | - <div slot="content"> |
63 | | - <a-form-item> |
64 | | - <mark-down-editor v-model="description" :handleAt="handleAt" :handleHashTag="handleHashTag" /> |
65 | | - </a-form-item> |
66 | | - <a-form-item> |
67 | | - <div style="margin-left:20pt; margin-right:20pt"> |
68 | | - <span><a-button html-type="submit" :loading="submitting" type="primary" @click="handleCancel()"> |
69 | | - 取消 |
70 | | - </a-button></span> |
71 | | - <span style="float:right"><a-button |
72 | | - html-type="submit" |
73 | | - :loading="submitting" |
74 | | - type="primary" |
75 | | - @click="handleSubmit()"> |
76 | | - 提交 |
77 | | - </a-button></span> |
78 | | - </div> |
79 | | - </a-form-item> |
80 | | - </div> |
| 38 | + </span> |
| 39 | + <span v-if="!this.canEdit"><a-button @click="reply()"> 回复</a-button></span> |
| 40 | + <span |
| 41 | + v-if="this.canDeleteComment || (this.comment.User.nickname===this.$store.state.user.info.nickname)"> |
| 42 | + <a-popconfirm |
| 43 | + title="确定删除此评论吗" |
| 44 | + ok-text="删除" |
| 45 | + cancel-text="再想想" |
| 46 | + @confirm="deleteTargetComment()" |
| 47 | + > |
| 48 | + <a-icon slot="icon" type="question-circle-o" style="color: red" /> |
| 49 | + <a-button> 删除评论</a-button> |
| 50 | + </a-popconfirm> |
| 51 | + </span> |
| 52 | + <span style="float:right"> |
| 53 | + <a-tooltip slot="datetime" :title="moment(this.comment.created_at).format('YYYY-MM-DD HH:mm:ss')"> |
| 54 | + <span>{{ moment(this.comment.created_at).fromNow() }}</span> |
| 55 | + </a-tooltip> |
| 56 | + </span> |
| 57 | + </div> |
| 58 | + <div v-if="this.canEdit"> |
| 59 | + <span><avatar size="large" :user="this.$store.state.user.info"></avatar></span> |
| 60 | + <span> 你的发言</span> |
| 61 | + <div slot="content"> |
| 62 | + <a-form-item> |
| 63 | + <mark-down-editor v-model="description" :handleAt="handleAt" :handleHashTag="handleHashTag" /> |
| 64 | + </a-form-item> |
| 65 | + <a-form-item> |
| 66 | + <div style="margin-left:20pt; margin-right:20pt"> |
| 67 | + <span><a-button html-type="submit" :loading="submitting" type="primary" @click="handleCancel()"> |
| 68 | + 取消 |
| 69 | + </a-button></span> |
| 70 | + <span style="float:right"><a-button |
| 71 | + html-type="submit" |
| 72 | + :loading="submitting" |
| 73 | + type="primary" |
| 74 | + @click="handleSubmit()"> |
| 75 | + 提交 |
| 76 | + </a-button></span> |
| 77 | + </div> |
| 78 | + </a-form-item> |
81 | 79 | </div> |
82 | | - <a-list |
83 | | - v-if="children.length!==0" |
84 | | - :data-source="children" |
85 | | - :split="false" |
86 | | - :size="large"> |
87 | | - <a-list-item slot="renderItem" slot-scope="keyID"> |
88 | | - <one-comment |
89 | | - style="width:95%; margin-left:5pt" |
90 | | - :depth="depth + 1" |
91 | | - :comment="jsonStr[keyID]['data']" |
92 | | - :canDeleteComment="canDeleteComment" |
93 | | - :jsonStr="jsonStr[keyID]"> |
94 | | - </one-comment> |
95 | | - </a-list-item> |
96 | | - </a-list> |
97 | | - </a-row> |
98 | | - </div> |
| 80 | + </div> |
| 81 | + <a-list |
| 82 | + v-if="children.length!==0" |
| 83 | + :data-source="children" |
| 84 | + :split="false" |
| 85 | + size="large"> |
| 86 | + <a-list-item slot="renderItem" slot-scope="keyID"> |
| 87 | + <one-comment |
| 88 | + style="width:95%; margin-left:5pt" |
| 89 | + :depth="depth + 1" |
| 90 | + :comment="jsonStr[keyID]['data']" |
| 91 | + :canDeleteComment="canDeleteComment" |
| 92 | + :jsonStr="jsonStr[keyID]"> |
| 93 | + </one-comment> |
| 94 | + </a-list-item> |
| 95 | + </a-list> |
| 96 | + </a-row> |
99 | 97 | </div> |
100 | 98 | </div> |
101 | | - </a-skeleton> |
102 | | - </a-spin> |
103 | | - </div> |
104 | | - </a-comment> |
| 99 | + </div> |
| 100 | + </a-skeleton> |
| 101 | + </a-spin> |
| 102 | + </div> |
105 | 103 | </template> |
106 | 104 |
|
107 | 105 | <script> |
@@ -130,6 +128,7 @@ export default { |
130 | 128 | comparerConf, |
131 | 129 | languageConf, |
132 | 130 | config, |
| 131 | + submitting: false, |
133 | 132 | moment, |
134 | 133 | loading: true, |
135 | 134 | canEdit: false, |
|
0 commit comments