Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

浪浪 4 месяцев назад
Родитель
Сommit
31bc9a0829
2 измененных файлов с 18 добавлено и 16 удалено
  1. 14 12
      src/views/adweb/data/trafficAnalysis.vue
  2. 4 4
      src/views/adweb/site/components/GtmAdd.vue

+ 14 - 12
src/views/adweb/data/trafficAnalysis.vue

@@ -10,7 +10,7 @@
       </a-col>
       <a-col :span="8">
         <span class="t1">统计时间:</span>
-        <a-range-picker @change="onChangeDatePciker" :disabledDate="disabledDate" :value="rangeDate"
+        <a-range-picker @change="onChangeDatePicker" :disabledDate="disabledDate" :value="rangeDate"
                         style="width:70%" />
       </a-col>
       <a-col :span="10">
@@ -226,11 +226,11 @@
 <script lang="ts" name="data-trafficAnalysis" setup>
 import selectSite from "@/components/Adweb/selectSite.vue";
 import areaChart from "./chart/areaChart.vue";
-import { onMounted, reactive, ref, watch } from "vue";
+import { reactive, ref } from "vue";
 import { getAction } from "@/api/manage/manage";
-import moment from "moment";
 import MapAdweb from "@/components/chart/mapAdweb.vue";
 import "flag-icon-css/css/flag-icons.css";
+import dayjs from 'dayjs';
 
 
 const queryParam = reactive<any>({});
@@ -499,19 +499,21 @@ const getMostAccessList = async () => {
 
 const rangeDate = ref([]);
 
-const onChangeDatePciker = (date, dateString) => {
+const onChangeDatePicker = (date, dateString) => {
   if (dateString.length > 0) {
+    console.log("rangeDate:", rangeDate.value);
     rangeDate.value = date;
-    queryParam.value.start = dateString[0];
-    queryParam.value.end = dateString[1];
-    queryParam.value.dateType = undefined;
+    console.log("date:", date);
+    queryParam.start = dateString[0];
+    queryParam.end = dateString[1];
+    queryParam.dateType = undefined;
     reloadData();
   }
 };
 
 //日期选择只能今天之前
 function disabledDate(current) {
-  return current && current > moment().subtract(0, "days");
+  return current && current > dayjs();
 }
 
 const setTime = (time) => {
@@ -522,13 +524,13 @@ const setTime = (time) => {
   if (time == "") {
     rangeDate.value = undefined;
   } else if (time == "sevenDay") {
-    rangeDate.value = [moment().subtract(7, "days"), moment().subtract(1, "days")];
+    rangeDate.value = [dayjs().add(-7, 'd'), dayjs().add(-1, 'd')];
   } else if (time == "thirtyDay") {
-    rangeDate.value = [moment().subtract(30, "days"), moment().subtract(1, "days")];
+    rangeDate.value = [dayjs().add(-30, 'd'), dayjs().add(-1, 'd')];
   } else if (time == "yesterday") {
-    rangeDate.value = [moment().subtract(1, "days"), moment().subtract(1, "days")];
+    rangeDate.value = [dayjs().add(-1, 'd'), dayjs().add(-1, 'd')];
   } else if (time == "today") {
-    rangeDate.value = [moment(), moment()];
+    rangeDate.value = [dayjs(), dayjs()];
   }
 
   reloadData();

+ 4 - 4
src/views/adweb/site/components/GtmAdd.vue

@@ -24,7 +24,7 @@
           <div>
             <p style="text-align: center; font-weight: bold">系统生成的跟踪代码已添加至网站,请勿重复添加跟踪代码。</p>
           </div>
-          <a-form-item label="Gtm Head" prop="head">
+          <a-form-item label="GTM Head" prop="head">
             <a-textarea
               v-model:value="googleGtmForm.head"
               id="googleGtmHead"
@@ -33,7 +33,7 @@
               :readOnly="true"
             />
           </a-form-item>
-          <a-form-item label="Gtm Body" prop="body">
+          <a-form-item label="GTM Body" prop="body">
             <a-textarea
               v-model:value="googleGtmForm.body"
               id="googleGtmBody"
@@ -94,8 +94,8 @@
   let googleGtmForm = reactive({ head: '', body: '' });
 
   const googleGtmFormRules = reactive({
-    head: [{ required: true, message: 'Gtm Head不能为空', trigger: 'blur' }],
-    body: [{ required: true, message: 'Gtm Body不能为空', trigger: 'blur' }],
+    head: [{ required: true, message: 'GTM Head不能为空', trigger: 'blur' }],
+    body: [{ required: true, message: 'GTM Body不能为空', trigger: 'blur' }],
   });
 
   function init(record) {