|
@@ -1,36 +1,80 @@
|
|
|
<template>
|
|
|
<div class="page-wrap page-wrap-put-books">
|
|
|
- <tool-bar :text="['account', 'user']"
|
|
|
- :label="['公众号名称', '用户名']">
|
|
|
+ <tool-bar
|
|
|
+ :text="['official_name', 'book_name']"
|
|
|
+ :label="['公众号名称', '书名']"
|
|
|
+ @confirm="onSearch"
|
|
|
+ v-model:loading="inSearching"
|
|
|
+ >
|
|
|
<template #picker>
|
|
|
<p class="label">日期</p>
|
|
|
<a-range-picker />
|
|
|
</template>
|
|
|
</tool-bar>
|
|
|
- <a-table :columns="columns"
|
|
|
- :data-source="list"
|
|
|
- :scroll="{x: 1800}"></a-table>
|
|
|
+ <a-table :columns="columns" :data-source="list" :scroll="{x: 1800}">
|
|
|
+ <template #operator="data">
|
|
|
+ <div @click="more(data)">更多</div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, reactive, toRefs } from "vue";
|
|
|
+import { defineComponent, reactive, toRefs, ref } from "vue";
|
|
|
|
|
|
import ToolBar from "@/components/tool-bar/index.vue";
|
|
|
|
|
|
import { TableColumnOfPutData } from "../_pageOptions/table-put";
|
|
|
|
|
|
+import { getDeliveryStatList } from "@/api";
|
|
|
+import usePagination from "@/hooks/usePagination";
|
|
|
+
|
|
|
+import { deliveryPlanItem, PageOptions } from "@/types/api";
|
|
|
+
|
|
|
const PutData = defineComponent({
|
|
|
components: {
|
|
|
ToolBar,
|
|
|
},
|
|
|
setup() {
|
|
|
- const data = reactive({
|
|
|
- list: [],
|
|
|
+ let { loading, meta, tablePageOptions } = usePagination();
|
|
|
+ const state = reactive({
|
|
|
+ list: ref<deliveryPlanItem[]>([]),
|
|
|
columns: TableColumnOfPutData,
|
|
|
+ inSearching: false,
|
|
|
});
|
|
|
-
|
|
|
- return { ...toRefs(data) };
|
|
|
+ const onSearch = async (fields: Record<string, string>) => {
|
|
|
+ try {
|
|
|
+ const { official_name, book_name, start_time, end_time } = fields;
|
|
|
+ const { data } = await getDeliveryStatList({
|
|
|
+ start_time,
|
|
|
+ end_time,
|
|
|
+ official_name,
|
|
|
+ book_name,
|
|
|
+ page: 1,
|
|
|
+ });
|
|
|
+ state.list = data.list;
|
|
|
+ meta.value = data.meta;
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ } finally {
|
|
|
+ console.log(state.inSearching);
|
|
|
+ state.inSearching = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ getDeliveryStatList().then((res) => {
|
|
|
+ state.list = res.data.list;
|
|
|
+ });
|
|
|
+ const handleTableChange = (pagination: PageOptions) => {
|
|
|
+ const { current, pageSize, total } = pagination;
|
|
|
+ getDeliveryStatList({ page: current }).then((res) => {
|
|
|
+ state.list = res.data.list;
|
|
|
+ meta.value = res.data.meta;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const more = () => {
|
|
|
+
|
|
|
+ };
|
|
|
+ return { ...toRefs(state), onSearch, handleTableChange, meta };
|
|
|
},
|
|
|
});
|
|
|
|