Bladeren bron

refactor(arrivalStats): streamline button actions and update stock search parameters

- Simplified button action methods in the arrival statistics view for better readability and consistency.
- Updated stock search parameters to use more descriptive keys for minimum and maximum stock values.
- Enhanced the toolbar layout by consolidating button definitions and improving placeholder text for stock inputs.
ylong 1 week geleden
bovenliggende
commit
11939efbe4

+ 47 - 0
src/views/data/arrivalStats/components/arrival-dialogs.vue

@@ -0,0 +1,47 @@
+<template>
+    <set-params ref="paramsRef" @refresh="emit('refresh')" />
+    <add-discount ref="discountRef" @refresh="emit('refresh')" />
+    <orderRecycleLog ref="recycleLogRef" />
+    <orderSalesLog ref="salesLogRef" />
+    <modifyOrderRecycle ref="orderRecycleRef" @refresh="emit('refresh')" />
+    <modifyMaxRecycle ref="maxRecycleRef" @refresh="emit('refresh')" />
+    <modifyDiscount ref="modifyDiscountRef" @refresh="emit('refresh')" />
+    <orderBlacklist ref="blacklistRef" @refresh="emit('refresh')" />
+    <subscribe-detail ref="detailRef" />
+</template>
+
+<script setup>
+    import { ref } from 'vue';
+    import setParams from '@/views/recycle/components/set-params.vue';
+    import addDiscount from '@/views/recycle/components/add-discount.vue';
+    import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
+    import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
+    import modifyOrderRecycle from '@/views/recycle/components/modify-order-recycle.vue';
+    import modifyMaxRecycle from '@/views/recycle/components/modify-max-recycle.vue';
+    import modifyDiscount from '@/views/recycle/components/modify-discount.vue';
+    import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
+    import subscribeDetail from '@/views/data/arrivalStats/components/subscribe-detail.vue';
+
+    const emit = defineEmits(['refresh']);
+    const paramsRef = ref(null);
+    const discountRef = ref(null);
+    const recycleLogRef = ref(null);
+    const salesLogRef = ref(null);
+    const orderRecycleRef = ref(null);
+    const maxRecycleRef = ref(null);
+    const modifyDiscountRef = ref(null);
+    const blacklistRef = ref(null);
+    const detailRef = ref(null);
+
+    defineExpose({
+        openDetail: (row) => detailRef.value?.handleOpen(row),
+        openDiscount: (row) => modifyDiscountRef.value?.handleOpen(row),
+        openBlacklist: (isbnList) => blacklistRef.value?.handleOpen(isbnList),
+        openMax: (row) => maxRecycleRef.value?.handleOpen(row),
+        openOrder: (row) => orderRecycleRef.value?.handleOpen(row),
+        openRecycleLog: (row) => recycleLogRef.value?.handleOpen(row),
+        openSalesLog: (row) => salesLogRef.value?.handleOpen(row),
+        openAddDiscount: (data) => discountRef.value?.handleOpen(data),
+        openParams: (row) => paramsRef.value?.handleOpen(row)
+    });
+</script>

+ 79 - 0
src/views/data/arrivalStats/components/handlers.js

