From 4ea3fb422f1c1af628d948eb3908b6a61f71bbdf Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 07 八月 2025 18:05:17 +0800
Subject: [PATCH] fix: 修改
---
src/views/Permission/RoleManage.vue | 6
src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue | 22 +
src/hooks/dic.ts | 163 +++++++++++++-
.eslintrc-auto-import.json | 8
src/services/api/typings.d.ts | 245 ++++++++++++++++++++-
src/services/api/dictionary.ts | 17 +
src/views/EnterpriseManage/AddOrEditEnterprise.vue | 2
src/components/Form/ProFromAddressSelectV2.vue | 4
types/api.d.ts | 19 +
src/services/api/task.ts | 45 ++++
src/services/api/index.ts | 2
auto-imports.d.ts | 18 +
src/utils/common/area.ts | 11
src/constants/apiEnum.ts | 60 ++++
14 files changed, 558 insertions(+), 64 deletions(-)
diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json
index d8574cc..4fd6d6c 100644
--- a/.eslintrc-auto-import.json
+++ b/.eslintrc-auto-import.json
@@ -20,6 +20,7 @@
"EmptyTextEditorItem": true,
"EnterpriseConfigureType": true,
"EnterpriseConfigureTypeText": true,
+ "EnumBillingMethod": true,
"EnumClientType": true,
"EnumClientTypeText": true,
"EnumMenuType": true,
@@ -32,8 +33,12 @@
"EnumRoleWebApiDataPower": true,
"EnumRoleWebApiDataPowerText": true,
"EnumRoleWebApiDataPowerTextForFilter": true,
+ "EnumSettlementCycle": true,
"EnumSmsAccess": true,
"EnumSmsAccessText": true,
+ "EnumTaskReleaseStatus": true,
+ "EnumTaskStatus": true,
+ "EnumUserGender": true,
"EnumUserInfoStatus": true,
"EnumUserInfoStatusText": true,
"EnumUserType": true,
@@ -160,7 +165,10 @@
"triggerRef": true,
"unref": true,
"useAccess": true,
+ "useAllAreaList": true,
"useAllRoleList": true,
+ "useArea": true,
+ "useAreaByCascader": true,
"useAttrs": true,
"useClearSubModule": true,
"useCopyToClipboard": true,
diff --git a/auto-imports.d.ts b/auto-imports.d.ts
index 2a77459..167ee77 100644
--- a/auto-imports.d.ts
+++ b/auto-imports.d.ts
@@ -27,6 +27,7 @@
const EmptyTextEditorItem: typeof import('./src/constants/editor')['EmptyTextEditorItem']
const EnterpriseConfigureType: typeof import('./src/constants/enterprise')['EnterpriseConfigureType']
const EnterpriseConfigureTypeText: typeof import('./src/constants/enterprise')['EnterpriseConfigureTypeText']
+ const EnumBillingMethod: typeof import('./src/constants/apiEnum')['EnumBillingMethod']
const EnumClientType: typeof import('./src/constants/apiEnum')['EnumClientType']
const EnumClientTypeText: typeof import('./src/constants/apiEnumText')['EnumClientTypeText']
const EnumMenuType: typeof import('./src/constants/apiEnum')['EnumMenuType']
@@ -39,8 +40,12 @@
const EnumRoleWebApiDataPower: typeof import('./src/constants/apiEnum')['EnumRoleWebApiDataPower']
const EnumRoleWebApiDataPowerText: typeof import('./src/constants/apiEnumText')['EnumRoleWebApiDataPowerText']
const EnumRoleWebApiDataPowerTextForFilter: typeof import('./src/constants/apiEnumText')['EnumRoleWebApiDataPowerTextForFilter']
+ const EnumSettlementCycle: typeof import('./src/constants/apiEnum')['EnumSettlementCycle']
const EnumSmsAccess: typeof import('./src/constants/apiEnum')['EnumSmsAccess']
const EnumSmsAccessText: typeof import('./src/constants/enterprise')['EnumSmsAccessText']
+ const EnumTaskReleaseStatus: typeof import('./src/constants/apiEnum')['EnumTaskReleaseStatus']
+ const EnumTaskStatus: typeof import('./src/constants/apiEnum')['EnumTaskStatus']
+ const EnumUserGender: typeof import('./src/constants/apiEnum')['EnumUserGender']
const EnumUserInfoStatus: typeof import('./src/constants/apiEnum')['EnumUserInfoStatus']
const EnumUserInfoStatusText: typeof import('./src/constants/user')['EnumUserInfoStatusText']
const EnumUserType: typeof import('./src/constants/apiEnum')['EnumUserType']
@@ -159,7 +164,10 @@
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAccess: typeof import('./src/hooks/useAccess')['useAccess']
+ const useAllAreaList: typeof import('./src/hooks/dic')['useAllAreaList']
const useAllRoleList: typeof import('./src/hooks/useUser')['useAllRoleList']
+ const useArea: typeof import('./src/hooks/dic')['useArea']
+ const useAreaByCascader: typeof import('./src/hooks/dic')['useAreaByCascader']
const useAttrs: typeof import('vue')['useAttrs']
const useClearSubModule: typeof import('./src/hooks/useAccess')['useClearSubModule']
const useCopyToClipboard: typeof import('./src/hooks/useCopyToClipboard')['useCopyToClipboard']
@@ -201,7 +209,7 @@
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
// @ts-ignore
- export type { EnumClientType, EnumMenuType, EnumMenuVisitLevel, EnumPagedListOrder, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSmsAccess, EnumUserInfoStatus, EnumUserType, EnumClientType, EnumMenuType, EnumMenuVisitLevel, EnumPagedListOrder, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSmsAccess, EnumUserInfoStatus, EnumUserType } from './src/constants/apiEnum'
+ export type { EnumBillingMethod, EnumClientType, EnumMenuType, EnumMenuVisitLevel, EnumPagedListOrder, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskReleaseStatus, EnumTaskStatus, EnumUserGender, EnumUserInfoStatus, EnumUserType, EnumBillingMethod, EnumClientType, EnumMenuType, EnumMenuVisitLevel, EnumPagedListOrder, EnumRealAccess, EnumResourceController, EnumResourceMethod, EnumRoleWebApiDataPower, EnumSettlementCycle, EnumSmsAccess, EnumTaskReleaseStatus, EnumTaskStatus, EnumUserGender, EnumUserInfoStatus, EnumUserType } from './src/constants/apiEnum'
import('./src/constants/apiEnum')
// @ts-ignore
export type { FlexWorkerEleSignEnum, FlexTaskWorkerHireEnum, FlexWorkerEleSignEnum, FlexTaskWorkerHireEnum } from './src/constants/cPerson'
@@ -256,6 +264,7 @@
readonly EmptyTextEditorItem: UnwrapRef<typeof import('./src/constants/editor')['EmptyTextEditorItem']>
readonly EnterpriseConfigureType: UnwrapRef<typeof import('./src/constants/enterprise')['EnterpriseConfigureType']>
readonly EnterpriseConfigureTypeText: UnwrapRef<typeof import('./src/constants/enterprise')['EnterpriseConfigureTypeText']>
+ readonly EnumBillingMethod: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumBillingMethod']>
readonly EnumClientType: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumClientType']>
readonly EnumClientTypeText: UnwrapRef<typeof import('./src/constants/apiEnumText')['EnumClientTypeText']>
readonly EnumMenuType: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumMenuType']>
@@ -268,8 +277,12 @@
readonly EnumRoleWebApiDataPower: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumRoleWebApiDataPower']>
readonly EnumRoleWebApiDataPowerText: UnwrapRef<typeof import('./src/constants/apiEnumText')['EnumRoleWebApiDataPowerText']>
readonly EnumRoleWebApiDataPowerTextForFilter: UnwrapRef<typeof import('./src/constants/apiEnumText')['EnumRoleWebApiDataPowerTextForFilter']>
+ readonly EnumSettlementCycle: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumSettlementCycle']>
readonly EnumSmsAccess: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumSmsAccess']>
readonly EnumSmsAccessText: UnwrapRef<typeof import('./src/constants/enterprise')['EnumSmsAccessText']>
+ readonly EnumTaskReleaseStatus: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumTaskReleaseStatus']>
+ readonly EnumTaskStatus: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumTaskStatus']>
+ readonly EnumUserGender: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumUserGender']>
readonly EnumUserInfoStatus: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumUserInfoStatus']>
readonly EnumUserInfoStatusText: UnwrapRef<typeof import('./src/constants/user')['EnumUserInfoStatusText']>
readonly EnumUserType: UnwrapRef<typeof import('./src/constants/apiEnum')['EnumUserType']>
@@ -377,7 +390,10 @@
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly useAccess: UnwrapRef<typeof import('./src/hooks/useAccess')['useAccess']>
+ readonly useAllAreaList: UnwrapRef<typeof import('./src/hooks/dic')['useAllAreaList']>
readonly useAllRoleList: UnwrapRef<typeof import('./src/hooks/useUser')['useAllRoleList']>
+ readonly useArea: UnwrapRef<typeof import('./src/hooks/dic')['useArea']>
+ readonly useAreaByCascader: UnwrapRef<typeof import('./src/hooks/dic')['useAreaByCascader']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useClearSubModule: UnwrapRef<typeof import('./src/hooks/useAccess')['useClearSubModule']>
readonly useCopyToClipboard: UnwrapRef<typeof import('./src/hooks/useCopyToClipboard')['useCopyToClipboard']>
diff --git a/src/components/Form/ProFromAddressSelectV2.vue b/src/components/Form/ProFromAddressSelectV2.vue
index 73a24c3..a324328 100644
--- a/src/components/Form/ProFromAddressSelectV2.vue
+++ b/src/components/Form/ProFromAddressSelectV2.vue
@@ -24,7 +24,7 @@
});
type Props = {
- areaList: number[];
+ areaList: string[];
areaListPlaceholder?: string;
disabled?: boolean;
layer?: AreaType;
@@ -36,7 +36,7 @@
});
const emit = defineEmits<{
- (e: 'update:areaList', val: number[]): void;
+ (e: 'update:areaList', val: string[]): void;
}>();
const { areaList: innerAreaList } = useVModels(props, emit);
diff --git a/src/constants/apiEnum.ts b/src/constants/apiEnum.ts
index f1a06ac..1e227fd 100644
--- a/src/constants/apiEnum.ts
+++ b/src/constants/apiEnum.ts
@@ -1,6 +1,18 @@
/* eslint-disable */
// @ts-ignore
+/** 璁¤垂鏂瑰紡 */
+export enum EnumBillingMethod {
+ /**鎸夋湀 */
+ Month = 10,
+ /**鎸夊ぉ */
+ Day = 20,
+ /**鎸夋椂 */
+ Hour = 30,
+ /**璁′欢 */
+ Piece = 40,
+}
+
/** 瀹㈡埛绔被鍨� */
export enum EnumClientType {
/**鐢佃剳缃戦〉 */
@@ -53,18 +65,20 @@
export enum EnumResourceController {
/**鏁版嵁瀛楀吀 */
Dictionary = 0,
+ /**浠诲姟 */
+ Task = 1,
/**鐢ㄦ埛璁よ瘉 */
- Auth = 1,
+ Auth = 2,
/**鐢ㄦ埛鑿滃崟 */
- Menu = 2,
+ Menu = 3,
/**鐢ㄦ埛璧勬簮 */
- Resource = 3,
+ Resource = 4,
/**鐢ㄦ埛瑙掕壊 */
- Role = 4,
+ Role = 5,
/**鐢ㄦ埛淇℃伅 */
- UserInfo = 5,
+ UserInfo = 6,
/**浼佷笟淇℃伅 */
- Enterprise = 6,
+ Enterprise = 7,
}
/** 璧勬簮璇锋眰鏂瑰紡 */
@@ -95,12 +109,46 @@
All = 999,
}
+/** 缁撶畻鍛ㄦ湡 */
+export enum EnumSettlementCycle {
+ /**鏈堢粨 */
+ Month = 10,
+ /**鍛ㄧ粨 */
+ Week = 20,
+ /**鏃ョ粨 */
+ Day = 30,
+}
+
/** 鐭俊閫氶亾 */
export enum EnumSmsAccess {
/**闃块噷浜戠煭淇� */
AliyunSms = 10,
}
+/** 浠诲姟鍙戝竷鐘舵�� */
+export enum EnumTaskReleaseStatus {
+ /**鍙戝竷涓� */
+ InProcess = 20,
+ /**宸插仠姝� */
+ Stopped = 100,
+}
+
+/** 浠诲姟瀹夋帓鐘舵�� */
+export enum EnumTaskStatus {
+ /**寰呭畨鎺� */
+ Wait = 10,
+ /**宸插畨鎺� */
+ Complete = 20,
+}
+
+/** 鐢ㄦ埛鎬у埆 */
+export enum EnumUserGender {
+ /**鐢� */
+ Male = 10,
+ /**濂� */
+ Female = 20,
+}
+
/** 鐢ㄦ埛淇℃伅鐘舵�� */
export enum EnumUserInfoStatus {
/**姝e父 */
diff --git a/src/hooks/dic.ts b/src/hooks/dic.ts
index 5d9baff..bd004f1 100644
--- a/src/hooks/dic.ts
+++ b/src/hooks/dic.ts
@@ -1,5 +1,7 @@
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import * as dictionaryServices from '@/services/api/dictionary';
+import { formatAreaListToTree } from '@/utils';
+import { CascaderProps } from 'element-plus';
export function useGetDictionaryCategorySelect() {
const { data: dictionaryCategoryList, refetch } = useQuery({
@@ -31,11 +33,11 @@
}
function getDictionaryCategoryById(id: string) {
- return dictionaryCategoryList.value.find((x) => x.value === id);
+ return dictionaryCategoryList.value.find((x) => x.data?.id === id);
}
function getDictionaryCategoryByCode(code: string) {
- return dictionaryCategoryList.value.find((x) => x.code === code);
+ return dictionaryCategoryList.value.find((x) => x.data?.code === code);
}
function getDictionaryCategoryNameByCode(code: string) {
@@ -55,36 +57,53 @@
type UseDictionaryDataSelectOptions = {
categoryId?: MaybeRef<string>;
categoryCode?: MaybeRef<CategoryCode>;
+ parentId?: MaybeRef<string>;
+ staleTime?: number;
+ /** 鍏抽敭瀛� */
+ keywords?: MaybeRef<string>;
+ /** 鏌ヨ鎵�鏈� */
+ all?: MaybeRef<boolean>;
+ maxDeep?: number;
};
export function useDictionaryDataSelect({
categoryId,
categoryCode,
+ parentId,
+ staleTime,
+ keywords,
+ all,
+ maxDeep,
}: UseDictionaryDataSelectOptions) {
+ const params = computed(() => ({
+ categoryId: unref(categoryId),
+ categoryCode: unref(categoryCode),
+ parentId: unref(parentId),
+ keywords: unref(keywords),
+ all: unref(all),
+ maxDeep: maxDeep,
+ }));
const { data: dictionaryDataList, refetch } = useQuery({
- queryKey: ['dictionaryServices/getDictionaryDataSelect', categoryId, categoryCode],
+ queryKey: ['dictionaryServices/getDictionaryDataSelect', params],
queryFn: async () => {
- let res = await dictionaryServices.getDictionaryDataSelect(
- {
- categoryId: unref(categoryId),
- categoryCode: unref(categoryCode),
- },
- { showLoading: false }
- );
+ let res = await dictionaryServices.getDictionaryDataSelect(params.value, {
+ showLoading: false,
+ });
return res.map((x) => ({
...x,
code: x.data?.code ?? '',
}));
},
- placeholderData: () => [] as API.SelectOptionGuidGetDictionaryDataSelectQueryResultOption[],
+ placeholderData: () => [] as API.SelectOptionStringGetDictionaryDataSelectQueryResultOption[],
+ staleTime,
});
function getDictionaryDataNameById(id: string) {
- return dictionaryDataList.value?.find((x) => x.value === id)?.label;
+ return dictionaryDataList.value?.find((x) => x.data?.id === id)?.label;
}
function getDictionaryDataByCode(code: string) {
- return dictionaryDataList.value?.find((x) => x.code === code);
+ return dictionaryDataList.value?.find((x) => x.data?.code === code);
}
function getDictionaryDataNameByCode(code: string) {
@@ -95,7 +114,7 @@
function ensureQueryData() {
return queryClient.ensureQueryData<
- API.SelectOptionGuidGetDictionaryDataSelectQueryResultOption[]
+ API.SelectOptionStringGetDictionaryDataSelectQueryResultOption[]
>({
queryKey: ['dictionaryServices/getDictionaryDataSelect'],
});
@@ -103,7 +122,7 @@
function updateDictionaryDataSelect(categoryId?: string) {
queryClient.invalidateQueries({
- queryKey: ['dictionaryServices/getDictionaryDataSelect', categoryId],
+ queryKey: ['dictionaryServices/getDictionaryDataSelect'],
});
}
@@ -117,3 +136,117 @@
updateDictionaryDataSelect,
};
}
+
+export function useArea() {
+ const queryClient = useQueryClient();
+
+ function getAreaList(parentId = '') {
+ const params = {
+ categoryCode: CategoryCode.Area,
+ parentId: parentId,
+ };
+ return queryClient.fetchQuery({
+ queryKey: ['dictionaryServices/getDictionaryDataSelect', params],
+ queryFn: async () => {
+ let res = await dictionaryServices.getDictionaryDataSelect(params, { showLoading: false });
+ return res.map(convertDictionaryToAreaTreeNode);
+ },
+ staleTime: Infinity,
+ });
+ }
+
+ return { getAreaList };
+}
+
+function convertDictionaryToAreaTreeNode(
+ item: API.SelectOptionStringGetDictionaryDataSelectQueryResultOption
+) {
+ return {
+ children: [],
+ areaCode: item.data?.code,
+ parentCode: '',
+ areaName: item.label,
+ layer: Number(item.data?.field4),
+ sort: item.data?.sort,
+ id: item.data?.id,
+ } as API.AreaTreeNode;
+}
+
+/**
+ *
+ * @description 鏆傛椂鏃犳硶浣跨敤
+ */
+export function useAllAreaList() {
+ const { dictionaryDataList } = useDictionaryDataSelect({
+ categoryCode: CategoryCode.Area,
+ staleTime: Infinity,
+ all: true,
+ maxDeep: AreaType.Area,
+ });
+
+ const areaList = computed(() => dictionaryDataList.value.map(convertDictionaryToAreaTreeNode));
+
+ const areaTreeProps = {
+ children: 'children',
+ label: 'areaName',
+ value: 'areaCode',
+ };
+
+ const areaTree = computed(() => formatAreaListToTree(areaList.value));
+
+ const findAreaCodeFromName = (areaName: string) => {
+ const areaItem = areaList.value.find((x) => x.areaName === areaName);
+ return areaItem?.areaCode ?? '';
+ };
+
+ const findAreaNameFromCode = (areaCode: string) => {
+ const areaItem = areaList.value.find((x) => x.areaCode === areaCode);
+ return areaItem?.areaName ?? '';
+ };
+
+ const findAreaItemFromCode = (areaCode: string) => {
+ const areaItem = areaList.value.find((x) => x.areaCode === areaCode);
+ return areaItem;
+ };
+
+ return {
+ areaList,
+ areaTree,
+ areaTreeProps,
+ findAreaCodeFromName,
+ findAreaNameFromCode,
+ findAreaItemFromCode,
+ };
+}
+
+type UseAreaByCascaderOptions = {
+ layer?: AreaType;
+};
+
+/**
+ * @description 鑱旂骇閫夋嫨涓娇鐢�
+ */
+export function useAreaByCascader(options: UseAreaByCascaderOptions = {}) {
+ const { layer = AreaType.Area } = options;
+
+ const { getAreaList } = useArea();
+
+ return computed(() => ({
+ props: {
+ label: 'areaName',
+ value: 'areaCode',
+ lazy: true,
+ async lazyLoad(node, resolve) {
+ const { level, data } = node;
+ const areas = (await getAreaList((data as API.AreaTreeNode).id)) as any[];
+
+ return resolve(
+ areas.map((x) => ({
+ ...x,
+ leaf: x.layer >= layer,
+ }))
+ );
+ },
+ } as CascaderProps,
+ }));
+}
diff --git a/src/services/api/dictionary.ts b/src/services/api/dictionary.ts
index b4233ab..c48fb89 100644
--- a/src/services/api/dictionary.ts
+++ b/src/services/api/dictionary.ts
@@ -79,7 +79,7 @@
params: API.APIgetDictionaryDataSelectParams,
options?: API.RequestConfig
) {
- return request<API.SelectOptionGuidGetDictionaryDataSelectQueryResultOption[]>(
+ return request<API.SelectOptionStringGetDictionaryDataSelectQueryResultOption[]>(
'/api/main/dictionary/getDictionaryDataSelect',
{
method: 'GET',
@@ -135,3 +135,18 @@
...(options || {}),
});
}
+
+/** 鍚屾浜哄姏璧勬簮鍦板尯瀛楀吀鏁版嵁 POST /api/main/dictionary/syncHumanResourcesAreaDictionaryData */
+export async function syncHumanResourcesAreaDictionaryData(
+ body: API.SyncHumanResourcesAreaDictionaryDataCommand,
+ options?: API.RequestConfig
+) {
+ return request<number>('/api/main/dictionary/syncHumanResourcesAreaDictionaryData', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json-patch+json',
+ },
+ data: body,
+ ...(options || {}),
+ });
+}
diff --git a/src/services/api/index.ts b/src/services/api/index.ts
index dfc336d..de6fd71 100644
--- a/src/services/api/index.ts
+++ b/src/services/api/index.ts
@@ -9,6 +9,7 @@
import * as resource from './resource';
import * as role from './role';
import * as enterprise from './enterprise';
+import * as task from './task';
export default {
userInfo,
auth,
@@ -17,4 +18,5 @@
resource,
role,
enterprise,
+ task,
};
diff --git a/src/services/api/task.ts b/src/services/api/task.ts
new file mode 100644
index 0000000..264a625
--- /dev/null
+++ b/src/services/api/task.ts
@@ -0,0 +1,45 @@
+/* eslint-disable */
+// @ts-ignore
+import { request } from '@/utils/request';
+
+/** 鏌ヨ浠诲姟璇︽儏 GET /api/main/task/getTaskInfo */
+export async function getTaskInfo(
+ // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+ params: API.APIgetTaskInfoParams,
+ options?: API.RequestConfig
+) {
+ return request<API.GetTaskInfoQueryResult>('/api/main/task/getTaskInfo', {
+ method: 'GET',
+ params: {
+ ...params,
+ },
+ ...(options || {}),
+ });
+}
+
+/** 鏌ヨ浠诲姟鍒嗛〉鍒楄〃 POST /api/main/task/getTaskInfos */
+export async function getTaskInfos(body: API.GetTaskInfosQuery, options?: API.RequestConfig) {
+ return request<API.PagedListQueryResultGetTaskInfosQueryResultItem>(
+ '/api/main/task/getTaskInfos',
+ {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json-patch+json',
+ },
+ data: body,
+ ...(options || {}),
+ }
+ );
+}
+
+/** 淇濆瓨浠诲姟 POST /api/main/task/saveTaskInfo */
+export async function saveTaskInfo(body: API.SaveTaskInfoCommand, options?: API.RequestConfig) {
+ return request<string>('/api/main/task/saveTaskInfo', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json-patch+json',
+ },
+ data: body,
+ ...(options || {}),
+ });
+}
diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts
index 2ee35ae..f99c072 100644
--- a/src/services/api/typings.d.ts
+++ b/src/services/api/typings.d.ts
@@ -30,6 +30,12 @@
categoryCode?: string;
/** 涓婄骇Id */
parentId?: string;
+ /** 鍏抽敭瀛� */
+ keywords?: string;
+ /** 鏌ヨ鎵�鏈� */
+ all?: boolean;
+ /** 鏈�澶ф繁搴� */
+ maxDeep?: number;
}
interface APIgetEnterpriseElectronSignSettingParams {
@@ -87,6 +93,11 @@
roleId?: string;
}
+ interface APIgetTaskInfoParams {
+ /** Id */
+ id?: string;
+ }
+
interface APIgetUserInfoRolesParams {
/** 鐢ㄦ埛Id */
userInfoId?: string;
@@ -104,6 +115,24 @@
interface DeleteRoleCommand {
ids: string[];
+ }
+
+ interface DictionaryDataQueryModel {
+ /** 缂栧彿 */
+ code?: string;
+ /** 鍚嶇О */
+ name?: string;
+ }
+
+ enum EnumBillingMethod {
+ /**鎸夋湀 */
+ Month = 10,
+ /**鎸夊ぉ */
+ Day = 20,
+ /**鎸夋椂 */
+ Hour = 30,
+ /**璁′欢 */
+ Piece = 40,
}
enum EnumClientType {
@@ -152,18 +181,20 @@
enum EnumResourceController {
/**鏁版嵁瀛楀吀 */
Dictionary = 0,
+ /**浠诲姟 */
+ Task = 1,
/**鐢ㄦ埛璁よ瘉 */
- Auth = 1,
+ Auth = 2,
/**鐢ㄦ埛鑿滃崟 */
- Menu = 2,
+ Menu = 3,
/**鐢ㄦ埛璧勬簮 */
- Resource = 3,
+ Resource = 4,
/**鐢ㄦ埛瑙掕壊 */
- Role = 4,
+ Role = 5,
/**鐢ㄦ埛淇℃伅 */
- UserInfo = 5,
+ UserInfo = 6,
/**浼佷笟淇℃伅 */
- Enterprise = 6,
+ Enterprise = 7,
}
enum EnumResourceMethod {
@@ -192,9 +223,39 @@
All = 999,
}
+ enum EnumSettlementCycle {
+ /**鏈堢粨 */
+ Month = 10,
+ /**鍛ㄧ粨 */
+ Week = 20,
+ /**鏃ョ粨 */
+ Day = 30,
+ }
+
enum EnumSmsAccess {
/**闃块噷浜戠煭淇� */
AliyunSms = 10,
+ }
+
+ enum EnumTaskReleaseStatus {
+ /**鍙戝竷涓� */
+ InProcess = 20,
+ /**宸插仠姝� */
+ Stopped = 100,
+ }
+
+ enum EnumTaskStatus {
+ /**寰呭畨鎺� */
+ Wait = 10,
+ /**宸插畨鎺� */
+ Complete = 20,
+ }
+
+ enum EnumUserGender {
+ /**鐢� */
+ Male = 10,
+ /**濂� */
+ Female = 20,
}
enum EnumUserInfoStatus {
@@ -311,6 +372,24 @@
/** 閿欒鐮� */
errorCode?: string;
data?: GetRoleQueryResult;
+ /** 鎵ц鎴愬姛 */
+ success?: boolean;
+ /** 閿欒淇℃伅 */
+ msg?: any;
+ /** 闄勫姞鏁版嵁 */
+ extras?: any;
+ /** 鏃堕棿鎴� */
+ timestamp?: number;
+ }
+
+ interface FriendlyResultGetTaskInfoQueryResult {
+ /** 璺熻釜Id */
+ traceId?: string;
+ /** 鐘舵�佺爜 */
+ code?: number;
+ /** 閿欒鐮� */
+ errorCode?: string;
+ data?: GetTaskInfoQueryResult;
/** 鎵ц鎴愬姛 */
success?: boolean;
/** 閿欒淇℃伅 */
@@ -473,7 +552,7 @@
timestamp?: number;
}
- interface FriendlyResultListSelectOptionGuidGetDictionaryDataSelectQueryResultOption {
+ interface FriendlyResultListSelectOptionStringGetDictionaryDataSelectQueryResultOption {
/** 璺熻釜Id */
traceId?: string;
/** 鐘舵�佺爜 */
@@ -481,7 +560,7 @@
/** 閿欒鐮� */
errorCode?: string;
/** 鏁版嵁 */
- data?: SelectOptionGuidGetDictionaryDataSelectQueryResultOption[];
+ data?: SelectOptionStringGetDictionaryDataSelectQueryResultOption[];
/** 鎵ц鎴愬姛 */
success?: boolean;
/** 閿欒淇℃伅 */
@@ -582,6 +661,24 @@
timestamp?: number;
}
+ interface FriendlyResultPagedListQueryResultGetTaskInfosQueryResultItem {
+ /** 璺熻釜Id */
+ traceId?: string;
+ /** 鐘舵�佺爜 */
+ code?: number;
+ /** 閿欒鐮� */
+ errorCode?: string;
+ data?: PagedListQueryResultGetTaskInfosQueryResultItem;
+ /** 鎵ц鎴愬姛 */
+ success?: boolean;
+ /** 閿欒淇℃伅 */
+ msg?: any;
+ /** 闄勫姞鏁版嵁 */
+ extras?: any;
+ /** 鏃堕棿鎴� */
+ timestamp?: number;
+ }
+
interface FriendlyResultPasswordLoginCommandCallback {
/** 璺熻釜Id */
traceId?: string;
@@ -639,6 +736,8 @@
categoryId?: string;
/** 绫诲埆缂栧彿锛圛d/缂栧彿浜岄�変竴锛� */
categoryCode?: string;
+ /** 涓婄骇Id */
+ parentId?: string;
/** 鍏抽敭瀛� */
keywords?: string;
}
@@ -697,16 +796,16 @@
legalPerson?: string;
/** 娉曚汉韬唤璇佸彿 */
legalIdentity?: string;
- /** 鎵�鍦ㄧ渷浠絀d */
- provinceId?: string;
+ /** 鎵�鍦ㄧ渷浠界紪鍙� */
+ provinceCode?: string;
/** 鎵�鍦ㄧ渷浠� */
provinceContent?: string;
- /** 鎵�鍦ㄥ煄甯侷d */
- cityId?: string;
+ /** 鎵�鍦ㄥ煄甯傜紪鍙� */
+ cityCode?: string;
/** 鎵�鍦ㄥ煄甯� */
cityContent?: string;
- /** 鎵�灞炶涓欼d */
- industryTypeId?: string;
+ /** 鎵�灞炶涓氱紪鍙� */
+ industryTypeCode?: string;
/** 鎵�灞炶涓� */
industryTypeContent?: string;
/** 涓昏惀涓氬姟 */
@@ -1000,6 +1099,72 @@
isChecked?: boolean;
}
+ interface GetTaskInfoQueryResult {
+ /** Id */
+ id?: string;
+ /** 浠诲姟鍚嶇О */
+ name?: string;
+ billingMethod?: EnumBillingMethod;
+ /** 鏈嶅姟璐� */
+ serviceFee?: number;
+ settlementCycle?: EnumSettlementCycle;
+ /** 绂忓埄 */
+ benefits?: DictionaryDataQueryModel[];
+ /** 骞撮緞鑼冨洿鏈�灏� */
+ ageMinLimit?: number;
+ /** 骞撮緞鑼冨洿澶� */
+ ageMaxLimit?: number;
+ genderLimit?: EnumUserGender;
+ /** 璧勬牸璇佷功绫诲瀷 */
+ credentialLimits?: DictionaryDataQueryModel[];
+ /** 浠诲姟鍦扮偣鎵�灞炵渷浠界紪鍙� */
+ provinceCode?: string;
+ /** 浠诲姟鍦扮偣鎵�灞炵渷浠� */
+ provinceName?: string;
+ /** 浠诲姟鍦扮偣鎵�灞炲煄甯傜紪鍙� */
+ cityCode?: string;
+ /** 浠诲姟鍦扮偣鎵�灞炲煄甯� */
+ cityName?: string;
+ /** 浠诲姟鍦扮偣璇︾粏鍦板潃 */
+ address?: string;
+ /** 浠诲姟寮�濮嬫椂闂� */
+ beginTime?: string;
+ /** 浠诲姟缁撴潫鏃堕棿 */
+ endTime?: string;
+ /** 鍒涘缓鏃堕棿 */
+ createdTime?: string;
+ }
+
+ interface GetTaskInfosQuery {
+ pageModel?: PagedListQueryPageModel;
+ /** 鍏抽敭瀛楋紙浠诲姟鍚嶇О锛� */
+ keywords?: string;
+ /** 鍙戝竷鏃堕棿 */
+ time?: string;
+ status?: EnumTaskStatus;
+ releaseStatus?: EnumTaskReleaseStatus;
+ }
+
+ interface GetTaskInfosQueryResultItem {
+ /** 浠诲姟鍚嶇О */
+ name: string;
+ /** 浠诲姟鍗曞彿 */
+ code?: string;
+ billingMethod?: EnumBillingMethod;
+ /** 鏈嶅姟璐� */
+ serviceFee?: number;
+ settlementCycle?: EnumSettlementCycle;
+ genderLimit?: EnumUserGender;
+ /** 鎶ュ悕浜烘暟 */
+ userCount?: number;
+ status?: EnumTaskStatus;
+ /** 浠诲姟寮�濮嬫椂闂� */
+ beginTime?: string;
+ /** 浠诲姟缁撴潫鏃堕棿 */
+ endTime?: string;
+ releaseStatus?: EnumTaskReleaseStatus;
+ }
+
interface GetUserInfoRolesQueryResultItem {
/** 瑙掕壊Id */
id?: string;
@@ -1054,6 +1219,12 @@
pageModel?: PagedListQueryResultPageModel;
/** 鏁版嵁 */
data?: GetRolesQueryResultItem[];
+ }
+
+ interface PagedListQueryResultGetTaskInfosQueryResultItem {
+ pageModel?: PagedListQueryResultPageModel;
+ /** 鏁版嵁 */
+ data?: GetTaskInfosQueryResultItem[];
}
interface PagedListQueryResultPageModel {
@@ -1138,12 +1309,12 @@
legalPerson?: string;
/** 娉曚汉韬唤璇佸彿 */
legalIdentity?: string;
- /** 鎵�鍦ㄧ渷浠絀d */
- provinceId?: string;
- /** 鎵�鍦ㄥ煄甯侷d */
- cityId?: string;
- /** 鎵�灞炶涓欼d */
- industryTypeId?: string;
+ /** 鎵�鍦ㄧ渷浠界紪鍙� */
+ provinceCode?: string;
+ /** 鎵�鍦ㄥ煄甯傜紪鍙� */
+ cityCode?: string;
+ /** 鎵�灞炶涓氱紪鍙� */
+ industryTypeCode?: string;
/** 涓昏惀涓氬姟 */
mainBusiness?: string;
/** 鑱旂郴浜� */
@@ -1299,6 +1470,36 @@
resources?: GetRoleQueryResultResource[];
}
+ interface SaveTaskInfoCommand {
+ /** Id */
+ id?: string;
+ /** 浠诲姟鍚嶇О */
+ name: string;
+ billingMethod: EnumBillingMethod;
+ /** 鏈嶅姟璐� */
+ serviceFee: number;
+ settlementCycle: EnumSettlementCycle;
+ /** 绂忓埄缂栧彿 */
+ benefits?: string[];
+ /** 骞撮緞鑼冨洿鏈�灏� */
+ ageMinLimit: number;
+ /** 骞撮緞鑼冨洿澶� */
+ ageMaxLimit: number;
+ genderLimit: EnumUserGender;
+ /** 璧勬牸璇佷功绫诲瀷缂栧彿 */
+ credentialLimits?: string[];
+ /** 浠诲姟鍦扮偣鎵�灞炵渷浠界紪鍙� */
+ provinceCode: string;
+ /** 浠诲姟鍦扮偣鎵�灞炲煄甯傜紪鍙� */
+ cityCode: string;
+ /** 浠诲姟鍦扮偣璇︾粏鍦板潃 */
+ address: string;
+ /** 浠诲姟寮�濮嬫椂闂� */
+ beginTime: string;
+ /** 浠诲姟缁撴潫鏃堕棿 */
+ endTime: string;
+ }
+
interface SelectOptionGuidGetDictionaryCategorySelectQueryOption {
/** 鍊� */
value?: string;
@@ -1308,7 +1509,7 @@
data?: any;
}
- interface SelectOptionGuidGetDictionaryDataSelectQueryResultOption {
+ interface SelectOptionStringGetDictionaryDataSelectQueryResultOption {
/** 鍊� */
value?: string;
/** 鏍囩 */
@@ -1378,4 +1579,6 @@
ids?: string[];
status?: EnumUserInfoStatus;
}
+
+ type SyncHumanResourcesAreaDictionaryDataCommand = Record<string, any>;
}
diff --git a/src/utils/common/area.ts b/src/utils/common/area.ts
index cffe5d7..485b749 100644
--- a/src/utils/common/area.ts
+++ b/src/utils/common/area.ts
@@ -1,13 +1,14 @@
import { AreaType } from '@/constants';
import _ from 'lodash';
-export interface AreaTreeNode extends API.AreaDto {
- children?: AreaTreeNode[];
-}
+// type formatAreaListToTreeOptions = {
+// parentId?: string;
+// maxLayer?: number;
+// };
export function formatAreaListToTree(
- areaDataList: API.AreaDto[],
- parentId: number,
+ areaDataList: API.AreaTreeNode[],
+ parentId = '',
maxLayer = AreaType.Area
) {
const treeNodeList: API.AreaTreeNode[] = [];
diff --git a/src/views/EnterpriseManage/AddOrEditEnterprise.vue b/src/views/EnterpriseManage/AddOrEditEnterprise.vue
index 403484d..755c60d 100644
--- a/src/views/EnterpriseManage/AddOrEditEnterprise.vue
+++ b/src/views/EnterpriseManage/AddOrEditEnterprise.vue
@@ -13,7 +13,7 @@
export default defineComponent({
name: 'AddOrEditEnterprise',
beforeRouteEnter(to) {
- to.meta.title = to.params.id ? '缂栬緫' : '鏂板';
+ to.meta.title = to.params.id ? '缂栬緫浼佷笟' : '鏂板浼佷笟';
setPageTitle(to.meta.title as string);
},
});
diff --git a/src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue b/src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue
index 13f762d..e462e86 100644
--- a/src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue
+++ b/src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue
@@ -49,7 +49,7 @@
/>
</ProFormItemV2>
</ProFormColItem>
- <!-- <ProFormColItem :span="8">
+ <ProFormColItem :span="8">
<ProFormItemV2
label="鎵�鍦ㄥ湴鍖�:"
prop="areaList"
@@ -63,13 +63,14 @@
<ProFromAddressSelectV2
v-model:areaList="form.areaList"
areaListPlaceholder="璇烽�夋嫨"
+ :layer="AreaType.City"
/>
</ProFormItemV2>
- </ProFormColItem> -->
+ </ProFormColItem>
<ProFormColItem :span="8">
<ProFormItemV2 label="鎵�灞炶涓�:" prop="industryTypeId">
<ProFormSelect
- v-model="form.industryTypeId"
+ v-model="form.industryTypeCode"
placeholder="璇烽�夋嫨鎵�灞炶涓�"
:value-enum="dictionaryDataList"
clearable
@@ -205,6 +206,7 @@
import { validateFormList, filterCN } from '@/utils';
import { Message, BoleRegExp } from '@bole-core/core';
import { useQuery } from '@tanstack/vue-query';
+import { AreaType } from '@/constants';
defineOptions({ name: 'AddOrEditEnterpriseView' });
@@ -236,9 +238,9 @@
legalPerson: '',
legalIdentity: '',
societyCreditCode: '',
- industryTypeId: '',
+ industryTypeCode: '',
mainBusiness: '',
- areaList: [130000, 131000] as number[],
+ areaList: [] as string[],
contacts: '',
contactPhoneNumber: '',
contactEmail: '',
@@ -264,12 +266,13 @@
form.legalPerson = data.legalPerson;
form.legalIdentity = data.legalIdentity;
form.societyCreditCode = data.societyCreditCode;
- form.industryTypeId = data.industryTypeId;
+ form.industryTypeCode = data.industryTypeCode;
form.mainBusiness = data.mainBusiness;
form.contacts = data.contacts;
form.contactPhoneNumber = data.contactPhoneNumber;
form.contactEmail = data.contactEmail;
form.userName = data.userName;
+ form.areaList = [data.provinceCode, data.cityCode].filter(Boolean);
},
enabled: computed(() => !!id),
});
@@ -293,14 +296,15 @@
async function handleCreateOrEditFlexEnterprise() {
try {
+ console.log('form.areaList: ', form.areaList);
let params: API.SaveEnterpriseCommand = {
enterpriseName: form.enterpriseName,
legalPerson: form.legalPerson,
legalIdentity: form.legalIdentity,
societyCreditCode: form.societyCreditCode,
- provinceId: '',
- cityId: '',
- industryTypeId: form.industryTypeId,
+ provinceCode: form.areaList[0],
+ cityCode: form.areaList[1],
+ industryTypeCode: form.industryTypeCode,
mainBusiness: form.mainBusiness,
contacts: form.contacts,
contactPhoneNumber: form.contactPhoneNumber,
diff --git a/src/views/Permission/RoleManage.vue b/src/views/Permission/RoleManage.vue
index ba103bb..976860e 100644
--- a/src/views/Permission/RoleManage.vue
+++ b/src/views/Permission/RoleManage.vue
@@ -125,6 +125,7 @@
},
userType: extraParamState.userType,
clientType: extraParamState.clientType,
+ keywords: extraParamState.queryCondition,
};
let res = await roleServices.getRoles(params, {
showLoading: !state.loading,
@@ -160,7 +161,10 @@
detail: detail,
});
} else {
- handleAdd();
+ handleAdd({
+ userType: extraParamState.userType,
+ clientType: extraParamState.clientType,
+ });
}
} catch (error) {}
}
diff --git a/types/api.d.ts b/types/api.d.ts
index ce18c18..85afbfe 100644
--- a/types/api.d.ts
+++ b/types/api.d.ts
@@ -18,13 +18,28 @@
field1?:string
}
- interface SelectOptionGuidGetDictionaryCategorySelectQueryOption{
+ interface SelectOptionStringGetDictionaryDataSelectQueryResultOption{
fieldNamesMap?: SelectQueryResultOptionGuidGetDictionaryCategorySelectQueryOptionMap;
code?:string
}
- interface SelectOptionGuidGetDictionaryDataSelectQueryResultOption{
+ interface SelectOptionGuidGetDictionaryCategorySelectQueryOption{
code?:string
}
+ interface AreaTreeNode {
+ children?: AreaTreeNode[];
+ /** 缂栫爜 */
+ areaCode?: string;
+ /** 鐖剁骇缂栫爜 */
+ parentCode?: string;
+ /** 鍚嶇О */
+ areaName?: string;
+ /** 1鐪� 2甯� 3鍖� 4闀� */
+ layer?: number;
+ /** 鎺掑簭 */
+ sort?: number;
+ id?: string
+ }
+
}
--
Gitblit v1.9.1