Forráskód Böngészése

'暂时提交下单制'

魏志佳 4 éve
szülő
commit
a1541a4ba3

+ 4 - 0
src/components/uploadFile.vue

@@ -97,6 +97,9 @@ export default {
     },
     value: {
       required: true,
+      default() {
+        return ''
+      },
     },
     size: {
       type: Number,
@@ -141,6 +144,7 @@ export default {
     value: {
       immediate: true,
       handler(n, o) {
+        console.log(n,o)
         if (this.fileList&&this.fileList.length == 0) {
           if (typeof n == 'object') {
             this.fileList = n.map((item, index) => {

+ 4 - 4
src/views/modules/autoLaunch/strategyList.vue

@@ -610,8 +610,8 @@ export default {
         goAnalysis(record){
             console.log(record)
             localStorage.setItem('currentStrategy',JSON.stringify(record))
-            this.$router.push('/autoLaunch/autoLaunchReport')
-            // this.$router.push('/autoLaunch/autoReportIndex')
+            // this.$router.push('/autoLaunch/autoLaunchReport')
+            this.$router.push('/autoLaunch/autoReportIndex')
         },
         filterOption(input, option) {
             return (
@@ -1054,9 +1054,9 @@ export default {
     .optionBtn{
         // display: inline-block;
         float: right;
-        .searchBtn{
+        // .searchBtn{
             // margin-right: 10px;
-        }
+        // }
     }
     .tableArea{
         .tableOption{

+ 221 - 141
src/views/modules/workBench/materialList.vue

@@ -420,7 +420,9 @@
                                 :visible="childrenDrawer"
                                 @close="onChildrenDrawerClose"
                             >  
+                                <a-spin :spinning="videoUploadLoading"> 
                                 <a-form :form="form" :label-col="labelCol" :wrapper-col="wrapperCol">
+                                     
                                     <a-form-item label="视频上传">
                                         
                                         <uploadFile
@@ -559,6 +561,7 @@
                                         />
                                     </a-form-item>
                                 </a-form>
+                                </a-spin>
                                <div
                                     :style="{
                                     position: 'absolute',
@@ -575,7 +578,7 @@
                                 >
                                     
                                     <a-button key="back" @click="onChildrenDrawerClose" style="margin-right:15px">取消</a-button>
-                                    <a-button type="primary" :disabled="!confirmLoading" @click="onChildrenDrawerOk" :loading="loadingElse2">确定</a-button>
+                                    <a-button type="primary" :disabled="!confirmLoading" @click="onChildrenDrawerOk" :loading="loadingElse">确定</a-button>
                                 
                                 </div>
                             </a-drawer>
@@ -917,11 +920,23 @@ export default {
             
         ]
         return {
+            videoEchoInfo:{},
+            videoUploadLoading:false,
+            videoinfo:{
+                url: '',
+                md5: '',
+                name: '',
+                width:undefined,
+                height:undefined,
+
+            },
+            imageinfo:[],
+
             assignVisibleLoading:false,
             visibleLoading:false,
 
             loadingElse2:false,
-             rules: {
+            rules: {
                 
                 clip: [{ required: true, message: '剪辑人员必须指派', trigger: 'change' }],
                 // shot: [{ required: true, message: '拍摄人员必须指派', trigger: 'change' }],
@@ -1164,18 +1179,42 @@ export default {
         },
         modifyVideo(){
             this.childrenDrawer=true;
-            console.log(this.currentVideo);
-            // urlList: {
-            //     url: '',
-            //     md5: '',
-            //     name: '',
-            // },
-            // urlListImage: {
-            //     url: [],
-            //     md5: [],
-            //     name: [],
-            //     size: [],
-            // },
+            // console.log(this.currentVideo);
+            
+            this.videoUploadLoading=true
+            getAction('/platform/material/videoEcho',{
+                videoId:this.currentVideo.videoId
+            }).then(res=>{
+                console.log(res)
+                console.log(res)
+                this.videoUploadLoading=false;
+                this.confirmLoading=true;
+                if(res.result.video){
+                    this.urlList=res.result.video
+                    this.videoinfo=res.result.video;
+                    this.videoinfo.url=this.videoinfo.url.replace(/https:/g,'')
+                }
+                if(res.result.covers){
+                    this.imageinfo=res.result.covers;
+                    this.urlListImage= {
+                        url : res.result.covers.map(item=>{return item.url}),
+                        md5 : res.result.covers.map(item=>item.md5),
+                        name : res.result.covers.map(item=>item.name),
+                        size : res.result.covers.map(item=>item.size),
+                        format : res.result.covers.map(item=>item.format),
+                    }
+                }
+                
+                this.form.setFieldsValue({
+                    contentTagList: res.result.tags.contentTagList.map(item=>{return item.tagId}),
+                    modalityTagList:  res.result.tags.modalityTagList.map(item=>{return item.tagId}),
+                    modTagList:  res.result.tags.modTagList.map(item=>{return item.tagId}),
+                    senceTagList:  res.result.tags.senceTagList.map(item=>{return item.tagId}),
+                })
+
+                this.videoEchoInfo=res.result
+            })
+            
         },
         goOrderDetail(record){
             console.log(record)
@@ -1384,10 +1423,10 @@ export default {
         },
 
 
-
-
         beforeUpload(file) {
-            this.uploadAction= `http://api.tjyourong.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
+
+            // this.uploadAction= `http://api.tjyourong.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
+            this.uploadAction= `http://139.186.151.174:8804/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
             this.loadDisabled = true
             const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
             const fileName = file.name
@@ -1433,7 +1472,7 @@ export default {
         },
         onChildrenDrawerClose() {
             this.childrenDrawer = false;
-            this.loadingElse2=false
+            this.loadingElse=false
             this.dataElse = []
             this.form.resetFields()
             this.urlList = {
@@ -1448,113 +1487,95 @@ export default {
                 name: [],
                 size: [],
             }
-            this.imageArrList = []
+            this.imageArrList = [];
+            this.videoinfo={
+                url: '',
+                md5: '',
+                name: '',
+                width:undefined,
+                height:undefined,
+            };
+            this.imageinfo=[];
+            this.form.setFieldsValue({
+                contentTagList: null,
+                modalityTagList: null,
+                modTagList: null,
+                senceTagList: null,
+            })
         },
 
         onChildrenDrawerOk(){
             this.form.validateFieldsAndScroll((err, values) => {
                 if (!err) {
                     console.log(values)
-                    this.loadingElse2 = true
+                    this.loadingElse = true
                     var params = {
                         ...values,
+                        ...this.videoinfo,
+                        covers:[...this.imageinfo]
                     }
-                    // var roleCode = {}
-                    // for (const key in this.role) {
-                    //     if (key == 'roleCode') {
-                    //         this.role[key] = this.role[key] + 'Id'
-                    //         roleCode[this.role[key]] = this.userInfo.id
-                    //     }
-                    // }
+                   
                     params.id = this.add ? null : this.id
-                    params.code = this.urlList.md5
-                    params.url = this.urlList.url
-                    params.materialName = this.urlList.name
-                
                     params.userId = this.userInfo.id
-                    params.projectId = values.projectId
-                    params.materialDescribe = values.materialDescribe
-                    params.type = 'VIDEO'
-                    //   params.tagList = values.tagList
-                    params.ascription ={
-                        planId: this.currentMaterial.plan,
-                        shotId: this.currentMaterial.shot,
-                        clipId: this.currentMaterial.clip,
-                    }
+
                     params.projectId=this.currentMaterial.projectId
-                    params.materialId=this.currentMaterial.id||this.currentMaterial.materialId
-                    params.tag = this.tags
-                    params.imageArr = this.imageArrList
-                    if (this.add) {
-                        orderFileInsert(params).then((res) => {
-                        if (res.success) {
-                            this.form.resetFields()
-                            this.urlList = {
-                            url: '',
-                            md5: '',
-                            name: '',
-                            }
-                            
-                            this.urlListImage = {
-                            url: [],
-                            md5: [],
-                            name: [],
-                            size: [],
-                            }
-                            this.imageArrList = []
-                            this.tags = []
-                            
-                            this.childrenDrawer = false
-                            this.visible=false;
-                            this.add = true
-                            for (const key in this.role) {
-                            if (key == 'roleCode') {
-                                this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
-                            }
-                            }
-                            this.$message.success('素材上传成功')
-                            this.loadingElse2 = false
-                            this.materialHttp(this.activeKey)
-                            //   this.departValue = []
-                        } else {
-                            this.$message.error(res.message)
-                            this.loadingElse2 = false
-                            this.childrenDrawer = false
-                            this.visible=false;
-                        }
-                        })
-                    } else {
-                        fileEdit({
-                        ...params,
-                        status: '0',
-                        }).then((res) => {
-                        if (res.success) {
-                            this.form.resetFields()
-                            this.urlList = {
-                            url: '',
-                            md5: '',
-                            name: '',
-                            }
-                            
-                            this.tags = []                      
-                            this.childrenDrawer = false
-                            this.add = true
-                            for (const key in this.role) {
+                    params.materialId=this.currentMaterial.id ||this.currentMaterial.materialId
+                    params.materialCode=this.currentMaterial.materialCode
+                    
+                        postAction('/platform/file/uploadVideo',params).then(res=>{
+                            this.loading=false;
+                            if (res.success) {
+                                this.form.resetFields()
+                                this.urlList = {
+                                    url: '',
+                                    md5: '',
+                                    name: '',
+                                }
+                                
+                                this.urlListImage = {
+                                    url: [],
+                                    md5: [],
+                                    name: [],
+                                    size: [],
+                                }
+                                this.imageArrList = []
+                                this.tags = []
+                                
+                                this.childrenDrawer = false
+                                this.visible=false;
+                                this.add = true
+                                for (const key in this.role) {
                                 if (key == 'roleCode') {
                                     this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
                                 }
+                                }
+                                this.$message.success('素材上传成功')
+                                this.loadingElse = false
+                                this.videoinfo={
+                                    url: '',
+                                    md5: '',
+                                    name: '',
+                                    width:undefined,
+                                    height:undefined,
+                                };
+                                this.imageinfo=[];
+                                this.materialHttp(this.activeKey)
+                                //   this.departValue = []
+                            } else {
+                                this.$message.error(res.message)
+                                this.loadingElse = false
+                                // this.childrenDrawer = false
+                                // this.visible=false;
                             }
-                        } else {
-                            this.$message.error(res.message)                       
-                            this.childrenDrawer = false
-                        }
                         })
-                    }
-                }else {
-
+                        
+                } else {
+                    this.$message.error('请正确填写必填项目')
                 }
+                
             })
         },
+
         // 上传视频相关方法
         removeUpload() {
             this.form.setFieldsValue({
@@ -1569,10 +1590,12 @@ export default {
             this.confirmLoading = true
             this.repeat = false
             this.urlList.url = urlAll[0].url
+            
+            this.videoinfo.url=urlAll[0].url
             this.$message.success('上传成功')
 
             getAction('/ctop/materialTagInfo/detail', {
-                code: this.urlList.md5,
+                code: this.videoinfo.md5,
             }).then((res) => {
                 if (res.success) {
                 if (res.modalityTagList.length > 0) {
@@ -1601,25 +1624,23 @@ export default {
             console.log(index)
         },
         overUploadImage(urlAll) {
-        
+            console.log(urlAll)
             var that = this
             that.material = []
             that.imageArrList = []
             var img
             if (urlAll.length > 0) {
-                for (var i = 0; i < urlAll.length; i++) {
-                that.imageArrList.push({
-                    // width: img.width,
-                    // height: img.height,
-                    // size: this.urlListImage.size[i],
-                    code: this.urlListImage.md5[i],
-                    url: urlAll[i].url,
-                    materialName: this.urlListImage.name[i],
+                urlAll.forEach((ele,index)=>{
+
+                    this.imageinfo.forEach(item=>{
+                        if(item.name==ele.name){
+                            item.url=ele.url
+                        }
+                    })
+                    // img = new Image()
+                    // img.src = urlAll[index].url
                 })
-                img = new Image()
-                img.src = urlAll[i].url
                 
-                }
             } else {}
         },
         addImage(item) {
@@ -1650,35 +1671,79 @@ export default {
                 size: [],
             }
             this.imageArrList = []
+            
         },
         file(file) {
+            console.log(file)
             var bmf = new BMF()
             var that = this
-            return new Promise(function (resolve, reject) {
-                bmf.md5(file, (err, md5) => {
-                that.urlList.name = file.name
-                that.urlList.md5 = md5
-                fileCheck({
-                    code: md5,
-                    projectId: that.currentMaterial.projectId,
-                }).then((res) => {
-                    if (res.code == 0) {
-                    that.$message.error('此素材已经上传')
-                    that.repeat = true
-                    reject()
-                    } else {
-                    that.repeat = false
+            
+            return new Promise( (resolve, reject)=> {
+                
+                this.getVideoMsg(file).then((videoinfo) => {
+                    const { duration, height, width } = videoinfo;
+                    //获取到视频的时长,高度,宽度
+                    bmf.md5(file, (err, md5) => {
+                        videoinfo.name = file.name
+                        videoinfo.md5 = md5
+                        that.repeat = false
+                    })
+                    videoinfo.size=file.size;
+                    videoinfo.format=file.type
+                    console.log(videoinfo);
+                    this.videoinfo=videoinfo
                     resolve()
-                    //   reject()
-                    }
-                })
-                })
+                });
             })
+
+            
+
+            
+        },
+        
+        getVideoMsg(file) {
+            // console.log('getVideoMsg')
+            return new Promise((resolve) => {
+                let videoElement = document.createElement("video");
+                videoElement.src = URL.createObjectURL(file);
+                videoElement.addEventListener("loadedmetadata", function () {
+                    let obj={
+                        duration: videoElement.duration,
+                        height: videoElement.videoHeight,
+                        width: videoElement.videoWidth,
+                    }
+                    
+                    window.URL.revokeObjectURL(videoElement.src);
+                    videoElement.remove()
+                    resolve(obj);
+                });
+            });
+        },
+
+        getImageMsg(file){
+            return new Promise((resolve) => {
+                // let imageElement = document.createElement("image");
+                let imageElement = new Image();
+                let obj={}
+                imageElement.src = URL.createObjectURL(file);
+                // console.log(imageElement)
+                imageElement.onload=function(){
+                    // console.log(imageElement.width)
+                    obj={
+                        height:imageElement.height,
+                        width:imageElement.width
+                    }
+                    console.log(obj)
+                    resolve(obj)
+                }
+                
+            });
         },
         fileWater(file) {
+            console.log(file)
             var bmf = new BMF()
             var that = this
-            var codeData = that.urlList.md5 != '' ? that.urlList.md5 : that.addImageData.code
+            var codeData = that.videoinfo.md5 != '' ? that.videoinfo.md5 : that.addImageData.code
             console.log(codeData)
             this.urlListImage = {
                 url: [],
@@ -1686,14 +1751,27 @@ export default {
                 name: [],
                 size: [],
             }
-            return new Promise(function (resolve, reject) {
+            this.imageinfo=[]
+            return new Promise( (resolve, reject)=> {
                 bmf.md5(file, (err, md5) => {
                 that.urlListImage.name.push(file.name)
                 that.urlListImage.md5.push(md5)
-                that.urlListImage.size.push(file.size)
-                resolve()
+                that.urlListImage.size.push(file.size)})
                 
-                })
+                this.getImageMsg(file).then((imageinfo) => {
+                   
+                    imageinfo.size=file.size;
+                    imageinfo.format=file.type;
+                    imageinfo.name=file.name
+                    bmf.md5(file, (err, md5) => {                        
+                        imageinfo.md5=md5   
+                        this.imageinfo.push({
+                            ...imageinfo
+                        })   
+                        resolve()                                    
+                    })
+                    
+                });
             })
         },
 
@@ -1802,6 +1880,7 @@ export default {
         this.role=this.$parent.role;  
         this.activeKey=this.$parent.materialStatus
         this.materialHttp(this.$parent.materialStatus)
+        this.getTagListAll()
     },
     activated() {
         if(this.$parent.role=='operator'){
@@ -1813,6 +1892,7 @@ export default {
         }
         this.activeKey=this.$parent.materialStatus
         this.materialHttp(this.$parent.materialStatus)
+        this.getTagListAll()
     },
     filters:{
         handlerMaterialStatus(val){

+ 44 - 32
src/views/modules/workBench/operator/materialList.vue

@@ -828,23 +828,29 @@ export default {
         // 脚本驳回
         scriptReject(){
             this.loadingElse=true
-            postAction(this.url.scriptReject,{
-                id:this.currentMaterial.materialId,
-                scriptAdvise:this.scriptAdvise,
-                materialCode:this.currentMaterial.materialCode
-            }).then(res=>{
-                console.log(res);
-
-                this.scriptVisible=false;
+            if(this.scriptAdvise){
+                postAction(this.url.scriptReject,{
+                    id:this.currentMaterial.materialId,
+                    scriptAdvise:this.scriptAdvise,
+                    materialCode:this.currentMaterial.materialCode
+                }).then(res=>{
+                    console.log(res);
+                    this.scriptAdvise=''
+                    this.scriptVisible=false;
+                    this.loadingElse=false;
+                    this.scriptRejectVisiable=false
+                    if(res.success){
+                        this.$message.success(res.message);
+                        this.tableHttp(this.$parent.materialStatus)
+                    }else{
+                        this.$message.error(res.message)
+                    }
+                })
+            }else{
                 this.loadingElse=false;
-                this.scriptRejectVisiable=false
-                if(res.success){
-                    this.$message.success(res.message);
-                    this.tableHttp(this.$parent.materialStatus)
-                }else{
-                    this.$message.error(res.message)
-                }
-            })
+                this.$messgae.error('请填写驳回理由')
+            }
+            
         },
         // 视频通过审核
         approved(){
@@ -869,23 +875,29 @@ export default {
         // 视频驳回
         reject(){
             this.loadingElse=true
-            postAction(this.url.videoReject,{
-                id:this.currentMaterial.materialId,
-                videoAdvise:this.videoAdvise,
-                materialCode:this.currentMaterial.materialCode
-            }).then(res=>{
-                console.log(res);
-
-                this.visible=false;
+            if(this.videoAdvise){
+                postAction(this.url.videoReject,{
+                    id:this.currentMaterial.materialId,
+                    videoAdvise:this.videoAdvise,
+                    materialCode:this.currentMaterial.materialCode
+                }).then(res=>{
+                    console.log(res);
+                    this.videoAdvise='';
+                    this.visible=false;
+                    this.loadingElse=false;
+                    this.videoRejectVisiable=false
+                    if(res.success){
+                        this.$message.success(res.message);
+                        this.tableHttp(this.$parent.materialStatus)
+                    }else{
+                        this.$message.error(res.message)
+                    }
+                })
+            }else{
                 this.loadingElse=false;
-                this.videoRejectVisiable=false
-                if(res.success){
-                    this.$message.success(res.message);
-                    this.tableHttp(this.$parent.materialStatus)
-                }else{
-                    this.$message.error(res.message)
-                }
-            })
+                this.$message.error('请填写驳回理由')
+            }
+            
         },
         
         search(){

+ 313 - 155
src/views/modules/workBench/orderDetail.vue

@@ -525,7 +525,7 @@
                                
                                 
                                 <span class="wancheng" v-if="text==7"> </span>
-                                <span class="bohui" v-else-if="text==3"> </span>
+                                <span class="bohui" v-else-if="text==3 || text==6"> </span>
                                 <span class="shenhe" v-else> </span>
                                 {{text | handlerMaterialStatus}}
                             </div>
@@ -564,7 +564,7 @@
                     @close="onClose"
                     >
                         
-                         <a-spin :spinning="visibleLoading">   
+                        <a-spin :spinning="visibleLoading">   
                             <a-drawer
                                 :title="add ? '上传视频' : '修改视频'"
                                 width="600"
@@ -572,25 +572,26 @@
                                 :visible="childrenDrawer"
                                 @close="onChildrenDrawerClose"
                             >
+                                <a-spin :spinning="videoUploadLoading"> 
                                 <a-form :form="form" :label-col="labelCol" :wrapper-col="wrapperCol">
                                     <a-form-item label="视频上传">
-                                        <!-- :checkFile="file" -->
+                                        <!--  -->
                                         <uploadFile
-                                            
+                                            :checkFile="file"
                                             :value.sync="urlList.url"
                                             @overUpload="overUpload"
                                             @removeUpload="removeUpload"
-                                            :fileCount="10"
+                                            :fileCount="1"
                                             uploadType="video"
                                             :multiple="false"
                                         />
                                         <span v-if="repeat" style="color: red">此素材重复,请重新选择上传</span>
-                                        <span v-if="confirmLoading && urlList.url != ''" style="color: green">上传成功</span>
+                                        <span v-if="confirmLoading && videoinfo.url != ''" style="color: green">上传成功</span>
                                     </a-form-item>
                                     <a-form-item
                                         label="封面上传"
                                         class="add-image-material"
-                                        v-if="currentMaterial.projectId && add && urlList.url != ''"
+                                        v-if="currentMaterial.projectId && add && videoinfo.url != ''"
                                         >
                                         <uploadFile
                                             :value.sync="urlListImage.url"
@@ -732,12 +733,13 @@
                                         <a-textarea
                                             placeholder="请输入描述"
                                             v-decorator="[
-                                            'materialDescribe', // 给表单赋值或拉取表单时,该input对应的key
+                                            'describe', // 给表单赋值或拉取表单时,该input对应的key
                                             ]"
                                             :auto-size="{ minRows: 3, maxRows: 10 }"
                                         />
                                     </a-form-item>
                                 </a-form>
+                                </a-spin>
                                <div
                                     :style="{
                                     position: 'absolute',
@@ -814,11 +816,12 @@
                             </div>
                             <div class="bottom-btn">
                                 <a-button type='primary' @click="approved" v-if="role=='operator'&&currentMaterial.materialStatus==5" style="margin-right:20px">通过审核</a-button>
-                                <a-button type='default' @click="()=>{videoRejectVisiable=true}" v-if="role=='operator'&&currentMaterial.materialStatus==5"  style="margin-right:20px">驳回</a-button>                                                               
+                                <a-button type='default' @click="()=>{videoRejectVisiable=true}" v-if="role=='operator'&&currentMaterial.materialStatus==5"  style="margin-right:20px">驳回</a-button>            
+                                 <a-button type='primary' v-if="role!='operator'&&currentVideo.videoStatus==2" :disabled="currentVideo.clip!=userInfo.id" @click="modifyVideo" style="margin-right:20px">修改视频信息</a-button>                                                   
                                 <a-button type='default' @click="onClose">关闭</a-button>
                             </div>
                         </div>
-                         </a-spin>   
+                        </a-spin>   
                     </a-drawer>
                     
 
@@ -967,15 +970,6 @@
                         <a-button key="back" @click="()=>{videoRejectVisiable=false}">取消</a-button>
                         <a-button type="primary"  @click="reject" :loading="loadingElse">确定驳回</a-button>
                     </template>
-                    <!-- <div>
-                        <span>驳回类型:</span>
-                        <a-radio-group v-model="videoRejectType" >
-                            <a-radio-button value="video">视频不合格</a-radio-button>
-                            <a-radio-button value="image">封面不合格</a-radio-button>
-                            <a-radio-button value="tag">标签不合格</a-radio-button>
-                           
-                        </a-radio-group>
-                    </div> -->
                     
                    <a-textarea
                     v-model="videoAdvise"
@@ -1136,6 +1130,8 @@ export default {
     },
     data() {
         return {
+            videoEchoInfo:{},
+            videoUploadLoading:false,
             videoRejectType:'1',
             assignVisibleLoading:false,
             visibleLoading:false,
@@ -1163,7 +1159,7 @@ export default {
             loadDisabled:false,
             labelCol: { span: 4 },
             wrapperCol: { span: 14 },
-            loadingElse: false,
+            
             formPerson:{
                 plan:'',
                 shot:'',
@@ -1292,9 +1288,59 @@ export default {
             add: true,
             inputVisible: false,
             inputValue: '',
+
+
+            videoinfo:{
+                url: '',
+                md5: '',
+                name: '',
+                width:undefined,
+                height:undefined,
+
+            },
+            imageinfo:[],
         }
     },
     methods: {
+        modifyVideo(){
+            this.childrenDrawer=true;
+            // console.log(this.currentVideo);
+            
+            this.videoUploadLoading=true
+            getAction('/platform/material/videoEcho',{
+                videoId:this.currentVideo.videoId
+            }).then(res=>{
+                console.log(res)
+                
+                this.videoUploadLoading=false;
+                this.confirmLoading=true;
+                if(res.result.video){
+                    this.urlList=res.result.video
+                    this.videoinfo=res.result.video;
+                    this.videoinfo.url=this.videoinfo.url.replace(/https:/g,'')
+                }
+                if(res.result.covers){
+                    this.imageinfo=res.result.covers;
+                    this.urlListImage= {
+                        url : res.result.covers.map(item=>{return item.url}),
+                        md5 : res.result.covers.map(item=>item.md5),
+                        name : res.result.covers.map(item=>item.name),
+                        size : res.result.covers.map(item=>item.size),
+                        format : res.result.covers.map(item=>item.format),
+                    }
+                }
+                
+                this.form.setFieldsValue({
+                    contentTagList: res.result.tags.contentTagList.map(item=>{return item.tagId}),
+                    modalityTagList:  res.result.tags.modalityTagList.map(item=>{return item.tagId}),
+                    modTagList:  res.result.tags.modTagList.map(item=>{return item.tagId}),
+                    senceTagList:  res.result.tags.senceTagList.map(item=>{return item.tagId}),
+                })
+
+                this.videoEchoInfo=res.result
+            })
+            
+        },
         editOrder(){
             this.$parent.isEdit=true;
             this.$parent.orderId=this.currentOrderInfo.id;
@@ -1605,23 +1651,31 @@ export default {
             })
         },
         // 视频驳回
-        reject(){           
-            postAction(this.url.videoReject,{
-                id:this.currentMaterial.id,
-                videoAdvise:this.videoAdvise,
-                materialCode:this.currentMaterial.materialCode
-                
-            }).then(res=>{
-                console.log(res);
-                this.videoAdvise=''
-                this.visible=false;
-                if(res.success){
-                    this.$message.success(res.message);
-                    this.materialHttp()
-                }else{
-                    this.$message.error(res.message)
-                }
-            })
+        reject(){   
+            this.loadingElse=true;
+            if(this.videoAdvise){
+                postAction(this.url.videoReject,{
+                    id:this.currentMaterial.id,
+                    videoAdvise:this.videoAdvise,
+                    materialCode:this.currentMaterial.materialCode
+                    
+                }).then(res=>{
+                    console.log(res);
+                    this.videoAdvise=''
+                    this.visible=false;
+                    this.videoRejectVisiable=false;
+                    if(res.success){
+                        this.$message.success(res.message);
+                        this.materialHttp()
+                    }else{
+                        this.$message.error(res.message)
+                    }
+                })
+            }else{
+                this.loadingElse=false;
+                this.$message.error('请填写驳回理由')
+            }        
+            
 
         },
         // 脚本通过审核
@@ -1644,22 +1698,31 @@ export default {
         },
         // 脚本驳回
         scriptReject(){
-            postAction(this.url.scriptReject,{
-                id:this.currentMaterial.id,
-                scriptAdvise:this.scriptAdvise,
-                materialCode:this.currentMaterial.materialCode
-            }).then(res=>{
-                console.log(res);
+            this.loadingElse=true;
+            if(this.scriptAdvise){
+                postAction(this.url.scriptReject,{
+                    id:this.currentMaterial.id,
+                    scriptAdvise:this.scriptAdvise,
+                    materialCode:this.currentMaterial.materialCode
+                }).then(res=>{
+                    console.log(res);
 
-                this.scriptVisible=false;
-                this.scriptReject=''
-                if(res.success){
-                    this.$message.success(res.message);
-                    this.materialHttp()
-                }else{
-                    this.$message.error(res.message)
-                }
-            })
+                    this.scriptVisible=false;
+                    this.scriptAdvise=''
+                    this.scriptRejectVisiable=false;
+                    this.loadingElse=false;
+                    if(res.success){
+                        this.$message.success(res.message);
+                        this.materialHttp()
+                    }else{
+                        this.$message.error(res.message)
+                    }
+                })
+            }else{
+                this.loadingElse=false;
+                this.$messgae.error('请填写驳回理由')
+            }
+            
         },
         // 生成水印
         getWater() {
@@ -1740,7 +1803,9 @@ export default {
 
 
         beforeUpload(file) {
-            this.uploadAction= `http://api.tjyourong.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.id}&projectId=${this.currentMaterial.projectId}`
+            // this.uploadAction= `http://api.tjyourong.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.id}&projectId=${this.currentMaterial.projectId}`
+            this.uploadAction= `http://139.186.151.174:8804/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.id}&projectId=${this.currentMaterial.projectId}`
+
             this.loadDisabled = true
             const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
             const fileName = file.name
@@ -1801,7 +1866,21 @@ export default {
                 name: [],
                 size: [],
             }
-            this.imageArrList = []
+            this.imageArrList = [];
+            this.videoinfo={
+                url: '',
+                md5: '',
+                name: '',
+                width:undefined,
+                height:undefined,
+            };
+            this.imageinfo=[];
+            this.form.setFieldsValue({
+                contentTagList: null,
+                modalityTagList: null,
+                modTagList: null,
+                senceTagList: null,
+            })
         },
 
         onChildrenDrawerOk(){
@@ -1811,71 +1890,101 @@ export default {
                     this.loadingElse = true
                     var params = {
                         ...values,
+                        ...this.videoinfo,
+                        covers:[...this.imageinfo]
                     }
-                    // var roleCode = {}
-                    // for (const key in this.role) {
-                    //     if (key == 'roleCode') {
-                    //         this.role[key] = this.role[key] + 'Id'
-                    //         roleCode[this.role[key]] = this.userInfo.id
-                    //     }
-                    // }
+                   
                     params.id = this.add ? null : this.id
-                    params.code = this.urlList.md5
-                    params.url = this.urlList.url
-                    params.materialName = this.urlList.name
-                
                     params.userId = this.userInfo.id
-                    params.projectId = values.projectId
-                    params.materialDescribe = values.materialDescribe
-                    params.type = 'VIDEO'
-                    //   params.tagList = values.tagList
-                    params.ascription ={
-                        planId: this.currentMaterial.plan,
-                        shotId: this.currentMaterial.shot,
-                        clipId: this.currentMaterial.clip,
-                    }
+
                     params.projectId=this.currentMaterial.projectId
-                    params.materialId=this.currentMaterial.id||this.currentMaterial.materialId
-                    params.tag = this.tags
-                    params.imageArr = this.imageArrList
+                    params.materialId=this.currentMaterial.id ||this.currentMaterial.materialId
+                    params.materialCode=this.currentMaterial.materialCode
                     if (this.add) {
-                        orderFileInsert(params).then((res) => {
-                        if (res.success) {
-                            this.form.resetFields()
-                            this.urlList = {
-                            url: '',
-                            md5: '',
-                            name: '',
+                        postAction('/platform/file/uploadVideo',params).then(res=>{
+                            if (res.success) {
+                                this.form.resetFields()
+                                this.urlList = {
+                                    url: '',
+                                    md5: '',
+                                    name: '',
+                                }
+                                
+                                this.urlListImage = {
+                                    url: [],
+                                    md5: [],
+                                    name: [],
+                                    size: [],
+                                }
+                                this.imageArrList = []
+                                this.tags = []
+                                
+                                this.childrenDrawer = false
+                                this.visible=false;
+                                this.add = true
+                                for (const key in this.role) {
+                                if (key == 'roleCode') {
+                                    this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+                                }
+                                }
+                                this.$message.success('素材上传成功')
+                                this.loadingElse = false
+                                this.videoinfo={
+                                    url: '',
+                                    md5: '',
+                                    name: '',
+                                    width:undefined,
+                                    height:undefined,
+                                };
+                                this.imageinfo=[];
+                                this.materialHttp()
+                                //   this.departValue = []
+                            } else {
+                                this.$message.error(res.message)
+                                this.loadingElse = false
+                                // this.childrenDrawer = false
+                                // this.visible=false;
                             }
+                        })
+                        // orderFileInsert(params).then((res) => {
+                        // if (res.success) {
+                        //     this.form.resetFields()
+                        //     this.urlList = {
+                        //         url: '',
+                        //         md5: '',
+                        //         name: '',
+                        //     }
                             
-                            this.urlListImage = {
-                            url: [],
-                            md5: [],
-                            name: [],
-                            size: [],
-                            }
-                            this.imageArrList = []
-                            this.tags = []
+                        //     this.urlListImage = {
+                        //         url: [],
+                        //         md5: [],
+                        //         name: [],
+                        //         size: [],
+                        //     }
+                        //     this.imageArrList = []
+                        //     this.tags = []
                             
-                            this.childrenDrawer = false
-                            this.visible=false;
-                            this.add = true
-                            for (const key in this.role) {
-                            if (key == 'roleCode') {
-                                this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
-                            }
-                            }
-                            this.$message.success('素材上传成功')
-                            this.loadingElse = false
-                            this.materialHttp()
-                            //   this.departValue = []
-                        } else {
-                            this.$message.error(res.message)
-                            this.loadingElse = false
-                            this.childrenDrawer = false
-                            this.visible=false;
-                        }
-                        })
+                        //     this.childrenDrawer = false
+                        //     this.visible=false;
+                        //     this.add = true
+                        //     for (const key in this.role) {
+                        //     if (key == 'roleCode') {
+                        //         this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+                        //     }
+                        //     }
+                        //     this.$message.success('素材上传成功')
+                        //     this.loadingElse = false
+                        //     this.videoinfo={};
+                        //     this.imageinfo=[];
+                        //     this.materialHttp()
+                        //     //   this.departValue = []
+                        // } else {
+                        //     this.$message.error(res.message)
+                        //     this.loadingElse = false
+                        //     this.childrenDrawer = false
+                        //     this.visible=false;
+                        // }
+                        // })
                     } else {
                         fileEdit({
                         ...params,
@@ -1915,14 +2024,6 @@ export default {
 
 
 
-
-
-
-
-
-
-
-
         // 上传视频相关方法
         removeUpload() {
             this.form.setFieldsValue({
@@ -1937,10 +2038,12 @@ export default {
             this.confirmLoading = true
             this.repeat = false
             this.urlList.url = urlAll[0].url
+            
+            this.videoinfo.url=urlAll[0].url
             this.$message.success('上传成功')
 
             getAction('/ctop/materialTagInfo/detail', {
-                code: this.urlList.md5,
+                code: this.videoinfo.md5,
             }).then((res) => {
                 if (res.success) {
                 if (res.modalityTagList.length > 0) {
@@ -1969,25 +2072,23 @@ export default {
             console.log(index)
         },
         overUploadImage(urlAll) {
-        
+            console.log(urlAll)
             var that = this
             that.material = []
             that.imageArrList = []
             var img
             if (urlAll.length > 0) {
-                for (var i = 0; i < urlAll.length; i++) {
-                that.imageArrList.push({
-                    // width: img.width,
-                    // height: img.height,
-                    // size: this.urlListImage.size[i],
-                    code: this.urlListImage.md5[i],
-                    url: urlAll[i].url,
-                    materialName: this.urlListImage.name[i],
+                urlAll.forEach((ele,index)=>{
+
+                    this.imageinfo.forEach(item=>{
+                        if(item.name==ele.name){
+                            item.url=ele.url
+                        }
+                    })
+                    // img = new Image()
+                    // img.src = urlAll[index].url
                 })
-                img = new Image()
-                img.src = urlAll[i].url
                 
-                }
             } else {}
         },
         addImage(item) {
@@ -2018,35 +2119,79 @@ export default {
                 size: [],
             }
             this.imageArrList = []
+            
         },
         file(file) {
+            console.log(file)
             var bmf = new BMF()
             var that = this
-            return new Promise(function (resolve, reject) {
-                bmf.md5(file, (err, md5) => {
-                that.urlList.name = file.name
-                that.urlList.md5 = md5
-                fileCheck({
-                    code: md5,
-                    projectId: that.currentMaterial.projectId,
-                }).then((res) => {
-                    if (res.code == 0) {
-                    that.$message.error('此素材已经上传')
-                    that.repeat = true
-                    reject()
-                    } else {
-                    that.repeat = false
+            
+            return new Promise( (resolve, reject)=> {
+                
+                this.getVideoMsg(file).then((videoinfo) => {
+                    const { duration, height, width } = videoinfo;
+                    //获取到视频的时长,高度,宽度
+                    bmf.md5(file, (err, md5) => {
+                        videoinfo.name = file.name
+                        videoinfo.md5 = md5
+                        that.repeat = false
+                    })
+                    videoinfo.size=file.size;
+                    videoinfo.format=file.type
+                    console.log(videoinfo);
+                    this.videoinfo=videoinfo
                     resolve()
-                    //   reject()
-                    }
-                })
-                })
+                });
             })
+
+            
+
+            
+        },
+        
+        getVideoMsg(file) {
+            // console.log('getVideoMsg')
+            return new Promise((resolve) => {
+                let videoElement = document.createElement("video");
+                videoElement.src = URL.createObjectURL(file);
+                videoElement.addEventListener("loadedmetadata", function () {
+                    let obj={
+                        duration: videoElement.duration,
+                        height: videoElement.videoHeight,
+                        width: videoElement.videoWidth,
+                    }
+                    
+                    window.URL.revokeObjectURL(videoElement.src);
+                    videoElement.remove()
+                    resolve(obj);
+                });
+            });
+        },
+
+        getImageMsg(file){
+            return new Promise((resolve) => {
+                // let imageElement = document.createElement("image");
+                let imageElement = new Image();
+                let obj={}
+                imageElement.src = URL.createObjectURL(file);
+                // console.log(imageElement)
+                imageElement.onload=function(){
+                    // console.log(imageElement.width)
+                    obj={
+                        height:imageElement.height,
+                        width:imageElement.width
+                    }
+                    console.log(obj)
+                    resolve(obj)
+                }
+                
+            });
         },
         fileWater(file) {
+            console.log(file)
             var bmf = new BMF()
             var that = this
-            var codeData = that.urlList.md5 != '' ? that.urlList.md5 : that.addImageData.code
+            var codeData = that.videoinfo.md5 != '' ? that.videoinfo.md5 : that.addImageData.code
             console.log(codeData)
             this.urlListImage = {
                 url: [],
@@ -2054,14 +2199,27 @@ export default {
                 name: [],
                 size: [],
             }
-            return new Promise(function (resolve, reject) {
+            this.imageinfo=[]
+            return new Promise( (resolve, reject)=> {
                 bmf.md5(file, (err, md5) => {
                 that.urlListImage.name.push(file.name)
                 that.urlListImage.md5.push(md5)
-                that.urlListImage.size.push(file.size)
-                resolve()
+                that.urlListImage.size.push(file.size)})
                 
-                })
+                this.getImageMsg(file).then((imageinfo) => {
+                   
+                    imageinfo.size=file.size;
+                    imageinfo.format=file.type;
+                    imageinfo.name=file.name
+                    bmf.md5(file, (err, md5) => {                        
+                        imageinfo.md5=md5   
+                        this.imageinfo.push({
+                            ...imageinfo
+                        })   
+                        resolve()                                    
+                    })
+                    
+                });
             })
         },
 

+ 3 - 3
vue.config.js

@@ -77,14 +77,14 @@ module.exports = {
         // target: 'http://192.168.1.43:8087', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
-        // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        // target: 'http://192.168.1.193:8088', //请求本地 需要jeecg-boot后台项目  李煜一
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
         // target:'http://118.24.244.213:8804',
-        // target:'http://139.186.151.174:8804', //测试
+        target:'http://139.186.151.174:8804', //测试