Prechádzať zdrojové kódy

Merge branch 'master' into testv2

yumeng 5 rokov pred
rodič
commit
c127e911b3

+ 145 - 0
src/views/modules/actor/ActorList.vue

@@ -0,0 +1,145 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="24">
+          <a-col :md="6" :sm="8">
+            <a-form-item label="姓名">
+              <a-input placeholder="请输入姓名" v-model="queryParam.name"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <a-form-item label="性别">
+              <a-select v-model="queryParam.sex" placeholder="请选择性别查询">
+                <a-select-option value="">请选择性别查询</a-select-option>
+                <a-select-option value="1">男</a-select-option>
+                <a-select-option value="2">女</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+
+          <a-col :md="6" :sm="8">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+            </span>
+          </a-col>
+
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" v-show="show" type="primary" icon="plus">新增</a-button>
+
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        @change="handleTableChange">
+
+        <!-- 字符串超长截取省略号显示-->
+        <span slot="esContent" slot-scope="text">
+          <j-ellipsis :value="text" :length="10"/>
+        </span>
+
+        <span slot="action" slot-scope="text, record">
+          <a href="javascript:;" @click="handleDetail(record)">详情</a>
+          <a-divider type="vertical"/>
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
+            <a-menu slot="overlay">
+               <a-menu-item v-show="show">
+                <a @click="handleEdit(record)">编辑</a>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+    <!-- table区域-end -->
+
+    <!-- 表单区域 -->
+    <actor-modal ref="modalForm" @ok="modalFormOk"></actor-modal>
+  </a-card>
+</template>
+
+<script>
+  import ActorModal from './modules/ActorModal'
+  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+  import JEllipsis from "@/components/jeecg/JEllipsis";
+
+  export default {
+    name: "SysMessageList",
+    mixins: [JeecgListMixin],
+    components: {
+      JEllipsis,
+      ActorModal
+    },
+    data() {
+      return {
+        queryParam:{},
+        description: '演员管理',
+        // 新增修改按钮是否显示
+        show: true,
+        // 表头
+        columns: [
+          {
+            title: '姓名',
+            align: "center",
+            dataIndex: 'name'
+          },
+          {
+            title: '生日',
+            align: "center",
+            dataIndex: 'birthday',
+          },
+          {
+            title: '性别',
+            align: "center",
+            dataIndex: 'sex_dictText',
+          },
+          {
+            title: '特长',
+            align: "center",
+            dataIndex: 'speciality'
+          },
+          {
+            title: '创建时间',
+            align: 'center',
+            dataIndex: 'createTime'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: "center",
+            scopedSlots: {customRender: 'action'},
+          }
+        ],
+        url: {
+          list: "/ctop/actor/list",
+        },
+      }
+    },
+
+    methods: {}
+  }
+</script>
+<style  scoped>
+  @import '~@assets/less/common.less'
+</style>

+ 206 - 0
src/views/modules/actor/modules/ActorModal.vue

