4b100fd3702d9455d42cd7001900e6c94fd47870.svn-base 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div>
  3. <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" @close="dialogClose" :append-to-body="true" width="60%" class="jqmm">
  4. <el-row>
  5. <el-tabs style="overflow-y: auto;margin:5px;">
  6. <el-tab-pane :label="picturetabName" style="height: 400px;">
  7. <el-carousel :interval="4000" height="350px" id="imgView">
  8. <el-carousel-item v-for="(item,index) in pictureArray" :key="index">
  9. <img style="height:100%;width: 100%;" :src="`${hostUrl}/${item.filePath}`">
  10. </el-carousel-item>
  11. <p v-if="pictureArray.length==0" class="noPic">暂无图片信息</p>
  12. </el-carousel>
  13. </el-tab-pane>
  14. <el-tab-pane :label="videotabName">
  15. <el-carousel :interval="4000" height="350px">
  16. <el-carousel-item v-for="(item,index) in videoArray" :key="index">
  17. <video-player
  18. class="vjs-custom-skin"
  19. ref="videoPlayer"
  20. :options="item"
  21. :playsinline="true"
  22. ></video-player>
  23. </el-carousel-item>
  24. <el-carousel-item v-if="videoArray.length==0">
  25. <p class="noPic">暂无视频信息</p>
  26. </el-carousel-item>
  27. </el-carousel>
  28. </el-tab-pane>
  29. <el-tab-pane :label="audiotabName">
  30. <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;" :height="testHeight">
  31. <el-table-column header-align="center" align="center" label="音频">
  32. <template slot-scope="scope">
  33. <elaudio
  34. style="margin-left:15%;width:100px;height:30px;"
  35. :theUrl="`${hostUrl}/${scope.row.filePath}`"
  36. ></elaudio>
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. </el-tab-pane>
  41. <el-tab-pane :label="filetabName">
  42. <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;" :height="testHeight">
  43. <el-table-column header-align="center" align="center" label="文档">
  44. <template slot-scope="scope">
  45. <p>
  46. <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank"
  47. rel="noopener noreferrer">
  48. {{scope.row.fileName}}
  49. </a>
  50. </p>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </el-tab-pane>
  55. </el-tabs>
  56. </el-row>
  57. </el-dialog>
  58. </div>
  59. </template>
  60. <script>
  61. import request from '../../../../utils/gw_ajax_request'
  62. import {hostUrl} from "@util/global_variable.js";
  63. import elaudio from "../../../../widgets/elAudioShort.vue";
  64. import Viewer from 'viewerjs';
  65. import 'viewerjs/dist/viewer.css';
  66. export default {
  67. name: "pblmMendFile",
  68. props: ['jqmmShow', 'pblmId', 'dialogTitle', 'currentObjectName','openType','taskInstId','bizType'],
  69. components: {
  70. elaudio
  71. },
  72. data() {
  73. return {
  74. testHeight:350,
  75. dialogFormVisible: true,
  76. addPicPanel: false,
  77. pictureArray: [],
  78. videoArray: [],
  79. videoArray: [],
  80. audioArray: [],
  81. fileArray:[],
  82. picturetabName: "",
  83. videotabName: "",
  84. audiotabName: "",
  85. filetabName: "",
  86. updateObj:{}
  87. }
  88. },
  89. computed: {
  90. hostUrl() {
  91. return hostUrl
  92. }
  93. },
  94. mounted() {
  95. this.getTaskDetail();
  96. },
  97. watch: {
  98. },
  99. methods: {
  100. getTaskDetail() {
  101. this.updateObj = {};
  102. request.get(`/bis/insp/pblm/plist/v1/workflow/qryTaskDetail/${this.taskInstId}`).then(res => {
  103. if (res.success) {
  104. this.updateObj = res.data;
  105. this.getPicArray();
  106. }
  107. }).catch(err => {
  108. console.log(err)
  109. })
  110. },
  111. dialogClose() {
  112. // //debugger
  113. this.$emit('jqmmDialogClose');
  114. },
  115. getPicArray() {
  116. var params = {
  117. bizId:this.updateObj.formId,
  118. bizType: this.bizType
  119. }
  120. var _this = this;
  121. request.post(`/file/findAllFile`,params).then(res => {
  122. if (res.success) {
  123. this.pictureArray = [];
  124. this.videoArray = [];
  125. this.audioArray = [];
  126. this.fileArray = [];
  127. res.data.forEach(item => {
  128. if (
  129. item.fileExt == "jpg" ||
  130. item.fileExt == "JPG" ||
  131. item.fileExt == "png" ||
  132. item.fileExt == "PNG" ||
  133. item.fileExt == "JPEG" ||
  134. item.fileExt == "jpeg"
  135. ) {
  136. this.pictureArray.push(item);
  137. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  138. this.videoArray.push({
  139. height: "320",
  140. width: "500",
  141. id: item.id,
  142. bizId: item.bizId,
  143. autoplay: false,
  144. muted: true,
  145. language: "en",
  146. playbackRates: [0.7, 1.0, 1.5, 2.0],
  147. sources: [
  148. {
  149. type: "video/mp4",
  150. src: this.hostUrl + item.filePath
  151. }
  152. ]
  153. });
  154. }else if (
  155. item.fileExt == "mp3" ||
  156. item.fileExt == "MP3" ||
  157. item.fileExt == "m4a"
  158. ) {
  159. this.audioArray.push(item);
  160. }else{
  161. this.fileArray.push(item);
  162. }
  163. });
  164. _this.$nextTick(function(){
  165. var ViewerDom = document.getElementById('imgView');
  166. var viewer = new Viewer(ViewerDom, {})
  167. });
  168. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  169. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  170. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  171. this.filetabName = "其他资料(" + this.fileArray.length + ")";
  172. }
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss">
  179. .noPic{
  180. text-align: center;
  181. }
  182. .image-preview-action {
  183. position: absolute;
  184. top:0;
  185. width: 100%;
  186. height: 30px;
  187. text-align: center;
  188. opacity: 0;
  189. font-size: 20px;
  190. background-color: rgba(0, 0, 0, 0.5);
  191. transition: opacity 0.3s;
  192. cursor: pointer;
  193. line-height: 30px;
  194. }
  195. .image-preview-action .el-icon-delete {
  196. font-size: 25px;
  197. }
  198. .image-preview-action:hover {
  199. opacity: 1;
  200. }
  201. .jqmm {
  202. .image-preview-action {
  203. position: absolute;
  204. top:0;
  205. width: 100%;
  206. height: 30px;
  207. text-align: center;
  208. opacity: 0;
  209. font-size: 20px;
  210. background-color: rgba(0, 0, 0, 0.5);
  211. transition: opacity 0.3s;
  212. cursor: pointer;
  213. line-height: 30px;
  214. }
  215. .image-preview-action .el-icon-delete {
  216. font-size: 25px;
  217. color:white;
  218. }
  219. .image-preview-action:hover {
  220. opacity: 1;
  221. }
  222. .noPic {
  223. width: 100%;
  224. height: 100%;
  225. text-align: center;
  226. line-height: 300px;
  227. font-size: 17px;
  228. font-weight: bold;
  229. }
  230. .jqmm span.el-dialog__title {
  231. font-weight: bold;
  232. }
  233. /*.el-carousel.el-carousel--horizontal {*/
  234. /*text-align: center;*/
  235. /*}*/
  236. .el-dialog__body {
  237. padding: 0 30px 20px;
  238. }
  239. }
  240. </style>