AuditRemark.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <div class="audit-remark">
  3. <h5>审核批注</h5>
  4. <ul v-if="remarkList.length > 0">
  5. <li
  6. v-for="{
  7. id: remarkId,
  8. content,
  9. remark_person_name,
  10. remark_time,
  11. content_select,
  12. component_id,
  13. audit_flow_node_name,
  14. file_list,
  15. position_y,
  16. } in remarkList"
  17. :key="remarkId"
  18. >
  19. <template v-if="content_select">
  20. <span class="el-icon-notebook-2"> 原文</span>
  21. <span class="content-select">{{ content_select }}</span>
  22. </template>
  23. <p v-html="content"></p>
  24. <template v-if="file_list.length > 0">
  25. <div v-for="(item, index) in file_list" :key="index" class="file-item">
  26. <SvgIcon :icon-class="item.icon_type" />
  27. <span class="file-item-name">{{ item.file_name }}</span>
  28. <SvgIcon icon-class="uploadPreview" @click="viewDialog(item)" />
  29. <SvgIcon icon-class="download" @click="downLoad(item)" />
  30. </div>
  31. </template>
  32. <div v-if="isAudit" class="remark-bottom">
  33. <span>{{ remark_person_name + ':' + remark_time }}</span>
  34. <div class="btn-box">
  35. <el-link type="primary" class="delete-black delete-btn" @click="deleteRemarks(remarkId)"
  36. ><SvgIcon icon-class="delete-black" size="12"
  37. /></el-link>
  38. <el-link type="primary" class="el-icon-place linkLocation" @click="handleLocation(position_y)" />
  39. </div>
  40. </div>
  41. <div class="remark-bottom" v-if="audit_flow_node_name">
  42. <span>{{ '审核流程节点:' + audit_flow_node_name }}</span>
  43. </div>
  44. </li>
  45. </ul>
  46. <p v-else style="text-align: center">暂无批注</p>
  47. <el-dialog
  48. v-if="visible"
  49. :visible.sync="visible"
  50. :show-close="true"
  51. :close-on-click-modal="true"
  52. :modal-append-to-body="true"
  53. :append-to-body="true"
  54. :lock-scroll="true"
  55. :width="'80%'"
  56. top="0"
  57. >
  58. <iframe v-if="visible" :src="newpath" width="100%" :height="iframeHeight" frameborder="0"></iframe>
  59. </el-dialog>
  60. </div>
  61. </template>
  62. <script>
  63. import { getToken, getConfig } from '@/utils/auth';
  64. export default {
  65. name: 'AuditRemark',
  66. props: {
  67. isAudit: {
  68. type: Boolean,
  69. default: false,
  70. },
  71. remarkList: {
  72. type: Array,
  73. required: true,
  74. },
  75. },
  76. data() {
  77. return {
  78. file_preview_url: getConfig() ? getConfig().doc_preview_service_address : '',
  79. visible: false,
  80. newpath: '',
  81. iframeHeight: `${window.innerHeight - 100}px`,
  82. };
  83. },
  84. methods: {
  85. deleteRemarks(remarkId) {
  86. this.$emit('deleteRemarks', remarkId);
  87. },
  88. handleLocation(componentId) {
  89. this.$emit('handleLocationRemarks', componentId);
  90. },
  91. // 下载文件
  92. downLoad(file) {
  93. let userInfor = getToken();
  94. let AccessToken = '';
  95. if (userInfor) {
  96. AccessToken = userInfor.access_token;
  97. }
  98. let FileID = file.file_id;
  99. let data = {
  100. AccessToken,
  101. FileID,
  102. };
  103. location.href = `${process.env.VUE_APP_EEP}/FileServer/WebFileDownload?AccessToken=${data.AccessToken}&FileID=${data.FileID}`;
  104. },
  105. // 预览
  106. viewDialog(file) {
  107. this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(file.file_url)}`;
  108. this.visible = true;
  109. },
  110. },
  111. };
  112. </script>
  113. <style lang="scss" scoped>
  114. .audit-remark {
  115. width: 240px;
  116. height: 100%;
  117. overflow: auto;
  118. border: 1px solid #e5e5e5;
  119. h5 {
  120. padding: 0 5px;
  121. margin: 0;
  122. font-size: 18px;
  123. line-height: 40px;
  124. background: #f2f3f5;
  125. }
  126. .btn-box {
  127. display: flex;
  128. gap: 8px;
  129. align-items: center;
  130. width: 55px;
  131. padding: 0 10px;
  132. border-left: 1px solid #e5e5e5;
  133. }
  134. .delete-btn {
  135. color: #f44444;
  136. }
  137. ul {
  138. height: calc(100% - 40px);
  139. overflow: auto;
  140. li {
  141. border-bottom: 1px solid #e5e5e5;
  142. .el-icon-notebook-2 {
  143. display: block;
  144. padding: 10px 10px 0;
  145. margin-bottom: 4px;
  146. font-size: 12px;
  147. color: grey;
  148. }
  149. .content-select {
  150. display: block;
  151. margin-left: 10px;
  152. border-bottom: 1px solid #eee;
  153. }
  154. > p {
  155. padding: 5px;
  156. }
  157. :deep p {
  158. margin: 0;
  159. }
  160. .remark-bottom {
  161. display: flex;
  162. align-items: center;
  163. justify-content: space-between;
  164. padding: 0 5px;
  165. font-size: 12px;
  166. color: #555;
  167. border-top: 1px solid #e5e5e5;
  168. }
  169. }
  170. }
  171. .file-item {
  172. display: flex;
  173. gap: 5px;
  174. align-items: center;
  175. padding: 3px;
  176. margin: 5px;
  177. background: #f2f3f5;
  178. border-radius: 3px;
  179. &-name {
  180. flex: 1;
  181. font-size: 12px;
  182. word-break: break-all;
  183. }
  184. .svg-icon {
  185. flex-shrink: 0;
  186. font-size: 16px;
  187. }
  188. .uploadPreview,
  189. .download {
  190. cursor: pointer;
  191. }
  192. }
  193. }
  194. </style>