af98e5f2efb5b3285ef06b64eaf944ddd3f6c548.svn-base 16 KB

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