zhengyiming
7 天以前 4ea3fb422f1c1af628d948eb3908b6a61f71bbdf
fix: 修改
1个文件已添加
13个文件已修改
622 ■■■■ 已修改文件
.eslintrc-auto-import.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
auto-imports.d.ts 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Form/ProFromAddressSelectV2.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/apiEnum.ts 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/dic.ts 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/dictionary.ts 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/task.ts 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/typings.d.ts 245 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/common/area.ts 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EnterpriseManage/AddOrEditEnterprise.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EnterpriseManage/components/AddOrEditEnterpriseView.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Permission/RoleManage.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
types/api.d.ts 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.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,
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']>
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);
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 {
  /**正常 */
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,
  }));
}
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 || {}),
  });
}
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,
};
src/services/api/task.ts
New file
@@ -0,0 +1,45 @@
/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/request';
/** 查询任务详情 GET /api/main/task/getTaskInfo */
export async function getTaskInfo(
  // 叠加生成的Param类型 (非body参数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 || {}),
  });
}
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;
    /** 类别编号(Id/编号二选一) */
    categoryCode?: string;
    /** 上级Id */
    parentId?: string;
    /** 关键字 */
    keywords?: string;
  }
@@ -697,16 +796,16 @@
    legalPerson?: string;
    /** 法人身份证号 */
    legalIdentity?: string;
    /** 所在省份Id */
    provinceId?: string;
    /** 所在省份编号 */
    provinceCode?: string;
    /** 所在省份 */
    provinceContent?: string;
    /** 所在城市Id */
    cityId?: string;
    /** 所在城市编号 */
    cityCode?: string;
    /** 所在城市 */
    cityContent?: string;
    /** 所属行业Id */
    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;
    /** 所在省份Id */
    provinceId?: string;
    /** 所在城市Id */
    cityId?: string;
    /** 所属行业Id */
    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>;
}
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[] = [];
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);
  },
});
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,
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) {}
}
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
  }
}