| | |
| | | <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"> |
| | |
| | | |
| | | <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, |
| | |
| | | const queryParams = reactive<PointsQueryParams>({ |
| | | dataCategory: '', |
| | | dataType: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | flowStartTime: '', |
| | | flowEndTime: '', |
| | | year: new Date().getFullYear().toString(), |
| | | month: '', |
| | | day: '', |
| | |
| | | |
| | | // 总数 |
| | | const total = ref(0) |
| | | |
| | | // 数据类目列表 |
| | | const categoryList = ref<string[]>([]) |
| | | |
| | | // 获取积分详情 |
| | | const earnedDetails = ref<UnitPointsDetail[]>([ |
| | |
| | | } |
| | | } |
| | | |
| | | // 获取数据类目列表 |
| | | 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 { |
| | |
| | | const resetQuery = () => { |
| | | queryParams.dataCategory = '' |
| | | queryParams.dataType = '' |
| | | queryParams.startTime = '' |
| | | queryParams.endTime = '' |
| | | queryParams.flowStartTime = '' |
| | | queryParams.flowEndTime = '' |
| | | queryParams.year = new Date().getFullYear().toString() |
| | | queryParams.month = '' |
| | | queryParams.day = '' |
| | |
| | | // 处理时间类型变化 |
| | | const handleTimeTypeChange = (type: string | number | boolean | undefined) => { |
| | | // 清空其他时间字段 |
| | | queryParams.startTime = '' |
| | | queryParams.endTime = '' |
| | | queryParams.flowStartTime = '' |
| | | queryParams.flowEndTime = '' |
| | | queryParams.month = '' |
| | | queryParams.day = '' |
| | | monthValue.value = '' |
| | |
| | | // 处理日期变化 |
| | | 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 = '' |
| | | } |
| | | } |
| | | |
| | |
| | | onMounted(() => { |
| | | getUnitPointsStats() |
| | | getUnitPointsFlow() |
| | | getCategoryList() |
| | | }) |
| | | </script> |
| | | |