diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index 588d710..e0d4796 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -17,8 +17,10 @@ const formInline = ref({ date: [], policeId: "", event: "", - violation: "" + violation: "", + violationType: "" }); + const currentPage = ref(1); const totalNumber = ref(0); const pageSize = ref(10); @@ -68,6 +70,7 @@ function onSearch() { police_id: formInline.value.policeId || undefined, event_type: formInline.value.event || undefined, violation: violationMap.value[formInline.value.violation] || undefined, + violation_type: formInline.value.violationType || undefined, page: currentPage.value || undefined, page_size: pageSize.value || undefined }, @@ -132,7 +135,7 @@ function getEvents() { }) .then(response => { eventMap.value = response.data.data; - console.log(eventMap.value); + // console.log(eventMap.value); }) .catch(error => { // console.log("请求失败"); @@ -141,6 +144,14 @@ function getEvents() { } +function pickerOptions(time){ + return time.getTime() > Date.now() +} + +const now_date = new Date(); +now_date.setMonth(now_date.getMonth() - 1) +const lastMonth = now_date + onMounted(() => { onSearch(); }); @@ -166,15 +177,18 @@ onMounted(() => { start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" + :disabled-date="pickerOptions" + :default-value="lastMonth" /> - + + - + @@ -185,6 +199,10 @@ onMounted(() => { + + + + 查询 @@ -205,7 +223,7 @@ onMounted(() => { > - +