From c92b723d893bddd1cf9093e660806b226dc00921 Mon Sep 17 00:00:00 2001 From: seatonwan9 Date: 星期五, 15 八月 2025 19:01:56 +0800 Subject: [PATCH] 提交源码 --- src/views/pointsManage/unit/index.vue | 50 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/views/pointsManage/unit/index.vue b/src/views/pointsManage/unit/index.vue index b9b47d7..469f0a0 100644 --- a/src/views/pointsManage/unit/index.vue +++ b/src/views/pointsManage/unit/index.vue @@ -104,12 +104,12 @@ <span class="filter-label">鏁版嵁绫荤洰:</span> <el-select v-model="queryParams.dataCategory" placeholder="鍏ㄩ儴" clearable> <el-option label="鍏ㄩ儴" value="" /> - <el-option label="璧勬簮璐$尞" value="resource_contribution" /> - <el-option label="璧勬簮浜ゆ槗" value="resource_transaction" /> - <el-option label="璧勬簮浼犳挱" value="resource_dissemination" /> - <el-option label="鐢ㄦ埛鍙備笌" value="user_participation" /> - <el-option label="绉垎杞崲" value="points_conversion" /> - <el-option label="鍏朵粬" value="other" /> + <el-option + v-for="category in categoryList" + :key="category" + :label="getCategoryLabel(category)" + :value="category" + /> </el-select> </div> <div class="filter-item"> @@ -234,7 +234,7 @@ <script setup lang="ts"> import { ref, reactive, onMounted, computed } from 'vue' -import { ElMessage } from 'element-plus' +import { dayjs, ElMessage } from 'element-plus' import { Money, Plus, @@ -257,8 +257,8 @@ const queryParams = reactive<PointsQueryParams>({ dataCategory: '', dataType: '', - startTime: '', - endTime: '', + flowStartTime: '', + flowEndTime: '', year: new Date().getFullYear().toString(), month: '', day: '', @@ -280,6 +280,9 @@ // 鎬绘暟 const total = ref(0) + +// 鏁版嵁绫荤洰鍒楄〃 +const categoryList = ref<string[]>([]) // 鑾峰彇绉垎璇︽儏 const earnedDetails = ref<UnitPointsDetail[]>([ @@ -327,6 +330,18 @@ } } +// 鑾峰彇鏁版嵁绫荤洰鍒楄〃 +const getCategoryList = async () => { + try { + const res = await pointsApi.getPointsFlowCategories() + if (res.code === 200 && res.data) { + categoryList.value = res.data + } + } catch (error) { + console.error('鑾峰彇鏁版嵁绫荤洰澶辫触:', error) + } +} + // 鑾峰彇鍗曚綅绉垎娴佹按 const getUnitPointsFlow = async () => { try { @@ -351,8 +366,8 @@ const resetQuery = () => { queryParams.dataCategory = '' queryParams.dataType = '' - queryParams.startTime = '' - queryParams.endTime = '' + queryParams.flowStartTime = '' + queryParams.flowEndTime = '' queryParams.year = new Date().getFullYear().toString() queryParams.month = '' queryParams.day = '' @@ -366,8 +381,8 @@ // 澶勭悊鏃堕棿绫诲瀷鍙樺寲 const handleTimeTypeChange = (type: string | number | boolean | undefined) => { // 娓呯┖鍏朵粬鏃堕棿瀛楁 - queryParams.startTime = '' - queryParams.endTime = '' + queryParams.flowStartTime = '' + queryParams.flowEndTime = '' queryParams.month = '' queryParams.day = '' monthValue.value = '' @@ -389,11 +404,11 @@ // 澶勭悊鏃ユ湡鍙樺寲 const handleDateChange = (dates: [string, string] | null) => { if (dates) { - queryParams.startTime = dates[0] - queryParams.endTime = dates[1] + queryParams.flowStartTime = dates[0] + queryParams.flowEndTime = dates[1] } else { - queryParams.startTime = '' - queryParams.endTime = '' + queryParams.flowStartTime = '' + queryParams.flowEndTime = '' } } @@ -413,6 +428,7 @@ onMounted(() => { getUnitPointsStats() getUnitPointsFlow() + getCategoryList() }) </script> -- Gitblit v1.8.0