Quellcode durchsuchen

账号增加分类开关

dodo hold vor 2 Jahren
Ursprung
Commit
56541e5b0b
2 geänderte Dateien mit 73 neuen und 23 gelöschten Zeilen
  1. 7 0
      src/api/taobao.ts
  2. 66 23
      src/views/taobao/list.vue

+ 7 - 0
src/api/taobao.ts

@@ -50,7 +50,14 @@ export interface TkPoolRecord {
     end_point: string;
     api_id: number;
     enable_fake_click: boolean;
+    enable_parse: boolean;
+    enable_coupon: boolean;
 }
+
+
+
+
+
 export interface TkPoolParams extends Partial<TkPoolRecord> {
     current: number;
     pageSize: number;

+ 66 - 23
src/views/taobao/list.vue

@@ -126,23 +126,63 @@
                     </a-tag>
                 </template>
                 <template #status="{ record }">
+                    <a-tag v-if="record.status" bordered color="green" @click="changeStatus(record.id, false)">
+                        <template #icon>
+                            <icon-check />
+                        </template>
+                        在线
+                    </a-tag>
+                    <a-tag v-else bordered color="" @click="changeStatus(record.id, true)">
+                        <template #icon>
+                            <icon-stop />
+                        </template>
+                        下线
+                    </a-tag>
+                </template>
+                <template #actions="{ record }">
                     <div style="margin:5px 5px 0 0;">
-                        <a-tag v-if="record.status" bordered color="green" @click="changeStatus(record.id, false)">
-                            <icon-check-circle-fill />在线
+                        <a-tag v-if="record.enable_parse" size="mini" bordered color="red"
+                            @click="changeStatus(record.id, 'enable_parse', false)">
+                            <template #icon>
+                                <icon-check />
+                            </template>
+                            转链
                         </a-tag>
-                        <a-tag v-else bordered color="" @click="changeStatus(record.id, true)">
-                            <icon-close-circle-fill />下线
+                        <a-tag v-else size="mini" bordered color=""
+                            @click="changeAttr(record.id, 'enable_parse', true)">
+                            <template #icon>
+                                <icon-stop />
+                            </template>
+                            转链
                         </a-tag>
                     </div>
                     <div style="margin:5px 5px 0 0;">
-                        <a-tag v-if="record.enable_fake_click" bordered color="blue"
-                            @click="changeFakeClick(record.id, false)">
+                        <a-tag v-if="record.enable_coupon" size="mini" bordered color="orange"
+                            @click="changeAttr(record.id, 'enable_coupon', false)">
+                            <template #icon>
+                                <icon-check />
+                            </template>
+                            优惠券
+                        </a-tag>
+                        <a-tag v-else size="mini" bordered color=""
+                            @click="changeAttr(record.id, 'enable_coupon', true)">
                             <template #icon>
-                                <icon-check-circle-fill />
+                                <icon-stop />
+                            </template>
+                            优惠券
+                        </a-tag>
+                    </div>
+
+                    <div style="margin:5px 5px 0 0;">
+                        <a-tag v-if="record.enable_fake_click" size="mini" bordered color="blue"
+                            @click="changeAttr(record.id, 'enable_fake_click', false)">
+                            <template #icon>
+                                <icon-check />
                             </template>
                             补点击
                         </a-tag>
-                        <a-tag v-else bordered color="gray" @click="changeFakeClick(record.id, true)">
+                        <a-tag v-else size="mini" bordered color="gray"
+                            @click="changeAttr(record.id, 'enable_fake_click', true)">
                             <template #icon>
                                 <icon-stop />
                             </template>
@@ -150,6 +190,10 @@
                         </a-tag>
                     </div>
                 </template>
+                <template #time="{ record }">
+                    <div>{{ record.create_time }}</div>
+                    <div>{{ record.last_time }}</div>
+                </template>
                 <template #operations="{ record }">
                     <a-button type="text" size="small" @click="changeItem(record)">
                         更新
@@ -197,7 +241,7 @@ const formModel = ref(generateFormModel());
 const cloneColumns = ref<Column[]>([]);
 const showColumns = ref<Column[]>([]);
 
-const size = ref<SizeProps>('medium');
+const size = ref<SizeProps>('mini');
 
 const basePagination: Pagination = {
     current: 1,
@@ -238,16 +282,6 @@ const columns = computed<TableColumnData[]>(() => [
         slotName: 'name',
         width: 200,
     },
-    {
-        title: '创建时间',
-        dataIndex: 'create_time',
-        width: 180,
-    },
-    {
-        title: '最后更新',
-        dataIndex: 'last_time',
-        width: 180,
-    },
     {
         title: '每日收益限额',
         dataIndex: 'daily_income_limit',
@@ -257,7 +291,6 @@ const columns = computed<TableColumnData[]>(() => [
     {
         title: '可提现余额',
         dataIndex: 'draw_balance',
-        slotName: 'draw_balance',
         width: 120,
     },
     {
@@ -267,10 +300,20 @@ const columns = computed<TableColumnData[]>(() => [
     },
     {
         title: '状态',
-        dataIndex: 'status',
         slotName: 'status',
         width: 100,
     },
+    {
+        title: '分类',
+        slotName: 'actions',
+        width: 100,
+        align: 'right',
+    },
+    {
+        title: '时间',
+        slotName: 'time',
+        width: 170,
+    },
     {
         title: '操作',
         dataIndex: 'operations',
@@ -356,10 +399,10 @@ const changeStatus = async (id: number, val: any) => {
 };
 
 
-const changeFakeClick = async (id: number, val: any) => {
+const changeAttr = async (id: number, name: string, val: any) => {
     const args = {
         id,
-        name: 'enable_fake_click',
+        name,
         val
     } as TkUpdateAccountModel;