@@ -0,0 +1,79 @@
+let pageRef;
+let dialogsRef;
+let reloadFn;
+
+export function initArrivalHandlers(page, dialogs, reload) {
+    pageRef = page;
+    dialogsRef = dialogs;
+    reloadFn = reload;
+}
+
+function isbns(row) {
+    const selections = row ? [row] : pageRef.value?.getSelections();
+    if (!selections || !selections.length) {
+        ElMessage.warning('请选择要操作的图书');
+        return null;
+    }
+    return selections.map((item) => item.isbn);
+}
+
+export function onDiscount(row) {
+    dialogsRef.value?.openDiscount(row);
+}
+export function onBlacklist(row) {
+    const list = row?.isbn ? [row.isbn] : isbns();
+    if (list) dialogsRef.value?.openBlacklist(list);
+}
+export function onMax(row) {
+    dialogsRef.value?.openMax(row);
+}
+export function onOrder(row) {
+    dialogsRef.value?.openOrder(row);
+}
+export function onRecycleLog(row) {
+    dialogsRef.value?.openRecycleLog(row);
+}
+export function onSalesLog(row) {
+    dialogsRef.value?.openSalesLog(row);
+}
+export function onRecycle(row, status) {
+    const list = isbns(row);
+    if (!list) return;
+    const stop = status === 2;
+    pageRef.value?.operatBatch({
+        title: stop ? '确认暂停回收?' : '确认开启回收?',
+        method: 'post',
+        url: stop
+            ? '/book/bookRecycleInfo/stopRecycle'
+            : '/book/bookRecycleInfo/openRecycle',
+        data: { isbnList: list },
+        row,
+        success: () => reloadFn()
+    });
+}
+export function onRemove(row) {
+    const list = isbns(row);
+    if (!list) return;
+    pageRef.value?.operatBatch({
+        title: '确认移除回收书单?',
+        method: 'post',
+        url: '/book/bookRecycleInfo/removeOut',
+        data: { isbnList: list },
+        row,
+        success: () => reloadFn()
+    });
+}
+export function onType(type) {
+    const list = isbns();
+    if (!list) return;
+    pageRef.value?.operatBatch({
+        title: type == 1 ? '确认加社科库?' : '确认加教材库?',
+        method: 'post',
+        url:
+            type == 1
+                ? '/book/bookRecycleInfo/changeBookTag2'
+                : '/book/bookRecycleInfo/changeBookTag1',
+        data: { isbnList: list },
+        success: () => reloadFn()
+    });
+}

+ 10 - 8
src/views/data/arrivalStats/components/page-search.vue

@@ -23,15 +23,15 @@
             type: 'inputNumberRange',
             label: '库存',
             prop: 'stock',
-            keys: ['minStock', 'maxStock'],
+            keys: ['minStockNum', 'maxStockNum'],
             props: {
-                minAttrs: { min: 0 },
-                maxAttrs: { max: 10 },
+                minAttrs: { min: 0, placeholder: '最小库存' },
+                maxAttrs: { placeholder: '最大库存' },
                 label: '库存',
                 onChange: (val) => {
                     searchRef.value?.setData({
-                        minStock: val.min,
-                        maxStock: val.max
+                        minStockNum: val.min,
+                        maxStockNum: val.max
                     });
                 }
             }
@@ -41,13 +41,15 @@
     const initKeys = reactive({
         bookName: '',
         isbn: '',
-        minStock: void 0,
-        maxStock: void 0
+        minStockNum: void 0,
+        maxStockNum: void 0
     });
 
     const searchRef = ref(null);
     /** 搜索 */
     const search = (data) => {
-        emit('search', data);
+        const params = { ...data };
+        delete params.stock;
+        emit('search', params);
     };
 </script>

+ 78 - 0
src/views/data/arrivalStats/components/row-actions.vue

@@ -0,0 +1,78 @@
+<template>
+    <div class="grid grid-cols-2 gap-2 book-btns">
+        <el-button
+            color="#7728f5"
+            v-permission="'recycle:independent:updateDiscount'"
+            @click="emit('discount', row)"
+        >
+            修改回收折扣
+        </el-button>
+        <el-button
+            color="#333333"
+            v-permission="'recycle:independent:addBlacklist'"
+            @click="emit('blacklist', row)"
+        >
+            加入黑名单
+        </el-button>
+        <el-button
+            color="#3ab54a"
+            v-permission="'recycle:independent:updateMaxRecycle'"
+            @click="emit('max', row)"
+        >
+            修改最大回收量
+        </el-button>
+        <el-button
+            color="#bd3124"
+            v-permission="'recycle:independent:pauseRecycle'"
+            v-if="row.recycleStatus == 1"
+            @click="emit('recycle', row, 2)"
+        >
+            暂停回收
+        </el-button>
+        <el-button
+            color="#bd3124"
+            v-permission="'recycle:independent:startRecycle'"
+            v-else
+            @click="emit('recycle', row, 1)"
+        >
+            开启回收
+        </el-button>
+        <el-button
+            color="#e99d42"
+            v-permission="'recycle:independent:updateOrderRecycle'"
+            @click="emit('order', row)"
+        >
+            修改订单回收量
+        </el-button>
+        <el-button
+            color="#4095e5"
+            v-permission="'recycle:independent:removeBooklist'"
+            @click="emit('remove', row)"
+        >
+            移除回收书单
+        </el-button>
+    </div>
+</template>
+<script setup>
+    defineProps({ row: { type: Object, default: () => ({}) } });
+    const emit = defineEmits([
+        'discount',
+        'blacklist',
+        'max',
+        'recycle',
+        'order',
+        'remove'
+    ]);
+</script>
+<style lang="scss" scoped>
+    .book-btns {
+        gap: 6px;
+        .el-button {
+            min-width: 100px;
+            font-size: 12px;
+            color: #ffffff;
+            padding: 4px 6px;
+            margin-right: 0;
+        }
+    }
+</style>

