Files
cz-web/src/views/contract/index.vue
2026-10-01 17:24:57 +08:00

242 lines
4.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 页面:合同中心(Contract) -->
<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
import { FilterPanel, PaginationBar } from '@/components'
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">
<div class="contract__head">
<div class="container">
<h1 class="contract__title">
合同中心
</h1>
<p class="contract__slogan text-secondary">
项目电子合同在线签署、归档与查询管理
</p>
</div>
</div>
<div class="container">
<div class="contract__card">
<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>
</div>
</div>
</template>
<style lang="less" scoped>
.contract {
padding-bottom: @spacing-xxl;
&__head {
padding: 24px 0 52px;
background: @white;
.container {
padding-left: 42px;
}
}
&__title {
font-size: 36px;
font-weight: 700;
line-height: 52px;
color: @contract-ink;
}
&__slogan {
margin-top: 13.5px;
font-size: 24px;
font-weight: 500;
line-height: 37px;
color: @contract-muted;
}
}
.contract .contract__card {
margin-top: 20px;
padding: 51px 64px 59px;
border-radius: @radius-lg;
background: @white;
:deep(.filter-panel) {
margin-bottom: 39px;
padding: 0;
border-radius: 0;
background: transparent;
box-shadow: none;
}
:deep(.filter-panel__body) {
margin-top: 0;
}
:deep(.filter-panel__bar) {
gap: 8px;
.filter-panel__btn {
margin-left: 78px;
}
.filter-panel__btn--primary {
margin-left: 40px;
} }
:deep(.filter-panel__input) {
flex: 0 0 592px;
width: 592px;
max-width: none;
margin-right: 0;
height: 49px;
border-color: transparent;
border-radius: 0;
background: @input-bg;
font-size: 20px;
box-sizing: border-box;
}
:deep(.filter-panel__input::placeholder) {
color: @contract-placeholder;
}
:deep(.filter-panel__input:focus) {
border-color: @primary-strong;
}
:deep(.filter-panel__btn) {
order: 1;
min-width: 0;
height: 29px;
padding: 0 12px;
border: none;
border-radius: 0;
background: transparent;
color: @contract-placeholder;
font-size: 20px;
}
:deep(.filter-panel__btn:hover) {
border-color: transparent;
color: @text-color;
}
:deep(.filter-panel__btn--primary) {
order: 2;
border-radius: 0;
background: transparent;
color: @contract-accent;
}
:deep(.filter-panel__btn--primary:hover) {
background: transparent;
color: @primary-color;
}
:deep(.pagination) {
justify-content: flex-end;
gap: 10px;
padding: 0;
margin-top: 28px;
}
:deep(.pagination__btn) {
min-width: 40px;
height: 26px;
padding: 0 4px;
border: 1px solid @contract-line;
border-radius: 0;
background: @white;
color: @contract-line;
font-size: 14px;
}
:deep(.pagination__btn:hover:not(:disabled):not(.is-ellipsis)) {
border-color: @contract-accent;
color: @contract-accent;
}
:deep(.pagination__btn.is-active) {
border-color: @contract-accent;
background: @contract-accent;
color: @white;
}
:deep(.pagination__btn.is-ellipsis) {
border-color: transparent;
background: transparent;
color: @contract-muted;
}
:deep(.pagination__btn:first-child),
:deep(.pagination__btn:last-child) {
min-width: auto;
padding: 0 2px;
border: none;
background: transparent;
color: @contract-muted;
font-size: 12px;
}
:deep(.pagination__btn:first-child:disabled),
:deep(.pagination__btn:last-child:disabled) {
opacity: 1;
}
}
</style>