@dazhicheng/ui 1.5.129 → 1.5.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,3 +2,7 @@
2
2
  export declare function queryDataPermissionDetailDataTypeContext(params: IamAPI.UserDataPermissionQueryParam, options?: {
3
3
  [key: string]: any;
4
4
  }): Promise<IamAPI.DataPermissionDetailDTO[]>;
5
+ /** 角色分页 角色分页 POST /user/page */
6
+ export declare function pageUser(params: IamAPI.UserDTO, options?: {
7
+ [key: string]: any;
8
+ }): Promise<IamAPI.PageResultUserDTO>;
@@ -18,6 +18,7 @@ declare const _default: import('vue').DefineComponent<PanelMiddleProps, {
18
18
  onOptionCheck?: ((value: PanelSelectValue, checked: boolean) => any) | undefined;
19
19
  onOptionsCheck?: ((values: PanelSelectValue[], checked: boolean) => any) | undefined;
20
20
  }>, {
21
+ disabled: boolean;
21
22
  scrollToGroupValue: PanelSelectValue;
22
23
  pasteSearch: boolean;
23
24
  separator: string;
@@ -5,6 +5,7 @@ type __VLS_Props = {
5
5
  prefixCls: string;
6
6
  multiple: boolean;
7
7
  selectedOptions: PanelTreeNode[];
8
+ disabled: boolean;
8
9
  };
9
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
11
  remove: (value: PanelSelectValue) => any;
@@ -9,6 +9,8 @@ export interface PanelSelectOption extends Recordable {
9
9
  children?: PanelSelectOption[];
10
10
  }
11
11
  export interface PanelMiddleProps {
12
+ /** 是否禁用 */
13
+ disabled: boolean;
12
14
  /** class */
13
15
  prefixCls: string;
14
16
  /** 是否多选 */
@@ -54,6 +56,8 @@ export interface PanelSelectTreeConfig {
54
56
  rootParentValue?: PanelSelectValue | null;
55
57
  }
56
58
  export interface PanelContainerProps {
59
+ /** 是否禁用 */
60
+ disabled?: boolean;
57
61
  /** 是否显示左侧导航树 */
58
62
  showNav?: boolean;
59
63
  /** 是否多选 */
@@ -0,0 +1,29 @@
1
+ import { MaybeRef, Ref } from 'vue';
2
+ export type BudinessDataType = "platformId" | "shopId" | "purchasePlaceId" | "businessType" | "lockUserId" | "userId";
3
+ export type DataPermissionOptionItem = Record<string, any> & {
4
+ label?: string;
5
+ value?: string | number;
6
+ };
7
+ export type DataPermissionOptionsMap = Partial<Record<BudinessDataType, DataPermissionOptionItem[]>>;
8
+ export interface UseBudinessDataOptions {
9
+ codes: BudinessDataType[];
10
+ dataSource?: MaybeRef<DataPermissionOptionsMap | undefined>;
11
+ }
12
+ /**
13
+ * 每个 code 对应的 label value 字段映射
14
+ */
15
+ export declare const fieldMap: Record<BudinessDataType, [string, string]>;
16
+ /**
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const { dataSource } = useFormSchemasLink({
21
+ * codes:['userId','shopId]
22
+ * })
23
+ *
24
+ * dataSource.value.userId
25
+ */
26
+ export declare function useDataPermissionOptions(options: UseBudinessDataOptions): {
27
+ dataSource: Ref<Record<BudinessDataType, DataPermissionOptionItem[]>>;
28
+ fetchData: () => Promise<void>;
29
+ };
@@ -1,16 +1,8 @@
1
1
  import { TtFormSchema } from '../components/tt-form';
2
2
  import { Recordable } from '../../../utils/src';
3
3
  import { MaybeRef, Ref } from 'vue';
4
- /**
5
- * 数据权限接口支持的联动数据类型。
6
- *
7
- * - platformId:平台
8
- * - shopId:店铺,默认会跟随平台值联动过滤
9
- * - purchasePlaceId:采购地
10
- * - businessType:业务线
11
- * - lockUserId:锁单人
12
- */
13
- export type DataType = "platformId" | "shopId" | "purchasePlaceId" | "businessType" | "lockUserId";
4
+ import { BudinessDataType, DataPermissionOptionsMap } from './useDataPermissionOptions';
5
+ type DataType = Exclude<BudinessDataType, "userId">;
14
6
  /**
15
7
  * 表单使用场景。
16
8
  *
@@ -71,7 +63,7 @@ export interface UseFormSchemasLinkOptions {
71
63
  /** 表单场景,默认 list */
72
64
  scene?: FormScene;
73
65
  /** 外部数据源。未传时会按 codes 调用 queryDataPermissionDetailDataTypeContext。 */
74
- dataSource?: MaybeRef<IamAPI.DataPermissionDetailDTO[] | undefined>;
66
+ dataSource?: MaybeRef<DataPermissionOptionsMap | undefined>;
75
67
  /** 字段级配置,key 为 DataType */
76
68
  fieldConfigs?: Partial<Record<DataType, FieldSchemaConfig>>;
77
69
  /** Schema 级覆盖。传函数时可基于默认 schema 做增量修改。 */
@@ -89,8 +81,6 @@ export type SelectOption = Recordable & {
89
81
  platformId?: string | number;
90
82
  };
91
83
  /**
92
- * 构建后的表单 schema 集合。
93
- *
94
84
  * 返回值会包含每个 DataType 对应的 TtFormSchema,以及当前已归一化的下拉数据源。
95
85
  */
96
86
  type UseFormSchemasLinkResult = Record<DataType, TtFormSchema> & {
@@ -106,7 +96,7 @@ type FormSchemasLinkBuilder = {
106
96
  /** 指定需要请求和构建的字段类型,默认包含全部 DataType */
107
97
  codes(codes: DataType[]): FormSchemasLinkBuilder;
108
98
  /** 使用外部数据源,跳过内部接口请求 */
109
- dataSource(dataSource: MaybeRef<IamAPI.DataPermissionDetailDTO[] | undefined>): FormSchemasLinkBuilder;
99
+ dataSource(dataSource: MaybeRef<DataPermissionOptionsMap | undefined>): FormSchemasLinkBuilder;
110
100
  /** 覆盖单个字段配置 */
111
101
  field(dataType: DataType, config: FieldSchemaConfig): FormSchemasLinkBuilder;
112
102
  build(): UseFormSchemasLinkResult;
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './components/tt-api-component';
23
23
  export * from './components/tt-log';
24
24
  export * from './components/tt-panel-select';
25
25
  export { useFormSchemasLink } from './hooks/useFormSchemasLink';
26
+ export { useDataPermissionOptions } from './hooks/useDataPermissionOptions';
26
27
  export { useFormat } from './hooks/useFormat';
27
28
  export { useLoading } from './hooks/useLoading';
28
29
  export { setXHR };