+ 107 - 0
src/views/data/arrivalStats/components/subscribe-detail.vue

@@ -0,0 +1,107 @@
+<template>
+    <ele-modal v-model="visible" :width="920" :title="title">
+        <el-table v-loading="loading" :data="rows" border max-height="480">
+            <el-table-column
+                prop="userId"
+                label="用户ID"
+                min-width="140"
+                align="center"
+            />
+            <el-table-column
+                prop="nickName"
+                label="昵称"
+                min-width="140"
+                align="center"
+                show-overflow-tooltip
+            />
+            <el-table-column
+                prop="bookName"
+                label="书名"
+                min-width="200"
+                show-overflow-tooltip
+            />
+            <el-table-column
+                prop="isbn"
+                label="ISBN"
+                min-width="150"
+                align="center"
+            />
+            <el-table-column
+                prop="subscribeTime"
+                label="订阅时间"
+                min-width="180"
+                align="center"
+                :formatter="(row) => formatTime(row.subscribeTime)"
+            />
+        </el-table>
+        <div class="detail-total">共 {{ total }} 条</div>
+        <template #footer>
+            <el-button @click="visible = false">关闭</el-button>
+        </template>
+    </ele-modal>
+</template>
+
+<script setup>
+    import { computed, ref } from 'vue';
+    import { dayjs } from 'element-plus';
+    import { EleMessage } from 'ele-admin-plus/es';
+    import request from '@/utils/request';
+
+    const visible = ref(false);
+    const loading = ref(false);
+    const rows = ref([]);
+    const total = ref(0);
+    const bookName = ref('');
+
+    const title = computed(() =>
+        bookName.value ? `订阅明细 - ${bookName.value}` : '订阅明细'
+    );
+
+    function formatTime(value) {
+        if (!value) {
+            return '-';
+        }
+        const date = dayjs(value);
+        return date.isValid() ? date.format('YYYY-MM-DD HH:mm:ss') : value;
+    }
+
+    async function handleOpen(row) {
+        if (!row?.isbn) {
+            EleMessage.warning('缺少 ISBN,无法查看订阅明细');
+            return;
+        }
+        visible.value = true;
+        bookName.value = row.bookName || '';
+        rows.value = [];
+        total.value = 0;
+        loading.value = true;
+        try {
+            const res = await request.get(
+                '/shop/shopNoticeArrival/detailPage',
+                {
+                    params: { isbn: row.isbn }
+                }
+            );
+            if (res.data.code !== 200) {
+                EleMessage.error(res.data.msg || '订阅明细加载失败');
+                return;
+            }
+            rows.value = res.data.rows || [];
+            total.value = res.data.total || 0;
+        } catch (error) {
+            EleMessage.error(error.message || '订阅明细加载失败');
+        } finally {
+            loading.value = false;
+        }
+    }
+
+    defineExpose({ handleOpen });
+</script>
+
+<style scoped>
+    .detail-total {
+        margin-top: 12px;
+        color: var(--el-text-color-secondary);
+        text-align: right;
+    }
+</style>

+ 88 - 298
src/views/data/arrivalStats/index.vue

@@ -6,73 +6,28 @@
             ref="pageRef"
             :pageConfig="pageConfig"
             :columns="columns"
+            :datasource="datasource"
             :tools="false"
         >
             <template #toolbar>
-                <el-radio-group
-                    @change="handleStatusChange"
-                    v-model="searchType"
-                >
+                <el-radio-group @change="handleStatusChange" v-model="searchType">
                     <el-radio-button label="全部" value="0" />