@@ -0,0 +1,206 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="演员姓名">
+          <a-input placeholder="请输入演员姓名" v-decorator="['name', validatorRules.name ]"/>
+        </a-form-item>
+        <a-form-item
+          label="照片"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+        >
+          <upload-to-ali
+            v-model="imageUrl"
+            :customDomain="customDomain"
+            multiple
+            preview
+            :region="region"
+            :bucket="bucket"
+            :accept="acceptImage"
+            :max="10"
+            :size="1024000"
+            :accessKeyId="accessKeyId"
+            :accessKeySecret="accessKeySecret"
+          ></upload-to-ali>
+        </a-form-item>
+        <a-form-item
+          label="视频作品"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+        >
+          <upload-to-ali
+            v-model="videoUrl"
+            :customDomain="customDomain"
+            multiple
+            preview
+            :region="region"
+            :bucket="bucket"
+            :accept="acceptVideo"
+            :max="10"
+            :size="1024000"
+            :accessKeyId="accessKeyId"
+            :accessKeySecret="accessKeySecret"
+          ></upload-to-ali>
+        </a-form-item>
+        <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-date-picker
+            style="width: 100%"
+            placeholder="请选择生日"
+            v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"/>
+        </a-form-item>
+
+        <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别">
+            <a-select-option :value="1">男</a-select-option>
+            <a-select-option :value="2">女</a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="特长">
+          <a-input placeholder="请输入特长" v-decorator="['speciality']"/>
+        </a-form-item>
+
+
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import {httpAction} from '@/api/manage'
+  import pick from 'lodash.pick'
+  import JTreeSelect from '@/components/jeecg/JTreeSelect'
+  import moment from 'moment'
+  import UploadToAli from '@femessage/upload-to-ali'
+  export default {
+    name: "ActorModal",
+    components: {
+      UploadToAli,
+      JTreeSelect
+    },
+    data() {
+      return {
+        title: "操作",
+        visible: false,
+        model: {},
+        videoUrl: [],
+        imageUrl: [],
+        customDomain: '',
+        region: 'oss-cn-beijing',
+        bucket: 'ctop-media',
+        acceptVideo: 'video/mpeg,video/mp4',
+        acceptImage: 'image/jpeg,image,jpg/png',
+        accessKeyId: 'LTAIbNbqWzSOklQV',
+        accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+        dateFormat: "YYYY-MM-DD",
+        labelCol: {
+          xs: {span: 24},
+          sm: {span: 5},
+        },
+        wrapperCol: {
+          xs: {span: 24},
+          sm: {span: 16},
+        },
+
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules: {
+          name: {rules: [{required: true, message: '请输入演员姓名!'}]},
+          // sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))},
+        },
+        url: {
+          add: "/ctop/actor/add",
+          edit: "/ctop/actor/edit",
+        },
+      }
+    },
+    created() {
+    },
+    methods: {
+      add() {
+        this.edit({});
+      },
+      edit(record) {
+
+        let that = this;
+        that.form.resetFields();
+        that.model = Object.assign({}, record);
+        that.visible = true;
+        that.$nextTick(() => {
+          that.form.setFieldsValue(pick(this.model, 'name', 'sex', 'speciality'))
+          //时间格式化
+        });
+
+      },
+      close() {
+        this.$emit('close');
+        this.visible = false;
+      },
+      moment,
+      handleOk() {
+        const that = this;
+        // 触发表单验证
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if (!this.model.id) {
+              httpurl += this.url.add;
+              method = 'post';
+            } else {
+              httpurl += this.url.edit;
+              method = 'put';
+            }
+            if (!values.birthday) {
+              values.birthday = '';
+            } else {
+              values.birthday = values.birthday.format(this.dateFormat);
+            }
+            let formData = Object.assign(this.model, values);
+            //时间格式化
+
+            console.log(formData)
+            httpAction(httpurl, formData, method).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit('ok');
+              } else {
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.close();
+            })
+
+
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      },
+
+
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 1 - 1
src/views/modules/kuaishouapp/campaignCreate.vue

