From dc1d067c566bbde1c7170186960a8bd27f210a47 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 09 九月 2026 13:45:58 +0800
Subject: [PATCH] feat(bi): 新增决策总览仪表盘并优化预测分析功能
---
src/views/hrm/workHourSummary/index.vue | 128 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 128 insertions(+), 0 deletions(-)
diff --git a/src/views/hrm/workHourSummary/index.vue b/src/views/hrm/workHourSummary/index.vue
new file mode 100644
index 0000000..fa571f5
--- /dev/null
+++ b/src/views/hrm/workHourSummary/index.vue
@@ -0,0 +1,128 @@
+<script lang="ts" setup>
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { HrmWorkHourSummaryApi } from '#/api/hrm/work-hour-summary';
+
+import { ref } from 'vue';
+
+import { Page } from '#/packages/effects/common-ui/src';
+
+import { message, DatePicker, Form, FormItem, Modal } from 'ant-design-vue';
+
+import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import {
+ generateWorkHourSummary,
+ getWorkHourSummaryPage,
+} from '#/api/hrm/work-hour-summary';
+
+import { useGridColumns, useGridFormSchema } from './data';
+
+/** HRM 鏈堝害宸ユ椂姹囨�� */
+defineOptions({ name: 'HrmWorkHourSummary' });
+
+// 鐢熸垚鏈堝害姹囨�诲脊绐�
+const generateVisible = ref(false);
+const generatePeriod = ref<string>();
+const generateLoading = ref(false);
+
+/** 鎵撳紑鐢熸垚寮圭獥锛屽甫鍑烘悳绱㈡潯浠朵腑鐨勬牳绠楀懆鏈� */
+function openGenerateModal() {
+ void gridApi.formApi.getValues().then((values) => {
+ generatePeriod.value = values.period;
+ });
+ generateVisible.value = true;
+}
+
+/** 鍒锋柊琛ㄦ牸 */
+function handleRefresh() {
+ gridApi.query();
+}
+
+/** 鎵ц鐢熸垚 */
+async function handleGenerate() {
+ if (!generatePeriod.value) {
+ message.warning('璇烽�夋嫨鏍哥畻鍛ㄦ湡');
+ return;
+ }
+ generateLoading.value = true;
+ try {
+ await generateWorkHourSummary(generatePeriod.value);
+ message.success('鏈堝害宸ユ椂姹囨�荤敓鎴愭垚鍔�');
+ generateVisible.value = false;
+ handleRefresh();
+ } finally {
+ generateLoading.value = false;
+ }
+}
+
+const [Grid, gridApi] = useVbenVxeGrid({
+ formOptions: {
+ schema: useGridFormSchema(),
+ },
+ gridOptions: {
+ columns: useGridColumns(),
+ height: 'auto',
+ keepSource: true,
+ proxyConfig: {
+ ajax: {
+ query: async ({ page }, formValues) => {
+ return await getWorkHourSummaryPage({
+ pageNo: page.currentPage,
+ pageSize: page.pageSize,
+ ...formValues,
+ });
+ },
+ },
+ },
+ rowConfig: {
+ keyField: 'id',
+ isHover: true,
+ },
+ toolbarConfig: {
+ refresh: true,
+ search: true,
+ },
+ } as VxeTableGridOptions<HrmWorkHourSummaryApi.WorkHourSummary>,
+});
+</script>
+
+<template>
+ <Page auto-content-height>
+ <!-- 鐢熸垚鏈堝害宸ユ椂姹囨�诲脊绐� -->
+ <Modal
+ v-model:open="generateVisible"
+ title="鐢熸垚鏈堝害宸ユ椂姹囨��"
+ width="420px"
+ :confirm-loading="generateLoading"
+ @ok="handleGenerate"
+ >
+ <Form layout="vertical" class="pt-4">
+ <FormItem label="鏍哥畻鍛ㄦ湡" required>
+ <DatePicker
+ v-model:value="generatePeriod"
+ picker="month"
+ format="YYYY-MM"
+ valueFormat="YYYY-MM"
+ placeholder="璇烽�夋嫨鏍哥畻鍛ㄦ湡"
+ style="width: 100%"
+ />
+ </FormItem>
+ </Form>
+ </Modal>
+
+ <Grid table-title="鏈堝害宸ユ椂姹囨�诲垪琛�">
+ <template #toolbar-tools>
+ <TableAction
+ :actions="[
+ {
+ label: '鐢熸垚鏈堝害姹囨��',
+ type: 'primary',
+ icon: ACTION_ICON.ADD,
+ auth: ['hrm:work-hour:generate'],
+ onClick: openGenerateModal,
+ },
+ ]"
+ />
+ </template>
+ </Grid>
+ </Page>
+</template>
\ No newline at end of file
--
Gitblit v1.9.3