-                    <el-radio-button
-                        label="已加入回收书单(正在回收)"
-                        value="1"
-                    />
-                    <el-radio-button
-                        label="已加入回收书单(暂停回收)"
-                        value="2"
-                    />
+                    <el-radio-button label="已加入回收书单(正在回收)" value="1" />
+                    <el-radio-button label="已加入回收书单(暂停回收)" value="2" />
                 </el-radio-group>
-
                 <span class="ml-8"></span>
-                <el-button
-                    type="danger"
-                    plain
-                    v-permission="'recycle:independent:batchAddBlacklist'"
-                    @click="handleOptBlacklist()"
-                >
-                    加黑名单
-                </el-button>
-                <el-button
-                    type="warning"
-                    plain
-                    v-permission="'recycle:independent:batchPauseRecycle'"
-                    @click="handleOptRecycle(null, 2)"
-                >
-                    暂停回收
-                </el-button>
-                <el-button
-                    type="warning"
-                    plain
-                    v-permission="'recycle:independent:batchStartRecycle'"
-                    @click="handleOptRecycle(null, 1)"
-                >
-                    开启回收
-                </el-button>
-                <el-button
-                    type="success"
-                    plain
-                    v-permission="'recycle:independent:batchAddSocial'"
-                    @click="handleOptType(1)"
-                >
-                    加社科库
-                </el-button>
-                <el-button
-                    type="primary"
-                    plain
-                    v-permission="'recycle:independent:batchAddTeach'"
-                    @click="handleOptType(2)"
-                >
-                    加教材库
-                </el-button>
+                <el-button type="danger" plain v-permission="'recycle:independent:batchAddBlacklist'" @click="onBlacklist()">加黑名单</el-button>
+                <el-button type="warning" plain v-permission="'recycle:independent:batchPauseRecycle'" @click="onRecycle(null, 2)">暂停回收</el-button>
+                <el-button type="warning" plain v-permission="'recycle:independent:batchStartRecycle'" @click="onRecycle(null, 1)">开启回收</el-button>
+                <el-button type="success" plain v-permission="'recycle:independent:batchAddSocial'" @click="onType(1)">加社科库</el-button>
+                <el-button type="primary" plain v-permission="'recycle:independent:batchAddTeach'" @click="onType(2)">加教材库</el-button>
             </template>
-
             <template #cover="{ row }">
                 <el-image
                     style="width: 90px; height: 120px; border-radius: 4px"
                     fit="cover"
                     :src="row.cover"
-                    :preview-src-list="[row.cover]"
+                    :preview-src-list="row.cover ? [row.cover] : []"
                     :initial-index="0"
                     preview-teleported
                 />
@@ -80,8 +35,10 @@
             <template #baseInfo="{ row }">
                 <book-info :row="row" @refresh="reload" />
             </template>
-            <template #stock="{ row }">
-                <book-stock :row="row" />
+            <template #subscribeNum="{ row }">
+                <el-link type="primary" @click="handleDetail(row)">
+                    {{ row.subscribeNum ?? 0 }}
+                </el-link>
             </template>
             <template #view="{ row }">
                 <div class="grid grid-cols-2 gap-2 book-btns">
@@ -94,7 +51,7 @@
                     </el-button>
                     <el-button
                         color="#e99d42"
-                        @click="handleRecycleLog(row)"
+                        @click="onRecycleLog(row)"
                         v-permission="'recycle:independent:viewRecycleLog'"
                     >
                         回收日志
@@ -106,18 +63,10 @@
                     >
                         查看淘宝
                     </el-button>
-                    <el-button
-                        color="#0f7dc7"
-                        @click="handleSalesLog(row)"
-                        v-permission="'recycle:independent:viewSalesLog'"
-                    >
+                    <el-button color="#0f7dc7" v-permission="'recycle:independent:viewSalesLog'" @click="onSalesLog(row)">
                         售价日志
                     </el-button>
-                    <el-button
-                        color="#399420"
-                        @click="handleViewUrl(row, 'db')"
-                        v-permission="'recycle:independent:viewUrl'"
-                    >
+                    <el-button color="#399420" @click="handleViewUrl(row, 'db')">
                         查看豆瓣
                     </el-button>
                     <el-button
