069b3ba4a3ce9483709a61d8d0c6cecbeece641b.svn-base 17 KB

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