|
@@ -17,6 +17,9 @@
|
|
|
</a-descriptions>
|
|
|
<a-divider orientation="left">管理驿站 共计:{{ manageSiteList.length }}</a-divider>
|
|
|
<a-table :columns="manageSitesTabColumns" :data-source="manageSiteList" :scroll="{ x:'100%', y: 200 }"
|
|
|
+ :pagination="manageSitesPagination"
|
|
|
+ :loading="manageSitesFormState.loading"
|
|
|
+ @change="manageSitesTableChange"
|
|
|
bordered>
|
|
|
</a-table>
|
|
|
<a-divider orientation="left">其他信息</a-divider>
|
|
@@ -28,13 +31,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import {onMounted, reactive, ref} from "vue";
|
|
|
+import {computed, onMounted, reactive, ref} from "vue";
|
|
|
import {getInstitutionByID} from "@/api/baseSettings/institution";
|
|
|
import {getListByInstitutionID} from "@/api/baseSettings/siteInfo";
|
|
|
import dayjs from "dayjs";
|
|
|
+import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
+import type {TableProps} from "ant-design-vue";
|
|
|
|
|
|
// 运营机构数据
|
|
|
const institutionInfo = reactive({
|
|
|
+ institutionID: "",
|
|
|
companyName: "",
|
|
|
companyAddress: "",
|
|
|
fzrName: "",
|
|
@@ -55,12 +61,23 @@ const manageSitesTabColumns = [
|
|
|
title: '序号',
|
|
|
align: "center",
|
|
|
key: 'siteID',
|
|
|
- customRender: item => `${pageParams.pageSize * (pageParams.pageIndex - 1) + item.index + 1}`
|
|
|
+ customRender: item => `${manageSitesPageParams.pageSize * (manageSitesPageParams.pageIndex - 1) + item.index + 1}`
|
|
|
},
|
|
|
{title: '驿站名称', dataIndex: 'siteName', key: 'siteName', align: "center"},
|
|
|
{title: '驿站地址', dataIndex: 'detailAddress', key: 'detailAddress', align: "center"},
|
|
|
];
|
|
|
-const pageParams = reactive({
|
|
|
+const manageSitesPagination = computed(() => ({
|
|
|
+ total: manageSitesFormState.total,
|
|
|
+ current: manageSitesPageParams.pageIndex,
|
|
|
+ pageSize: manageSitesPageParams.pageSize,
|
|
|
+ showSizeChanger: true,
|
|
|
+ showTotal: total => getPaginationTotalTitle(total)
|
|
|
+}));
|
|
|
+const manageSitesFormState = reactive({
|
|
|
+ total: 0,
|
|
|
+ loading: false
|
|
|
+});
|
|
|
+const manageSitesPageParams = reactive({
|
|
|
pageIndex: 1,
|
|
|
pageSize: 10,
|
|
|
institutionID: ''
|
|
@@ -80,12 +97,22 @@ function loadData(id: string) {
|
|
|
|
|
|
// 获取关联驿站数据
|
|
|
function getManageSites(id: string) {
|
|
|
- pageParams.institutionID = id;
|
|
|
- getListByInstitutionID(pageParams).then((result: any) => {
|
|
|
+ manageSitesPageParams.institutionID = id;
|
|
|
+ manageSitesFormState.loading = true;
|
|
|
+ getListByInstitutionID(manageSitesPageParams).then((result: any) => {
|
|
|
manageSiteList.value = result.list;
|
|
|
+ manageSitesFormState.total = result.total;
|
|
|
+ }).finally(() => {
|
|
|
+ manageSitesFormState.loading = false;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+const manageSitesTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
|
|
|
+ manageSitesPageParams.pageIndex = pag.current;
|
|
|
+ manageSitesPageParams.pageSize = pag.pageSize;
|
|
|
+ getManageSites(institutionInfo.institutionID);
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
// 页面初始化
|
|
|
onMounted(() => {
|