Pārlūkot izejas kodu

✨ 公众号管理接口对接

晓晓晓晓丶vv 4 gadi atpakaļ
vecāks
revīzija
13d1de8ce9
2 mainītis faili ar 39 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/api/index.ts
  2. 38 0
      src/views/account/account.vue

+ 1 - 1
src/api/index.ts

@@ -73,7 +73,7 @@ export const getAdPushList = (
   return axios("/ad/accounts", { params: query });
 };
 
-/**
+/*
  * 获取公众号列表
  * @param query
  */

+ 38 - 0
src/views/account/account.vue

@@ -8,6 +8,7 @@
         <p class="label">平台</p>
         <a-select class="full-width"
                   v-model:value="query.platform">
+<<<<<<< HEAD
           <a-select-option v-for="platform in platforms"
                            :key="platform.value"
                            :value="platform.value">{{platform.label}}</a-select-option>
@@ -20,10 +21,23 @@
              :columns="columns"
              :data-source="list"
              @change="onLoadOfficials" />
+=======
+          <a-select-option value="platform1">平台1</a-select-option>
+          <a-select-option value="platform2">平台2</a-select-option>
+          <a-select-option value="platform3">平台3</a-select-option>
+        </a-select>
+      </div>
+    </tool-bar>
+    <a-table :loading="loading"
+             :pagination="tablePageOptions"
+             :columns="columns"
+             :data-source="list"></a-table>
+>>>>>>> ✨ 公众号管理接口对接
   </div>
 </template>
 
 <script lang="ts">
+<<<<<<< HEAD
 import {
   computed,
   defineComponent,
@@ -38,6 +52,12 @@ import {
 import ToolBar from "@/components/tool-bar/index.vue";
 
 import useApp from "@/hooks/useApp";
+=======
+import { defineComponent, onMounted, reactive, ref, toRefs } from "vue";
+
+import ToolBar from "@/components/tool-bar/index.vue";
+
+>>>>>>> ✨ 公众号管理接口对接
 import usePagination from "@/hooks/usePagination";
 
 import { TableColumnOfAccount } from "@/views/_pageOptions/table-account";
@@ -50,10 +70,16 @@ const Account = defineComponent({
   },
   setup() {
     let { loading, meta, tablePageOptions } = usePagination();
+<<<<<<< HEAD
     const { store } = useApp();
 
     const state = reactive({
       platforms: computed(() => store.getters.platforms),
+=======
+
+    const state = reactive({
+      platform: "platform1",
+>>>>>>> ✨ 公众号管理接口对接
       list: ref<IOfficials[]>([]),
       columns: TableColumnOfAccount,
       searching: false,
@@ -70,6 +96,7 @@ const Account = defineComponent({
       onLoadOfficials();
     };
 
+<<<<<<< HEAD
     const onLoadOfficials = (query?: { current: number }) => {
       let params = state.query;
       if (query) params.page = query.current;
@@ -77,6 +104,13 @@ const Account = defineComponent({
       getOfficialAccounts(params).then(({ data }) => {
         state.list = data.list;
         meta.value = data.meta;
+=======
+    const onLoadOfficials = () => {
+      loading.value = true;
+      getOfficialAccounts(state.query).then(({ data }) => {
+        state.list = data.list;
+        meta = data.meta;
+>>>>>>> ✨ 公众号管理接口对接
         loading.value = false;
         state.searching = false;
       });
@@ -84,6 +118,7 @@ const Account = defineComponent({
 
     onMounted(onLoadOfficials);
 
+<<<<<<< HEAD
     return {
       ...toRefs(state),
       loading,
@@ -91,6 +126,9 @@ const Account = defineComponent({
       onSearch,
       onLoadOfficials,
     };
+=======
+    return { ...toRefs(state), loading, tablePageOptions, onSearch };
+>>>>>>> ✨ 公众号管理接口对接
   },
 });