|
@@ -14,101 +14,117 @@
|
|
<template>
|
|
<template>
|
|
<div class="advertising-group">
|
|
<div class="advertising-group">
|
|
<a-row style="margin-top:15px">
|
|
<a-row style="margin-top:15px">
|
|
- <a-card :tabList="title" :activeTabKey="titleKey" @tabChange="key => onTabChange(key, 'titleKey')">
|
|
|
|
- <a-button @click="dianji" style="margin-bottom:15px;">新增广告组</a-button>
|
|
|
|
- <a-button @click="showEdit = true" style="margin:0 0 15px 15px;">列表项筛选</a-button>
|
|
|
|
|
|
+ <a-card title="">
|
|
|
|
+ <!-- :tabList="title" :activeTabKey="titleKey" @tabChange="key => onTabChange(key, 'titleKey')" -->
|
|
|
|
+ <a-tabs v-model="titleKey" type="editable-card" hideAdd @edit="remove">
|
|
|
|
+ <a-tab-pane v-for="pane in title" :tab="pane.tab" :key="pane.key">
|
|
|
|
+ <a-button @click="dianji" style="margin-bottom:15px;">新增广告组</a-button>
|
|
|
|
+ <a-button @click="showEdit = true" style="margin:0 0 15px 15px;">列表项筛选</a-button>
|
|
|
|
|
|
- <div v-show="selectedRowKeys.length > 0">
|
|
|
|
- 批量修改预算:<a-input-number :min="0" :step="0.01" v-model="allMoney" style="width:150px" @fouse.stop />
|
|
|
|
- <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
|
|
|
|
|
|
+ <div v-show="selectedRowKeys.length > 0">
|
|
|
|
+ 批量修改预算:<a-input-number :min="0" :step="0.01" v-model="allMoney" style="width:150px" @fouse.stop />
|
|
|
|
+ <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
|
|
|
|
|
|
- 批量修改出价:<a-input-number :min="0" :step="0.01" v-model="allMoneyBid" style="width:150px" @fouse.stop />
|
|
|
|
- <a-button @click="editMoneyBid" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
|
|
|
|
-
|
|
|
|
- 批量操作:
|
|
|
|
- <a-select style="width: 120px" v-model="allType">
|
|
|
|
- <a-select-option value="1">启动</a-select-option>
|
|
|
|
- <a-select-option value="2">暂停</a-select-option>
|
|
|
|
- <a-select-option value="3">删除</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
|
|
|
|
- </div>
|
|
|
|
- <a-modal title="列表项筛选" v-model="showEdit" @ok="handleOk">
|
|
|
|
- <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
|
|
|
|
- <a-checkbox-group :options="showList" v-model="dataValue" class="checked" />
|
|
|
|
- </a-modal>
|
|
|
|
-
|
|
|
|
- <a-table
|
|
|
|
- size="middle"
|
|
|
|
- :columns="columns"
|
|
|
|
- :dataSource="dataList"
|
|
|
|
- bordered
|
|
|
|
- :customRow="rowClick"
|
|
|
|
- :pagination="ipagination"
|
|
|
|
- :scroll="{ x: 1900 }"
|
|
|
|
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
|
- >
|
|
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
|
- <a-switch v-model="record.showSwich" @change="onChangeSwitch(record)" />
|
|
|
|
- </span>
|
|
|
|
-
|
|
|
|
- <span slot="status" slot-scope="text">{{ text | status }}</span>
|
|
|
|
- <span slot="putStatus" slot-scope="text">{{ text | putStatus }}</span>
|
|
|
|
- <span slot="createChannel" slot-scope="text">{{ text | createChannel }}</span>
|
|
|
|
- <span slot="bidType" slot-scope="text, record">
|
|
|
|
- <!-- {{ text | bidType }} -->
|
|
|
|
- {{ record.ocpxActionType | ocpxActionType }}</span
|
|
|
|
- >
|
|
|
|
- <!-- <span slot="ocpxActionType" slot-scope="text">{{ text | ocpxActionType }}</span> -->
|
|
|
|
-
|
|
|
|
- <span slot="speed" slot-scope="text">{{ text | speed }}</span>
|
|
|
|
- <span slot="sceneId" slot-scope="text"
|
|
|
|
- ><span v-for="item of text" :key="item">{{ item | sceneId }}</span></span
|
|
|
|
- >
|
|
|
|
- <span slot="showModel" slot-scope="text">{{ text | showModel }}</span>
|
|
|
|
- <span slot="unitType" slot-scope="text">{{ text == 4 ? '自定义' : '' }}</span>
|
|
|
|
- <span slot="urlType" slot-scope="text">{{ text | urlType }}</span>
|
|
|
|
-
|
|
|
|
- <template slot="dayBudget" slot-scope="text, record">
|
|
|
|
- <div style="display:flex;justify-content: center;">
|
|
|
|
- <span v-show="!record.edit" class="count">{{ text ? (text / 1000).toFixed(2) : '不限制预算' }}</span>
|
|
|
|
- <a-input-number
|
|
|
|
- :min="0"
|
|
|
|
- :step="0.01"
|
|
|
|
- v-show="record.edit"
|
|
|
|
- v-model="record.elseMoney"
|
|
|
|
- style="width:150px"
|
|
|
|
- @fouse.stop
|
|
|
|
- />
|
|
|
|
- <a-icon
|
|
|
|
- :type="record.edit ? 'check' : 'edit'"
|
|
|
|
- @click.stop=";(record.edit = !record.edit), editShow(record)"
|
|
|
|
- style="margin-left:10px"
|
|
|
|
- class="count"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template slot="bid" slot-scope="text, record">
|
|
|
|
- <!-- <span slot="bid" slot-scope="text, record">{{ text == 0 ? record.cpaBid / 1000 : text / 1000 }}</span> -->
|
|
|
|
- <div style="display:flex;justify-content: center;">
|
|
|
|
- <span v-show="!record.editBid" class="count">{{ text == 0 ? record.cpaBid / 1000 : text / 1000 }}</span>
|
|
|
|
- <a-input-number
|
|
|
|
|
|
+ 批量修改出价:<a-input-number
|
|
:min="0"
|
|
:min="0"
|
|
:step="0.01"
|
|
:step="0.01"
|
|
- v-show="record.editBid"
|
|
|
|
- v-model="record.elseMoneyBid"
|
|
|
|
|
|
+ v-model="allMoneyBid"
|
|
style="width:150px"
|
|
style="width:150px"
|
|
@fouse.stop
|
|
@fouse.stop
|
|
/>
|
|
/>
|
|
- <a-icon
|
|
|
|
- :type="record.editBid ? 'check' : 'edit'"
|
|
|
|
- @click.stop=";(record.editBid = !record.editBid), editShowBid(record)"
|
|
|
|
- style="margin-left:10px"
|
|
|
|
- class="count"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-button @click="editMoneyBid" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
|
|
|
|
+
|
|
|
|
+ 批量操作:
|
|
|
|
+ <a-select style="width: 120px" v-model="allType">
|
|
|
|
+ <a-select-option value="1">启动</a-select-option>
|
|
|
|
+ <a-select-option value="2">暂停</a-select-option>
|
|
|
|
+ <a-select-option value="3">删除</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
- </a-table>
|
|
|
|
|
|
+ <a-modal title="列表项筛选" v-model="showEdit" @ok="handleOk">
|
|
|
|
+ <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll"
|
|
|
|
+ >全选</a-checkbox
|
|
|
|
+ >
|
|
|
|
+ <a-checkbox-group :options="showList" v-model="dataValue" class="checked" />
|
|
|
|
+ </a-modal>
|
|
|
|
+
|
|
|
|
+ <a-table
|
|
|
|
+ size="middle"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :dataSource="dataList"
|
|
|
|
+ bordered
|
|
|
|
+ :customRow="rowClick"
|
|
|
|
+ :pagination="ipagination"
|
|
|
|
+ :scroll="{ x: true }"
|
|
|
|
+ :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
|
+ >
|
|
|
|
+ <a slot="unitName" slot-scope="text, record" @click="toDetail(record)">{{ text }}</a>
|
|
|
|
+ <span slot="action" slot-scope="text, record">
|
|
|
|
+ <a-switch v-model="record.showSwich" @change="onChangeSwitch(record)" />
|
|
|
|
+ </span>
|
|
|
|
+
|
|
|
|
+ <span slot="status" slot-scope="text">{{ text | status }}</span>
|
|
|
|
+ <span slot="putStatus" slot-scope="text">{{ text | putStatus }}</span>
|
|
|
|
+ <span slot="createChannel" slot-scope="text">{{ text | createChannel }}</span>
|
|
|
|
+ <span slot="bidType" slot-scope="text, record">
|
|
|
|
+ <!-- {{ text | bidType }} -->
|
|
|
|
+ {{ record.ocpxActionType | ocpxActionType }}</span
|
|
|
|
+ >
|
|
|
|
+ <!-- <span slot="ocpxActionType" slot-scope="text">{{ text | ocpxActionType }}</span> -->
|
|
|
|
+
|
|
|
|
+ <span slot="speed" slot-scope="text">{{ text | speed }}</span>
|
|
|
|
+ <span slot="sceneId" slot-scope="text"
|
|
|
|
+ ><span v-for="item of text" :key="item">{{ item | sceneId }}</span></span
|
|
|
|
+ >
|
|
|
|
+ <span slot="showModel" slot-scope="text">{{ text | showModel }}</span>
|
|
|
|
+ <span slot="unitType" slot-scope="text">{{ text == 4 ? '自定义' : '' }}</span>
|
|
|
|
+ <span slot="urlType" slot-scope="text">{{ text | urlType }}</span>
|
|
|
|
+
|
|
|
|
+ <template slot="dayBudget" slot-scope="text, record">
|
|
|
|
+ <div style="display:flex;justify-content: center;">
|
|
|
|
+ <span v-show="!record.edit" class="count">{{ text ? (text / 1000).toFixed(2) : '不限制预算' }}</span>
|
|
|
|
+ <a-input-number
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="0.01"
|
|
|
|
+ v-show="record.edit"
|
|
|
|
+ v-model="record.elseMoney"
|
|
|
|
+ style="width:150px"
|
|
|
|
+ @fouse.stop
|
|
|
|
+ />
|
|
|
|
+ <a-icon
|
|
|
|
+ :type="record.edit ? 'check' : 'edit'"
|
|
|
|
+ @click.stop=";(record.edit = !record.edit), editShow(record)"
|
|
|
|
+ style="margin-left:10px"
|
|
|
|
+ class="count"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="bid" slot-scope="text, record">
|
|
|
|
+ <!-- <span slot="bid" slot-scope="text, record">{{ text == 0 ? record.cpaBid / 1000 : text / 1000 }}</span> -->
|
|
|
|
+ <div style="display:flex;justify-content: center;">
|
|
|
|
+ <span v-show="!record.editBid" class="count">{{
|
|
|
|
+ text == 0 ? record.cpaBid / 1000 : text / 1000
|
|
|
|
+ }}</span>
|
|
|
|
+ <a-input-number
|
|
|
|
+ :min="0"
|
|
|
|
+ :step="0.01"
|
|
|
|
+ v-show="record.editBid"
|
|
|
|
+ v-model="record.elseMoneyBid"
|
|
|
|
+ style="width:150px"
|
|
|
|
+ @fouse.stop
|
|
|
|
+ />
|
|
|
|
+ <a-icon
|
|
|
|
+ :type="record.editBid ? 'check' : 'edit'"
|
|
|
|
+ @click.stop=";(record.editBid = !record.editBid), editShowBid(record)"
|
|
|
|
+ style="margin-left:10px"
|
|
|
|
+ class="count"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </a-table>
|
|
|
|
+ </a-tab-pane>
|
|
|
|
+ </a-tabs>
|
|
</a-card>
|
|
</a-card>
|
|
</a-row>
|
|
</a-row>
|
|
<a-modal v-model="visible" title="错误信息" onOk="handleOk" :footer="null">
|
|
<a-modal v-model="visible" title="错误信息" onOk="handleOk" :footer="null">
|
|
@@ -165,6 +181,7 @@ var columns = [
|
|
title: '广告组名称',
|
|
title: '广告组名称',
|
|
align: 'center',
|
|
align: 'center',
|
|
dataIndex: 'unitName',
|
|
dataIndex: 'unitName',
|
|
|
|
+ scopedSlots: { customRender: 'unitName' },
|
|
colSpan: 1,
|
|
colSpan: 1,
|
|
fixed: 'left',
|
|
fixed: 'left',
|
|
width: 200
|
|
width: 200
|
|
@@ -281,23 +298,23 @@ export default {
|
|
on: {
|
|
on: {
|
|
dblclick: () => {
|
|
dblclick: () => {
|
|
// 点击改行时要做的事情
|
|
// 点击改行时要做的事情
|
|
- localStorage.setItem('originalityKey', record.unitId)
|
|
|
|
- localStorage.setItem('campaignId', record.campaignId)
|
|
|
|
- if (localStorage.getItem('originality')) {
|
|
|
|
- var dataElse = JSON.parse(localStorage.getItem('originality'))
|
|
|
|
- for (let i = 0; i < dataElse.length; i++) {
|
|
|
|
- if (dataElse[i].key == record.unitId) {
|
|
|
|
- this.$router.replace({ path: '/account/originality' })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- dataElse.push(record)
|
|
|
|
- localStorage.setItem('originality', JSON.stringify(dataElse))
|
|
|
|
- } else {
|
|
|
|
- var data = [record]
|
|
|
|
- localStorage.setItem('originality', JSON.stringify(data))
|
|
|
|
- }
|
|
|
|
- this.$router.replace({ path: '/account/originality' })
|
|
|
|
|
|
+ // localStorage.setItem('originalityKey', record.unitId)
|
|
|
|
+ // localStorage.setItem('campaignId', record.campaignId)
|
|
|
|
+ // if (localStorage.getItem('originality')) {
|
|
|
|
+ // var dataElse = JSON.parse(localStorage.getItem('originality'))
|
|
|
|
+ // for (let i = 0; i < dataElse.length; i++) {
|
|
|
|
+ // if (dataElse[i].key == record.unitId) {
|
|
|
|
+ // this.$router.replace({ path: '/account/originality' })
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // dataElse.push(record)
|
|
|
|
+ // localStorage.setItem('originality', JSON.stringify(dataElse))
|
|
|
|
+ // } else {
|
|
|
|
+ // var data = [record]
|
|
|
|
+ // localStorage.setItem('originality', JSON.stringify(data))
|
|
|
|
+ // }
|
|
|
|
+ // this.$router.replace({ path: '/account/originality' })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
@@ -389,6 +406,52 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ remove(targetKey) {
|
|
|
|
+ let activeKey = this.titleKey
|
|
|
|
+ let lastIndex
|
|
|
|
+ this.title.forEach((pane, i) => {
|
|
|
|
+ if (pane.key === targetKey) {
|
|
|
|
+ lastIndex = i - 1
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ const panes = this.title.filter(pane => pane.key !== targetKey)
|
|
|
|
+ if (panes.length && activeKey === targetKey) {
|
|
|
|
+ if (lastIndex >= 0) {
|
|
|
|
+ activeKey = panes[lastIndex].key
|
|
|
|
+ } else {
|
|
|
|
+ activeKey = panes[0].key
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.title = panes
|
|
|
|
+ this.titleKey = activeKey
|
|
|
|
+ if (this.title.length == 0) {
|
|
|
|
+ this.$bus.$emit('remove', '/account/advertisingGroup')
|
|
|
|
+ } else {
|
|
|
|
+ localStorage.setItem('advertisingGroup', JSON.stringify(this.title))
|
|
|
|
+ localStorage.setItem('advertisingGroupKey', JSON.stringify(this.titleKey))
|
|
|
|
+ this.getDataList(activeKey)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toDetail(record) {
|
|
|
|
+ // 点击改行时要做的事情
|
|
|
|
+ localStorage.setItem('originalityKey', record.unitId)
|
|
|
|
+ localStorage.setItem('campaignId', record.campaignId)
|
|
|
|
+ if (localStorage.getItem('originality')) {
|
|
|
|
+ var dataElse = JSON.parse(localStorage.getItem('originality'))
|
|
|
|
+ for (let i = 0; i < dataElse.length; i++) {
|
|
|
|
+ if (dataElse[i].unitId == record.unitId) {
|
|
|
|
+ this.$router.replace({ path: '/account/originality' })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dataElse.push(record)
|
|
|
|
+ localStorage.setItem('originality', JSON.stringify(dataElse))
|
|
|
|
+ } else {
|
|
|
|
+ var data = [record]
|
|
|
|
+ localStorage.setItem('originality', JSON.stringify(data))
|
|
|
|
+ }
|
|
|
|
+ this.$router.replace({ path: '/account/originality' })
|
|
|
|
+ },
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
onChangeSwitch(item) {
|
|
onChangeSwitch(item) {
|
|
console.log(item)
|
|
console.log(item)
|