albumList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div>
  3. <a-comment class="commentList">
  4. <div slot="actions" key="comment-nested-reply-to" >
  5. <div class="actionBox">
  6. {{item.createTime}}
  7. <div class="albumCallback" @click="showSubmitBox(item.pkId)">
  8. <img src="../../../../image/reply.png" class="btnsty"/>
  9. 回复
  10. </div>
  11. </div>
  12. <div class="submitBoxAlbum" v-show="replyPkid==item.pkId">
  13. <a-input-search
  14. v-model="item.replyComment"
  15. class="commentAdd"
  16. placeholder="我也说一句"
  17. enter-button="提交"
  18. size="large"
  19. maxLength="100"
  20. @search="reply(-1)"
  21. />
  22. </div>
  23. </div>
  24. <a slot="author">{{item.createName}}</a>
  25. <a-avatar
  26. slot="avatar"
  27. :src="'/api/api-system/system/core/sysFile/previewFile?fileId='+item.createPhoto"
  28. :alt="item.createName"
  29. />
  30. <p slot="content" class="contentBox">
  31. {{ item.content }}
  32. </p>
  33. <div v-if="item.open==1">
  34. <a-comment v-if="index0<2||showAll" style="margin-top:0.6vw" v-for="(item0, index0) in item.replies" :key="index">
  35. <div slot="actions" key="comment-nested-reply-to">
  36. <div class="actionBox">
  37. {{item0.createTime}}
  38. <div class="albumCallback" @click="showSubmitBox(item0.pkId)">
  39. <img src="../../../../image/reply.png" class="btnsty"/>
  40. 回复
  41. </div>
  42. </div>
  43. <div class="submitBoxAlbum" v-show="replyPkid==item0.pkId">
  44. <a-input-search
  45. v-model="item0.replyComment"
  46. class="commentAdd commentAddlevel2"
  47. placeholder="我也说一句"
  48. enter-button="提交"
  49. size="large"
  50. maxLength="100"
  51. @search="reply(index0)"
  52. >
  53. <div slot="prefix" style="font-size: 1.14583vw;">{{item0.replyLeft}}</div>
  54. </a-input-search>
  55. </div>
  56. </div>
  57. <a slot="author">{{item0.createName}}</a>
  58. <a-avatar
  59. slot="avatar"
  60. :src="'/api/api-system/system/core/sysFile/previewFile?fileId='+item0.createPhoto"
  61. :alt="item0.createName"
  62. />
  63. <p slot="content" class="contentBox">
  64. {{ item0.content }}
  65. </p>
  66. </a-comment>
  67. <div @click="showMoreData" class="getMore" v-if="item.replies.length>2&&showAll!=true">查看全部{{item.replies.length}}条回复&nbsp;&nbsp;></div>
  68. </div>
  69. </a-comment>
  70. </div>
  71. </template>
  72. <script>
  73. import header0 from '../../../../image/header0.png'
  74. import header1 from '../../../../image/header1.png'
  75. import home from '@/api/knowledge/home'
  76. import contentData from '@/api/knowledge/contentData'
  77. import {mapState} from "vuex";
  78. export default {
  79. props: {
  80. item: {
  81. type: Object,
  82. default: []
  83. }
  84. },
  85. computed: {
  86. ...mapState({
  87. user: (state) => state.appSetting.user,
  88. })
  89. },
  90. data() {
  91. return {
  92. showAll:false,
  93. delVisible:false,
  94. header0,
  95. header1,
  96. typeArr:['pdf','word','excel','ppt','其他'],
  97. replyPkid:''
  98. }
  99. },
  100. created() {
  101. },
  102. methods: {
  103. showMoreData(){
  104. this.showAll = true
  105. },
  106. showSubmitBox(pkId){
  107. if(this.replyPkid==pkId){
  108. this.replyPkid = ''
  109. }else{
  110. this.replyPkid = pkId
  111. }
  112. },
  113. lookDetail(data){
  114. if(this.type=='list0'||this.type=='list1'){
  115. if(this.approval) {
  116. this.$router.push({
  117. name: "knowledgeAuditInfo",
  118. query: {
  119. pkId: data.pkId
  120. }
  121. })
  122. } else {
  123. this.$router.push({
  124. name: "knowledgeContentInfo",
  125. query: {
  126. pkId: data.pkId
  127. }
  128. })
  129. }
  130. }else{
  131. let getData = {
  132. documentId:data.documentId,
  133. userId:this.user.userId,
  134. secretType:data.secretType
  135. }
  136. home.viewApi(getData).then((res) => {
  137. window.open(res.data)
  138. })
  139. }
  140. },
  141. download(data){
  142. window.open('/api/api-system/system/core/sysFile/previewFile?fileId='+data.attachment)
  143. },
  144. closeDel(){
  145. this.delVisible = false
  146. },
  147. confirmOk(){
  148. let param = {
  149. knowledgeId:this.item.pkId
  150. }
  151. this.delVisible = false
  152. contentData.deleteKnowledge(param).then((res) => {
  153. this.$message.success('删除成功')
  154. this.$emit('delRefresh')
  155. })
  156. },
  157. deleteData(){
  158. this.delVisible = true
  159. },
  160. jump(item){
  161. this.$router.push({
  162. path: '/knowledgePage/knowledgeAddUpdate',
  163. query: { pkId: item.pkId }
  164. })
  165. },
  166. reply(num){
  167. let content = ''
  168. if(num==-1){
  169. content = this.item.replyComment
  170. }else{
  171. content = this.item.replies[num].replyLeft+this.item.replies[num].replyComment
  172. }
  173. let replyData={
  174. content:content,
  175. yelpId:this.replyPkid
  176. }
  177. this.$emit('replyYelp',replyData);
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="less" scoped>
  183. .commentList /deep/.ant-avatar-image{
  184. width: 1.6666vw;
  185. height: 1.6666vw;
  186. }
  187. .commentList /deep/.ant-avatar-image img{
  188. width: 100%;
  189. height: 100%;
  190. }
  191. .commentList /deep/.ant-comment-content-author-name a{
  192. font-size: 0.9375vw;
  193. color: #202124;
  194. height: 1.6666vw;
  195. line-height: 1.6666vw;
  196. }
  197. .commentList /deep/.ant-comment-content-detail p{
  198. font-size: 0.9375vw;
  199. color: #202124;
  200. white-space: inherit;
  201. }
  202. .commentList /deep/.ant-comment-inner{
  203. padding-top: 1.25vw;
  204. padding-bottom: 0vw;
  205. }
  206. .commentList /deep/.ant-comment-actions{
  207. margin: 0px;
  208. }
  209. .commentList /deep/.ant-comment-actions{
  210. margin: 0px;
  211. }
  212. .actionBox{
  213. margin-top: 5px;
  214. font-size: 0.9375vw;
  215. display: flex;
  216. width:100%;
  217. color: #5E5E5E;
  218. }
  219. .contentBox{
  220. white-space: inherit;
  221. padding: 0px;
  222. }
  223. .commentList /deep/.ant-comment-actions li{
  224. width:100%
  225. }
  226. .getMore{
  227. margin-top: 1.5625vw;
  228. width: 10.9375vw;
  229. height: 2.03125vw;
  230. line-height: 2.03125vw;
  231. background: rgba(64,108,196,0.1);
  232. color: #406CC4;
  233. text-align: center;
  234. font-size: 0.9375vw;
  235. margin-left: 2.2vw;
  236. cursor: pointer;
  237. }
  238. .submitBoxAlbum{
  239. width: 100%;
  240. display: inline-block;
  241. margin-top: 0.573vw;
  242. }
  243. .commentAdd /deep/input{
  244. height: 2.8125vw;
  245. font-size: 1.14583vw;
  246. border-radius: 0.41666vw;
  247. }
  248. .commentAddlevel2 /deep/.ant-input-lg{
  249. padding-left: 8vw;
  250. }
  251. .commentAdd /deep/.ant-input-search-button{
  252. font-size: 1.14583vw;
  253. background-color: #406cc4;
  254. border-color: #406cc4;
  255. height: 2.8125vw;
  256. width: 6.09375vw;
  257. border-radius: 0.41666vw!important;
  258. }
  259. .albumCallback{
  260. margin-left: auto;
  261. color: #406CC4;
  262. cursor: pointer;
  263. }
  264. .btnsty{
  265. height: 1vw;
  266. }
  267. </style>