Skip to content

Commit f15c78e

Browse files
committed
feat: 新增二手房交易月历
1 parent 69adfd7 commit f15c78e

File tree

9 files changed

+308
-22
lines changed

9 files changed

+308
-22
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@
4545
},
4646
"dependencies": {
4747
"@element-plus/icons-vue": "^2.3.1",
48+
"@fullcalendar/core": "^6.1.15",
49+
"@fullcalendar/daygrid": "^6.1.15",
50+
"@fullcalendar/interaction": "^6.1.15",
51+
"@fullcalendar/vue3": "^6.1.15",
4852
"@howbizarre/vue-month-calendar": "^1.4.5",
4953
"@vueuse/core": "^10.11.0",
5054
"@wangeditor/editor": "^5.1.23",
5155
"@wangeditor/editor-for-vue": "5.1.10",
5256
"animate.css": "^4.1.1",
5357
"axios": "^1.7.2",
5458
"color": "^4.2.3",
59+
"date-fns": "^3.6.0",
5560
"echarts": "^5.5.1",
5661
"element-plus": "^2.7.6",
5762
"exceljs": "^4.4.0",

src/api/house/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import request from "@/utils/request";
22
import { ChartHouseDataVO, ChartHouseDataList } from "./model";
3+
import { format } from "date-fns";
34

45
class HouseAPI {
56
/**
67
* 获取房源数据
78
*
89
* @param dataType
910
*/
10-
static getHouseData(dataType: number) {
11+
static getHouseData(dataType: number, dataDate: Date) {
1112
return request<any, ChartHouseDataVO>({
12-
url: "/house/" + dataType,
13+
url: "/house/" + format(dataDate, "yyyy-MM-dd") + "/" + dataType,
1314
method: "get",
1415
});
1516
}

src/views/house/newarea/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const chartComponent = (item: string) => {
4040
return defineAsyncComponent(() => import(`../components/${item}.vue`));
4141
};
4242
43-
async function handleQuery(dataType: number) {
43+
async function handleQuery(dataType: number, dataDate: Date) {
4444
loading.value = true;
45-
await HouseAPI.getHouseData(dataType)
45+
await HouseAPI.getHouseData(dataType, dataDate)
4646
.then((data) => {
4747
chartHousedataList.value = data as ChartHouseDataVO;
4848
})
@@ -52,7 +52,7 @@ async function handleQuery(dataType: number) {
5252
}
5353
5454
onMounted(() => {
55-
handleQuery(1);
55+
handleQuery(1, new Date());
5656
});
5757
</script>
5858

src/views/house/newsold/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const chartComponent = (item: string) => {
4040
return defineAsyncComponent(() => import(`../components/${item}.vue`));
4141
};
4242
43-
async function handleQuery(dataType: number) {
43+
async function handleQuery(dataType: number, dataDate: Date) {
4444
loading.value = true;
45-
await HouseAPI.getHouseData(dataType)
45+
await HouseAPI.getHouseData(dataType, dataDate)
4646
.then((data) => {
4747
chartHousedataList.value = data as ChartHouseDataVO;
4848
})
@@ -52,7 +52,7 @@ async function handleQuery(dataType: number) {
5252
}
5353
5454
onMounted(() => {
55-
handleQuery(0);
55+
handleQuery(0, new Date());
5656
});
5757
</script>
5858

src/views/house/rearea-avg/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const chartComponent = (item: string) => {
4040
return defineAsyncComponent(() => import(`../components/${item}.vue`));
4141
};
4242
43-
async function handleQuery(dataType: number) {
43+
async function handleQuery(dataType: number, dataDate: Date) {
4444
loading.value = true;
45-
await HouseAPI.getHouseData(dataType)
45+
await HouseAPI.getHouseData(dataType, dataDate)
4646
.then((data) => {
4747
chartHousedataList.value = data as ChartHouseDataVO;
4848
})
@@ -52,7 +52,7 @@ async function handleQuery(dataType: number) {
5252
}
5353
5454
onMounted(() => {
55-
handleQuery(3);
55+
handleQuery(3, new Date());
5656
});
5757
</script>
5858

src/views/house/rearea/index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const chartComponent = (item: string) => {
4040
return defineAsyncComponent(() => import(`../components/${item}.vue`));
4141
};
4242
43-
async function handleQuery(dataType: number) {
43+
async function handleQuery(dataType: number, dataDate: Date) {
4444
loading.value = true;
45-
await HouseAPI.getHouseData(dataType)
45+
await HouseAPI.getHouseData(dataType, dataDate)
4646
.then((data) => {
4747
chartHousedataList.value = data as ChartHouseDataVO;
4848
})
@@ -52,7 +52,7 @@ async function handleQuery(dataType: number) {
5252
}
5353
5454
onMounted(() => {
55-
handleQuery(6);
55+
handleQuery(6, new Date());
5656
});
5757
</script>
5858

0 commit comments

Comments
 (0)