@@ -129,98 +78,39 @@
                     </el-button>
                 </div>
             </template>
-
             <template #action="{ row }">
-                <div class="grid grid-cols-2 gap-2 book-btns">
-                    <el-button
-                        color="#7728f5"
-                        v-permission="'recycle:independent:updateDiscount'"
-                        @click="handleModifyDiscount(row)"
-                    >
-                        修改回收折扣
-                    </el-button>
-                    <el-button
-                        color="#333333"
-                        v-permission="'recycle:independent:addBlacklist'"
-                        @click="handleOptBlacklist(row)"
-                    >
-                        加入黑名单
-                    </el-button>
-                    <el-button
-                        color="#3ab54a"
-                        v-permission="'recycle:independent:updateMaxRecycle'"
-                        @click="handleModifyMaxRecycle(row)"
-                    >
-                        修改最大回收量
-                    </el-button>
-                    <el-button
-                        color="#bd3124"
-                        v-permission="'recycle:independent:pauseRecycle'"
-                        @click="handleOptRecycle(row, 2)"
-                        v-if="row.recycleStatus == 1"
-                    >
-                        暂停回收
-                    </el-button>
-                    <el-button
-                        color="#bd3124"
-                        v-permission="'recycle:independent:startRecycle'"
-                        @click="handleOptRecycle(row, 1)"
-                        v-else
-                    >
-                        开启回收
-                    </el-button>
-                    <el-button
-                        color="#e99d42"
-                        v-permission="'recycle:independent:updateOrderRecycle'"
-                        @click="handleModifyOrderRecycle(row)"
-                    >
-                        修改订单回收量
-                    </el-button>
-                    <el-button
-                        color="#4095e5"
-                        v-permission="'recycle:independent:removeBooklist'"
-                        @click="handleOptBooklist(row)"
-                    >
-                        移除回收书单
-                    </el-button>
-                </div>
+                <row-actions :row="row" @discount="onDiscount" @blacklist="onBlacklist" @max="onMax" @recycle="onRecycle" @order="onOrder" @remove="onRemove" />
             </template>
         </common-table>
 
-        <set-params ref="paramsRef" @refresh="reload" />
-        <add-discount ref="discountRef" @refresh="reload" />
-        <orderRecycleLog ref="recycleLogRef" />
-        <orderSalesLog ref="salesLogRef" />
-        <modifyOrderRecycle ref="orderRecycleRef" @refresh="reload" />
-        <modifyMaxRecycle ref="maxRecycleRef" @refresh="reload" />
-        <modifyDiscount ref="modifyDiscountRef" @refresh="reload" />
-        <orderBlacklist ref="blacklistRef" @refresh="reload" />
+        <arrival-dialogs ref="dialogsRef" @refresh="reload" />
     </ele-page>
 </template>
 
 <script setup>
     import { ref, reactive } from 'vue';
+    import { dayjs } from 'element-plus';
     import CommonTable from '@/components/CommonPage/CommonTable.vue';
     import bookSearch from '@/views/data/arrivalStats/components/page-search.vue';
     import bookInfo from '@/views/recycle/components/book-info.vue';
-    import bookStock from '@/views/recycle/components/book-stock.vue';
-    import setParams from '@/views/recycle/components/set-params.vue';
-    import addDiscount from '@/views/recycle/components/add-discount.vue';
-    import orderRecycleLog from '@/views/recycleOrder/detail/order-recycle-log.vue';
-    import orderSalesLog from '@/views/recycleOrder/detail/order-sales-log.vue';
-    import modifyOrderRecycle from '@/views/recycle/components/modify-order-recycle.vue';
-    import modifyMaxRecycle from '@/views/recycle/components/modify-max-recycle.vue';
-    import modifyDiscount from '@/views/recycle/components/modify-discount.vue';
-    import orderBlacklist from '@/views/recycleOrder/detail/order-blacklist.vue';
+    import rowActions from './components/row-actions.vue';
+    import arrivalDialogs from './components/arrival-dialogs.vue';
+    import { initArrivalHandlers, onDiscount, onBlacklist, onMax, onOrder, onRecycle, onRemove, onRecycleLog, onSalesLog, onType } from './components/handlers.js';
+    import request from '@/utils/request';
 
