Browse Source

账户列表

xiuli.gao 1 year ago
parent
commit
25176d1533

+ 1 - 1
src/api/api.ts

@@ -86,7 +86,7 @@ export enum Api{
86 86
     directPacket_add = '/api/ad/targetingsAdd',
87 87
     directPacket_list = '/api/ad/targetingGet',
88 88
     directPacket_edit = '/api/ad/targetingsUp',
89
-    directPacket_get_behavior_list = 'api/ad/moreOptimizationGoal',
89
+    directPacket_get_behavior_list = '/api/ad/moreOptimizationGoal',
90 90
     directPacket_get_customer_base_list = '/api/ad/customAudiencesGet',
91 91
     directPacket_user_os_list = '/api/ad/userOsList',
92 92
     directPacket_location_list = '/api/ad/targetingTagsGet',

+ 1 - 1
src/components/businessMoudle/batchGdt/configArea/basicInfo/ts/basicApi.ts

@@ -57,7 +57,7 @@ interface IMoreOptimizationGoal {
57 57
 }
58 58
 export function moreOptimizationGoal(params: IMoreOptimizationGoal) {
59 59
   return new Promise( async (resolve, reject)=>{
60
-    const res: any = await http.get('api/ad/moreOptimizationGoal', params)
60
+    const res: any = await http.get('/api/ad/moreOptimizationGoal', params)
61 61
     if (res.errNo == 0 && res.rst) {
62 62
       let arr:Array<{label:string, value: string}> = [];
63 63
       for(let key in res.rst){

+ 38 - 154
src/components/businessMoudle/gdtList/account.vue

@@ -10,6 +10,7 @@
10 10
     </div>
11 11
     <div>
12 12
       <div class="bMar10 flex">
13
+        <el-button plain @click="goAdq">+ 添加账户</el-button>
13 14
         <Dropdown title="批量操作" :list="tableInfo.moreList" @close="dropdownEvent" class="rMar10"
14 15
                   :disabledFlag="tableInfo.multipleSelection&&tableInfo.multipleSelection.length == 0"></Dropdown>
15 16
         <div>已选 : <span>{{tableInfo.multipleSelection&&tableInfo.multipleSelection.length}}</span></div>
@@ -27,64 +28,30 @@
27 28
                 max-height="calc(100vh - 294px)">
28 29
         <el-table-column type="selection" width="55" align="center" fixed="left"/>
29 30
         <template v-for="item in tableInfo.descol">
30
-          <el-table-column :fixed="item.isfixed" :min-width="item.label.length <= 4 ? '100px' : item.label.length <= 8 ? '150px' : '180px'">
31
+          <el-table-column :fixed="item.disabled == 1" :min-width="item.key_value != 'advertiser_status' && item.key_value != 'advertiser_nick' && item.label.length <= 4 ? '100px' : item.label.length <= 8 ? '150px' : '200px'">
31 32
             <template #header>
32 33
               <div class="flex"
33
-                   :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'center' }"
34
-                   :class="[tableInfo.sortKey == item.key_value ? 'active_css' : '',item.isSort ? 'pointer' : '']"
35
-                   @click="item.isSort&&sortEvent(item.key_value)">
34
+                   :class="[tableInfo.sortKey == item.key_value ? 'active_css' : '',item.if_sort == 1 ? 'pointer' : '']"
35
+                   @click="item.if_sort == 1&&sortEvent(item.key_value)">
36 36
                 {{ item.label }}
37 37
                 <el-tooltip v-if="item.tooltip && item.tooltip != item.label" placement="top" effect="dark" :content="item.tooltip"><i-ep-QuestionFilled class="lMar5 c-999 f14 pointer" /></el-tooltip>
38
-                <div v-if="item.isSort">
39
-                  <div class="sortItem"><el-icon :color="tableInfo.sortKey == item.key_value ? '#3173FF' : ''"><i-ep-CaretBottom /></el-icon></div>
38
+                <div v-if="item.if_sort == 1">
39
+                  <div class="sortItem"><el-icon :color="tableInfo.sortKey == item.key_value ? '#3173FF' : '#a8abb2'"><i-ep-CaretBottom /></el-icon></div>
40 40
                 </div>
41 41
               </div>
42 42
             </template>
43 43
             <template #default="scope">
44
-              <div class="flex" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'center' }">
45
-
46
-              <!-- <div v-if="item.column == 'campaign_name'">
47
-                <span class="c-theme flex campaignName">
48
-                  <span class="pointer" @click="goAdvertEvent(scope.row.campaign_id)">{{scope.row[item.column]}}</span>
49
-                  <el-icon color="#3173FF" class="pointer lMarauto f16 icon" @click="edit_campaign_name_event(scope.row)"><i-ep-Edit /></el-icon>
50
-                </span>
51
-              </div>
52
-              <div v-else-if="item.column == 'configured_status'">
53
-                <span class="c-green" v-if="scope.row[item.column] == 'AD_STATUS_NORMAL'">正常</span>
54
-                <span class="c-red" v-else-if="scope.row[item.column] == 'AD_STATUS_SUSPEND'">暂停</span>
55
-                <span v-else>-</span>
44
+              <!-- 账户ID -->
45
+              <div v-if="item.key_value == 'advertiser_id'">
46
+                <span style="color: #3173FF" class="pointer">{{ scope.row[item.key_value] }}</span>
56 47
               </div>
57
-              <div v-else-if="item.column == 'speed_mode'">
58
-                <span v-if="scope.row[item.column] == 'SPEED_MODE_STANDARD'">标准投</span>
59
-                <span v-else-if="scope.row[item.column] == 'SPEED_MODE_FAST'">加速投放</span>
60
-                <span v-else>-</span>
48
+              <!-- 账户状态 -->
49
+              <div v-else-if="item.key_value == 'advertiser_status'" class="flex">
50
+                <div class="dot"></div>
51
+                <span>{{ scope.row[item.key_value] }}</span>
61 52
               </div>
62
-              <div v-else-if="item.column == 'operate'">
63
-                <div class="flex">
64
-                  <span class="c-theme pointer" @click="editPlanEvent(scope.row)">修改</span>
65
-                  <span class="lMar10"
66
-                        :class="scope.row.configured_status == 'AD_STATUS_NORMAL' ? 'pointer-drop c-green-opa' : 'pointer c-green'"
67
-                        @click="scope.row.configured_status == 'AD_STATUS_SUSPEND'&&batchPlanEvent(scope.row,1)">启用</span>
68
-                </div>
69
-                <div>
70
-                    <span :class="scope.row.configured_status == 'AD_STATUS_SUSPEND' ? 'pointer-drop c-red-opa' : 'pointer c-red'"
71
-                          @click="scope.row.configured_status == 'AD_STATUS_NORMAL'&&batchPlanEvent(scope.row,2)">暂停</span>
72
-                  <Popconfirm key="dele" @confirm="batchPlanEvent(scope.row,3)" :slotFlag="true">
73
-                    <template #con>
74
-                      <span class="pointer lMar10">删除</span>
75
-                    </template>
76
-                  </Popconfirm>
77
-
78
-                </div>
79
-
80
-
81
-              </div>
82
-              <div class="flex c-theme pointer" v-else-if="item.column == 'daily_budget'" @click="editPlanEvent(scope.row)">
83
-                {{scope.row[item.column] ? NumberHandle(scope.row[item.column]) : '不限'}}
84
-              </div> -->
85
-
86
-
87
-              <div class="cellDiv" :class="tableInfo.sortKey == item.key_value ? 'active_css' : ''">
53
+              <!-- 其他 -->
54
+              <div class="cellDiv" v-else :class="tableInfo.sortKey == item.key_value ? 'active_css' : ''">
88 55
                 <el-tooltip :disabled="!(scope.row[item.key_value] && scope.row[item.key_value].length >30)" effect="dark" :content="scope.row[item.key_value]+''">
89 56
                   <div class="clampTwo line21" style="flex: 1">
90 57
                     {{ scope.row[item.key_value] || scope.row[item.key_value]==0 ?
@@ -93,7 +60,6 @@
93 60
                   </div>
94 61
                 </el-tooltip>
95 62
               </div>
96
-              </div>
97 63
             </template>
98 64
           </el-table-column>
99 65
         </template>
@@ -101,25 +67,20 @@
101 67
 
102 68
     </div>
103 69
 
104
-    <EditIpt ref="planEditIptRef" title="推广计划" @confirm="planEditConfirm"></EditIpt>
105
-    <TargetEdit ref="TargetEditRef" title="计划设置" @confirm="init"></TargetEdit>
106 70
   </div>
107 71
 </template>
108 72
 <script setup lang="ts">
109 73
 import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
110
-import Select from '@/components/capsulationMoudle/_select.vue'
111 74
 import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
112 75
 import Input from '@/components/capsulationMoudle/_input.vue'
113
-import EditIpt from '@/components/businessMoudle/gdtList/dialog/editIpt.vue'
114
-import TargetEdit from '@/components/businessMoudle/gdtList/dialog/target.vue'
115 76
 import Dropdown from '@/components/capsulationMoudle/_dropdown.vue'
116
-import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
117
-import noData from '@/components/capsulationMoudle/noData.vue'
118 77
 import {listTs} from "@/components/businessMoudle/gdtList/ts/list";
119 78
 import {Api} from "@/api/api";
120 79
 import {ElMessage} from "element-plus";
121 80
 import {batchGdt_edit, batchAccount_list, reactiveTableAndAny} from "@/api/ApiModel";
122 81
 import Indicators from './indicators/index.vue'
82
+import { useRouter } from "vue-router";
83
+const router = useRouter();
123 84
 
124 85
 const { proxy } = getCurrentInstance() as any;
125 86
 // 全局方法定义
@@ -132,9 +93,6 @@ const emit = defineEmits<{
132 93
 const goNewPlanEvent = () => {
133 94
   emit('goNewPlan')
134 95
 }
135
-const goAdvertEvent = (campaign_id:any) => {
136
-  emit('goAdvert',campaign_id)
137
-}
138 96
 
139 97
 const loading = ref<boolean>(false)
140 98
 const tableInfo = reactive<reactiveTableAndAny>({
@@ -159,11 +117,6 @@ const tableInfo = reactive<reactiveTableAndAny>({
159 117
 
160 118
 
161 119
 
162
-//批量操作
163
-const batchEvent = () => {
164
-
165
-}
166
-
167 120
 // 启用 暂停 删除
168 121
 const batchPlanApi = async (arr?:any,val?:any) => {
169 122
   const paramsModel = reactive<batchGdt_edit>({
@@ -179,16 +132,6 @@ const batchPlanApi = async (arr?:any,val?:any) => {
179 132
     loading.value = false
180 133
   }
181 134
 }
182
-const batchPlanEvent = async (row?:any,val?:any) => {
183
-  loading.value = true
184
-  let arr:any = []
185
-  arr.push({
186
-    account_id:row.account_id,
187
-    campaign_id:row.campaign_id
188
-  })
189
-  batchPlanApi(arr,val)
190
-
191
-}
192 135
 const dropdownEvent = (val: string | number | object) => {
193 136
   loading.value = true
194 137
   let arr:any = []
@@ -201,37 +144,29 @@ const dropdownEvent = (val: string | number | object) => {
201 144
   batchPlanApi(arr,val)
202 145
 }
203 146
 
204
-//修改计划
205
-const editPlanEvent = (row:any) => {
206
-  nextTick(()=>{
207
-    TargetEditRef.value!.switchShow(true,row)
208
-  })
209
-}
210
-//修改计划名称
211
-const edit_campaign_name_event = (row:any) => {
212
-  nextTick(()=>{
213
-    planEditIptRef.value!.switchShow(true,row.campaign_name)
214
-  })
215
-}
216
-//推广计划 - 确定
217
-const planEditConfirm = () => {
218
-
219
-}
220
-
221 147
 
222 148
 //排序
223 149
 const sortEvent = (row:any) => {
224
-
150
+  if(row != tableInfo.sortKey){
151
+    tableInfo.sortKey = row
152
+    init()
153
+  }
154
+  console.log('tableInfo.sortKey',tableInfo.sortKey)
225 155
 }
226 156
 
227 157
 //列表
228 158
 const init = async () => {
229 159
   loading.value = true
230
-  const paramsModel = reactive<batchAccount_list>({
160
+  let params = {
231 161
     keyword:InputRef_text.value!.value,
232 162
     st_date:timeRef.value!.dateVal&&timeRef.value!.dateVal[0],
233 163
     en_date:timeRef.value!.dateVal&&timeRef.value!.dateVal[1],
234
-  })
164
+  }
165
+  if(tableInfo.sortKey){
166
+    params['field'] = tableInfo.sortKey
167
+    params['order'] = 'desc'
168
+  }
169
+  const paramsModel = reactive<batchAccount_list>(params)
235 170
   let res:any = await proxy.$http.get(Api.batchGdt_accountList_list,paramsModel)
236 171
   loading.value = false
237 172
   if(res&&res.errNo=='0'){
@@ -243,81 +178,30 @@ const init = async () => {
243 178
   }
244 179
 }
245 180
 
246
-
247
-//清空值
248
-const clearChooseVal = ()=>{
249
-  tableInfo.chooseAll = false
250
-  tableInfo.multipleSelection = []
251
-}
252
-//添加值
253
-const multipleSelection_add = (item?:any) => {
254
-  let idx:number = tableInfo.multipleSelection.findIndex(n=>n.campaign_id == item.campaign_id)
255
-  if(idx<0){
256
-    tableInfo.multipleSelection.push(item)
257
-  }
258
-}
259
-//删除值
260
-const multipleSelection_splice = (item?:any) => {
261
-  let idx:number = tableInfo.multipleSelection.findIndex(n=>n.campaign_id == item.campaign_id)
262
-  if(idx>=0){
263
-    tableInfo.multipleSelection.splice(idx,1)
264
-  }
181
+const goAdq = () => {
182
+  router.push({ path: '/adqManage' })
265 183
 }
266
-const handleCommandChoosePage = async (command: string | number | object)=>{
267
-  let arr:any = tableInfo.tableList
268
-  clearChooseVal()
269
-  tableInfo.chooseAll = true
270
-  if(command == 2){ // 全部
271
-    await init()
272
-    arr = tableInfo.tableList_all
273
-  }
274
-  arr.forEach(item=>{
275
-    multipleSelection_add(item)
276
-  })
277
-}
278
-//全选
279
-const allChooseCheckboxEvent = (val:string | number | boolean)=>{
280
-  tableInfo.tableList.forEach(item=>{
281
-    if(val){
282
-      multipleSelection_add(item)
283
-    }else{
284
-      tableInfo.multipleSelection = []
285
-    }
286
-  })
287
-}
288
-//单选
289
-const singleChooseCheckboxEvent = (idx:number,row:any)=>{
290
-  if(idx==-1){
291
-    tableInfo.multipleSelection.push(row)
292
-  }else{
293
-    tableInfo.multipleSelection.splice(idx,1)
294
-    tableInfo.chooseAll = false
295
-  }
296
-}
297
-
298 184
 
299 185
 const {
300
-  init_acList,
301
-  pageInfo,
302 186
   timeRef,
303
-  acRef,
304
-  statusRef,
305 187
   InputRef_text,
306
-  clearEvent,
307 188
   tableHeaderStyle,
308
-  planEditIptRef,
309
-  TargetEditRef,
310
-  customIndEvent
311 189
 } = listTs()
312 190
 
313 191
 onMounted(()=>{
314 192
   nextTick(async ()=>{
315
-    await init_acList()
316 193
     await init()
317 194
   })
318 195
 })
319 196
 </script>
320 197
 <style lang="scss" scoped>
198
+.dot{
199
+  width: 6px;
200
+  height: 6px;
201
+  border-radius: 50%;
202
+  background-color: rgb(35, 194, 63);
203
+  margin-right: 4px;
204
+}
321 205
 .el-table th div.cell {
322 206
   white-space: nowrap;
323 207
   text-overflow: ellipsis;