Pārlūkot izejas kodu

修改广告语

zhuxinbo 5 gadi atpakaļ
vecāks
revīzija
c134983cac

+ 19 - 0
src/api/statistics.js

@@ -82,4 +82,23 @@ export function getRefuseCreative(parameter) {
       method: 'post',
       data: parameter
     })
+}
+
+//  /MaterialRefuse/updateCreative
+// 修改
+export function updateCreative(parameter) {
+    return axios({
+      url: "/MaterialRefuse/updateCreative",
+      method: 'post',
+      data: parameter
+    })
+}
+
+//  /MaterialRefuse/selectByCreateName
+export function selectByCreateName(parameter) {
+    return axios({
+      url: "/MaterialRefuse/selectByCreateName",
+      method: 'post',
+      data: parameter
+    })
 }

+ 34 - 71
src/mixins/JeecgListMixin.js

@@ -58,47 +58,33 @@ export const JeecgListMixin = {
   },
   methods: {
     expand(expanded,record){
-        console.log(expanded,record)
-        // if(this.url.listTwo){
-        //     var param = {}
-        //     param.field = this.getQueryField();
-        //     param.pageNo = this.ipagination.current;
-        //     param.pageSize = this.ipagination.pageSize;
-        //     param.parentId = record.id
-        //     if(expanded){
-        //         getAction(this.url.listTwo, filterObj(param)).then((res) => {
-        //             if (res.success) {
-        //                 record.innerData.push(...res.result.records)
-        //                 console.log(record.innerData)
-        //                 this.$forceUpdate();
-        //             }
-        //             if (res.code === 510) {
-        //               this.$message.warning(res.message)
-        //             }
-        //             this.loading = false;
-        //         })
-        //     }else{
-        //         record.innerData = []
-        //     }
-            
-        // }
-    },
-    async getCdata(id){
-        var param = {}
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        param.parentId = id
-        let data = await getAction(this.url.listTwo, filterObj(param)).then((res) => {
-            if (res.success) {
-                return res.result.records
-            }
-            if (res.code === 510) {
-             return []
+        if(this.url.listTwo){
+            var param = {}
+            param.field = this.getQueryField();
+            param.pageNo = this.ipagination.current;
+            param.pageSize = this.ipagination.pageSize;
+            param.parentId = record.id
+            if(expanded){
+                getAction(this.url.listTwo, filterObj(param)).then((res) => {
+                    if (res.success) {
+                        record.innerData=res.result.records.map((item,index)=>{
+                            return {
+                                ...item,
+                                key:index
+                            }
+                        })
+                        console.log(record.innerData)
+                        this.$forceUpdate();
+                    }
+                    if (res.code === 510) {
+                      this.$message.warning(res.message)
+                    }
+                    this.loading = false;
+                })
+            }else{
+                record.innerData = []
             }
-        })
-        console.log(data,"ceshi")
-        return data
+        }
     },
     async loadData(arg) {
       if (!this.url.list) {
@@ -113,37 +99,14 @@ export const JeecgListMixin = {
       this.loading = true;
       await getAction(this.url.list, params).then((res) => {
         if (res.success) {
-            if(this.url.listTwo){
-                var param = {}
-                param.field = this.getQueryField();
-                param.pageNo = this.ipagination.current;
-                param.pageSize = this.ipagination.pageSize;
-                // param.parentId = res.id
-                getAction(this.url.listTwo, params).then((item) => {
-                    if (item.success) {
-                        var data = item.result.records.map((s,index)=>{
-                            return {
-                                ...s,
-                                key:index
-                            }
-                        })
-                        var newData = res.result.records.concat(data)
-                        newData = transformTozTreeFormat(newData)
-                        console.log(newData)
-                        this.dataSource = newData.filter(v=>{
-                            return v.childrens
-                        })
-                    }else{
-                        this.dataSource = res.result.records
-                        this.ipagination.total = res.result.total;
-                    }
-                    
-                })
-                
-            }else{
-                this.dataSource = res.result.records
-                this.ipagination.total = res.result.total;
-            }
+            this.dataSource = res.result.records.map(item=>{
+                return {
+                    ...item,
+                    innerData:[]
+                }
+            })
+            this.ipagination.total = res.result.total;
+
             
             
           console.log(this.dataSource,12312321312)

+ 41 - 0
src/views/modules/Statistics/components/EditableCell.vue

@@ -0,0 +1,41 @@
+<template>
+  <div class="editable-cell">
+    <div v-if="editable" class="editable-cell-input-wrapper">
+      <a-input :value="value" @change="handleChange" @pressEnter="check" /><a-icon
+        type="check"
+        class="editable-cell-icon-check"
+        @click="check"
+      />
+    </div>
+    <div v-else class="editable-cell-text-wrapper">
+      {{ value || ' ' }}
+      <a-icon type="edit" class="editable-cell-icon" @click="edit" />
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    text: String,
+  },
+  data() {
+    return {
+      value: this.text,
+      editable: false,
+    };
+  },
+  methods: {
+    handleChange(e) {
+      const value = e.target.value;
+      this.value = value;
+    },
+    check() {
+      this.editable = false;
+      this.$emit('change', this.value);
+    },
+    edit() {
+      this.editable = true;
+    },
+  },
+};
+</script>

+ 54 - 37
src/views/modules/Statistics/refuseData.vue

@@ -78,6 +78,11 @@ th div {
     <a-row :gutter="10" style="margin-top:10px">
       <a-col :span="24">
         <a-card style="width:100%;">
+          <div style="display:flex;margin:0 0 20px 0">
+            <a-input placeholder="请输出要查找的创意名称" style="width:300px;" v-model="keyWord" />
+            <a-button type="primary" style="margin-left:10px" @click="addUserKey">搜索</a-button>
+          </div>
+
           <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading">
             <div slot="videoUrl" slot-scope="videoUrl">
               <video
@@ -90,6 +95,12 @@ th div {
             <div slot="coverUrl" slot-scope="coverUrl">
               <img :src="coverUrl" controls="controls" style="height:200px;width:112.5px" />
             </div>
+            <template slot="creativeName" slot-scope="text, record">
+              <editable-cell :text="text" @change="onCellChange(record, 'creativeName', $event)" />
+            </template>
+            <template slot="description" slot-scope="text, record">
+              <editable-cell :text="text" @change="onCellChange(record, 'description', $event)" />
+            </template>
           </a-table>
         </a-card>
       </a-col>
@@ -99,8 +110,9 @@ th div {
 
 <script>
 import moment from 'moment'
-import { getMaterialAccount, getRefuseCreative } from '@api/statistics'
+import { getMaterialAccount, getRefuseCreative, updateCreative, selectByCreateName } from '@api/statistics'
 import axios from 'axios'
+import EditableCell from './components/EditableCell'
 import { mapGetters } from 'vuex'
 import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
 const columns = [
@@ -132,7 +144,8 @@ const columns = [
     title: '创意名称',
     dataIndex: 'creativeName',
     key: 'creativeName',
-    align: 'left'
+    align: 'left',
+    scopedSlots: { customRender: 'creativeName' }
   },
   {
     title: '视频',
@@ -159,13 +172,16 @@ const columns = [
     title: '广告语',
     dataIndex: 'description',
     key: 'description',
-    align: 'left'
+    align: 'left',
+    scopedSlots: { customRender: 'description' }
   }
 ]
 
 export default {
   name: 'refuse-data',
-  components: {},
+  components: {
+    EditableCell
+  },
 
   data: function() {
     return {
@@ -174,41 +190,37 @@ export default {
       options: [],
       loading: false,
       columns,
-      dataList: []
-    }
-  },
-  filters: {
-    formatDate: function(value) {
-      let date = new Date(value)
-      let y = date.getFullYear()
-      let MM = date.getMonth() + 1
-      MM = MM < 10 ? '0' + MM : MM
-      let d = date.getDate()
-      d = d < 10 ? '0' + d : d
-      let h = date.getHours()
-      h = h < 10 ? '0' + h : h
-      let m = date.getMinutes()
-      m = m < 10 ? '0' + m : m
-      let s = date.getSeconds()
-      s = s < 10 ? '0' + s : s
-      return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
-    },
-    toFixtwo: function(value) {
-      if (value) {
-        return value.toFixed(2)
-      } else {
-        return 0.0
-      }
-    },
-    getBo: function(value) {
-      if (value) {
-        return (value * 100).toFixed(2) + '%'
-      } else {
-        return '0.00%'
-      }
+      dataList: [],
+      keyWord: ''
     }
   },
+  filters: {},
   methods: {
+    onCellChange(item, dataIndex, value) {
+      //   const dataSource = [...this.dataSource]
+      //   const target = dataSource.find(item => item.key === key)
+      //   if (target) {
+      //     target[dataIndex] = value
+      //     this.dataSource = dataSource
+      //   }
+      console.log(value)
+
+      item[dataIndex] = value
+      var params = {}
+      params.accountId = item.accountId
+      params.campaignId = item.campaignId
+      params.unitId = item.unitId
+      params.creativeId = item.creativeId
+      params.creativeName = item.creativeName
+      params.description = item.description
+      updateCreative(params).then(res => {
+        if(res.code == 0){
+            this.addUser()
+        }else{
+            this.$message.error(res.message)
+        }
+      })
+    },
     moment,
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
     addUser() {
@@ -224,12 +236,18 @@ export default {
                 key: index
               }
             })
+            this.list = this.dataList
             this.loading = false
           }
         })
       } else {
         this.$message.error('请选择账户')
       }
+    },
+    addUserKey() {
+      this.dataList = this.list.filter(item => {
+        return item.creativeName.toLowerCase().indexOf(this.keyWord.toLowerCase()) > -1
+      })
     }
   },
   watch: {},
@@ -240,7 +258,6 @@ export default {
   mounted: function() {
     this.$nextTick(() => {
       getMaterialAccount({ userId: this.userInfo().id }).then(res => {
-        this.list = res
         this.options = res
       })
     })

+ 4 - 4
src/views/modules/appium/AppiumTaskList.vue

@@ -110,7 +110,7 @@
           slot="expandedRowRender"
           slot-scope="text"
           :columns="innerColumns"
-          :dataSource="text.childrens"
+          :dataSource="text.innerData"
           :pagination="false"
         >
           <span slot="action" slot-scope="text,record" class="table-operation">
@@ -300,9 +300,9 @@ export default {
   methods: {
     lookDetail(item) {
         console.log(item)
-    //   this.$refs.modalItemForm.edit(item)
-    //   this.$refs.modalItemForm.title = '编辑'
-    //   this.$refs.modalItemForm.disableSubmit = false
+      this.$refs.modalItemForm.edit(item)
+      this.$refs.modalItemForm.title = '编辑'
+      this.$refs.modalItemForm.disableSubmit = false
     }
   },
   mounted() {

+ 6 - 4
src/views/modules/appium/modules/AppiumTaskItemModal.vue

@@ -111,14 +111,14 @@
           label="循环类型">
           <!-- <a-input placeholder="请输入循环类型" v-decorator="['loopType', {}]" /> -->
           {{model.isMust}}
-          <a-switch checkedChildren="loop" unCheckedChildren="noloop" @change="switchShow"/>
+          <a-switch checkedChildren="loop" unCheckedChildren="noloop" v-decorator="['loopType', {}]" @change="switchShow"/>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="是否必经执行">
           <!-- <a-input placeholder="请输入是否必经执行" v-decorator="['isMust', validatorRules.isMust ]" /> -->
-          <a-switch checkedChildren="是" unCheckedChildren="否"  @change="switchShowTwo"/>
+          <a-switch checkedChildren="是" unCheckedChildren="否" v-decorator="['isMust', validatorRules.isMust ]"  @change="switchShowTwo"/>
         </a-form-item>
         <a-form-item
           :labelCol="labelCol"
@@ -169,7 +169,7 @@
           :wrapperCol="wrapperCol"
           label="是否执行完关闭">
           <!-- <a-input placeholder="请输入是否执行完关闭" v-decorator="['isClose', {}]" /> -->
-          <a-switch checkedChildren="是" unCheckedChildren="否"  @change="switchShowClose"/>
+          <a-switch checkedChildren="是" unCheckedChildren="否"  v-decorator="['isClose', {}]"  @change="switchShowClose"/>
         </a-form-item>
 		
       </a-form>
@@ -241,7 +241,9 @@
         this.edit({findType:"id",clickType:"element",offsiteX:0,offsiteY:0,loopRate:1000,loopType:"noloop",isMust:0,waitTime:1000});
       },
       edit (record) {
-          console.log(record)
+        // record.isMust = record.isMust == 1?false:true
+        // record.isClose = record.isClose == 1?false:true
+        // record.loopType = record.loopType == "loop"?false:true
         this.form.resetFields();
         this.model = Object.assign({}, record);
         this.visible = true;

+ 2 - 2
vue.config.js

@@ -65,8 +65,8 @@ module.exports = {
        },*/
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
-        // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
-        target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        // target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
         ws: false,
         changeOrigin: true