feat: 财务看板口径重构与半年模拟数据及报销状态注册表
- 重构 finance_dashboard 口径计算,新增模拟公司画像数据生成与筛选 - 引入 expense_claim_status_registry 统一报销状态流转 - 完善报销草稿流程、Item Sync 与本体解析器 - 优化总览页趋势图、分页组件与请求进度步骤 - 增强报销申请快速预览、本体工具与详情展示 - 新增半年报销模拟数据种子脚本与状态审计工具 - 补充财务看板、报销状态注册与模拟数据测试覆盖
This commit is contained in:
@@ -38,19 +38,36 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<EnterpriseSelect
|
||||
v-if="showPageSize"
|
||||
class="page-size-select"
|
||||
:model-value="pageSize"
|
||||
:options="pageSizeOptions"
|
||||
size="small"
|
||||
@change="setPageSize"
|
||||
/>
|
||||
<div class="page-tools">
|
||||
<EnterpriseSelect
|
||||
v-if="showPageSize"
|
||||
class="page-size-select"
|
||||
:model-value="pageSize"
|
||||
:options="pageSizeOptions"
|
||||
size="small"
|
||||
@change="setPageSize"
|
||||
/>
|
||||
|
||||
<div class="page-jump">
|
||||
<span>跳至</span>
|
||||
<input
|
||||
:value="pageInput"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
pattern="[0-9]*"
|
||||
aria-label="输入页码跳转"
|
||||
@blur="commitPageInput"
|
||||
@input="updatePageInput"
|
||||
@keydown.enter.prevent="commitPageInput"
|
||||
/>
|
||||
<span>页</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
|
||||
import EnterpriseSelect from './EnterpriseSelect.vue'
|
||||
|
||||
@@ -73,12 +90,15 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['update:currentPage', 'update:pageSize', 'page-size-change'])
|
||||
|
||||
const pageInput = ref(String(props.currentPage || 1))
|
||||
|
||||
const pageItems = computed(() => {
|
||||
if (props.pages.length) {
|
||||
return props.pages
|
||||
const total = Math.max(1, Number(props.totalPages) || 1)
|
||||
if (total <= 4) {
|
||||
return Array.from({ length: total }, (_, index) => index + 1)
|
||||
}
|
||||
|
||||
return Array.from({ length: props.totalPages }, (_, index) => index + 1)
|
||||
return [1, 2, 3, 'ellipsis', total]
|
||||
})
|
||||
|
||||
const summaryText = computed(() => {
|
||||
@@ -104,4 +124,21 @@ function setPageSize(size) {
|
||||
emit('update:pageSize', size)
|
||||
emit('page-size-change', size)
|
||||
}
|
||||
|
||||
function updatePageInput(event) {
|
||||
pageInput.value = String(event.target.value || '').replace(/\D/g, '')
|
||||
}
|
||||
|
||||
function commitPageInput() {
|
||||
const nextPage = Math.min(Math.max(Number(pageInput.value) || props.currentPage || 1, 1), props.totalPages)
|
||||
pageInput.value = String(nextPage)
|
||||
setPage(nextPage)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.currentPage,
|
||||
(page) => {
|
||||
pageInput.value = String(page || 1)
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user