Bladeren bron

修改视频素材有效视频列表

zhuxinbo 5 jaren geleden
bovenliggende
commit
b4882ea5a8

+ 38 - 9
src/views/modules/material/videoMaterial.vue

@@ -463,6 +463,7 @@ a {
                   <a
                     href="javascript:;"
                     style="margin-left:20px"
+                    v-show="active !='3'"
                     @click="personEdit(items, '2')"
                     v-if="items.userId == userInfo().id"
                   >
@@ -483,7 +484,7 @@ a {
                     > -->
                   <a-popconfirm
                     @confirm="okEditShow(items, '2')"
-                    v-show="active != '2'"
+                    v-show="active != '2'&&active!='3'"
                     v-if="
                       role.roleCode == 'operator' ||
                         role.roleCode == 'kuaishouOperationManager' ||
@@ -524,7 +525,7 @@ a {
 
                   <a-popconfirm
                     @confirm="okEditShow(items, '1')"
-                    v-show="active != '1'"
+                    v-show="active != '1'&&active!='3'"
                     v-if="
                       role.roleCode == 'operator' ||
                         role.roleCode == 'kuaishouOperationManager' ||
@@ -559,6 +560,7 @@ a {
                     >
                   </a-popconfirm>
                   <a
+                    v-show="active!='3'"
                     v-if="role.roleCode == 'plane' || role.roleCode == 'admin'"
                     style="margin-left:20px"
                     @click="addImage(items)"
@@ -584,7 +586,10 @@ a {
         <div v-else style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;">
           <img
             src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
-            alt="" />
+            alt="" v-if="!loading"/>
+            <div style="position:absolute;font-size:20px;font-weight:700" v-else>
+                数据加载中...
+            </div>
         </div>
       </a-tab-pane>
     </a-tabs>
@@ -871,7 +876,9 @@ a {
               </a-checkbox-group>
             </ul>
             <div v-else style="height:100%;display:flex;justify-content: center;align-items: center;">
-              <a-empty />
+              <img
+                src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
+                alt="" />
             </div>
           </div>
         </div>
@@ -1245,6 +1252,10 @@ export default {
         {
           value: '2',
           tab: '已驳回'
+        },
+        {
+          value:'3',
+          tab:'有效视频'
         }
       ],
       // 表头
@@ -2011,12 +2022,30 @@ export default {
     callbackTwo(key) {
       this.checkAll = false
       this.checkArr = []
-      if (this.form.getFieldValue('projectId')) {
-        this.form.setFieldsValue({
-          projectId: ''
-        })
+
+      if(key == '3'){ 
+        this.url.list = "/ctop/materialInfo/effiMaterialInfo" 
+        this.queryParam = { 
+        } 
+      }else{ 
+        this.url.list = "/ctop/materialInfo/list" 
+        this.queryParam = { 
+            type: 'VIDEO', 
+            userId: this.userInfo().id, 
+            status: key 
+        } 
+        if (this.form.getFieldValue('projectId')) { 
+            this.form.setFieldsValue({ 
+            projectId: '' 
+            }) 
+        } 
       }
-      this.queryParam.status = key
+    //   if (this.form.getFieldValue('projectId')) {
+    //     this.form.setFieldsValue({
+    //       projectId: ''
+    //     })
+    //   }
+    //   this.queryParam.status = key
       this.loadData(1)
     },
     overUpload(urlAll) {

+ 372 - 0
src/views/modules/material/videoTemList.vue

@@ -0,0 +1,372 @@
+<style scoped lang="scss">
+  .template-content {
+    width: 100%;
+    overflow: hidden;
+    padding: 10px 0px;
+    display: flex;
+    flex-wrap: wrap;
+    margin-right: -10px;
+  }
+
+  @media (min-width: 1024px) {
+    .home-item {
+      border-style: solid;
+      border-width: 1px;
+      border-color: #e4e4e4;
+      width: calc(50% - 10px);
+      padding: 10px;
+      margin-right: 10px;
+      margin-bottom: 10px;
+      display: flex;
+      align-items: center;
+      background: #fff;
+      position: relative;
+      z-index: 99;
+    }
+  }
+
+  /*>=1024的设备*/
+
+  // @media (min-width: 1100px) {
+  //     .checkbox_item_container {
+  //         width:70%
+  //     }
+  // } /*>=1100的设备*/
+  @media (min-width: 1600px) {
+    .home-item {
+      border-style: solid;
+      border-width: 1px;
+      border-color: #e4e4e4;
+      width: calc(25% - 10px);
+      padding: 10px;
+      margin-right: 10px;
+      margin-bottom: 10px;
+      display: flex;
+      align-items: center;
+      background: #fff;
+      position: relative;
+      z-index: 99;
+    }
+  }
+
+  /*>=1280的设备*/
+
+  // @media (min-width: 1366px) {
+  // }
+
+  // @media (min-width: 1440px) {
+  // }
+
+  // @media (min-width: 1680px) {
+
+  // }
+  @media (min-width: 1920px) {
+    .home-item {
+      border-style: solid;
+      border-width: 1px;
+      border-color: #e4e4e4;
+      width: calc(25% - 10px);
+      padding: 10px;
+      margin-right: 10px;
+      margin-bottom: 10px;
+      display: flex;
+      align-items: center;
+      background: #fff;
+      position: relative;
+      z-index: 99;
+      cursor: pointer;
+    }
+  }
+
+  .bhShow {
+    height: 100px;
+    line-height: 25px;
+    text-align: center;
+  }
+
+  .bhShow span {
+    font-size: 14px;
+  }
+
+  .show-data {
+    width: 50%;
+    display: flex;
+    flex-direction: column;
+    align-items: flex-start;
+  }
+</style>
+<template>
+  <a-card :bordered="false">
+    <!-- <a-steps :current="current" style="width:50%;margin:auto">
+      <a-step v-for="item in steps" :key="item.title" :title="item.title" />
+    </a-steps> -->
+    <!-- <a-button type="primary" icon="plus" @click="visible = true">新增模板</a-button> -->
+    <div class="steps-content">
+      <div style="margin-bottom:10px">
+        <span>
+          视频尺寸&nbsp;&nbsp;&nbsp;&nbsp;
+        </span>
+        <!-- sizeType -->
+        <a-radio-group defaultValue="1" buttonStyle="solid" v-model="queryParam.sizeType" @change="changData()">
+          <a-radio-button value="1">竖版</a-radio-button>
+          <a-radio-button value="2">横板</a-radio-button>
+        </a-radio-group>
+      </div>
+
+      <div class="template-content" v-if="dataSource.length>0">
+        <div v-for="item of dataSource" :key="item.id" class="home-item">
+          <div class="home-right" style="width:100%">
+
+            <div style="display:flex;justify-content:center;width:100%;position:relative;">
+              <video class="video" :src="item.videoUrl" controls="controls" style="height:auto;max-width:100%;"
+                controlsList="nodownload">
+                您的浏览器不支持 video 标签。
+              </video>
+            </div>
+            <span
+              style="color: #999; fontSize: 16px;padding-top:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;">
+              {{ item.title }}
+              <!-- <a-button type="primary" style="float:right" @click="visibleMergeShow(item)">使用模板</a-button> -->
+            </span>
+          </div>
+        </div>
+      </div>
+      <div class="template-content" v-else
+        style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;">
+        <img
+          src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
+          alt="" />
+      </div>
+    </div>
+
+  </a-card>
+</template>
+<script>
+  import {
+    getAction,
+    postAction,
+    postFile,
+    deleteAction,
+    putAction
+  } from '@/api/manage'
+  import {
+    JeecgListMixin
+  } from '@/mixins/JeecgListMixin'
+  import BMF from 'browser-md5-file'
+  import UploadToAli from '@femessage/upload-to-ali'
+  import {
+    stopOtherVideo,
+    closeAllVideoFun
+  } from '@/utils/videoControl'
+  export default {
+    mixins: [JeecgListMixin],
+    components: {
+      UploadToAli,
+    },
+
+    data() {
+      return {
+        current: 0,
+        sizeType: '1',
+        orderType: '1',
+        visible: false,
+        visibleMerge: false,
+        showData: null,
+        showLoading: false,
+        url: {
+          list: '/ctop/modelVideoCompositeInfo/list'
+        },
+        urlList: {
+          url: '',
+          md5: ''
+        },
+        urlListMerge: {
+          url: '',
+          md5: ''
+        },
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 5
+          }
+        },
+        wrapperCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 12
+          }
+        },
+        form: this.$form.createForm(this),
+        steps: [{
+            title: '选择模板',
+            content: 'First-content'
+          },
+          {
+            title: '上传物料',
+            content: 'Second-content'
+          }
+        ],
+        creativeCopywriter: '',
+        customDomain: '',
+        region: 'oss-cn-beijing',
+        bucket: 'ctop-media',
+        acceptVideo: 'video/mpeg,video/mp4',
+        acceptImage: 'image/jpeg,image/jpg,image/png',
+        accessKeyId: 'LTAIbNbqWzSOklQV',
+        accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 5
+          }
+        },
+        wrapperCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 16
+          }
+        },
+        dirMerge: "model/part/"
+      }
+    },
+    computed: {
+      dirVideo() {
+
+        return 'model/video/'
+      }
+    },
+    methods: {
+      next() {
+        this.current++
+      },
+      prev() {
+        this.current--
+      },
+      changData() {
+        this.loadData(1)
+      },
+      visibleMergeShow(item) {
+        this.visibleMerge = true
+        this.showLoading = false
+        // this.showData = item
+        this.showData = JSON.parse(JSON.stringify(item))
+      },
+      closeMerge() {
+        this.visibleMerge = false
+        this.urlListMerge = {
+          url: '',
+          md5: ''
+        }
+        this.showData = null
+
+      },
+      handleOkMerge() {
+        this.closeMerge()
+      },
+      close() {
+        this.visible = false
+      },
+      handleOk() {
+        this.form.validateFieldsAndScroll((err, values) => {
+          if (err) {
+            // 这里做逻辑处理
+          } else {
+            var params = {
+              ...values
+            }
+            params.signature = this.urlList.md5
+            params.modelVideoUrl = this.urlList.url
+            postAction('/ctop/modelVideoInfo/add', params).then(res => {
+              console.log(res)
+              if (res.success) {
+                this.visible = false
+                this.form.resetFields()
+                this.urlList = {
+                  url: '',
+                  md5: '',
+                }
+                this.loadData()
+              }
+            })
+          }
+        })
+      },
+      overUpload(urlAll) {
+        this.$message.success('上传成功')
+      },
+      overUploadMerge(urlAll) {
+        this.showLoading = true
+        postAction('/ctop/modelVideoInfoConfig/videoMerge', {
+          modelId: this.showData.id,
+          url: urlAll
+        }).then(res => {
+          //   console.log(res)
+          if (res.success) {
+            this.showLoading = false
+            this.showData.modelVideoUrl = res.url
+          }
+        })
+      },
+      file(file) {
+        var bmf = new BMF()
+        var that = this
+        return new Promise(function (resolve, reject) {
+          bmf.md5(file[0], (err, md5) => {
+            that.urlList.md5 = md5
+            resolve()
+            // fileCheck({
+            //   code: md5,
+            //   projectId: that.getData('projectId')
+            // }).then(res => {
+            //   if (res.code == 0) {
+            //     that.$message.error('此素材已经上传')
+            //     that.repeat = true
+            //     reject()
+            //   } else {
+            //     that.repeat = false
+            //     resolve()
+            //     //   reject()
+            //   }
+            // })
+          })
+        })
+      },
+    },
+    mounted() {
+      //   getAction('/ctop/modelVideoInfo/list', {
+      //     sizeType: this.sizeType,
+      //     orderType: this.orderType
+      //   }).then(res => {
+      //     console.log(res)
+      //   })
+    },
+    created() {
+      this.queryParam.sizeType = this.sizeType
+      //   this.queryParam.orderType = this.orderType
+      // this.queryParam.status = key
+      this.ipagination.pageSize = 8
+    },
+  }
+</script>
+<style scoped>
+  .steps-content {
+    margin-top: 16px;
+    border: 1px dashed #e9e9e9;
+    border-radius: 6px;
+    background-color: #fafafa;
+    min-height: 200px;
+    padding: 30px;
+  }
+
+  .steps-action {
+    margin-top: 24px;
+  }
+</style>

+ 1 - 1
src/views/modules/material/videoTemplate.vue

@@ -351,7 +351,7 @@
 
       },
       handleOkMerge() {
-
+        this.closeMerge()
       },
       close() {
         this.visible = false

+ 2 - 2
vue.config.js

@@ -64,10 +64,10 @@ module.exports = {
          }
        },*/
       '/jeecg-boot': {
-        // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
+        target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
-        target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  英豪
+        // target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.127:8080', //请求本地 需要jeecg-boot后台项目  孙震