| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <template>
- <div>
- <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" @close="dialogClose" :append-to-body="true" width="60%" class="jqmm">
- <el-row style="text-align:right;">
- <el-button :type="!addPicPanel ? 'primary' : 'danger'"
- :icon="!addPicPanel ? 'el-icon-circle-plus-outline':'el-icon-circle-close-outline'"
- @click="addPic" v-if="openType"
- >{{!addPicPanel?"佐证材料":"取消"}}</el-button>
- </el-row>
- <el-row v-show="addPicPanel" style="text-align:center;">
- <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
- </el-row>
- <el-row v-show="!addPicPanel">
- <el-form label-width="80px">
- <el-form-item label="说明">
- <el-input type="textarea" v-model="formObj.explain" style="width:80%"></el-input>
- </el-form-item>
- <el-form-item label="评分专家">
- <el-select v-model="formObj.expertId" placeholder="请选择">
- <el-option
- v-for="item in expertList"
- :key="item.guid"
- :label="item.persName"
- :value="item.guid">
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div
- style="width: 100%;float: left;border: 1px solid rgb(213, 213, 255);margin-right: 5px;overflow-y: auto;max-height: 58vh;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">多媒体信息</p>
- <el-tabs style="margin:0px 5px">
- <el-tab-pane :label="picturetabName">
- <el-row>
- <div style="overflow-y:auto;overflow-x:hidden;max-height:30vh;padding:10px;">
- <div class="upload-container" id="imgView">
- <div
- v-for="(item, index) in pictureArray"
- :key="index"
- class="image-preview image-app-preview"
- >
- <div class="image-preview-wrapper">
- <img :src="`${hostUrl}/${item.filePath}`">
- <div class="image-preview-action">
- <i @click="removeFile(item.id)" v-if="openType" class="el-icon-delete"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-row>
- </el-tab-pane>
- <el-tab-pane :label="audiotabName">
- <el-table border :data="audioArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="音频">
- <template slot-scope="scope">
- <elaudio
- style="margin-left:15%;width:100px;height:30px;"
- :theUrl="`${hostUrl}/${scope.row.filePath}`"
- ></elaudio>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作" v-if="openType">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="videotabName">
- <el-table border :data="videoArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="视频">
- <template slot-scope="scope">
- <video-player
- class="vjs-custom-skin"
- ref="videoPlayer"
- :options="scope.row"
- :playsinline="true"
- ></video-player>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作" v-if="openType">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="filetabName">
- <el-table border :data="fileArray" style="width: 100%;margin: 0 auto;">
- <el-table-column header-align="center" align="center" label="文档">
- <template slot-scope="scope">
- <p>
- <a :href="`${hostUrl}/${scope.row.filePath}`" target="_blank" rel="noopener noreferrer">
- {{scope.row.fileName}}
- </a>
- </p>
- </template>
- </el-table-column>
- <el-table-column header-align="center" align="center" label="操作" v-if="openType">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="removeFile(scope.row.id,scope.$index)"
- type="danger"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- </div>
- </el-row>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" @click="onSubmit" v-if="openType">保 存</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import request from '@util/gw_ajax_request'
- import upload from './uploadPicWithDesc'
- import { deleteFileById } from "@api/duChaAPI.js";
- import { hostUrl } from "@util/global_variable.js";
- import Viewer from 'viewerjs';
- import 'viewerjs/dist/viewer.css';
- export default {
- name: "theRecentAppearance",
- props: ['jqmmShow','jqmmEngId','dialogTitle','currentObjectName','type','openType','currentNodeId'],
- components: {
- upload
- },
- data (){
- return {
- dialogFormVisible:true,
- addPicPanel:false,
- picturetabName: "",
- audiotabName: "",
- videotabName: "",
- pictureArray: [],
- audioArray: [],
- videoArray: [],
- filetabName: "",
- fileArray: [],
- gwComFileList:[],
- formObj:{
- expertId:"",
- explain:""
- },
- expertList:[]
- }
- },
- computed:{
- hostUrl(){
- return hostUrl
- }
- },
- mounted(){
- this.getExpert();
- },
- methods:{
- getExpert(){
- var _self = this;
- request.get(`/dc/pers/base/getExpertListByInspGroupId?inspGroupId=`+this.currentNodeId).then(res => {
- if(res.success){
- _self.expertList = res.data;
- _self.getExperInfo();
- }
- })
- },
- getExperInfo(){
- var _self = this;
- request.get(`/bis/insp/ststn/score/get?caseId=`+this.jqmmEngId+"&scoreName="+this.type).then(res =>{
- if(res.success) {
- _self.formObj = res.data;
- if(_self.formObj.id){
- _self.getPicArray();
- }
- }
- })
- },
- dialogClose(){
- this.$emit('jqmmDialogClose');
- },
- addPic() {
- this.addPicPanel = !this.addPicPanel;
- },
- getPicArray(){
- var _self = this;
- let params = {
- bizId: this.formObj.id
- }
- this.pictureArray = [];
- this.audioArray = [];
- this.videoArray = [];
- this.fileArray = [];
- this.gwComFileList = [];
- request.post(`/file/findPageInfo`,params).then(res =>{
- if(res.success) {
- _self.gwComFileList = res.data.list==null?[]:res.data.list;
- res.data.list.forEach(item => {
- if (
- item.fileExt == "mp3" ||
- item.fileExt == "MP3" ||
- item.fileExt == "m4a"
- ) {
- this.audioArray.push(item);
- } else if (
- item.fileExt == "jpg" ||
- item.fileExt == "JPG" ||
- item.fileExt == "png" ||
- item.fileExt == "PNG" ||
- item.fileExt == "JPEG" ||
- item.fileExt == "jpeg"
- ) {
- this.pictureArray.push(item);
- } else if (item.fileExt == "mp4" || item.fileExt == "MP4") {
- this.videoArray.push({
- id: item.id,
- bizId: item.bizId,
- width: "130",
- height: "130",
- autoplay: false,
- muted: true,
- language: "en",
- playbackRates: [0.7, 1.0, 1.5, 2.0],
- sources: [
- {
- type: "video/mp4",
- src: this.hostUrl + item.filePath
- }
- ]
- });
- } else {
- this.fileArray.push(item);
- }
- });
- _self.$nextTick(function(){
- var ViewerDom = document.getElementById('imgView');
- var viewer = new Viewer(ViewerDom, {})
- });
- this.picturetabName = "图片资料(" + this.pictureArray.length + ")";
- this.audiotabName = "音频资料(" + this.audioArray.length + ")";
- this.videotabName = "视频资料(" + this.videoArray.length + ")";
- this.filetabName = "其它资料(" + this.fileArray.length + ")";
- }
- })
- },
- onSubmit(){
- var expertNm = "";
- for(var i = 0;i<this.expertList.length;i++){
- if(this.expertList[i].persId = this.formObj.expertId){
- expertNm = this.expertList[i].persName;
- }
- }
- var _self = this;
- if(!this.formObj.expertId){
- this.$message.warning("请选择专家!");
- return;
- }
- var obj={
- id:_self.formObj.id,
- caseId:this.jqmmEngId,
- expertNm:expertNm,
- expertId:this.formObj.expertId,
- explain: this.formObj.explain,
- scoreName:this.type,
- gwComFileList:this.gwComFileList
- }
- request.post(`/bis/insp/ststn/score`,obj).then(res =>{
- if(res.success) {
- _self.submitUpload(res.data.id);
- }
- })
- },
- // 文件上传
- submitUpload(id) {
- if(this.$refs.uploadFile==undefined){
- this.$message.success('编辑成功');
- this.getExpert();
- this.$emit('jqmmDialogClose');
- this.addPicPanel = false;
- }
- if (this.$refs.uploadFile.submitUpload(id,this.type)) {
- this.removeNewSupervision();
- }
- },
- removeNewSupervision(arg){
- if (arg) {
- this.$message.success('上传成功');
- this.getExpert();
- this.$emit('jqmmDialogClose');
- // this.pictureArray = [];
- this.$refs.uploadFile.init();
- this.addPicPanel = !this.addPicPanel;
- } else{
- this.$message.error('上传有误');
- }
- },
- // 删除图片文件
- removeFile(id, index) {
- this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- type: "warning"
- }).then(
- res => {
- if (res === "confirm") {
- deleteFileById(id, localStorage.getItem("userid")).then(res => {
- if (res.success) {
- this.getPicArray();
- } else {
- this.$message.error(res.message);
- }
- });
- }
- }
- );
- },
- },
- }
- </script>
- <style lang="scss">
- .img_wrapper{
- width: 120px;
- min-height: 120px;
- max-height: 200px;
- position: relative;
- float: left;
- &:hover{
- .image-action{
- opacity: 1;
- }
- }
- +span{
- margin-left: 20px;
- }
- }
- .image-action{
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 40px;
- text-align: center;
- opacity: 0;
- font-size: 16px;
- background-color: rgba(0, 0, 0, 0.5);
- transition: opacity 0.3s;
- cursor: pointer;
- line-height: 40px;
- }
- .image-action .el-icon-delete {
- font-size: 20px;
- color: #fff;
- }
- .noPic{
- width: 100%;
- height: 100%;
- text-align: center;
- line-height: 300px;
- font-size: 17px;
- font-weight: bold;
- }
- .jqmm span.el-dialog__title {
- font-weight: bold;
- }
- .viewer-container{
- z-index: 9999 !important;
- }
- .upload-container {
- width: 100%;
- position: relative;
- .image-uploader {
- width: 35%;
- float: left;
- }
- .image-preview {
- width: 200px;
- height: 200px;
- position: relative;
- border: 1px dashed #d9d9d9;
- float: left;
- // margin-left: 50px;
- .image-preview-wrapper {
- position: relative;
- width: 100%;
- height: 100%;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .image-preview-action {
- position: absolute;
- width: 100%;
- height: 30px;
- left: 0;
- bottom: 0;
- color: #fff;
- opacity: 0;
- font-size: 20px;
- background-color: rgba(0, 0, 0, 0.5);
- transition: opacity 0.3s;
- cursor: pointer;
- text-align: center;
- line-height: 30px;
- .el-icon-delete {
- font-size: 25px;
- }
- }
- &:hover {
- .image-preview-action {
- opacity: 1;
- }
- }
- }
- .image-app-preview {
- margin-bottom: 10px;
- width: 33%;
- height: 180px;
- position: relative;
- border: 1px dashed #d9d9d9;
- float: left;
- // margin-left: 50px;
- .app-fake-conver {
- height: 44px;
- position: absolute;
- width: 100%; // background: rgba(0, 0, 0, .1);
- text-align: center;
- line-height: 64px;
- color: #fff;
- }
- }
- }
- </style>
|