08c3b38e2170409d187d14c265acdf7b6e9c0dcd.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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 style="text-align:right;">
  5. <el-button :type="!addPicPanel ? 'primary' : 'danger'"
  6. :icon="!addPicPanel ? 'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
  7. @click="addPic" v-if="openType"
  8. >{{!addPicPanel?"佐证材料":"取消"}}</el-button>
  9. </el-row>
  10. <el-row v-if="addPicPanel" style="text-align:center;">
  11. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  12. </el-row>
  13. <el-row v-else>
  14. <el-form label-width="80px">
  15. <el-form-item label="详细描述">
  16. <el-input type="textarea" v-model="formObj.explain" style="width:80%"></el-input>
  17. </el-form-item>
  18. </el-form>
  19. <div
  20. style="width: 100%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 58vh;">
  21. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
  22. <el-tabs style="margin:0px 5px">
  23. <el-tab-pane :label="picturetabName">
  24. <el-row>
  25. <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
  26. <div class="upload-container" id="imgView1">
  27. <div
  28. v-for="(item, index) in pictureArray"
  29. :key="index"
  30. class="image-preview image-app-preview"
  31. >
  32. <div class="image-preview-wrapper">
  33. <img :src="`${hostUrl}/${item.filePath}`">
  34. <div class="image-preview-action">
  35. <i @click="removeFile(item.id)" v-if="openType" class="el-icon-delete"></i>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </el-row>
  42. </el-tab-pane>
  43. <el-tab-pane :label="audiotabName">
  44. <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
  45. <el-table-column header-align="center" align="center" label="音频">
  46. <template slot-scope="scope">
  47. <elaudio
  48. style="margin-left:15%;width:100px;height:30px;"
  49. :theUrl="`${hostUrl}/${scope.row.filePath}`"
  50. ></elaudio>
  51. </template>
  52. </el-table-column>
  53. <el-table-column header-align="center" align="center" label="操作" v-if="openType">
  54. <template slot-scope="scope">
  55. <el-button
  56. size="mini"
  57. @click="removeFile(scope.row.id,scope.$index)"
  58. type="danger"
  59. >删除
  60. </el-button>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. </el-tab-pane>
  65. <el-tab-pane :label="videotabName">
  66. <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
  67. <el-table-column header-align="center" align="center" label="视频">
  68. <template slot-scope="scope">
  69. <video-player
  70. class="vjs-custom-skin"
  71. ref="videoPlayer"
  72. :options="scope.row"
  73. :playsinline="true"
  74. ></video-player>
  75. </template>
  76. </el-table-column>
  77. <el-table-column header-align="center" align="center" label="操作" v-if="openType">
  78. <template slot-scope="scope">
  79. <el-button
  80. size="mini"
  81. @click="removeFile(scope.row.id,scope.$index)"
  82. type="danger"
  83. >删除
  84. </el-button>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. </el-tab-pane>
  89. <el-tab-pane :label="filetabName">
  90. <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
  91. <el-table-column header-align="center" align="center" label="文档">
  92. <template slot-scope="scope">
  93. <p>
  94. <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
  95. {{scope.row.fileName}}
  96. </a>
  97. </p>
  98. </template>
  99. </el-table-column>
  100. <el-table-column header-align="center" align="center" label="操作" v-if="openType">
  101. <template slot-scope="scope">
  102. <el-button
  103. size="mini"
  104. @click="removeFile(scope.row.id,scope.$index)"
  105. type="danger"
  106. >删除</el-button>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. </el-tab-pane>
  111. </el-tabs>
  112. </div>
  113. </el-row>
  114. <div slot="footer" class="dialog-footer">
  115. <el-button @click="dialogFormVisible = false">取 消</el-button>
  116. <el-button type="primary" @click="onSubmit" v-if="openType">保 存</el-button>
  117. </div>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script>
  122. import request from '@util/gw_ajax_request'
  123. import upload from './uploadPicWithDesc'
  124. import { deleteFileById } from "@api/duChaAPI.js";
  125. import { hostUrl } from "@util/global_variable.js";
  126. import Viewer from 'viewerjs';
  127. import 'viewerjs/dist/viewer.css';
  128. export default {
  129. name: "theRecentAppearance",
  130. props: ['jqmmShow','jqmmEngId','dialogTitle','currentObjectName','type','openType'],
  131. components: {
  132. upload
  133. },
  134. data (){
  135. return {
  136. dialogFormVisible:true,
  137. addPicPanel:false,
  138. picturetabName: "",
  139. audiotabName: "",
  140. videotabName: "",
  141. pictureArray: [],
  142. audioArray: [],
  143. videoArray: [],
  144. filetabName: "",
  145. fileArray: [],
  146. gwComFileList:[],
  147. formObj:{
  148. explain:""
  149. },
  150. expertList:[]
  151. }
  152. },
  153. computed:{
  154. hostUrl(){
  155. return hostUrl
  156. }
  157. },
  158. mounted(){
  159. this.getDataInfo();
  160. },
  161. methods:{
  162. getDataInfo(){
  163. var _self = this;
  164. request.get(`/bis/insp/wiujs/support/get?caseId=`+this.jqmmEngId+"&name="+this.type).then(res =>{
  165. if(res.success) {
  166. _self.formObj = res.data;
  167. if(_self.formObj.id){
  168. _self.getPicArray();
  169. }
  170. }
  171. })
  172. },
  173. dialogClose(){
  174. this.$emit('jqmmDialogClose');
  175. },
  176. addPic() {
  177. this.addPicPanel = !this.addPicPanel;
  178. },
  179. getPicArray(){
  180. var _self = this;
  181. let params = {
  182. bizId: this.formObj.id
  183. }
  184. this.pictureArray = [];
  185. this.audioArray = [];
  186. this.videoArray = [];
  187. this.fileArray = [];
  188. this.gwComFileList = [];
  189. var _this = this;
  190. request.post(`/file/findPageInfo`,params).then(res =>{
  191. if(res.success) {
  192. _self.gwComFileList = res.data.list==null?[]:res.data.list;
  193. res.data.list.forEach(item => {
  194. if (
  195. item.fileExt == "mp3" ||
  196. item.fileExt == "MP3" ||
  197. item.fileExt == "m4a"
  198. ) {
  199. this.audioArray.push(item);
  200. } else if (
  201. item.fileExt == "jpg" ||
  202. item.fileExt == "JPG" ||
  203. item.fileExt == "png" ||
  204. item.fileExt == "PNG" ||
  205. item.fileExt == "JPEG" ||
  206. item.fileExt == "jpeg"
  207. ) {
  208. this.pictureArray.push(item);
  209. } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
  210. this.videoArray.push({
  211. id: item.id,
  212. bizId: item.bizId,
  213. width: "130",
  214. height: "130",
  215. autoplay: false,
  216. muted: true,
  217. language: "en",
  218. playbackRates: [0.7, 1.0, 1.5, 2.0],
  219. sources: [
  220. {
  221. type: "video/mp4",
  222. src: this.hostUrl + item.filePath
  223. }
  224. ]
  225. });
  226. } else {
  227. this.fileArray.push(item);
  228. }
  229. });
  230. _this.$nextTick(function(){
  231. var ViewerDom = document.getElementById('imgView1');
  232. var viewer = new Viewer(ViewerDom, {})
  233. console.log("img");
  234. });
  235. this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
  236. this.audiotabName = "音频资料(" + this.audioArray.length + ")";
  237. this.videotabName = "视频资料(" + this.videoArray.length + ")";
  238. this.filetabName = "其它资料(" + this.fileArray.length + ")";
  239. }
  240. })
  241. },
  242. onSubmit(){
  243. var _self = this;
  244. var obj={
  245. id:_self.formObj.id,
  246. caseId:this.jqmmEngId,
  247. explain: this.formObj.explain,
  248. name:this.type,
  249. gwComFileList:this.gwComFileList
  250. }
  251. request.post(`/bis/insp/wiujs/support`,obj).then(res =>{
  252. if(res.success) {
  253. _self.submitUpload(res.data.id);
  254. }
  255. })
  256. },
  257. // 文件上传
  258. submitUpload(id) {
  259. if(this.$refs.uploadFile==undefined){
  260. this.$message.success('编辑成功');
  261. this.getDataInfo();
  262. this.$emit('jqmmDialogClose');
  263. this.addPicPanel = false;
  264. }
  265. if (this.$refs.uploadFile.submitUpload(id,this.type)) {
  266. this.removeNewSupervision();
  267. }
  268. },
  269. removeNewSupervision(arg){
  270. if (arg) {
  271. this.$message.success('上传成功');
  272. this.getDataInfo();
  273. this.$emit('jqmmDialogClose');
  274. // this.pictureArray = [];
  275. this.$refs.uploadFile.init();
  276. this.addPicPanel = !this.addPicPanel;
  277. } else{
  278. this.$message.error('上传有误');
  279. }
  280. },
  281. // 删除图片文件
  282. removeFile(id, index) {
  283. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  284. confirmButtonText: "确定",
  285. cancelButtonText: "返回",
  286. type: "warning"
  287. }).then(
  288. res => {
  289. if (res === "confirm") {
  290. deleteFileById(id, localStorage.getItem("userid")).then(res => {
  291. if (res.success) {
  292. this.getPicArray();
  293. } else {
  294. this.$message.error(res.message);
  295. }
  296. });
  297. }
  298. }
  299. );
  300. },
  301. },
  302. }
  303. </script>
  304. <style lang="scss">
  305. .img_wrapper{
  306. width: 120px;
  307. min-height: 120px;
  308. max-height: 200px;
  309. position: relative;
  310. float: left;
  311. &:hover{
  312. .image-action{
  313. opacity: 1;
  314. }
  315. }
  316. +span{
  317. margin-left: 20px;
  318. }
  319. }
  320. .image-action{
  321. position: absolute;
  322. bottom: 0;
  323. left: 0;
  324. width: 100%;
  325. height: 40px;
  326. text-align: center;
  327. opacity: 0;
  328. font-size: 16px;
  329. background-color: rgba(0, 0, 0, 0.5);
  330. transition: opacity 0.3s;
  331. cursor: pointer;
  332. line-height: 40px;
  333. }
  334. .image-action .el-icon-delete {
  335. font-size: 20px;
  336. color: #fff;
  337. }
  338. .noPic{
  339. width: 100%;
  340. height: 100%;
  341. text-align: center;
  342. line-height: 300px;
  343. font-size: 17px;
  344. font-weight: bold;
  345. }
  346. .jqmm span.el-dialog__title {
  347. font-weight: bold;
  348. }
  349. .viewer-container{
  350. z-index: 9999 !important;
  351. }
  352. .upload-container {
  353. width: 100%;
  354. position: relative;
  355. .image-uploader {
  356. width: 35%;
  357. float: left;
  358. }
  359. .image-preview {
  360. width: 200px;
  361. height: 200px;
  362. position: relative;
  363. border: 1px dashed #d9d9d9;
  364. float: left;
  365. // margin-left: 50px;
  366. .image-preview-wrapper {
  367. position: relative;
  368. width: 100%;
  369. height: 100%;
  370. img {
  371. width: 100%;
  372. height: 100%;
  373. }
  374. }
  375. .image-preview-action {
  376. position: absolute;
  377. width: 100%;
  378. height: 30px;
  379. left: 0;
  380. bottom: 0;
  381. color: #fff;
  382. opacity: 0;
  383. font-size: 20px;
  384. background-color: rgba(0, 0, 0, 0.5);
  385. transition: opacity 0.3s;
  386. cursor: pointer;
  387. text-align: center;
  388. line-height: 30px;
  389. .el-icon-delete {
  390. font-size: 25px;
  391. }
  392. }
  393. &:hover {
  394. .image-preview-action {
  395. opacity: 1;
  396. }
  397. }
  398. }
  399. .image-app-preview {
  400. margin-bottom: 10px;
  401. width: 33%;
  402. height: 180px;
  403. position: relative;
  404. border: 1px dashed #d9d9d9;
  405. float: left;
  406. // margin-left: 50px;
  407. .app-fake-conver {
  408. height: 44px;
  409. position: absolute;
  410. width: 100%; // background: rgba(0, 0, 0, .1);
  411. text-align: center;
  412. line-height: 64px;
  413. color: #fff;
  414. }
  415. }
  416. }
  417. </style>