From be028017a461af4c9745c69c4df084d4c3e6b296 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 22 十月 2025 18:08:49 +0800
Subject: [PATCH] fix: bug
---
src/views/EnterpriseManage/EnterpriseManageList.vue | 194 +++++++++++++++++-------------------------------
1 files changed, 70 insertions(+), 124 deletions(-)
diff --git a/src/views/EnterpriseManage/EnterpriseManageList.vue b/src/views/EnterpriseManage/EnterpriseManageList.vue
index d7a8dde..12a573b 100644
--- a/src/views/EnterpriseManage/EnterpriseManageList.vue
+++ b/src/views/EnterpriseManage/EnterpriseManageList.vue
@@ -1,27 +1,22 @@
<template>
- <LoadingLayout :loading="state.loading">
+ <LoadingLayout :loading="isInitialLoading">
<AppContainer>
<ProTableQueryFilterBar @on-reset="reset">
<template #query>
- <QueryFilterItem tip-content="鐘舵��">
+ <QueryFilterItem tip-content="閰嶇疆鐘舵��">
<FieldRadio
- v-model="extraParamState.status"
- :value-enum="[
- { label: '宸查厤缃�', value: true },
- { label: '鏈厤缃�', value: false },
- ]"
+ v-model="extraParamState.isConfigured"
+ :value-enum="IsConfiguredText"
buttonStyle
showAllBtn
- @change="getList()"
/>
</QueryFilterItem>
<QueryFilterItem>
<SearchInput
- v-model="extraParamState.name"
- style="width: 200px"
+ v-model="extraParamState.keywords"
+ style="width: 300px"
placeholder="浼佷笟鍚嶇О/娉曚汉/鑱旂郴浜�"
@on-click-search="getList"
- @keyup.enter="getList()"
>
</SearchInput>
</QueryFilterItem>
@@ -29,7 +24,7 @@
<template #btn>
<el-button
v-if="checkSubModuleItemShow('pageButton', 'addBtn')"
- @click="openDialog()"
+ @click="addOrEditEnterprise()"
icon="Plus"
type="primary"
>鏂板</el-button
@@ -39,7 +34,8 @@
<ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
</ProTableV2>
</AppContainer>
- <!-- <AddOrEditSearchSetting v-bind="dialogProps" :typeList="typeList" /> -->
+ <ConfigureDialog v-bind="dialogProps" />
+ <WechatWalletOpen v-bind="dialogWechatProps"></WechatWalletOpen>
</LoadingLayout>
</template>
@@ -52,25 +48,25 @@
LoadingLayout,
AppContainer,
QueryFilterItem,
- useTable,
useFormDialog,
- UploadUserFile,
FieldRadio,
+ useTableV2,
} from '@bole-core/components';
import { useAccess, useGlobalEventContext } from '@/hooks';
-import * as searchSettingServices from '@/services/api/SearchSetting';
-import { SearchType, SearchTypeText } from '@/constants';
-import { OrderInputType, Message } from '@bole-core/core';
-import { convertApi2FormUrl } from '@/utils';
-import { useQueryClient } from '@tanstack/vue-query';
-import { useSearchSettingType } from '@/hooks';
+import { EnterpriseConfigureType, IsConfiguredText } from '@/constants';
+import ConfigureDialog from './components/ConfigureDialog.vue';
+import { Message } from '@bole-core/core';
+import * as enterpriseServices from '@/services/api/enterprise';
+import WechatWalletOpen from './components/WechatWalletOpen.vue';
defineOptions({
name: 'EnterpriseManageList',
});
const operationBtnMap: Record<string, OperationBtnType> = {
- editBtn: { emits: { onClick: (role) => openDialog(role) } },
+ editBtn: { emits: { onClick: (role) => addOrEditEnterprise(role) } },
+ detailBtn: { emits: { onClick: (role) => handleDetail(role) } },
+ configBtn: { emits: { onClick: (role) => openDialog(role) } },
};
const { checkSubModuleItemShow, column, operationBtns } = useAccess({
@@ -87,19 +83,7 @@
getList(paginationState.pageIndex);
});
-const BaseState = {
- loading: true,
-};
-const queryClient = useQueryClient();
-const { searchSettingTypeList: typeList } = useSearchSettingType({
- searchType: SearchType.IndustryCategory,
-});
-const state = reactive({ ...BaseState });
-
-onMounted(async () => {
- await getList();
- state.loading = false;
-});
+const router = useRouter();
const {
getDataSource: getList,
@@ -107,27 +91,22 @@
paginationState,
extraParamState,
reset,
-} = useTable(
- async ({ pageIndex, pageSize }, extraParamState) => {
+ isInitialLoading,
+} = useTableV2(
+ async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => {
try {
- let params: API.GetSearchSettingListInput = {
+ let params: API.GetEnterprisesQuery = {
pageModel: {
rows: pageSize,
page: pageIndex,
orderInput: extraParamState.orderInput,
},
- name: extraParamState.name,
- // belongType: Number(extraParamState.belongType),
- searchType: Number(extraParamState.searchType),
- status: extraParamState.status,
+ isConfigured: extraParamState.isConfigured,
+ keywords: extraParamState.keywords,
};
- if (extraParamState.searchType === SearchType.Position) {
- params.isRecommend = extraParamState.isRecommend;
- params.parentId = extraParamState.parentId;
- }
- let res = await searchSettingServices.getSearchSettingList(params, {
- showLoading: !state.loading,
+ let res = await enterpriseServices.getEnterprises(params, {
+ showLoading: !isInitialLoading,
});
return res;
} catch (error) {
@@ -136,93 +115,60 @@
},
{
defaultExtraParams: {
- name: '',
- searchType: SearchType.Identity,
- orderInput: [{ property: 'sort', order: OrderInputType.Asc }],
- status: '' as any as boolean,
- isRecommend: '' as any as boolean,
- parentId: '',
+ keywords: '',
+ orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }],
+ isConfigured: '' as any as boolean,
},
- queryKey: ['searchSettingServices/getSearchSettingList'],
+ queryKey: ['enterpriseServices/getEnterprises'],
columnsRenderProps: {
- searchType: { type: 'enum', valueEnum: SearchTypeText },
+ isReal: { type: 'enum', valueEnum: IsRealText },
+ isConfigured: { type: 'enum', valueEnum: IsConfiguredText },
},
}
);
-function openDialog(row?: API.GetSearchSettingList) {
- if (row) {
- handleEdit({
- id: row.id,
- searchType: extraParamState.searchType,
- name: row.name,
- sort: row.sort,
- status: row.status,
- src: row.src?.length ? [convertApi2FormUrl(row.src)] : [],
- parentId: row.parentId ?? '',
- });
- } else {
- handleAdd({
- searchType: extraParamState.searchType,
- });
- }
-}
-
-const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({
- onConfirm: handleAddOrEdit,
- defaultFormParams: {
- id: '',
- searchType: SearchType.Identity,
- name: '',
- sort: 0,
- status: true,
- src: [] as UploadUserFile[],
- parentId: '',
- },
-});
-
-async function handleAddOrEdit() {
- try {
- let params: API.CreateOrEditSearchInput = {
- searchType: extraParamState.searchType,
- name: editForm.name,
- sort: editForm.sort,
- status: editForm.status,
- src: editForm.src?.[0]?.path ?? '',
- parentId: editForm.parentId ?? '',
- };
- if (editForm.id) {
- params.id = editForm.id;
- }
- let res = await searchSettingServices.createOrEditSearchSetting(params);
- if (res) {
- Message.successMessage('鎿嶄綔鎴愬姛');
- getList(paginationState.pageIndex);
- dialogState.dialogVisible = false;
- updateCategoryMenu();
- }
- } catch (error) {}
-}
-
-function updateCategoryMenu() {
- queryClient.invalidateQueries({
- queryKey: [
- 'searchSettingServices/getTypeSearchSettingList',
- { searchType: extraParamState.searchType, belongType: null },
- ],
+function openDialog(row?: API.GetEnterprisesQueryResultItem) {
+ handleEdit({
+ id: row.id,
+ enterpriseConfigureType: EnterpriseConfigureType.Bank,
});
}
-async function setCategoryVis(row: API.GetSearchSettingList) {
+const { dialogProps, handleEdit, dialogState, editForm } = useFormDialog({
+ onConfirm: handleAddOrEdit,
+ defaultFormParams: {
+ id: '',
+ enterpriseConfigureType: EnterpriseConfigureType.Bank,
+ },
+});
+
+const { dialogProps: dialogWechatProps, handleAdd } = useFormDialog({
+ defaultFormParams: {
+ url: '',
+ },
+});
+
+async function handleAddOrEdit(data?: any) {
try {
- let params: API.EnableSearchSettingInput = {
- id: row.id,
- status: !row.status,
- };
- let res = await searchSettingServices.enableSearchSetting(params);
- updateCategoryMenu();
+ if (editForm.enterpriseConfigureType === EnterpriseConfigureType.Wechat) {
+ handleAdd({
+ url: data?.sign_url,
+ });
+ }
+ Message.successMessage(
+ editForm.enterpriseConfigureType === EnterpriseConfigureType.Wechat
+ ? '鎻愪氦鎴愬姛锛岃瓒呯骇绠$悊鍛樻壂鐮佽繘琛岀绾︽搷浣�'
+ : '鎿嶄綔鎴愬姛'
+ );
getList(paginationState.pageIndex);
- return !!res;
+ dialogState.dialogVisible = false;
} catch (error) {}
}
+
+function addOrEditEnterprise(row?: API.GetEnterprisesQueryResultItem) {
+ router.push({ name: 'AddOrEditEnterprise', params: { id: row?.id ?? '' } });
+}
+function handleDetail(row: API.GetEnterprisesQueryResultItem) {
+ router.push({ name: 'EnterpriseDetail', params: { id: row?.id ?? '' } });
+}
</script>
--
Gitblit v1.9.1