@@ -150,7 +150,7 @@
     methods: {
       ...mapGetters(["nickname", "avatar", "userInfo"]),
       handleConfirmValue(rule, value,callback) {
-        if (this.dayBudget == '' || this.dayBudget <= 500 || this.dayBudget >= 100000000) {
+        if (this.dayBudget == '' || this.dayBudget < 500 || this.dayBudget >= 100000000) {
           callback('请输入正确预算金额')
         }
         callback()

+ 171 - 85
src/views/modules/kuaishouapp/creativeCreate.vue

@@ -129,6 +129,25 @@
               </a-radio-group>
             </template>
           </a-modal>
+          <div class="checkbox_item_container" v-if="videoUrl">
+            <div class="item_ul">
+              <div class="item_li" style="width:130px;height:180px;">
+                <a-col class="item">
+                  <a-icon
+                    type="close-circle"
+                    style="position:absolute;top:-5px;right:-5px;color:red"
+                    @click="deteleRadio"
+                  />
+                  <video
+                    class="video"
+                    :src="videoUrl"
+                    controls="controls"
+                    style="min-height:160px"
+                  >您的浏览器不支持 video 标签。</video>
+                </a-col>
+              </div>
+            </div>
+          </div>
         </div>
       </a-form-item>
 
@@ -170,6 +189,30 @@
               </div>
             </template>
           </a-modal>
+          <div class="checkbox_item_container">
+            <div class="item_ul">
+              <div
+                class="item_li"
+                v-for="(item,index) of haveSinglePicVideoUrl"
+                :key="index"
+                style="width:130px;height:180px;"
+              >
+                <a-col class="item">
+                  <a-icon
+                    type="close-circle"
+                    style="position:absolute;top:-5px;right:-5px;color:red"
+                    @click="detele(index)"
+                  />
+                  <video
+                    class="video"
+                    :src="item"
+                    controls="controls"
+                    style="min-height:160px"
+                  >您的浏览器不支持 video 标签。</video>
+                </a-col>
+              </div>
+            </div>
+          </div>
         </div>
       </a-form-item>
 
@@ -302,7 +345,13 @@
       <a-form-item v-if="showCover" label="选择封面" :labelCol="labelCol" :wrapperCol="wrapperCol">
         <div>
           <a type="primary" @click="showModal">点击选中已上传封面</a>
-          <a-modal title="选择封面" v-model="visible" @ok="handleOk" :width="860" class="ant_modal_body_container">
+          <a-modal
+            title="选择封面"
+            v-model="visible"
+            @ok="handleOk"
+            :width="860"
+            class="ant_modal_body_container"
+          >
             <template>
               <input
                 v-model="isAllChecked"
@@ -310,12 +359,12 @@
                 @click="checkAll($event)"
                 class="select_all"
               /> 全选
-              <br/>
-              <br/>
+              <br />
+              <br />
               <div class="image_item_container">
                 <div v-for="(item ,index) in imageList" class="image_item" :key="index">
                   <label :for="item.id" class="label_item">
-                    <img :src="item.src" alt class="item_img"/>
+                    <img :src="item.src" alt class="item_img" />
                     <p class="item_text">{{item.name}}</p>
                     <p class="item_checkbox">
                       <input
@@ -333,6 +382,26 @@
               </div>
             </template>
           </a-modal>
+          <div class="checkbox_item_container">
+            <div class="item_ul">
+              <div
+                class="item_li"
+                v-for="(item,index) of imageList"
+                :key="index"
+                style="width:100px;height:150px;margin:15px 0;"
+                v-if="checkeds.indexOf( item.id )!=-1"
+              >
+                <a-col class="item">
+                  <a-icon
+                    type="close-circle"
+                    style="position:absolute;top:-5px;right:-5px;color:red"
+                    @click="deteleImg(item.id)"
+                  />
+                  <img :src="item.src" alt style="width:100%" />
+                </a-col>
+              </div>
+            </div>
+          </div>
         </div>
       </a-form-item>
 
@@ -373,13 +442,12 @@
             v-for="actionBar in actionBarTextList"
             :key="actionBar.id"
             :value="actionBar.actionBarText"
-          >{{actionBar.actionBarText}}
-          </a-select-option>
+          >{{actionBar.actionBarText}}</a-select-option>
         </a-select>
       </a-form-item>
 
       <a-form-item label="作品广告语" :labelCol="labelCol" :wrapperCol="wrapperCol">
-        <a-textarea style="width: 650px" v-model="description" :rows="2"/>
+        <a-textarea style="width: 650px" v-model="description" :rows="2" />
       </a-form-item>
 
       <a-form-item label="创意名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -413,8 +481,8 @@
 </template>
 
 <script>
-  import {getAction, postAction} from '@/api/manage'
-  import {mapGetters} from 'vuex'
+  import { getAction, postAction } from '@/api/manage'
+  import { mapGetters } from 'vuex'
   import UploadToAli from '@femessage/upload-to-ali'
   import moment from 'moment'
   import VuePreview from 'vue-preview'
@@ -521,7 +589,7 @@
           getOptionsUrl: '/kuaishou/create/getOptions',
           getChildrenUrl: '/kuaishou/create/getChildren',
           videoListUrl: '/kuaishou/kuaiShouVideo/list',
-          imageListUrl: '/kuaishou/kuaiShouImage//image/list',
+          imageListUrl: '/kuaishou/kuaiShouImage/image/list',
           actionBarTextListUrl: '/kuaishou/kuaiShouActionBarText/list',
           getDescriptionUrl: '/kuaishou/kuaiShouVideo/queryShouVideo',
 
@@ -618,7 +686,7 @@
         this.haveSinglePicimagesList = []
       },
 
-      checkeda: function (id) {
+      checkeda: function(id) {
         let indexOf = this.checkeds.indexOf(id)
         if (indexOf >= 0) {
           this.$delete(this.checkeds, id)
@@ -846,6 +914,8 @@
             this.creativeName = res.result.videoName + '_' + moment().format('YYYY-MM-DD_HH:mm')
           }
         })
+        this.imageUrl = []
+        this.checkeds = []
       },
 
       // 有单张图片的贴片方式
@@ -1013,7 +1083,7 @@
         e.preventDefault()
         this.form.validateFields((err, values) => {
           if (!err) {
-            this.loading = true;
+            this.loading = true
             let params = {}
             params.accountId = this.accountId
             if (this.ids.length == 2) {
@@ -1046,7 +1116,7 @@
                   params.haveSinglePicVideoUrl = this.tiepianVideoLocalUploadList
                 }
               } else if (this.creativeMaterialType == '3') {
-                params.singlePicTiepianType = this.singlePicTiepianType;
+                params.singlePicTiepianType = this.singlePicTiepianType
                 if (this.changeSinglePicType == '1') {
                   params.haveSinglePicimagesList = this.haveSinglePicimagesList
                 } else if (this.changeSinglePicType == '2') {
@@ -1057,19 +1127,30 @@
             postAction(this.url.creativeUrl, params).then(res => {
               console.log(res)
               if (res.success) {
-                this.loading = false;
+                this.loading = false
                 alert('广告创意创建成功')
               } else {
-                this.loading = false;
-                alert(res.message);
+                this.loading = false
+                alert(res.message)
               }
             })
           }
         })
+      },
+      detele(index) {
+        this.haveSinglePicVideoUrl.splice(index, 1)
+      },
+      deteleRadio() {
+        this.videoUrl = null
+      },
+      deteleImg(item) {
+        var index = this.checkeds.findIndex(v => v === item)
+        this.checkeds.splice(index, 1)
+        this.imageUrl.splice(index, 1)
       }
     },
 
