@kayak-sj/design 1.0.65 → 1.0.67

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.
@@ -1 +1 @@
1
- .k-icon[data-v-6fd081ab]{vertical-align:middle;flex-shrink:0;display:inline-block}.k-long-page-panel[data-v-9d6e7832]{background:var(--k-color-bg-surface,#fff);width:100%}.k-long-page-panel__title[data-v-9d6e7832]{height:50px;color:var(--k-color-text-regular,#333);padding-left:20px;font-size:16px;font-weight:700;line-height:70px;position:relative}.k-long-page-panel__title[data-v-9d6e7832]:after{content:"";background:var(--k-color-primary);border-radius:2px;width:30px;height:3px;position:absolute;bottom:0;left:23px}.k-long-page-panel__content[data-v-9d6e7832]{padding:10px 20px}.k-long-page[data-v-ac934c5d]{z-index:1000}.k-long-page__panel[data-v-ac934c5d]{margin-top:10px}.k-long-page__nav[data-v-ac934c5d]{z-index:12;background:var(--k-color-bg-surface,#fff);width:80px;min-height:30px;box-shadow:var(--k-shadow-md,0 0 14px 0 #cbcbcb8f);cursor:grab;-webkit-user-select:none;user-select:none;border-radius:10px 0 0 10px;position:fixed;top:33%;right:0}.k-long-page__nav[data-v-ac934c5d]:active{cursor:grabbing}.k-long-page__nav-item[data-v-ac934c5d]{text-align:center;cursor:pointer;width:100%;color:var(--k-color-text-regular,#606266);flex-direction:column;align-items:center;padding:10px 0;display:flex}.k-long-page__nav-item>span[data-v-ac934c5d]{font-size:12px;line-height:2}.k-long-page__nav-item-icon--active[data-v-ac934c5d]{display:none}.k-long-page__nav-item[data-v-ac934c5d]:hover{color:var(--k-color-primary-hover,var(--k-color-primary))}.k-long-page__nav-item:hover .k-long-page__nav-item-icon--default[data-v-ac934c5d]{display:none}.k-long-page__nav-item:hover .k-long-page__nav-item-icon--active[data-v-ac934c5d]{display:initial}.k-table-column__radio[data-v-578909bc] .el-radio__label{display:none}.k-table-column__tip[data-v-578909bc]{cursor:help;vertical-align:middle;border:1px solid;border-radius:50%;justify-content:center;align-items:center;width:14px;height:14px;margin-left:4px;font-size:10px;line-height:1;display:inline-flex}.k-table-column-selector__trigger[data-v-e0b3cf31]{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:28px;height:28px;padding:0;display:inline-flex}.k-table-column-selector__icon[data-v-e0b3cf31]{width:18px;height:18px;color:var(--el-text-color-regular);background:linear-gradient(currentColor,currentColor) 0 2px/100% 2px no-repeat,linear-gradient(currentColor,currentColor) 0 8px/100% 2px no-repeat,linear-gradient(currentColor,currentColor) 0 14px/70% 2px no-repeat;display:inline-block}.k-table-column-selector__header[data-v-e0b3cf31]{justify-content:space-between;align-items:center;height:40px;padding:0 10px;font-size:16px;font-weight:500;display:flex}.k-table-column-selector__divider[data-v-e0b3cf31]{margin:4px 0 12px}.k-table-column-selector__content[data-v-e0b3cf31]{flex-direction:column;gap:10px;max-height:300px;padding:0 10px 10px;display:flex;overflow-y:auto}.k-table-toolbar__main[data-v-bff19ed1]{align-items:center;min-height:30px;margin-bottom:4px;display:flex;position:relative}.k-table-toolbar__header[data-v-bff19ed1]{flex:1}.k-table-toolbar__extra[data-v-bff19ed1]{margin-left:auto}.k-table-toolbar__divider[data-v-bff19ed1]{background:var(--el-border-color-lighter);height:1px;margin:15px 0}.k-table-toolbar__selection[data-v-bff19ed1]{white-space:nowrap;margin-top:5px;font-size:12px}.k-table__sort-handle[data-v-ccb6f7c6]{cursor:grab;color:var(--el-text-color-secondary);letter-spacing:-2px;-webkit-user-select:none;user-select:none;display:inline-block}
1
+ .k-icon[data-v-6fd081ab]{vertical-align:middle;flex-shrink:0;display:inline-block}.k-long-page-panel[data-v-9d6e7832]{background:var(--k-color-bg-surface,#fff);width:100%}.k-long-page-panel__title[data-v-9d6e7832]{height:50px;color:var(--k-color-text-regular,#333);padding-left:20px;font-size:16px;font-weight:700;line-height:70px;position:relative}.k-long-page-panel__title[data-v-9d6e7832]:after{content:"";background:var(--k-color-primary);border-radius:2px;width:30px;height:3px;position:absolute;bottom:0;left:23px}.k-long-page-panel__content[data-v-9d6e7832]{padding:10px 20px}.k-long-page[data-v-ac934c5d]{z-index:1000}.k-long-page__panel[data-v-ac934c5d]{margin-top:10px}.k-long-page__nav[data-v-ac934c5d]{z-index:12;background:var(--k-color-bg-surface,#fff);width:80px;min-height:30px;box-shadow:var(--k-shadow-md,0 0 14px 0 #cbcbcb8f);cursor:grab;-webkit-user-select:none;user-select:none;border-radius:10px 0 0 10px;position:fixed;top:33%;right:0}.k-long-page__nav[data-v-ac934c5d]:active{cursor:grabbing}.k-long-page__nav-item[data-v-ac934c5d]{text-align:center;cursor:pointer;width:100%;color:var(--k-color-text-regular,#606266);flex-direction:column;align-items:center;padding:10px 0;display:flex}.k-long-page__nav-item>span[data-v-ac934c5d]{font-size:12px;line-height:2}.k-long-page__nav-item-icon--active[data-v-ac934c5d]{display:none}.k-long-page__nav-item[data-v-ac934c5d]:hover{color:var(--k-color-primary-hover,var(--k-color-primary))}.k-long-page__nav-item:hover .k-long-page__nav-item-icon--default[data-v-ac934c5d]{display:none}.k-long-page__nav-item:hover .k-long-page__nav-item-icon--active[data-v-ac934c5d]{display:initial}.k-table-column__radio[data-v-578909bc] .el-radio__label{display:none}.k-table-column__tip[data-v-578909bc]{cursor:help;vertical-align:middle;border:1px solid;border-radius:50%;justify-content:center;align-items:center;width:14px;height:14px;margin-left:4px;font-size:10px;line-height:1;display:inline-flex}.k-table-column-selector__trigger[data-v-e0b3cf31]{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:28px;height:28px;padding:0;display:inline-flex}.k-table-column-selector__icon[data-v-e0b3cf31]{width:18px;height:18px;color:var(--el-text-color-regular);background:linear-gradient(currentColor,currentColor) 0 2px/100% 2px no-repeat,linear-gradient(currentColor,currentColor) 0 8px/100% 2px no-repeat,linear-gradient(currentColor,currentColor) 0 14px/70% 2px no-repeat;display:inline-block}.k-table-column-selector__header[data-v-e0b3cf31]{justify-content:space-between;align-items:center;height:40px;padding:0 10px;font-size:16px;font-weight:500;display:flex}.k-table-column-selector__divider[data-v-e0b3cf31]{margin:4px 0 12px}.k-table-column-selector__content[data-v-e0b3cf31]{flex-direction:column;gap:10px;max-height:300px;padding:0 10px 10px;display:flex;overflow-y:auto}.k-table-toolbar__main[data-v-bff19ed1]{align-items:center;min-height:30px;margin-bottom:4px;display:flex;position:relative}.k-table-toolbar__header[data-v-bff19ed1]{flex:1}.k-table-toolbar__extra[data-v-bff19ed1]{margin-left:auto}.k-table-toolbar__divider[data-v-bff19ed1]{background:var(--el-border-color-lighter);height:1px;margin:15px 0}.k-table-toolbar__selection[data-v-bff19ed1]{white-space:nowrap;margin-top:5px;font-size:12px}.k-table__sort-handle[data-v-8ef38691]{cursor:grab;color:var(--el-text-color-secondary);letter-spacing:-2px;-webkit-user-select:none;user-select:none;display:inline-block}
@@ -22,6 +22,7 @@ declare const __VLS_export: <T = Record<string, unknown>>(__VLS_props: NonNullab
22
22
  expose: (exposed: import('vue').ShallowUnwrapRef<{
23
23
  getTableRef: () => TableInstance | undefined;
24
24
  getQueryRef: () => KPanelQueryInstance | undefined;
25
+ getColumnDisplay: () => Record<string, boolean>;
25
26
  getSelection: () => T[];
26
27
  clearSelection: () => void;
27
28
  toggleRowSelection: (row: T, selected?: boolean) => void;
@@ -19,6 +19,8 @@ export interface KTableInstance<T = Record<string, unknown>> {
19
19
  getTableRef: () => TableInstance | undefined;
20
20
  /** 获取内嵌 KPanelQuery 实例 */
21
21
  getQueryRef: () => KPanelQueryInstance | undefined;
22
+ /** 获取有效列显隐快照(包含缓存;禁用列设置时全部可见) */
23
+ getColumnDisplay: () => Record<string, boolean>;
22
24
  /** 获取当前多选行 */
23
25
  getSelection: () => T[];
24
26
  /** 清空多选 */
@@ -150,6 +152,7 @@ export declare function useKTable<T>(options: UseKTableOptions<T>): {
150
152
  resetColumnDisplay: () => void;
151
153
  getTableRef: () => TableInstance | undefined;
152
154
  getQueryRef: () => KPanelQueryInstance | undefined;
155
+ getColumnDisplay: () => Record<string, boolean>;
153
156
  getSelection: () => T[];
154
157
  clearSelection: () => void;
155
158
  toggleRowSelection: (row: T, selected?: boolean) => void;
@@ -31,4 +31,4 @@ export { useKTableCrossPageSelection, type KTableSelectionMode, type UseKTableCr
31
31
  export { useTableRadio } from './composables/useTableRadio';
32
32
  export { useTableTreeLoad, type TreeLoadHandler } from './composables/useTableTreeLoad';
33
33
  export { useTableRowSort } from './composables/useTableRowSort';
34
- export { convertDownloadCol, exportKTableReport, exportKTableReportData, exportReportData, exportReportTable, pickExportColumns, useExportKTableReport, type ExportKTableReportOptions, type KTableExportApi, type KTableExportPayload, type PickExportColumnsOptions, type UseExportKTableReportOptions } from './report';
34
+ export { convertDownloadCol, exportKTableReport, exportKTableReportData, exportReportData, exportReportTable, pickExportColumns, useExportKTableReport, type ExportColumnDisplayOptions, type ExportKTableReportOptions, type KTableExportApi, type KTableExportPayload, type PickExportColumnsOptions, type UseExportKTableReportOptions } from './report';
@@ -1,49 +1,34 @@
1
1
  import { Ref } from 'vue';
2
2
  import { KTableInstance } from '../composables/useKTable';
3
3
  import { KTableColumn } from '../types';
4
- import { KTableExportApi } from './types';
5
4
  import { PickExportColumnsOptions } from './pickExportColumns';
6
- /**
7
- * {@link exportKTableReport} 入参。
8
- *
9
- * @typeParam T - 表格行数据类型
10
- */
11
- export interface ExportKTableReportOptions<T> extends PickExportColumnsOptions {
12
- /** KTable 实例 ref(需能调用 `getQueryRef()?.getParams()`) */
13
- tableRef: Ref<KTableInstance<T> | undefined>;
14
- /** 参与导出的列配置,会再经 `pickExportColumns` 过滤 */
5
+ import { KTableExportApi } from './types';
6
+ /** 导出列显隐配置;不提供映射时可通过表格实例读取。 */
7
+ export interface ExportColumnDisplayOptions<T> {
8
+ /** 显式列显隐映射;缺省的 key 视为可见,required 列始终保留 */
9
+ columnDisplay?: Record<string, boolean>;
10
+ /** 默认 true:自动读取表格列设置(含缓存);false 时忽略显隐映射 */
11
+ respectColumnDisplay?: boolean;
12
+ /** 列 key 计算;index 始终为传入 columns 的原始下标 */
13
+ getExportColumnKey?: (column: KTableColumn<T>, index: number) => string;
14
+ }
15
+ export interface ExportKTableReportOptions<T> extends PickExportColumnsOptions, ExportColumnDisplayOptions<T> {
16
+ tableRef: Ref<KTableInstance<T> | null | undefined>;
17
+ /** 完整列配置;内部统一过滤 UI 列与操作列 */
15
18
  columns: KTableColumn<T>[];
16
- /** 导出接口;入参为 `{ globColumnlist, jsondata }` */
17
19
  exportApi: KTableExportApi;
18
- /** 与列表 `:convert-params` 保持一致 */
20
+ /** 与列表 :convert-params 保持一致 */
19
21
  convertParams?: (params: Record<string, unknown>) => Record<string, unknown>;
20
22
  }
21
- /**
22
- * 导出当前 KTable 查询条件下的报表。
23
- *
24
- * 从 `tableRef` 读取查询参数,经 `convertParams` 后与列配置一并交给 `exportApi`。
25
- * 需要防重 / 响应式列时请用 {@link useExportKTableReport}。
26
- *
27
- * @typeParam T - 表格行数据类型
28
- * @param options - 见 {@link ExportKTableReportOptions}
29
- * @returns `exportApi` 的 Promise 结果
30
- */
23
+ /** 导出当前查询条件的报表;列显隐可由 tableRef 自动读取,避免页面维护重复状态。 */
31
24
  export declare function exportKTableReport<T>(options: ExportKTableReportOptions<T>): Promise<unknown>;
32
- /**
33
- * 弹窗等场景:直接传入已转换的 `jsondata` 导出报表(不读表格查询区)。
34
- *
35
- * @typeParam T - 表格行数据类型
36
- * @param options.columns - 参与导出的列配置
37
- * @param options.jsondata - 已转换的导出查询参数
38
- * @param options.exportApi - 导出接口
39
- * @returns `exportApi` 的 Promise 结果
40
- */
25
+ /** 弹窗等场景:直接传入已转换的查询参数,不读取表格查询区。 */
41
26
  export declare function exportKTableReportData<T>(options: {
42
27
  columns: KTableColumn<T>[];
43
28
  jsondata: Record<string, unknown>;
44
29
  exportApi: KTableExportApi;
45
- } & PickExportColumnsOptions): Promise<unknown>;
46
- /** @deprecated 使用 {@link exportKTableReport} */
30
+ } & PickExportColumnsOptions & ExportColumnDisplayOptions<T>): Promise<unknown>;
31
+ /** @deprecated 使用 exportKTableReport */
47
32
  export declare const exportReportTable: typeof exportKTableReport;
48
- /** @deprecated 使用 {@link exportKTableReportData} */
33
+ /** @deprecated 使用 exportKTableReportData */
49
34
  export declare const exportReportData: typeof exportKTableReportData;
@@ -1,5 +1,5 @@
1
1
  export type { KTableExportApi, KTableExportPayload } from './types';
2
2
  export { convertDownloadCol } from './convertDownloadCol';
3
3
  export { pickExportColumns, type PickExportColumnsOptions } from './pickExportColumns';
4
- export { exportKTableReport, exportKTableReportData, exportReportData, exportReportTable, type ExportKTableReportOptions } from './exportKTableReport';
4
+ export { exportKTableReport, exportKTableReportData, exportReportData, exportReportTable, type ExportColumnDisplayOptions, type ExportKTableReportOptions } from './exportKTableReport';
5
5
  export { useExportKTableReport, type UseExportKTableReportOptions } from './useExportKTableReport';
@@ -1,8 +1,14 @@
1
1
  import { KTableColumn } from '../types';
2
2
  export interface PickExportColumnsOptions {
3
- /** 是否排除操作列 */
3
+ /**
4
+ * 是否排除操作列(`type/prop === 'operates'`)。
5
+ * 推荐统一使用此项去除操作列,而不是 `excludeLast`。
6
+ */
4
7
  excludeOperates?: boolean;
5
- /** 是否排除最后一列 */
8
+ /**
9
+ * 是否排除最后一列(兼容旧用法,常用于去掉末尾操作列)。
10
+ * @deprecated 使用 `excludeOperates` 替代
11
+ */
6
12
  excludeLast?: boolean;
7
13
  }
8
14
  /** 按规则筛选参与导出的列(序号/勾选/单选/展开等 UI 列不参与导出) */
@@ -10,7 +10,7 @@ import { PickExportColumnsOptions } from './pickExportColumns';
10
10
  */
11
11
  export interface UseExportKTableReportOptions<T> {
12
12
  /** KTable 实例 ref(需能调用 `getQueryRef()?.getParams()`) */
13
- tableRef: Ref<KTableInstance<T> | undefined>;
13
+ tableRef: Ref<KTableInstance<T> | null | undefined>;
14
14
  /**
15
15
  * 参与导出的列配置;支持 plain / ref / getter。
16
16
  * 实际导出前会再经 `pickExportColumns` 过滤 UI 列。
@@ -26,19 +26,34 @@ export interface UseExportKTableReportOptions<T> {
26
26
  * 勿用 `MaybeRefOrGetter`,避免与 getter 混淆。
27
27
  */
28
28
  convertParams?: (params: Record<string, unknown>) => Record<string, unknown>;
29
- /** 是否排除操作列(`type/prop === 'operates'`);支持 plain / ref / getter */
29
+ /** 是否排除操作列(`type/prop === 'operates'`);支持 plain / ref / getter。推荐用此项去除操作列 */
30
30
  excludeOperates?: MaybeRefOrGetter<boolean | undefined>;
31
- /** 是否排除最后一列(常用于去掉操作列);支持 plain / ref / getter */
31
+ /**
32
+ * 是否排除最后一列(常用于去掉末尾操作列);支持 plain / ref / getter。
33
+ * @deprecated 使用 `excludeOperates` 替代
34
+ */
32
35
  excludeLast?: MaybeRefOrGetter<boolean | undefined>;
36
+ /**
37
+ * KTable 当前列显隐映射;支持 plain / ref / getter。
38
+ * 传入后按列设置面板的当前显隐状态过滤导出列。
39
+ */
40
+ columnDisplay?: MaybeRefOrGetter<Record<string, boolean> | undefined>;
41
+ /** 默认 true:自动读取表格列显隐(含缓存);false 时关闭联动;显式传入映射始终生效 */
42
+ respectColumnDisplay?: MaybeRefOrGetter<boolean | undefined>;
43
+ /** 自定义列 key;index 为原始 columns 下标 */
44
+ getExportColumnKey?: (column: KTableColumn<T>, index: number) => string;
45
+ /** 自定义错误文案;返回 void 时使用默认提示 */
46
+ onExportError?: (error: unknown) => string | void;
33
47
  }
34
48
  /**
35
- * KTable 报表导出 composable(adaptable:`columns` / `exclude*` 支持 ref 或 getter)。
49
+ * KTable 报表导出 composable(adaptable:`columns` / `exclude*` / `columnDisplay` 支持 ref 或 getter)。
36
50
  *
37
51
  * 调用 `exportTable()` 时会:
38
52
  * 1. 若已在导出中则直接 return(由 `exportLoading` 防重)
39
53
  * 2. `toValue` 解析 reactive 入参
40
54
  * 3. 委托 {@link exportKTableReport} 拉取查询条件并请求 `exportApi`
41
- * 4. `finally` 中复位 loading
55
+ * 4. 失败时优先展示后端 `head_ret_msg`(或通过 `onExportError` 自定义)
56
+ * 5. `finally` 中复位 loading
42
57
  *
43
58
  * @typeParam T - 表格行数据类型
44
59
  * @param options - 导出配置,见 {@link UseExportKTableReportOptions}
@@ -55,27 +70,18 @@ export interface UseExportKTableReportOptions<T> {
55
70
  * columns: userColumns,
56
71
  * exportApi: EXPORT_USER_LIST,
57
72
  * convertParams: convertUserParams, // 与 <KTable :convert-params="..." /> 一致
58
- * excludeLast: true // 去掉末尾操作列
73
+ * excludeOperates: true, // 去掉操作列
74
+ * respectColumnDisplay: true // 自动联动列设置面板显隐及缓存
59
75
  * })
60
76
  *
61
77
  * // 模板:
62
- * // <KButton :loading="exportLoading" @click="exportTable">导出</KButton>
63
78
  * // <KTable ref="tableRef" :columns="userColumns" :convert-params="convertUserParams" ... />
64
- * ```
65
- *
66
- * @example
67
- * ```ts
68
- * // columns / exclude* 也可传入 getter,随权限或视图切换实时生效
69
- * const { exportTable } = useExportKTableReport({
70
- * tableRef,
71
- * columns: () => (isAdmin.value ? adminColumns : userColumns),
72
- * exportApi: EXPORT_USER_LIST,
73
- * excludeOperates: () => !showOperates.value
74
- * })
79
+ * // <KButton :loading="exportLoading" @click="exportTable">导出</KButton>
75
80
  * ```
76
81
  */
77
82
  export declare function useExportKTableReport<T>(options: UseExportKTableReportOptions<T>): {
78
83
  exportTable: () => Promise<void>;
84
+ asyncExportTable: () => Promise<void>;
79
85
  exportLoading: Ref<boolean, boolean>;
80
86
  };
81
87
  export type { PickExportColumnsOptions };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./chunks/componentRegistry-03Qq9Fqk.js";
2
2
  import { t as _ } from "./chunks/_plugin-vue_export-helper-B3ysoDQm.js";
3
- import { a as v, d as y, i as b, l as x, n as ee, r as te, u as ne } from "./chunks/editorValue-DSKvW8ty.js";
4
- import { Fragment as S, Transition as C, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createSlots as k, createTextVNode as A, createVNode as j, defineComponent as M, guardReactiveProps as re, h as N, inject as ie, mergeDefaults as ae, mergeProps as P, nextTick as F, normalizeClass as I, normalizeProps as oe, normalizeStyle as se, onBeforeUnmount as ce, onMounted as le, openBlock as L, provide as ue, reactive as de, ref as R, renderList as z, renderSlot as B, resolveComponent as fe, resolveDirective as pe, resolveDynamicComponent as me, shallowRef as he, toDisplayString as V, toRef as H, toValue as U, unref as W, useAttrs as ge, useSlots as G, useTemplateRef as _e, watch as K, withCtx as q, withDirectives as ve, withModifiers as ye } from "vue";
3
+ import { a as v, d as y, i as b, l as x, n as S, r as ee, u as te } from "./chunks/editorValue-DSKvW8ty.js";
4
+ import { Fragment as C, Transition as ne, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createSlots as k, createTextVNode as A, createVNode as j, defineComponent as M, guardReactiveProps as re, h as N, inject as ie, mergeDefaults as ae, mergeProps as P, nextTick as F, normalizeClass as I, normalizeProps as oe, normalizeStyle as se, onBeforeUnmount as ce, onMounted as le, openBlock as L, provide as ue, reactive as de, ref as R, renderList as z, renderSlot as B, resolveComponent as fe, resolveDirective as pe, resolveDynamicComponent as me, shallowRef as he, toDisplayString as V, toRef as H, toValue as U, unref as W, useAttrs as ge, useSlots as G, useTemplateRef as _e, watch as K, withCtx as q, withDirectives as ve, withModifiers as ye } from "vue";
5
5
  import { ElButton as be, ElCard as xe, ElCheckbox as Se, ElCollapse as Ce, ElCollapseItem as we, ElDivider as Te, ElForm as Ee, ElFormItem as De, ElIcon as Oe, ElMessage as ke, ElPagination as Ae, ElPopover as je, ElRadio as Me, ElTable as Ne, ElTableColumn as J, ElTooltip as Pe } from "element-plus";
6
6
  import Fe from "dayjs";
7
7
  import { useLocalStorage as Ie, useResizeObserver as Le } from "@vueuse/core";
@@ -9,7 +9,7 @@ import { cloneDeep as Y } from "lodash-es";
9
9
  import { Loading as Re, Plus as ze } from "@element-plus/icons-vue";
10
10
  import * as Be from "lucide-vue-next";
11
11
  import Ve from "sortablejs";
12
- import './assets/index-Biv6Btn_.css';//#region \0rolldown/runtime.js
12
+ import './assets/index-o6CgEMYr.css';//#region \0rolldown/runtime.js
13
13
  var He = Object.defineProperty, Ue = (e, t) => {
14
14
  let n = {};
15
15
  for (var r in e) He(n, r, {
@@ -525,7 +525,7 @@ var ct = /* @__PURE__ */ M({
525
525
  f(t) && (e[`kitDate-${t.id}`] = u(b.formModel[t.id]));
526
526
  }), l.value = e;
527
527
  }
528
- let { normalizedConfigs: ee, getFieldOptions: te, resolveItemRules: ne, itemStyle: C, itemDisplay: M, isItemReadonly: re, isItemDisabled: N } = $e({
528
+ let { normalizedConfigs: S, getFieldOptions: ee, resolveItemRules: te, itemStyle: ne, itemDisplay: M, isItemReadonly: re, isItemDisabled: N } = $e({
529
529
  formConfigs: H(a, "formConfigs"),
530
530
  layout: m,
531
531
  formReadonly: H(a, "readonly")
@@ -539,7 +539,7 @@ var ct = /* @__PURE__ */ M({
539
539
  }
540
540
  function ae(e) {
541
541
  let t = M(e), n = {
542
- ...C(e) ?? {},
542
+ ...ne(e) ?? {},
543
543
  ...t ? { display: t } : {}
544
544
  };
545
545
  return e.controlWidth && e.controlWidth !== "full" && (n["--k-form-field-control-max"] = ie(e.controlWidth)), n;
@@ -558,7 +558,7 @@ var ct = /* @__PURE__ */ M({
558
558
  }
559
559
  function le(e) {
560
560
  if (!c.value) return;
561
- let t = e.validatePeers ?? [], n = ne(e).length > 0;
561
+ let t = e.validatePeers ?? [], n = te(e).length > 0;
562
562
  !n && !t.length || F(() => {
563
563
  n && c.value?.validateField(e.id).catch(() => {});
564
564
  for (let e of t) c.value?.validateField(e).catch(() => {});
@@ -632,12 +632,12 @@ var ct = /* @__PURE__ */ M({
632
632
  style: v.value,
633
633
  model: W(b).formModel
634
634
  }, oe.value, { onSubmit: t[0] ||= ye(() => {}, ["prevent"]) }), {
635
- default: q(() => [(L(!0), D(S, null, z(W(ee), (n) => (L(), D(S, { key: n.id }, [j(W(De), {
635
+ default: q(() => [(L(!0), D(C, null, z(W(S), (n) => (L(), D(C, { key: n.id }, [j(W(De), {
636
636
  "data-label": n.label || "",
637
637
  "data-field-id": n.id,
638
638
  label: n.label ? `${n.label}:` : void 0,
639
639
  prop: n.id,
640
- rules: W(ne)(n),
640
+ rules: W(te)(n),
641
641
  class: I(["k-form__item", [n.class, {
642
642
  "k-form__item--readonly": W(re)(n),
643
643
  "k-form__item--disabled": W(N)(n),
@@ -652,7 +652,7 @@ var ct = /* @__PURE__ */ M({
652
652
  key: 0,
653
653
  item: n,
654
654
  "model-value": W(b).formModel[n.id],
655
- options: W(te)(n),
655
+ options: W(ee)(n),
656
656
  readonly: W(re)(n),
657
657
  disabled: W(N)(n),
658
658
  "onUpdate:modelValue": (e) => ce(n, e)
@@ -809,7 +809,7 @@ var gt = { class: "k-handle-page" }, _t = {
809
809
  }
810
810
  return (n, r) => (L(), D("div", gt, [
811
811
  p.value ? (L(), D("header", _t, [B(n.$slots, "header")])) : E("", !0),
812
- O("div", vt, [j(C, { name: "k-handle-page-loading" }, {
812
+ O("div", vt, [j(ne, { name: "k-handle-page-loading" }, {
813
813
  default: q(() => [t.loading ? (L(), D("div", yt, [O("div", bt, [j(W(Oe), {
814
814
  class: "k-handle-page__loading-icon is-loading",
815
815
  size: 32
@@ -940,7 +940,7 @@ var jt = /*#__PURE__*/ _(/* @__PURE__ */ M({
940
940
  return (t, n) => (L(), D("div", {
941
941
  class: "k-link-button",
942
942
  style: se({ justifyContent: e.align })
943
- }, [(L(!0), D(S, null, z(i.value, (e, n) => (L(), T(W(Pe), {
943
+ }, [(L(!0), D(C, null, z(i.value, (e, n) => (L(), T(W(Pe), {
944
944
  key: `${e.label}-${n}`,
945
945
  content: e.tooltip,
946
946
  placement: "top",
@@ -949,7 +949,7 @@ var jt = /*#__PURE__*/ _(/* @__PURE__ */ M({
949
949
  default: q(() => [O("div", Mt, [n > 0 ? (L(), D("span", Nt)) : E("", !0), O("a", {
950
950
  class: I(["k-link-button__btn", [o(e), { "k-link-button__btn--readonly": a(e) }]]),
951
951
  onClick: ye((t) => s(e, n), ["prevent"])
952
- }, [c(e) ? B(t.$slots, l(e), { item: e }, () => [A(V(e.label), 1)], void 0, 0) : (L(), D(S, { key: 1 }, [A(V(e.label), 1)], 64))], 10, Pt)])]),
952
+ }, [c(e) ? B(t.$slots, l(e), { item: e }, () => [A(V(e.label), 1)], void 0, 0) : (L(), D(C, { key: 1 }, [A(V(e.label), 1)], 64))], 10, Pt)])]),
953
953
  _: 2
954
954
  }, 1032, ["content", "disabled"]))), 128))], 4));
955
955
  }
@@ -1063,7 +1063,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1063
1063
  ref_key: "rootRef",
1064
1064
  ref: t,
1065
1065
  class: "k-long-page"
1066
- }, [(L(!0), D(S, null, z(e.panels, (e) => (L(), T(Bt, {
1066
+ }, [(L(!0), D(C, null, z(e.panels, (e) => (L(), T(Bt, {
1067
1067
  key: e.name,
1068
1068
  class: "k-long-page__panel",
1069
1069
  "panel-id": e.name,
@@ -1076,7 +1076,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1076
1076
  ref: n,
1077
1077
  class: "k-long-page__nav",
1078
1078
  onPointerdown: s[0] ||= (...e) => W(r) && W(r)(...e)
1079
- }, [(L(!0), D(S, null, z(e.panels, (e) => (L(), D("div", {
1079
+ }, [(L(!0), D(C, null, z(e.panels, (e) => (L(), D("div", {
1080
1080
  key: e.name,
1081
1081
  class: "k-long-page__nav-item",
1082
1082
  role: "button",
@@ -1158,7 +1158,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1158
1158
  _: 3
1159
1159
  }, 8, ["title"])]),
1160
1160
  _: 3
1161
- }, 8, ["modelValue"])) : (L(), D(S, { key: 1 }, [e.title || t.$slots.title ? (L(), D("div", sn, [O("div", cn, [B(t.$slots, "title", {}, () => [A(V(e.title), 1)])])])) : E("", !0), O("div", ln, [B(t.$slots, "default")])], 64))], 2));
1161
+ }, 8, ["modelValue"])) : (L(), D(C, { key: 1 }, [e.title || t.$slots.title ? (L(), D("div", sn, [O("div", cn, [B(t.$slots, "title", {}, () => [A(V(e.title), 1)])])])) : E("", !0), O("div", ln, [B(t.$slots, "default")])], 64))], 2));
1162
1162
  }
1163
1163
  }), dn = {
1164
1164
  key: 0,
@@ -1185,7 +1185,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1185
1185
  }, {
1186
1186
  default: q(() => [...i[5] ||= [A("重置", -1)]]),
1187
1187
  _: 1
1188
- })])) : (L(), D(S, { key: 1 }, [j(e, {
1188
+ })])) : (L(), D(C, { key: 1 }, [j(e, {
1189
1189
  type: "primary",
1190
1190
  onClick: i[2] ||= (e) => r("query")
1191
1191
  }, {
@@ -1288,7 +1288,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1288
1288
  getParams: u,
1289
1289
  resetForm: d,
1290
1290
  getFormRef: () => void 0
1291
- }), (e, t) => (L(), D("div", mn, [O("ul", hn, [(L(!0), D(S, null, z(W(o), (e) => (L(), D("li", {
1291
+ }), (e, t) => (L(), D("div", mn, [O("ul", hn, [(L(!0), D(C, null, z(W(o), (e) => (L(), D("li", {
1292
1292
  key: e.id,
1293
1293
  class: I(["k-item", { "k-item_flex": !!e.label }])
1294
1294
  }, [e.label ? (L(), D("label", gn, V(e.label), 1)) : E("", !0), O("div", _n, [j(ct, {
@@ -1398,7 +1398,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1398
1398
  unfold: e.unfold,
1399
1399
  hover: e.hover
1400
1400
  }, {
1401
- default: q(() => [c.value ? (L(), D(S, { key: 0 }, [l.value ? (L(), T(yn, P({
1401
+ default: q(() => [c.value ? (L(), D(C, { key: 0 }, [l.value ? (L(), T(yn, P({
1402
1402
  key: 0,
1403
1403
  ref_key: "formRef",
1404
1404
  ref: a
@@ -1409,7 +1409,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1409
1409
  onReset: d
1410
1410
  })]),
1411
1411
  key: "0"
1412
- }]), 1040)) : (L(), D(S, { key: 1 }, [j(pn, P({
1412
+ }]), 1040)) : (L(), D(C, { key: 1 }, [j(pn, P({
1413
1413
  ref_key: "formRef",
1414
1414
  ref: a
1415
1415
  }, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? E("", !0) : (L(), T(fn, {
@@ -1424,7 +1424,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1424
1424
  "is-fold",
1425
1425
  "unfold",
1426
1426
  "hover"
1427
- ])) : (L(), D(S, { key: 0 }, [c.value ? (L(), D(S, { key: 0 }, [l.value ? (L(), T(yn, P({
1427
+ ])) : (L(), D(C, { key: 0 }, [c.value ? (L(), D(C, { key: 0 }, [l.value ? (L(), T(yn, P({
1428
1428
  key: 0,
1429
1429
  ref_key: "formRef",
1430
1430
  ref: a
@@ -1435,7 +1435,7 @@ var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__
1435
1435
  onReset: d
1436
1436
  })]),
1437
1437
  key: "0"
1438
- }]), 1040)) : (L(), D(S, { key: 1 }, [j(pn, P({
1438
+ }]), 1040)) : (L(), D(C, { key: 1 }, [j(pn, P({
1439
1439
  ref_key: "formRef",
1440
1440
  ref: a
1441
1441
  }, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? E("", !0) : (L(), T(fn, {
@@ -1645,7 +1645,7 @@ var Nn = /*#__PURE__*/ _(/* @__PURE__ */ M({
1645
1645
  }, void 0, !0)]),
1646
1646
  _: 3
1647
1647
  }, 16)) : e.column.children?.length ? (L(), T(W(J), P({ key: `${W(Q)(e.column, e.columnIndex)}:group` }, s.value), {
1648
- default: q(() => [(L(!0), D(S, null, z(e.column.children, (i, a) => (L(), T(m, {
1648
+ default: q(() => [(L(!0), D(C, null, z(e.column.children, (i, a) => (L(), T(m, {
1649
1649
  key: W(Q)(i, a),
1650
1650
  column: i,
1651
1651
  "column-index": a,
@@ -1674,7 +1674,7 @@ var Nn = /*#__PURE__*/ _(/* @__PURE__ */ M({
1674
1674
  row: n,
1675
1675
  column: r,
1676
1676
  index: i
1677
- }, void 0, !0, 0) : (L(), D(S, { key: 1 }, [A(V(W(a)(e.column, n, i)), 1)], 64))]),
1677
+ }, void 0, !0, 0) : (L(), D(C, { key: 1 }, [A(V(W(a)(e.column, n, i)), 1)], 64))]),
1678
1678
  _: 2
1679
1679
  }, [e.column.toolTip ? {
1680
1680
  name: "header",
@@ -1725,7 +1725,7 @@ var Nn = /*#__PURE__*/ _(/* @__PURE__ */ M({
1725
1725
  _: 1
1726
1726
  })]),
1727
1727
  j(W(Te), { class: "k-table-column-selector__divider" }),
1728
- O("div", In, [(L(!0), D(S, null, z(e.items, (e) => (L(), T(W(Se), {
1728
+ O("div", In, [(L(!0), D(C, null, z(e.items, (e) => (L(), T(W(Se), {
1729
1729
  key: e.key,
1730
1730
  "model-value": e.checked,
1731
1731
  disabled: e.disabled,
@@ -2106,11 +2106,11 @@ function er(e) {
2106
2106
  pagination: _,
2107
2107
  initialLoading: !!(t.action && t.initTable),
2108
2108
  onDataLoaded: (e, t) => n("data-loaded", e, t)
2109
- }), y = w(() => t.enableColumnCache ? m.visibleColumns.value : p.value), b = w(() => y.value.map((e, t) => Q(e, t)).join("|")), x = w(() => !!(t.addButton || t.selectionShow || d.value || t.enableColumnCache)), ee = w(() => l.value ? v.tableData.value : t.data), te = w(() => t.loading === void 0 ? l.value ? v.loading.value : !1 : t.loading), ne = w(() => te.value || !!(l.value && t.initTable && !v.loaded.value)), S = w(() => {
2109
+ }), y = w(() => t.enableColumnCache ? m.visibleColumns.value : p.value), b = w(() => y.value.map((e, t) => Q(e, t)).join("|")), x = w(() => !!(t.addButton || t.selectionShow || d.value || t.enableColumnCache)), S = w(() => l.value ? v.tableData.value : t.data), ee = w(() => t.loading === void 0 ? l.value ? v.loading.value : !1 : t.loading), te = w(() => ee.value || !!(l.value && t.initTable && !v.loaded.value)), C = w(() => {
2110
2110
  let e = { ...r };
2111
2111
  l.value && "data" in e && delete e.data, t.load && delete e.load;
2112
2112
  let n = {
2113
- data: ee.value,
2113
+ data: S.value,
2114
2114
  rowKey: t.rowKey,
2115
2115
  border: !0,
2116
2116
  stripe: !0,
@@ -2128,13 +2128,13 @@ function er(e) {
2128
2128
  tableRef: a,
2129
2129
  rebindKey: () => b.value,
2130
2130
  onSortEnd: (e) => {
2131
- let t = [...ee.value];
2131
+ let t = [...S.value];
2132
2132
  if (e.oldIndex == null || e.newIndex == null) return;
2133
2133
  let [r] = t.splice(e.oldIndex, 1);
2134
2134
  t.splice(e.newIndex, 0, r), n("sort-end", e, t);
2135
2135
  }
2136
2136
  });
2137
- function C() {
2137
+ function ne() {
2138
2138
  l.value && v.fetchData();
2139
2139
  }
2140
2140
  le(() => {
@@ -2150,16 +2150,16 @@ function er(e) {
2150
2150
  a.value?.setCurrentRow();
2151
2151
  }
2152
2152
  function O(e) {
2153
- f(e), _.resetPage(), t.clearCurrentRowOnQuery && D(), n("query", s.value), C();
2153
+ f(e), _.resetPage(), t.clearCurrentRowOnQuery && D(), n("query", s.value), ne();
2154
2154
  }
2155
2155
  function k() {
2156
- n("reset"), t.selectionShow && oe(), t.clearCurrentRowOnReset && D();
2156
+ n("reset"), t.selectionShow && se(), t.clearCurrentRowOnReset && D();
2157
2157
  }
2158
2158
  function A(e) {
2159
- _.setCurrentPage(e), n("page-change", e), C();
2159
+ _.setCurrentPage(e), n("page-change", e), ne();
2160
2160
  }
2161
2161
  function j(e) {
2162
- _.setPageSize(e), n("size-change", e), C();
2162
+ _.setPageSize(e), n("size-change", e), ne();
2163
2163
  }
2164
2164
  function M() {
2165
2165
  n("add");
@@ -2185,27 +2185,34 @@ function er(e) {
2185
2185
  return o.value;
2186
2186
  }
2187
2187
  function I() {
2188
- return a.value?.getSelectionRows() ?? [];
2188
+ if (!t.enableColumnCache) return {};
2189
+ let e = { ...m.columnDisplay.value };
2190
+ return t.columns.forEach((t, n) => {
2191
+ t.required && (e[Q(t, n)] = !0);
2192
+ }), e;
2189
2193
  }
2190
2194
  function oe() {
2195
+ return a.value?.getSelectionRows() ?? [];
2196
+ }
2197
+ function se() {
2191
2198
  a.value?.clearSelection(), c.value = 0;
2192
2199
  }
2193
- function se(e, t) {
2200
+ function ce(e, t) {
2194
2201
  a.value?.toggleRowSelection(e, t);
2195
2202
  }
2196
- async function ce(e = !1) {
2203
+ async function L(e = !1) {
2197
2204
  l.value && await v.refresh(e);
2198
2205
  }
2199
- function L() {
2206
+ function ue() {
2200
2207
  h.clearRadioSelection(), a.value?.setCurrentRow();
2201
2208
  }
2202
- function ue(e) {
2209
+ function de(e) {
2203
2210
  h.setRadioSelection(e);
2204
2211
  }
2205
- function de() {
2212
+ function z() {
2206
2213
  return h.getRadioSelection();
2207
2214
  }
2208
- function z(e) {
2215
+ function B(e) {
2209
2216
  g.refreshTree(e);
2210
2217
  }
2211
2218
  return {
@@ -2213,9 +2220,9 @@ function er(e) {
2213
2220
  showToolbar: x,
2214
2221
  hasHeaderSlot: d,
2215
2222
  renderColumns: y,
2216
- tableProps: S,
2217
- tableLoading: te,
2218
- showLoadingEmpty: ne,
2223
+ tableProps: C,
2224
+ tableLoading: ee,
2225
+ showLoadingEmpty: te,
2219
2226
  columnSelectorItems: m.selectorItems,
2220
2227
  paginationBind: _.bindProps,
2221
2228
  indexOffset: _.indexOffset,
@@ -2236,14 +2243,15 @@ function er(e) {
2236
2243
  resetColumnDisplay: m.resetColumnDisplay,
2237
2244
  getTableRef: P,
2238
2245
  getQueryRef: F,
2239
- getSelection: I,
2240
- clearSelection: oe,
2241
- toggleRowSelection: se,
2242
- refresh: ce,
2243
- clearRadioSelection: L,
2244
- setRadioSelection: ue,
2245
- getRadioSelection: de,
2246
- refreshTree: z
2246
+ getColumnDisplay: I,
2247
+ getSelection: oe,
2248
+ clearSelection: se,
2249
+ toggleRowSelection: ce,
2250
+ refresh: L,
2251
+ clearRadioSelection: ue,
2252
+ setRadioSelection: de,
2253
+ getRadioSelection: z,
2254
+ refreshTree: B
2247
2255
  };
2248
2256
  }
2249
2257
  var tr = {
@@ -2330,6 +2338,7 @@ var tr = {
2330
2338
  return t({
2331
2339
  getTableRef: c.getTableRef,
2332
2340
  getQueryRef: c.getQueryRef,
2341
+ getColumnDisplay: c.getColumnDisplay,
2333
2342
  getSelection: c.getSelection,
2334
2343
  clearSelection: c.clearSelection,
2335
2344
  toggleRowSelection: c.toggleRowSelection,
@@ -2402,7 +2411,7 @@ var tr = {
2402
2411
  "aria-hidden": "true"
2403
2412
  }, "⋮⋮", 2)], !0)]),
2404
2413
  _: 3
2405
- })) : E("", !0), (L(!0), D(S, null, z(c.renderColumns, (n, r) => (L(), T(Nn, {
2414
+ })) : E("", !0), (L(!0), D(C, null, z(c.renderColumns, (n, r) => (L(), T(Nn, {
2406
2415
  key: c.getColumnIdentity(n, r),
2407
2416
  column: n,
2408
2417
  "column-index": r,
@@ -2443,7 +2452,7 @@ var tr = {
2443
2452
  ])]);
2444
2453
  };
2445
2454
  }
2446
- }), sr = /*#__PURE__*/ _(or, [["__scopeId", "data-v-ccb6f7c6"]]);
2455
+ }), sr = /*#__PURE__*/ _(or, [["__scopeId", "data-v-8ef38691"]]);
2447
2456
  //#endregion
2448
2457
  //#region src/components/k-table/dictOptions.ts
2449
2458
  function cr(e) {
@@ -2560,50 +2569,100 @@ function hr(e, t) {
2560
2569
  //#endregion
2561
2570
  //#region src/components/k-table/report/exportKTableReport.ts
2562
2571
  function gr(e) {
2563
- let t = e.tableRef.value?.getQueryRef()?.getParams() ?? {}, n = e.convertParams ? e.convertParams(t) : t, r = hr(e.columns, e);
2572
+ let t = hr(e.columns, e);
2573
+ if (!e.columnDisplay || e.respectColumnDisplay === !1) return t;
2574
+ let n = e.columnDisplay, r = e.getExportColumnKey ?? Q, i = new Set(e.columns.filter((e, t) => e.required || n[r(e, t)] !== !1));
2575
+ return t.filter((e) => i.has(e));
2576
+ }
2577
+ function _r(e) {
2578
+ let t = e.tableRef.value, n = t?.getQueryRef()?.getParams() ?? {}, r = e.convertParams ? e.convertParams(n) : n, i = e.respectColumnDisplay ?? !0, a = e.columnDisplay ?? (i ? t?.getColumnDisplay?.() : void 0);
2564
2579
  return e.exportApi({
2565
- globColumnlist: mr(r),
2566
- jsondata: n
2580
+ globColumnlist: mr(gr({
2581
+ ...e,
2582
+ columnDisplay: a
2583
+ })),
2584
+ jsondata: r
2567
2585
  });
2568
2586
  }
2569
- function _r(e) {
2570
- let t = hr(e.columns, e);
2587
+ function vr(e) {
2571
2588
  return e.exportApi({
2572
- globColumnlist: mr(t),
2589
+ globColumnlist: mr(gr(e)),
2573
2590
  jsondata: e.jsondata
2574
2591
  });
2575
2592
  }
2576
2593
  //#endregion
2577
2594
  //#region src/components/k-table/report/useExportKTableReport.ts
2578
- function vr(e) {
2595
+ async function yr(e) {
2596
+ if (typeof e == "string") return e.trim() || void 0;
2597
+ if (!e || typeof e != "object") return;
2598
+ let t = e;
2599
+ if (typeof t.head_ret_msg == "string" && t.head_ret_msg.trim()) return t.head_ret_msg;
2600
+ let n = t.response?.data;
2601
+ if (n instanceof Blob) try {
2602
+ let e = await yr(JSON.parse(await n.text()));
2603
+ if (e) return e;
2604
+ } catch {}
2605
+ else if (n && n !== e) {
2606
+ let e = await yr(n);
2607
+ if (e) return e;
2608
+ }
2609
+ return typeof t.message == "string" && t.message.trim() || void 0;
2610
+ }
2611
+ function br(e) {
2579
2612
  let t = R(!1);
2580
- async function n() {
2613
+ function n(e) {
2614
+ e.preventDefault(), window.location.hash = "/download";
2615
+ }
2616
+ function r() {
2617
+ ke.success({ message: N("span", [
2618
+ "提交成功,请前往",
2619
+ N("a", {
2620
+ href: "#/download",
2621
+ class: "el-message__link",
2622
+ style: { textDecoration: "underline" },
2623
+ onClick: n
2624
+ }, "文件下载"),
2625
+ "页面进行下载"
2626
+ ]) });
2627
+ }
2628
+ async function i(n) {
2581
2629
  if (!t.value) {
2582
2630
  t.value = !0;
2583
2631
  try {
2584
- await gr({
2632
+ await _r({
2585
2633
  tableRef: e.tableRef,
2586
2634
  columns: U(e.columns),
2587
2635
  exportApi: e.exportApi,
2588
2636
  convertParams: e.convertParams,
2589
2637
  excludeOperates: U(e.excludeOperates),
2590
- excludeLast: U(e.excludeLast)
2591
- });
2592
- } catch {
2593
- ke.error("导出失败");
2638
+ excludeLast: U(e.excludeLast),
2639
+ columnDisplay: U(e.columnDisplay),
2640
+ respectColumnDisplay: U(e.respectColumnDisplay) ?? !0,
2641
+ getExportColumnKey: e.getExportColumnKey
2642
+ }), n ? r() : ke.success("导出成功");
2643
+ } catch (t) {
2644
+ let n = e.onExportError?.(t), r = await yr(t) ?? "导出失败";
2645
+ ke.error(n || r);
2594
2646
  } finally {
2595
2647
  t.value = !1;
2596
2648
  }
2597
2649
  }
2598
2650
  }
2651
+ function a() {
2652
+ return i(!1);
2653
+ }
2654
+ async function o() {
2655
+ return i(!0);
2656
+ }
2599
2657
  return {
2600
- exportTable: n,
2658
+ exportTable: a,
2659
+ asyncExportTable: o,
2601
2660
  exportLoading: t
2602
2661
  };
2603
2662
  }
2604
2663
  //#endregion
2605
2664
  //#region src/components/k-upload/utils/uploadFileValue.ts
2606
- function yr(e, t, n = {}) {
2665
+ function xr(e, t, n = {}) {
2607
2666
  let r = `${s(n.listType ?? "text")}${e}`;
2608
2667
  return [{
2609
2668
  uid: e,
@@ -2614,10 +2673,10 @@ function yr(e, t, n = {}) {
2614
2673
  url: r
2615
2674
  }];
2616
2675
  }
2617
- function br(e, t = {}) {
2618
- return Array.isArray(e) ? e : typeof e != "string" || !e ? [] : yr(e, t.fileName ?? e, { listType: t.listType });
2676
+ function Sr(e, t = {}) {
2677
+ return Array.isArray(e) ? e : typeof e != "string" || !e ? [] : xr(e, t.fileName ?? e, { listType: t.listType });
2619
2678
  }
2620
- function xr(e, t = {}) {
2679
+ function Cr(e, t = {}) {
2621
2680
  if (typeof e == "string") return e ? {
2622
2681
  resource_id: e,
2623
2682
  file_name: t.fileName
@@ -2631,8 +2690,8 @@ function xr(e, t = {}) {
2631
2690
  imp_count: n.imp_count
2632
2691
  };
2633
2692
  }
2634
- function Sr(e, t = {}) {
2635
- let n = xr(e, t);
2693
+ function wr(e, t = {}) {
2694
+ let n = Cr(e, t);
2636
2695
  return {
2637
2696
  resource_id: n?.resource_id ?? "",
2638
2697
  file_name: n?.file_name ?? t.fileName ?? "",
@@ -2640,20 +2699,20 @@ function Sr(e, t = {}) {
2640
2699
  imp_count: n?.imp_count
2641
2700
  };
2642
2701
  }
2643
- function Cr(e) {
2702
+ function Tr(e) {
2644
2703
  return !!(e.resource_id || e.imp_id);
2645
2704
  }
2646
2705
  //#endregion
2647
2706
  //#region src/components/index.ts
2648
- var wr = /* @__PURE__ */ Ue({
2707
+ var Er = /* @__PURE__ */ Ue({
2649
2708
  DICT_KEY: () => l,
2650
- KAffix: () => Tr,
2651
- KBreadcrumb: () => Er,
2709
+ KAffix: () => Dr,
2710
+ KBreadcrumb: () => Or,
2652
2711
  KButton: () => e,
2653
2712
  KCard: () => on,
2654
- KCascader: () => Dr,
2713
+ KCascader: () => kr,
2655
2714
  KCheckbox: () => g,
2656
- KColorPicker: () => Or,
2715
+ KColorPicker: () => Ar,
2657
2716
  KDatePicker: () => c,
2658
2717
  KDialog: () => o,
2659
2718
  KDialogHeader: () => a,
@@ -2671,53 +2730,53 @@ var wr = /* @__PURE__ */ Ue({
2671
2730
  KTable: () => sr,
2672
2731
  KTimePicker: () => t,
2673
2732
  KUpload: () => p,
2674
- countEditorHtmlWords: () => ee,
2675
- countEditorWords: () => te,
2676
- createUploadFileItem: () => yr,
2677
- exportKTableReport: () => gr,
2678
- exportKTableReportData: () => _r,
2733
+ countEditorHtmlWords: () => S,
2734
+ countEditorWords: () => ee,
2735
+ createUploadFileItem: () => xr,
2736
+ exportKTableReport: () => _r,
2737
+ exportKTableReportData: () => vr,
2679
2738
  getAllLucideKebabNames: () => At,
2680
2739
  getEditorHtml: () => b,
2681
2740
  getEditorWordCount: () => v,
2682
- getUploadConfig: () => ne,
2683
- hasUploadSubmitFields: () => Cr,
2741
+ getUploadConfig: () => te,
2742
+ hasUploadSubmitFields: () => Tr,
2684
2743
  mapGroupDictToOptions: () => cr,
2685
2744
  pascalToKebab: () => Et,
2686
2745
  registerFormComponents: () => h,
2687
2746
  resolveLucideIcon: () => Dt,
2688
2747
  toKEditorValue: () => x,
2689
2748
  toLucidePascalName: () => Tt,
2690
- toUploadFiles: () => br,
2691
- toUploadSubmitFields: () => Sr,
2749
+ toUploadFiles: () => Sr,
2750
+ toUploadSubmitFields: () => wr,
2692
2751
  updateUploadConfig: () => y,
2693
- useExportKTableReport: () => vr,
2752
+ useExportKTableReport: () => br,
2694
2753
  useHandlePageInit: () => Ct,
2695
2754
  useKFormTemplateRef: () => ft,
2696
2755
  useKTableCrossPageSelection: () => pr,
2697
2756
  useKTableTemplateRef: () => fr,
2698
2757
  withQueryFieldOptions: () => dr
2699
- }), Tr = We("KAffix"), Er = We("KBreadcrumb"), Dr = We("KCascader"), Or = We("KColorPicker"), kr = "data-theme", Ar = "kayak-design-theme";
2700
- function jr() {
2701
- let e = document.documentElement.getAttribute(kr);
2758
+ }), Dr = We("KAffix"), Or = We("KBreadcrumb"), kr = We("KCascader"), Ar = We("KColorPicker"), jr = "data-theme", Mr = "kayak-design-theme";
2759
+ function Nr() {
2760
+ let e = document.documentElement.getAttribute(jr);
2702
2761
  return e === "blue-pro" || e === "dark" ? e : "kayak";
2703
2762
  }
2704
- function Mr(e) {
2705
- document.documentElement.setAttribute(kr, e);
2763
+ function Pr(e) {
2764
+ document.documentElement.setAttribute(jr, e);
2706
2765
  try {
2707
- localStorage.setItem(Ar, e);
2766
+ localStorage.setItem(Mr, e);
2708
2767
  } catch {}
2709
2768
  }
2710
- function Nr() {
2769
+ function Fr() {
2711
2770
  let e = "kayak";
2712
2771
  try {
2713
- let t = localStorage.getItem(Ar);
2772
+ let t = localStorage.getItem(Mr);
2714
2773
  (t === "kayak" || t === "blue-pro" || t === "dark") && (e = t);
2715
2774
  } catch {}
2716
- Mr(e);
2775
+ Pr(e);
2717
2776
  }
2718
2777
  //#endregion
2719
2778
  //#region src/utils/validators.ts
2720
- var Pr = /^1[3-9]\d{9}$/, Fr = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/, Ir = /^\d{1,20}$/, Lr = /^(https?:\/\/).+/i, Rr = /^[1-9]\d*$/, zr = /^(0|[1-9][0-9]*)$/, Br = /^(|[1-9][0-9]*)$/, Vr = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/, Hr = /(^[0-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
2779
+ var Ir = /^1[3-9]\d{9}$/, Lr = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/, Rr = /^\d{1,20}$/, zr = /^(https?:\/\/).+/i, Br = /^[1-9]\d*$/, Vr = /^(0|[1-9][0-9]*)$/, Hr = /^(|[1-9][0-9]*)$/, Ur = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/, Wr = /(^[0-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
2721
2780
  function $(e, t, n = !1) {
2722
2781
  return (r, i, a) => {
2723
2782
  if (!n && (i === "" || i == null)) {
@@ -2731,10 +2790,10 @@ function $(e, t, n = !1) {
2731
2790
  a();
2732
2791
  };
2733
2792
  }
2734
- function Ur(e) {
2793
+ function Gr(e) {
2735
2794
  return RegExp(`^(?!00.*)(\\d{0,${e}}(\\.\\d{1,2})?)$`);
2736
2795
  }
2737
- function Wr(e, t, n = !0) {
2796
+ function Kr(e, t, n = !0) {
2738
2797
  return {
2739
2798
  required: n,
2740
2799
  validator: (r, i, a) => {
@@ -2751,69 +2810,69 @@ function Wr(e, t, n = !0) {
2751
2810
  trigger: "change"
2752
2811
  };
2753
2812
  }
2754
- function Gr(e, t, n = !0) {
2813
+ function qr(e, t, n = !0) {
2755
2814
  return {
2756
2815
  validator: $(RegExp(`^([\\u4e00-\\u9fa5]|\\w*|\\W*){1,${e}}$`), `请输入正确的${t}`, n),
2757
2816
  trigger: "change"
2758
2817
  };
2759
2818
  }
2760
- function Kr(e, t, n = !0) {
2819
+ function Jr(e, t, n = !0) {
2761
2820
  return {
2762
2821
  validator: $(RegExp(`^\\w{1,${e}}$`), `请输入正确的${t}`, n),
2763
2822
  trigger: "change"
2764
2823
  };
2765
2824
  }
2766
- function qr(e = "请输入11位手机号") {
2825
+ function Yr(e = "请输入11位手机号") {
2767
2826
  return {
2768
- validator: $(Pr, e, !0),
2827
+ validator: $(Ir, e, !0),
2769
2828
  trigger: "change"
2770
2829
  };
2771
2830
  }
2772
- function Jr(e = "请输入正确的统一社会信用代码") {
2831
+ function Xr(e = "请输入正确的统一社会信用代码") {
2773
2832
  return {
2774
- validator: $(Fr, e, !0),
2833
+ validator: $(Lr, e, !0),
2775
2834
  trigger: "change"
2776
2835
  };
2777
2836
  }
2778
- function Yr(e = "请输入正确的打款账号") {
2837
+ function Zr(e = "请输入正确的打款账号") {
2779
2838
  return {
2780
- validator: $(Ir, e, !0),
2839
+ validator: $(Rr, e, !0),
2781
2840
  trigger: "change"
2782
2841
  };
2783
2842
  }
2784
- function Xr(e = "请输入正确的链接地址", t = !1) {
2843
+ function Qr(e = "请输入正确的链接地址", t = !1) {
2785
2844
  return {
2786
- validator: $(Lr, e, t),
2845
+ validator: $(zr, e, t),
2787
2846
  trigger: "change"
2788
2847
  };
2789
2848
  }
2790
- function Zr(e = "请输入正确的数字", t = !1) {
2849
+ function $r(e = "请输入正确的数字", t = !1) {
2791
2850
  return {
2792
- validator: $(Rr, e, t),
2851
+ validator: $(Br, e, t),
2793
2852
  trigger: "change"
2794
2853
  };
2795
2854
  }
2796
- function Qr(e) {
2855
+ function ei(e) {
2797
2856
  return {
2798
- validator: $(zr, e, !1),
2857
+ validator: $(Vr, e, !1),
2799
2858
  trigger: "change"
2800
2859
  };
2801
2860
  }
2802
- function $r(e) {
2861
+ function ti(e) {
2803
2862
  return {
2804
- validator: $(Br, e, !1),
2863
+ validator: $(Hr, e, !1),
2805
2864
  trigger: "change"
2806
2865
  };
2807
2866
  }
2808
- function ei(e = !0) {
2867
+ function ni(e = !0) {
2809
2868
  return {
2810
2869
  required: e,
2811
- validator: $(Vr, "请输入正确格式的证件号码", !0),
2870
+ validator: $(Ur, "请输入正确格式的证件号码", !0),
2812
2871
  trigger: "change"
2813
2872
  };
2814
2873
  }
2815
- function ti(e, t = {}) {
2816
- let { required: n = !0, maxInt: r = 11 } = t, i = Ur(r);
2874
+ function ri(e, t = {}) {
2875
+ let { required: n = !0, maxInt: r = 11 } = t, i = Gr(r);
2817
2876
  return [{
2818
2877
  required: n,
2819
2878
  message: `请输入${e}`
@@ -2832,7 +2891,7 @@ function ti(e, t = {}) {
2832
2891
  trigger: "change"
2833
2892
  }];
2834
2893
  }
2835
- function ni(e, t) {
2894
+ function ii(e, t) {
2836
2895
  if (t === "number") {
2837
2896
  let t = Number(e);
2838
2897
  return Number.isFinite(t) ? t : null;
@@ -2848,7 +2907,7 @@ function ni(e, t) {
2848
2907
  let n = Date.parse(String(e));
2849
2908
  return Number.isFinite(n) ? n : null;
2850
2909
  }
2851
- function ri(e, t, n) {
2910
+ function ai(e, t, n) {
2852
2911
  let { op: r, message: i, skipEmpty: a = !0, type: o = "number" } = n;
2853
2912
  return {
2854
2913
  validator: (n, s, c) => {
@@ -2856,7 +2915,7 @@ function ri(e, t, n) {
2856
2915
  c();
2857
2916
  return;
2858
2917
  }
2859
- let l = ni(e, o), u = ni(t, o);
2918
+ let l = ii(e, o), u = ii(t, o);
2860
2919
  if (l == null || u == null) {
2861
2920
  c();
2862
2921
  return;
@@ -2868,10 +2927,10 @@ function ri(e, t, n) {
2868
2927
  }
2869
2928
  //#endregion
2870
2929
  //#region src/index.ts
2871
- function ii(e) {
2872
- Object.entries(wr).forEach(([t, n]) => {
2930
+ function oi(e) {
2931
+ Object.entries(Er).forEach(([t, n]) => {
2873
2932
  e.component(t, n);
2874
2933
  });
2875
2934
  }
2876
2935
  //#endregion
2877
- export { Ir as BANK_ACCOUNT_PATTERN, Hr as DECIMAL_MONEY_PATTERN, l as DICT_KEY, Lr as HTTP_URL_PATTERN, Vr as ID_CODE_PATTERN, Tr as KAffix, Er as KBreadcrumb, e as KButton, on as KCard, Dr as KCascader, g as KCheckbox, Or as KColorPicker, c as KDatePicker, o as KDialog, a as KDialogHeader, dt as KForm, St as KHandlePage, jt as KIcon, n as KInput, Ft as KLinkButton, an as KLongPage, It as KPagination, un as KPanel, bn as KPanelQuery, d as KRadio, m as KSelect, sr as KTable, t as KTimePicker, p as KUpload, zr as NON_NEGATIVE_INT_PATTERN, Br as OPTIONAL_NON_NEGATIVE_INT_PATTERN, Pr as PHONE_PATTERN, Rr as POSITIVE_INT_PATTERN, Fr as USC_CODE_PATTERN, Kr as alphaNumCodeRule, Yr as bankAccountRule, Wr as cnAlphaNumRule, ri as compareRule, ee as countEditorHtmlWords, te as countEditorWords, $ as createPatternValidator, yr as createUploadFileItem, gr as exportKTableReport, _r as exportKTableReportData, At as getAllLucideKebabNames, jr as getDesignTheme, b as getEditorHtml, v as getEditorWordCount, ne as getUploadConfig, Cr as hasUploadSubmitFields, Xr as httpUrlRule, ei as idCodeRule, Nr as initDesignTheme, ht as mapFieldVisibility, cr as mapGroupDictToOptions, Gr as mixedNameRule, ti as moneyRule, Qr as nonNegativeIntRule, $r as optionalNonNegativeIntRule, Et as pascalToKebab, qr as phoneRule, Zr as positiveIntRule, h as registerFormComponents, Dt as resolveLucideIcon, pt as resolveSchemaField, Mr as setDesignTheme, ii as setupDesign, x as toKEditorValue, Tt as toLucidePascalName, br as toUploadFiles, Sr as toUploadSubmitFields, y as updateUploadConfig, Jr as uscCodeRule, vr as useExportKTableReport, mt as useFormSchema, Ct as useHandlePageInit, ft as useKFormTemplateRef, pr as useKTableCrossPageSelection, fr as useKTableTemplateRef, dr as withQueryFieldOptions };
2936
+ export { Rr as BANK_ACCOUNT_PATTERN, Wr as DECIMAL_MONEY_PATTERN, l as DICT_KEY, zr as HTTP_URL_PATTERN, Ur as ID_CODE_PATTERN, Dr as KAffix, Or as KBreadcrumb, e as KButton, on as KCard, kr as KCascader, g as KCheckbox, Ar as KColorPicker, c as KDatePicker, o as KDialog, a as KDialogHeader, dt as KForm, St as KHandlePage, jt as KIcon, n as KInput, Ft as KLinkButton, an as KLongPage, It as KPagination, un as KPanel, bn as KPanelQuery, d as KRadio, m as KSelect, sr as KTable, t as KTimePicker, p as KUpload, Vr as NON_NEGATIVE_INT_PATTERN, Hr as OPTIONAL_NON_NEGATIVE_INT_PATTERN, Ir as PHONE_PATTERN, Br as POSITIVE_INT_PATTERN, Lr as USC_CODE_PATTERN, Jr as alphaNumCodeRule, Zr as bankAccountRule, Kr as cnAlphaNumRule, ai as compareRule, S as countEditorHtmlWords, ee as countEditorWords, $ as createPatternValidator, xr as createUploadFileItem, _r as exportKTableReport, vr as exportKTableReportData, At as getAllLucideKebabNames, Nr as getDesignTheme, b as getEditorHtml, v as getEditorWordCount, te as getUploadConfig, Tr as hasUploadSubmitFields, Qr as httpUrlRule, ni as idCodeRule, Fr as initDesignTheme, ht as mapFieldVisibility, cr as mapGroupDictToOptions, qr as mixedNameRule, ri as moneyRule, ei as nonNegativeIntRule, ti as optionalNonNegativeIntRule, Et as pascalToKebab, Yr as phoneRule, $r as positiveIntRule, h as registerFormComponents, Dt as resolveLucideIcon, pt as resolveSchemaField, Pr as setDesignTheme, oi as setupDesign, x as toKEditorValue, Tt as toLucidePascalName, Sr as toUploadFiles, wr as toUploadSubmitFields, y as updateUploadConfig, Xr as uscCodeRule, br as useExportKTableReport, mt as useFormSchema, Ct as useHandlePageInit, ft as useKFormTemplateRef, pr as useKTableCrossPageSelection, fr as useKTableTemplateRef, dr as withQueryFieldOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kayak-sj/design",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 与 Element Plus 的 Kayak PC 端 UI 组件库,提供 KForm、KTable 等表单与表格能力",
6
6
  "license": "ISC",