feat 搭建架构骨架

This commit is contained in:
Ironsp
2026-09-24 09:09:47 +08:00
parent dd9f6b77a4
commit 7a2efa3fea
180 changed files with 18967 additions and 9 deletions

View File

@@ -0,0 +1,95 @@
<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
import { FilterPanel, PaginationBar } from '@/components'
// 页面容器:只做组件引入、props 分发、事件中转,数据只经 store
import { useContractStore } from '@/stores/modules/contract'
import ContractTable from './cpns/ContractTable.vue'
const router = useRouter()
const contractStore = useContractStore()
const { query, list, total } = storeToRefs(contractStore)
const keyword = computed({
get: () => query.value.keyword,
set: (value: string) => contractStore.setQuery({ ...query.value, keyword: value }),
})
function onSearch(): void {
void contractStore.search()
}
function onReset(): void {
void contractStore.resetQuery()
}
function onPageChange(page: number): void {
void contractStore.changePage(page)
}
function onView(id: string): void {
void router.push(`/contract/${id}`)
}
function onSign(id: string): void {
void router.push(`/contract/${id}/sign`)
}
onMounted(() => {
void contractStore.fetchList()
})
</script>
<template>
<div class="contract">
<header class="contract__head">
<h1 class="contract__title">
合同中心
</h1>
<p class="contract__slogan text-secondary">
项目电子合同在线签署、归档与查询管理
</p>
</header>
<FilterPanel
v-model:keyword="keyword"
keyword-placeholder="合同名称/合同编号搜索"
@search="onSearch"
@reset="onReset"
/>
<ContractTable
:contracts="list"
@view="onView"
@sign="onSign"
/>
<PaginationBar
:page="query.page"
:page-size="query.pageSize"
:total="total"
@page-change="onPageChange"
/>
</div>
</template>
<style lang="less" scoped>
.contract {
.flex(column, flex-start);
gap: @spacing-base;
padding-top: @spacing-xl;
padding-bottom: @spacing-xxl;
&__title {
font-size: @font-size-xxl;
font-weight: 600;
color: @heading-color;
}
&__slogan {
margin-top: @spacing-xs;
font-size: @font-size-base;
}
}
</style>