xia vor 4 Jahren
Ursprung
Commit
180e14069d
2 geänderte Dateien mit 10 neuen und 17 gelöschten Zeilen
  1. 6 5
      src/helper/config/range.ts
  2. 4 12
      src/views/put/put-ad-plan.vue

+ 6 - 5
src/helper/config/range.ts

@@ -1,14 +1,15 @@
 import moment from "moment";
 
 export const picker = {
-  today: [moment(), moment()],
-  week: [moment().subtract(7, "days"), moment()],
-  month: [moment().subtract(30, "days"), moment()],
-  three_month: [
+  本日: [moment(), moment()],
+  近7日: [moment().subtract(7, "d"), moment()],
+  近14日: [moment().subtract(14, "d"), moment()],
+  近30日: [moment().subtract(30, "d"), moment()],
+  上季度: [
     moment()
       .subtract(3, "month")
       .startOf("month"),
-    moment(),
+    moment().startOf("month"),
   ],
 };
 

+ 4 - 12
src/views/put/put-ad-plan.vue

@@ -36,18 +36,7 @@
         <a-range-picker
           v-model:value="pickerFilter"
           @change="switchDate"
-          :ranges="{
-            本日: [moment(), moment()],
-            近7日: [moment().subtract(7, 'd'), moment()],
-            近14日: [moment().subtract(14, 'd'), moment()],
-            近30日: [moment().subtract(30, 'd'), moment()],
-            近3月: [
-              moment()
-                .subtract(3, 'month')
-                .startOf('month'),
-              moment().startOf('month'),
-            ],
-          }"
+          :ranges="rangePick"
           format="YYYY/MM/DD"
         />
       </div>
@@ -111,6 +100,8 @@ import ToolBar from "@/components/tool-bar/index.vue";
 import PutData from "@/views/put/put-log.vue";
 import EditableCell from "@/components/edit-cell/index.vue";
 import usePagination from "@/hooks/usePagination";
+import {picker} from "@/helper/config/range";
+
 import {
   TableColumnOfPutAdPlan,
   ALLCloumnList,
@@ -151,6 +142,7 @@ const PutAdPlan = defineComponent({
       optionList: opList,
       defaultColumns: TableColumnOfPutAdPlan,
       fields: {},
+      rangePick:picker
     });
     getAddStatus().then((res) => {
       state.optionList = res.data;