diff --git a/src/config.js b/src/config.js index 345f46e..734e1ee 100644 --- a/src/config.js +++ b/src/config.js @@ -5,39 +5,6 @@ export const PROJECT_NAME = "GHHub"; export const HT_HOST = import.meta.env.PROD ? "https://p9axztuwd7x8a7.mycht.cn" :"http://202.103.68.144:890"; //"http://202.103.68.231:889"; export const DATE_FORMAT = "YYYY-MM-DD"; export const DATE_FORMAT_MONTH = "YYYY-MM"; -export const DATE_PRESETS = [ - { - label: "This Week", - value: [dayjs().startOf("w"), dayjs().endOf("w")], - }, - { - label: "Last Week", - value: [dayjs().startOf("w").subtract(7, "days"), dayjs().endOf("w").subtract(7, "days")], - }, - { - label: "This Month", - value: [dayjs().startOf("M"), dayjs().endOf("M")], - }, - { - label: "Last Month", - value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")], - }, - { - label: "Last Three Month", - value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")], - }, - { - label: "This Year", - value: [dayjs().startOf("y"), dayjs().endOf("y")], - }, - // 本月: [dayjs().startOf("month"), moment().endOf("month")], - // 上个月: [dayjs().subtract(1, "months").startOf("month"), moment(new Date()).subtract(1, "months").endOf("month")], - // 近7天: [dayjs().add(-7, "days"), dayjs()], - // 近30天: [dayjs().subtract(30, "days"), moment()], - // 近三个月: [dayjs().subtract(2, "month").startOf("month"), moment().endOf("month")], - // 今年: [dayjs().startOf("year"), moment().endOf("year")], - // 去年: [dayjs().subtract(1, "year").startOf("year"), moment().subtract(1, "year").endOf("year")], -]; export const arrManager = ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];//特定账号加修改所属供应商的菜单 zp const __BUILD_VERSION__ = `__BUILD_VERSION__`.replace(/"/g, '') diff --git a/src/views/feedback/Index.jsx b/src/views/feedback/Index.jsx index ecb1e4b..8d88b94 100644 --- a/src/views/feedback/Index.jsx +++ b/src/views/feedback/Index.jsx @@ -5,6 +5,7 @@ import { toJS } from "mobx"; import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, App } from "antd"; import { useStore } from "@/stores/StoreContext.js"; import * as config from "@/config"; +import usePresets from '@/hooks/usePresets'; const { Title } = Typography; const feedbackListColumns = [ @@ -80,7 +81,7 @@ function Index() { allowClear={false} style={{ width: "100%" }} value={[search_date_start, search_date_end]} - presets={config.DATE_PRESETS} + presets={usePresets()} onChange={feedbackStore.onDateRangeChange} /> diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index 22a3822..0b8b29a 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -7,6 +7,7 @@ import { useStore } from "@/stores/StoreContext.js"; import * as config from "@/config"; import { formatDate, isNotEmpty } from "@/utils/commons"; import { AuditOutlined, SmileOutlined, SolutionOutlined, EditOutlined } from "@ant-design/icons"; +import usePresets from '@/hooks/usePresets'; const { Title } = Typography; @@ -124,7 +125,7 @@ function Index() {