From 25f7a02df424eb4b8f12534d9a94484abb3bcfb4 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 25 九月 2025 16:28:43 +0800 Subject: [PATCH] feat: 页面 --- src/views/EnterpriseManage/EnterpriseManageList.vue | 112 ++++++++++++------------------------------------------- 1 files changed, 25 insertions(+), 87 deletions(-) diff --git a/src/views/EnterpriseManage/EnterpriseManageList.vue b/src/views/EnterpriseManage/EnterpriseManageList.vue index 1ef6e37..9df9afe 100644 --- a/src/views/EnterpriseManage/EnterpriseManageList.vue +++ b/src/views/EnterpriseManage/EnterpriseManageList.vue @@ -1,33 +1,22 @@ <template> - <LoadingLayout :loading="state.loading"> + <LoadingLayout :loading="isInitialLoading"> <AppContainer> <ProTableQueryFilterBar @on-reset="reset"> <template #query> <QueryFilterItem tip-content="閰嶇疆鐘舵��"> <FieldRadio v-model="extraParamState.isConfigured" - :value-enum="[ - { - value: true, - label: '宸查厤缃�', - }, - { - value: false, - label: '鏈厤缃�', - }, - ]" + :value-enum="IsConfiguredText" buttonStyle showAllBtn - @change="getList()" /> </QueryFilterItem> <QueryFilterItem> <SearchInput v-model="extraParamState.keywords" - style="width: 200px" + style="width: 300px" placeholder="浼佷笟鍚嶇О/娉曚汉/鑱旂郴浜�" @on-click-search="getList" - @keyup.enter="getList()" > </SearchInput> </QueryFilterItem> @@ -45,7 +34,7 @@ <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> </ProTableV2> </AppContainer> - <!-- <ConfigureDialog v-bind="dialogProps" /> --> + <ConfigureDialog v-bind="dialogProps" /> </LoadingLayout> </template> @@ -58,12 +47,12 @@ LoadingLayout, AppContainer, QueryFilterItem, - useTable, useFormDialog, FieldRadio, + useTableV2, } from '@bole-core/components'; import { useAccess, useGlobalEventContext } from '@/hooks'; -import { EnterpriseConfigureType } from '@/constants'; +import { EnterpriseConfigureType, IsConfiguredText } from '@/constants'; import ConfigureDialog from './components/ConfigureDialog.vue'; import { Message } from '@bole-core/core'; import * as enterpriseServices from '@/services/api/enterprise'; @@ -94,25 +83,15 @@ const router = useRouter(); -const BaseState = { - loading: true, -}; - -const state = reactive({ ...BaseState }); - -onMounted(async () => { - await getList(); - state.loading = false; -}); - const { getDataSource: getList, proTableProps, paginationState, extraParamState, reset, -} = useTable( - async ({ pageIndex, pageSize }, extraParamState) => { + isInitialLoading, +} = useTableV2( + async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => { try { let params: API.GetEnterprisesQuery = { pageModel: { @@ -125,7 +104,7 @@ }; let res = await enterpriseServices.getEnterprises(params, { - showLoading: !state.loading, + showLoading: !isInitialLoading, }); return res; } catch (error) { @@ -138,75 +117,34 @@ orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], isConfigured: '' as any as boolean, }, - queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'], - columnsRenderProps: {}, + queryKey: ['enterpriseServices/getEnterprises'], + columnsRenderProps: { + isReal: { type: 'enum', valueEnum: IsRealText }, + isConfigured: { type: 'enum', valueEnum: IsConfiguredText }, + }, } ); function openDialog(row?: API.GetEnterprisesQueryResultItem) { - if (row) { - handleEdit({ - id: row.id, - }); - } else { - handleAdd(); - } + handleEdit({ + id: row.id, + enterpriseConfigureType: EnterpriseConfigureType.Bank, + }); } -const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ +const { dialogProps, handleEdit, dialogState } = useFormDialog({ onConfirm: handleAddOrEdit, defaultFormParams: { id: '', + enterpriseConfigureType: EnterpriseConfigureType.Bank, }, }); -async function handleAddOrEdit(type: EnterpriseConfigureType) { +async function handleAddOrEdit() { try { - let res; - // if (type === EnterpriseConfigureType.Bank) { - // res = await createOrEditFlexEnterpriseBankSetting(); - // } - if (type === EnterpriseConfigureType.Electronic) { - res = await createOrEditFlexEnterpriseSignSetting(); - } - if (type === EnterpriseConfigureType.ShortMessage) { - res = await createOrEditFlexEnterpriseMessageSetting(); - } - if (res) { - Message.successMessage('鎿嶄綔鎴愬姛'); - getList(paginationState.pageIndex); - dialogState.dialogVisible = false; - } - } catch (error) {} -} - -// async function createOrEditFlexEnterpriseBankSetting() { -// try { -// let params: API.CreateOrEditFlexEnterpriseBankInput = { -// id: editForm.id, -// openBank: editForm.openBank, -// openBranchBank: editForm.openBranchBank, -// bankAccount: editForm.bankAccount, -// verifyStatus: editForm.verifyStatus, -// flexEnterpirseId: editForm.flexEnterpirseId, -// }; -// return await flexEnterpriseServices.createOrEditFlexEnterpriseBankSetting(params); -// } catch (error) {} -// } -async function createOrEditFlexEnterpriseSignSetting() { - try { - let params: API.SetEnterpriseElectronSignSettingCommand = { - id: editForm.id, - }; - return await enterpriseServices.setEnterpriseElectronSignSetting(params); - } catch (error) {} -} -async function createOrEditFlexEnterpriseMessageSetting() { - try { - let params: API.SetEnterpriseSmsSettingCommand = { - id: editForm.id, - }; - return await enterpriseServices.setEnterpriseSmsSetting(params); + Message.successMessage('鎿嶄綔鎴愬姛'); + getList(paginationState.pageIndex); + dialogState.dialogVisible = false; } catch (error) {} } -- Gitblit v1.9.1