|
@@ -1,54 +1,66 @@
|
|
|
<template>
|
|
|
<PageWrapper>
|
|
|
- <template #headerContent> <WorkbenchHeader /> </template>
|
|
|
- <div class="lg:flex">
|
|
|
- <div class="lg:w-7/10 w-full !mr-4 enter-y">
|
|
|
- <ProjectCard :loading="loading" class="enter-y" />
|
|
|
- <DynamicInfo :loading="loading" class="!my-4 enter-y" />
|
|
|
- </div>
|
|
|
- <div class="lg:w-3/10 w-full enter-y">
|
|
|
- <QuickNav :loading="loading" class="enter-y" />
|
|
|
-
|
|
|
- <Card class="!my-4 enter-y" :loading="loading">
|
|
|
- <img class="xl:h-50 h-30 mx-auto" src="../../../assets/svg/illustration.svg" />
|
|
|
- </Card>
|
|
|
-
|
|
|
- <SaleRadar :loading="loading" class="enter-y" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar>
|
|
|
+ <span class="w-1/5">
|
|
|
+ <Search @search="value => handleSearch('search', value)" placeholder="项目名称/项目编号" />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #filterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters }">
|
|
|
+ <div class="p-3">
|
|
|
+ <a-select :options="options" placeholder="按办事处筛选" @select="value => setSelectedKeys([value])" style="width: 180px" allowClear />
|
|
|
+ </div>
|
|
|
+ <div class="pb-3 justify-center flex">
|
|
|
+ <a-button size="small" @click="() => handleSearch('insideCategoryId', selectedKeys[0], confirm)" class="mr-3">确定</a-button>
|
|
|
+ <a-button size="small" @click="() => clearFilters()">重置</a-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, ref } from 'vue';
|
|
|
-
|
|
|
- import { Card } from 'ant-design-vue';
|
|
|
- import { PageWrapper } from '/@/components/Page';
|
|
|
- import WorkbenchHeader from './components/WorkbenchHeader.vue';
|
|
|
- import ProjectCard from './components/ProjectCard.vue';
|
|
|
- import QuickNav from './components/QuickNav.vue';
|
|
|
- import DynamicInfo from './components/DynamicInfo.vue';
|
|
|
- import SaleRadar from './components/SaleRadar.vue';
|
|
|
-
|
|
|
+ import { computed, defineComponent } from 'vue'
|
|
|
+ import { BasicTable, useTable } from '/@/components/Table'
|
|
|
+ import { PageWrapper } from '/@/components/Page'
|
|
|
+ import { getProjectList } from '/@/api/sys/project'
|
|
|
+ import { Input, Select } from 'ant-design-vue'
|
|
|
+ import { getProjectTableColumns } from '../tableData'
|
|
|
+ import { useOfficeStore } from '/@/store/modules/office'
|
|
|
+ import { ProjectListItem, ProjectListParams } from '/@/api/sys/model/projectModel'
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
|
PageWrapper,
|
|
|
- WorkbenchHeader,
|
|
|
- ProjectCard,
|
|
|
- QuickNav,
|
|
|
- DynamicInfo,
|
|
|
- SaleRadar,
|
|
|
- Card,
|
|
|
+ BasicTable,
|
|
|
+ Search: Input.Search,
|
|
|
+ ASelect: Select
|
|
|
},
|
|
|
setup() {
|
|
|
- const loading = ref(true);
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false;
|
|
|
- }, 1500);
|
|
|
+ const officeStore = useOfficeStore()
|
|
|
+ const options = computed(() => officeStore.getCategoryOptions)
|
|
|
+ async function checkOffice() {
|
|
|
+ if (!officeStore.getOfficesAction.length) {
|
|
|
+ await officeStore.getOfficesAction()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const [registerTable, { setTableData }] = useTable({
|
|
|
+ canResize: true,
|
|
|
+ title: '项目列表',
|
|
|
+ rowKey: 'id',
|
|
|
+ api: getProjectList,
|
|
|
+ columns: getProjectTableColumns(),
|
|
|
+ showTableSetting: true
|
|
|
+ })
|
|
|
|
|
|
- return {
|
|
|
- loading,
|
|
|
- };
|
|
|
- },
|
|
|
- });
|
|
|
+ checkOffice()
|
|
|
+ async function handleSearch(key: keyof ProjectListParams, value: string, fn?: Fn) {
|
|
|
+ if (fn) {
|
|
|
+ fn()
|
|
|
+ } else {
|
|
|
+ const tableData = await getProjectList({ page: 1, pageSize: 10, [key]: value })
|
|
|
+ setTableData<ProjectListItem>(tableData.items)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return { registerTable, options, handleSearch }
|
|
|
+ }
|
|
|
+ })
|
|
|
</script>
|