-    created: function () {
+    created: function() {
       let params = {}
       params.pageSize = '1000'
       params.mediaId = '2'
@@ -1085,99 +1166,104 @@
 
 
 <style lang="scss">
-.select_all {
-  margin-bottom: 10px;
-}
+  .select_all {
+    margin-bottom: 10px;
+  }
 
-.ant_modal_body_container {
-  .ant-modal-body {
-    max-height: 650px;
-    overflow-y: scroll;
+  .ant_modal_body_container {
+    .ant-modal-body {
+      max-height: 650px;
+      overflow-y: scroll;
 
-    .image_item_container {
-      margin: 0 -10px;
-      width: 100%;
+      .image_item_container {
+        margin: 0 -10px;
+        width: 100%;
 
-      .image_item {
-        display: inline-block;
-        width: 20%;
-        padding: 0 10px;
-        box-sizing: border-box;
-        margin-bottom: 20px;
+        .image_item {
+          display: inline-block;
+          width: 20%;
+          padding: 0 10px;
+          box-sizing: border-box;
+          margin-bottom: 20px;
 
-        .label_item {
-          display: block;
-          cursor: pointer;
-        }
+          .label_item {
+            display: block;
+            cursor: pointer;
+          }
 
-        .item_img {
-          width: 100%;
-          margin-bottom: 10px;
-        }
+          .item_img {
+            width: 100%;
+            margin-bottom: 10px;
+          }
 
-        .item_text {
-          height: 42px;
-          overflow: hidden;
-          margin-bottom: 0;
-        }
+          .item_text {
+            height: 42px;
+            overflow: hidden;
+            margin-bottom: 0;
+          }
 
-        .item_checkbox {
-          margin-bottom: 0;
-        }
+          .item_checkbox {
+            margin-bottom: 0;
+          }
 
-        .video {
-          width: 100%;
+          .video {
+            width: 100%;
+          }
         }
       }
     }
-  }
 
-  .video_item_container {
-    .video {
-      width: 100%;
+    .video_item_container {
+      .video {
+        width: 100%;
+      }
     }
   }
-}
-
-//   多选框
-.checkbox_item_container {
-  .item_ul {
-    margin: 0 -10px;
 
-    .item_li {
-      width: 20%;
-      float: left;
-      padding: 0 10px;
-      box-sizing: border-box;
-
-      .item {
-        position: relative;
-
-        video {
-          width: 100%;
-          min-height: 255px;
-        }
+  //   多选框
+  .checkbox_item_container {
+    .item_ul {
+      margin: 0 -10px;
 
-        .checkbox_item {
+      .item_li {
+        width: 20%;
+        float: left;
+        padding: 0 10px;
+        box-sizing: border-box;
+        .item:hover i {
           display: block;
-
-          .ant-checkbox {
-            display: inline-block;
+          cursor: pointer;
+        }
+        .item {
+          position: relative;
+          i {
+            display: none;
+          }
+          video {
+            width: 100%;
+            min-height: 255px;
           }
 
-          span {
+          .checkbox_item {
             display: block;
-            padding: 0;
 
-            .item_txt {
-              text-align: left;
-              height: 42px;
-              overflow: hidden;
+            .ant-checkbox {
+              display: inline-block;
+            }
+
+            span {
+              display: block;
+              padding: 0;
+
+              .item_txt {
+                text-align: left;
+                height: 42px;
+                overflow: hidden;
+              }
             }
           }
         }
       }
     }
   }
-}
 </style>

+ 2 - 4
src/views/modules/kuaishouapp/groupCreate.vue

@@ -85,7 +85,7 @@
                   {rules: [{ required: true, message: ' ' },
                   {validator: handleConfirmValue}]}
                 ]"
-          placeholder="不小于500,不超过100000000,仅支持输入自然数" type="number" style="width: 70%"></a-input>
+          placeholder="不小于100,不超过100000000,仅支持输入自然数" type="number" style="width: 70%"></a-input>
       </a-form-item>
 
@@ -396,8 +396,6 @@
               } else {
                 this.isFormDisabled = true;
               }
-
-
             } else {
               this.activationDisabled = true;
               this.isFormDisabled = true;
@@ -456,7 +454,7 @@
 
 
       handleConfirmValue(rule, value, callback) {
-        if (this.dayBudget == '' || this.dayBudget <= 500 || this.dayBudget >= 100000000) {
+        if (this.dayBudget == '' || this.dayBudget < 100 || this.dayBudget >= 100000000) {
           callback('请输入正确预算金额')
         }
         callback()