chenrui  2 年之前
父節點
當前提交
9a639d0ab5
共有 2 個文件被更改,包括 15 次插入17 次删除
  1. 1 1
      src/api/statistics/statistics.js
  2. 14 16
      src/views/securityCheck/components/securityCheckHeader.vue

+ 1 - 1
src/api/statistics/statistics.js

@@ -4,7 +4,7 @@ import request from '@/utils/request'
 export function correlation(query) {
   return request({
     url: '/risk/report/securityCheck',
-    method: 'get',
+    method: 'POST',
     params: query
   })
 }

+ 14 - 16
src/views/securityCheck/components/securityCheckHeader.vue

@@ -21,9 +21,9 @@
         </a-form-item>
       </template>
       <template v-if="withDatePicker">
-        <a-form-item prop="startDate" style="margin-right: 8px">
+        <a-form-item prop="beginDate" style="margin-right: 8px">
           <a-date-picker
-            v-model="formData.startDate"
+            v-model="formData.beginDate"
             type="date"
             size="small"
             format="YYYY-MM-DD"
@@ -42,11 +42,7 @@
           class="radio-wrapper"
           style="margin-right: 36px"
         >
-          <a-radio-group
-            v-model="formData.dateRangeRadio"
-            size="small"
-            @change="changes(formData.dateRangeRadio)"
-          >
+          <a-radio-group v-model="formData.dateRangeRadio" size="small">
             <a-radio-button
               value="当日"
               :class="formData.dateRangeRadio == '当日' ? 'btn-mo' : 'btn-mos'"
@@ -69,7 +65,7 @@
       </template>
       <template v-if="withSelect">
         <a-form-item prop="selection" style="margin-right: 16px">
-          <a-select :default-value="optionLists[0]">
+          <a-select :default-value="optionLists[0]" @change="handleChange">
             <a-select-option v-for="province in optionLists" :key="province">
               {{ province }}
             </a-select-option>
@@ -176,14 +172,14 @@ export default {
   data() {
     return {
       changeButtonLoading: false,
+      optionLists: ["低风险", "优先", "普通", "高风险", "严控"],
       formData: {
-        startDate: "",
+        beginDate: "",
         endDate: "",
         dateRangeRadio: "",
         selection: "",
         searchText: "",
       },
-      optionLists: ["全部代理人等级"],
       optionList: [],
       inputList: [
         {
@@ -222,24 +218,25 @@ export default {
         const date = now.getDate();
         switch (val) {
           case "当日":
-            this.formData.startDate =
+            this.formData.beginDate =
               this.formData.endDate = `${year}-${formatNumber(
                 month
               )}-${formatNumber(date)}`;
             break;
           case "当月":
-            this.formData.startDate = `${year}-${formatNumber(month)}-01`;
+            this.formData.beginDate = `${year}-${formatNumber(month)}-01`;
             this.formData.endDate = `${year}-${formatNumber(
               month
             )}-${getLastDayOfMonth(year, month)}`;
             break;
           case "当年":
-            this.formData.startDate = `${year}-01-01`;
+            this.formData.beginDate = `${year}-01-01`;
             this.formData.endDate = `${year}-12-31`;
             break;
           default:
             break;
         }
+        this.search();
       },
     },
     selectOptions: {
@@ -262,11 +259,12 @@ export default {
     },
   },
   mounted() {
+    this.formData.selection = this.optionLists[0];
     this.formData.dateRangeRadio = "当日";
   },
   methods: {
-    changes(data) {
-      console.log(data);
+    handleChange(data) {
+      this.formData.selection = data;
     },
     change() {
       this.changeButtonLoading = true;
@@ -287,7 +285,7 @@ export default {
     search() {
       const searchArray = [];
       this.withDatePicker &&
-        searchArray.push([this.formData.startDate, this.formData.endDate]);
+        searchArray.push([this.formData.beginDate, this.formData.endDate]);
       this.withSelect && searchArray.push(this.formData.selection);
       this.withInput && searchArray.push(this.formData.searchText);
       this.$emit("search", searchArray);