AuditRemark.vue 5.0 KB

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