-    defineOptions({ name: 'IndependentParameter' });
+    defineOptions({ name: 'ArrivalStats' });
 
     const searchType = ref('0');
-    const blacklistRef = ref(null);
-    function handleStatusChange(value) {
-        searchType.value = value;
-        pageConfig.params.searchType = value;
-        pageRef.value.reload();
+    const pageRef = ref(null);
+    const dialogsRef = ref(null);
+    initArrivalHandlers(pageRef, dialogsRef, () => pageRef.value?.reload());
+
+    function formatTime(value) {
+        if (!value) {
+            return '-';
+        }
+        const date = dayjs(value);
+        return date.isValid() ? date.format('YYYY-MM-DD HH:mm:ss') : value;
     }
 
     /** 表格列配置 */
@@ -236,27 +126,38 @@
             label: '图片',
             prop: 'cover',
             width: 120,
-            slot: 'cover'
+            slot: 'cover',
+            align: 'center'
         },
         {
             label: '信息',
             prop: 'baseInfo',
-            width: 500,
+            minWidth: 480,
             slot: 'baseInfo'
         },
         {
             label: '订阅次数',
-            prop: 'recyclePrice',
+            prop: 'subscribeNum',
+            slot: 'subscribeNum',
             sortable: true,
-            columnKey: '5',
-            minWidth: 100
+            columnKey: 'subscribeNum',
+            minWidth: 120,
+            align: 'center'
         },
         {
-            label: '最后一次订阅时间',
-            minWidth: 120,
+            label: '最大回收量',
             prop: 'recycleMax',
+            minWidth: 110,
+            align: 'center'
+        },
+        {
+            label: '最近一次订阅时间',
+            prop: 'lastSubscribeTime',
             sortable: true,
-            columnKey: '6'
+            columnKey: 'lastSubscribeTime',
+            minWidth: 180,
+            align: 'center',
+            formatter: (row) => formatTime(row.lastSubscribeTime)
         },
         {
             label: '查看',
@@ -274,112 +175,54 @@
         }
     ]);
 
-    /** 页面组件实例 */
-    const pageRef = ref(null);
-
     const pageConfig = reactive({
-        pageUrl: '/book/bookRecycleInfo/sepSet/pageList',
+        pageUrl: '/shop/shopNoticeArrival/statPage',
         fileName: '到货提醒统计',
         cacheKey: 'arrivalStatsTable',
         rowKey: 'isbn',
-        params: {
-            searchType: '0'
-        }
+        params: { searchType: '0' }
     });
 
