|
@@ -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
|
|
|
})
|
|
|
})
|