瀏覽代碼

Merge branch 'feature/1223' into develop

zhengxy 2 年之前
父節點
當前提交
0b8ce2ce7b
共有 1 個文件被更改,包括 13 次插入5 次删除
  1. 13 5
      project/src/components/dataBoard/throwPerson/throwPersonPuton.vue

+ 13 - 5
project/src/components/dataBoard/throwPerson/throwPersonPuton.vue

56
       <ux-table-column v-for="item in desCol" :key="item.prop" :resizable="true" :field="item.prop" :title="item.label"
56
       <ux-table-column v-for="item in desCol" :key="item.prop" :resizable="true" :field="item.prop" :title="item.label"
57
         :min-width="item.min_width ? item.min_width : 120" :fixed="item.fixed ? item.fixed : ''" align="center">
57
         :min-width="item.min_width ? item.min_width : 120" :fixed="item.fixed ? item.fixed : ''" align="center">
58
         <template #header>
58
         <template #header>
59
-          <div class="flex-align-jus-center">
59
+          <div
60
+            :class="['flex-align-jus-center', item.sort ? 'pointer' : '', sort_field == item.prop ? 'sortFieldStyle' : '']"
61
+            @click="item.sort ? sortFieldEvent(item.prop) : ''">
60
             {{ item.label }}
62
             {{ item.label }}
63
+            <i class="el-icon-caret-bottom" v-if="item.sort"></i>
61
             <el-tooltip v-if="item.notes" :content="item.notes" placement="top">
64
             <el-tooltip v-if="item.notes" :content="item.notes" placement="top">
62
               <div><i class="el-icon-question"></i></div>
65
               <div><i class="el-icon-question"></i></div>
63
             </el-tooltip>
66
             </el-tooltip>
64
           </div>
67
           </div>
65
         </template>
68
         </template>
66
         <template v-slot="{ row }">
69
         <template v-slot="{ row }">
67
-          <span>{{ row[item.prop] || row[item.prop] == 0 ? $formatNum(row[item.prop]) : '-' }}</span>
70
+          <span :class="sort_field == item.prop ? 'sortFieldStyle' : ''">{{ row[item.prop] || row[item.prop] == 0 ? $formatNum(row[item.prop]) : '-' }}</span>
68
         </template>
71
         </template>
69
       </ux-table-column>
72
       </ux-table-column>
70
     </ux-grid>
73
     </ux-grid>
124
       pages: 0,
127
       pages: 0,
125
       total: 0,
128
       total: 0,
126
       page_size: 20,
129
       page_size: 20,
127
-      sort_field: 'first_day_roi',
130
+      sort_field: '',
128
       dataInfo: {},
131
       dataInfo: {},
129
       default_time: [this.$getDay(-30, false), this.$getDay(0, false)],
132
       default_time: [this.$getDay(-30, false), this.$getDay(0, false)],
130
       time: [],
133
       time: [],
137
         { prop: "user_name", label: "投手", min_width: 160 },
140
         { prop: "user_name", label: "投手", min_width: 160 },
138
         { prop: "start_date", label: "开始日期", min_width: 160 },
141
         { prop: "start_date", label: "开始日期", min_width: 160 },
139
         { prop: "end_date", label: "截止日期", min_width: 160 },
142
         { prop: "end_date", label: "截止日期", min_width: 160 },
140
-        { prop: "cost", label: "累计消耗" },
143
+        { prop: "cost", label: "累计消耗", sort: true },
141
         { prop: "pay_money", label: "累计充值" },
144
         { prop: "pay_money", label: "累计充值" },
142
         { prop: "scan_follow_total", label: "企微粉丝人数" },
145
         { prop: "scan_follow_total", label: "企微粉丝人数" },
143
         { prop: "qw_cost", label: "企微成本" },
146
         { prop: "qw_cost", label: "企微成本" },
247
           user_id: this.user_id,
250
           user_id: this.user_id,
248
           start: this.time[0],
251
           start: this.time[0],
249
           end: this.time[1],
252
           end: this.time[1],
253
+          sort_field: this.sort_field,
250
           page: type == 'export' ? 1 : this.page,
254
           page: type == 'export' ? 1 : this.page,
251
           pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
255
           pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
252
         }
256
         }
276
       this.init(val)
280
       this.init(val)
277
     },
281
     },
278
     sortFieldEvent (type) {
282
     sortFieldEvent (type) {
279
-      this.sort_field = type;
283
+      if (type === this.sort_field) { // 重复点击当前排序字段 => 重置排序字段
284
+        this.sort_field = ''
285
+      } else {
286
+        this.sort_field = type;
287
+      }
280
       this.init(1)
288
       this.init(1)
281
     },
289
     },
282
     exportEvent (data) {
290
     exportEvent (data) {