-    //刷新表格
-    function reload(where) {
-        pageRef.value?.reload(where);
-    }
-
-    //设置参数
-    const paramsRef = ref(null);
-    function handleSetParams(row) {
-        paramsRef.value?.handleOpen(row);
-    }
-
-    //黑名单操作
-    function handleOptBlacklist(row) {
-        let selections = row ? [row] : pageRef.value?.getSelections();
-        if (!selections || selections.length === 0) {
-            ElMessage.warning('请选择要操作的图书');
-            return;
+    const datasource = ({ pages, where, orders, sorter }) => {
+        const pageNum = Number(pages?.pageNum || 1);
+        const pageSize = Number(pages?.pageSize || 10);
+        const params = {
+            ...(pageConfig.params || {}),
+            ...where,
+            offset: (pageNum - 1) * pageSize,
+            limitSize: pageSize
+        };
+
+        if (orders?.orderByColumn) {
+            params.orderType = sorter?.column?.columnKey || orders.orderByColumn;
+            params.orderWay = orders.isAsc === 'ascending' ? 'asc' : 'desc';
         }
 
-        const isbnList = selections.map((item) => item.isbn);
-        // 加入黑名单,打开选择原因弹窗
-        blacklistRef.value?.handleOpen(isbnList);
-    }
-
-    //回收操作
-    function handleOptRecycle(row, status) {
-        let selections = row ? [row] : pageRef.value?.getSelections();
-        if (!selections || selections.length === 0) {
-            ElMessage.warning('请选择要操作的图书');
-            return;
-        }
-
-        const isbnList = selections.map((item) => item.isbn);
-        const isStop = status === 2;
-
-        const url = isStop
-            ? '/book/bookRecycleInfo/stopRecycle'
-            : '/book/bookRecycleInfo/openRecycle';
-
-        const title = isStop ? '确认暂停回收?' : '确认开启回收?';
+        return request
+            .get('/shop/shopNoticeArrival/statPage', { params })
+            .then((res) => {
+                if (res.data.code === 200) {
+                    return res.data;
+                }
+                return Promise.reject(new Error(res.data.msg));
+            });
+    };
 
-        pageRef.value?.operatBatch({
-            title,
-            method: 'post',
-            url,
-            data: { isbnList },
-            row,
-            success: () => {
-                reload();
-            }
-        });
+    
+    function handleStatusChange(value) {
+        searchType.value = value;
+        pageConfig.params.searchType = value;
+        pageRef.value?.reload();
     }
 
-    //类型操作
-    function handleOptType(type) {
-        let selections = pageRef.value?.getSelections();
-        if (!selections || selections.length === 0) {
-            ElMessage.warning('请选择要操作的图书');
-            return;
-        }
-
-        const isbnList = selections.map((item) => item.isbn);
-        const url =
-            type == 1
-                ? '/book/bookRecycleInfo/changeBookTag2'
-                : '/book/bookRecycleInfo/changeBookTag1';
-        const title = type == 1 ? '确认加社科库?' : '确认加教材库?';
-
-        pageRef.value?.operatBatch({
-            title,
-            method: 'post',
-            url,
-            data: { isbnList },
-            success: () => {
-                reload();
-            }
-        });
+    function reload(where) {
+        pageRef.value?.reload(where);
     }
 
-    //指定折扣
-    const discountRef = ref(null);
-    function handleAddDiscount() {
-        let selections = pageRef.value?.getSelections();
-        if (!selections || selections.length === 0) {
-            ElMessage.warning('请选择要操作的图书');
-            return;
-        }
-
-        const isbnList = selections.map((item) => item.isbn);
-        discountRef.value?.handleOpen({ isbnList });
+    function handleDetail(row) {
+        dialogsRef.value?.openDetail(row);
     }
 
-    //查看当当、淘宝、豆瓣链接
     const handleViewUrl = (row, type) => {
         let url = '';
         if (type == 'dd') {
@@ -393,61 +236,8 @@
         }
         window.open(url, '_blank');
     };
-
-    //查看回收日志
-    const recycleLogRef = ref();
-    const handleRecycleLog = (row) => {
-        recycleLogRef.value?.handleOpen(row);
-    };
-
-    //移除回收书单操作
-    function handleOptBooklist(row) {
-        let selections = row ? [row] : pageRef.value?.getSelections();
-        if (!selections || selections.length === 0) {
-            ElMessage.warning('请选择要操作的图书');
-            return;
-        }
-
-        const isbnList = selections.map((item) => item.isbn);
-        const url = '/book/bookRecycleInfo/removeOut';
-        const title = '确认移除回收书单?';
-
-        pageRef.value?.operatBatch({
-            title,
-            method: 'post',
-            url,
-            data: { isbnList },
-            row,
-            success: () => {
-                reload();
-            }
-        });
-    }
-
-    //查看售价日志
-    const salesLogRef = ref();
-    const handleSalesLog = (row) => {
-        salesLogRef.value?.handleOpen(row);
-    };
-
-    //修改订单回收量
-    const orderRecycleRef = ref();
-    const handleModifyOrderRecycle = (row) => {
-        orderRecycleRef.value?.handleOpen(row);
-    };
-
-    //修改最大回收量
-    const maxRecycleRef = ref();
-    const handleModifyMaxRecycle = (row) => {
-        maxRecycleRef.value?.handleOpen(row);
-    };
-
-    //修改回收折扣
-    const modifyDiscountRef = ref();
-    const handleModifyDiscount = (row) => {
-        modifyDiscountRef.value?.handleOpen(row);
-    };
 </script>
+
 <style lang="scss" scoped>
     .book-btns {
         gap: 6px;