@shaonq/vue 1.4.2 → 1.4.4
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.
- package/lib/index.d.ts +41 -74
- package/lib/index.js +1 -4150
- package/lib/style.css +634 -1
- package/package.json +37 -35
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Component } from 'vue';
|
|
|
4
4
|
import { ComponentOptionsMixin } from 'vue';
|
|
5
5
|
import { ComponentProvideOptions } from 'vue';
|
|
6
6
|
import { ComputedOptions } from 'vue';
|
|
7
|
+
import { CSSProperties } from 'vue';
|
|
7
8
|
import { DefineComponent } from 'vue';
|
|
8
9
|
import { ExtractPropTypes } from 'vue';
|
|
9
10
|
import { FormItem } from '@arco-design/web-vue';
|
|
@@ -238,8 +239,15 @@ declare type ComponentAttrHandler = (util: OrcFormUtilBind, index?: any) => unkn
|
|
|
238
239
|
/** componentAttr 支持的静态值类型 */
|
|
239
240
|
declare type ComponentAttrValue = null | boolean | number | string | RecordAny_3 | RecordAny_3[] | ComponentAttrHandler;
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
/**
|
|
243
|
+
* 单元格样式:对象 | 支持动态函数
|
|
244
|
+
* @param {Object} params
|
|
245
|
+
* @param {any} params.row - 行数据
|
|
246
|
+
* @param {number} params.rowIndex - 行索引
|
|
247
|
+
* @param {RecordAny} params.column - 列配置
|
|
248
|
+
* @param {number} params.columnIndex - 列索引
|
|
249
|
+
*/
|
|
250
|
+
export declare type CssType = Partial<CSSProperties> & RecordAny_2;
|
|
243
251
|
|
|
244
252
|
export declare const deepClone: <T = RecordAny | RecordAny[]>(origin: T) => T;
|
|
245
253
|
|
|
@@ -254,26 +262,7 @@ declare type DictLoadFn = (code: string) => Promise<unknown[]>;
|
|
|
254
262
|
|
|
255
263
|
export declare const download: (url: string, fileName?: string) => boolean;
|
|
256
264
|
|
|
257
|
-
/**
|
|
258
|
-
* 将指定 HTML 元素(及其子元素)渲染为 PDF 并下载。
|
|
259
|
-
*
|
|
260
|
-
* @param name - 下载的 PDF 文件名(不带扩展名)
|
|
261
|
-
* @param element - 要转换为 PDF 的 HTML 元素
|
|
262
|
-
* @param option - 可选配置项:
|
|
263
|
-
* - className?: 用于选择多个子元素的选择器类名
|
|
264
|
-
* - paddingBuffer?: 分页时忽略的小段高度阈值(单位 mm)
|
|
265
|
-
* - margin?: 页面边距(未在代码中使用,但保留兼容性)
|
|
266
|
-
* - 其他 jsPDF 支持的选项(如格式、方向等)
|
|
267
|
-
*
|
|
268
|
-
* @throws 如果未传入 element,则抛出错误
|
|
269
|
-
*
|
|
270
|
-
* 注意事项:
|
|
271
|
-
* - 使用 snapdom(替换了htmlToImage) 将 HTML 渲染为 Canvas
|
|
272
|
-
* - 使用 jsPDF 将 Canvas 添加到 PDF 文档
|
|
273
|
-
* - 默认 A4 格式纵向,可自定义通过 `option.orientation`
|
|
274
|
-
* - 当内容高度超过一页时会自动分页
|
|
275
|
-
* - 存在逻辑错误:canvas 的裁剪方式不正确,会导致每一页都显示整个页面的内容
|
|
276
|
-
*/
|
|
265
|
+
/** 指定element下载为pdf ,修改 pdfOption.orientation: "landscape" 更改导出方向 */
|
|
277
266
|
export declare function downLoadPdf(name: string, element: HTMLElement, option?: {
|
|
278
267
|
progress?: (...args: number[]) => void;
|
|
279
268
|
className?: string;
|
|
@@ -297,15 +286,15 @@ declare interface FieldOption {
|
|
|
297
286
|
|
|
298
287
|
export declare function findObject<T extends RecordAny>(obj: T, keys?: string | string[]): T;
|
|
299
288
|
|
|
300
|
-
/**
|
|
289
|
+
/** 行数据格式化工具:千分位|日期|百分比 */
|
|
301
290
|
export declare const formatTable: {
|
|
302
|
-
/**
|
|
291
|
+
/** 千分位格式化,支持小数位控制 */
|
|
303
292
|
tf: (val: any, digits?: any) => any;
|
|
304
|
-
/**
|
|
293
|
+
/** 快捷日期格式化 yyyy-MM-dd */
|
|
305
294
|
t: (val: any) => string;
|
|
306
|
-
/**
|
|
295
|
+
/** 完整日期格式化,默认 yyyy-MM-dd HH:mm:ss */
|
|
307
296
|
time: (val: any, f?: string) => string;
|
|
308
|
-
/**
|
|
297
|
+
/** 百分比格式化,默认保留2位小数,数据自动×100 */
|
|
309
298
|
p: (val: any, digits?: any, percent?: string) => string;
|
|
310
299
|
};
|
|
311
300
|
|
|
@@ -420,7 +409,7 @@ declare const lang_2: {
|
|
|
420
409
|
/** 日志 */
|
|
421
410
|
export declare function log(...args: any[]): void;
|
|
422
411
|
|
|
423
|
-
/**
|
|
412
|
+
/** 深度合并配置对象,数组拼接,函数直接报错。 @example mergeConfig({ a: 1 }, { b: 2 }) */
|
|
424
413
|
export declare function mergeConfig(defaults: RecordAny, overrides: RecordAny): RecordAny;
|
|
425
414
|
|
|
426
415
|
declare type ModalInstance = InstanceType<typeof Modal>;
|
|
@@ -517,11 +506,11 @@ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<Extract
|
|
|
517
506
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
518
507
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
519
508
|
}>, {
|
|
520
|
-
grid: Record<string, any>;
|
|
521
509
|
disabled: boolean;
|
|
522
510
|
loading: boolean;
|
|
523
|
-
|
|
511
|
+
grid: Record<string, any>;
|
|
524
512
|
span: number;
|
|
513
|
+
modelValue: Record<string, any>;
|
|
525
514
|
config: OrcFormItem[];
|
|
526
515
|
labelWidth: string;
|
|
527
516
|
labelAlign: "left" | "right";
|
|
@@ -568,7 +557,7 @@ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<E
|
|
|
568
557
|
"onUpdate:modelValue"?: ((data: RecordAny) => any) | undefined;
|
|
569
558
|
}>, {
|
|
570
559
|
title: string;
|
|
571
|
-
size: "
|
|
560
|
+
size: "medium" | "large" | "small" | "mini";
|
|
572
561
|
modelValue: RecordAny;
|
|
573
562
|
gutter: number;
|
|
574
563
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
@@ -640,6 +629,7 @@ export declare type OrcFormItem = {
|
|
|
640
629
|
* - `'a-radio-group'` → `options`, `direction` 等
|
|
641
630
|
* - `'a-textarea'` → `maxLength`, `showWordLimit`, `autoSize` 等
|
|
642
631
|
* - `'a-tree-select'` → `treeData`, `allowSearch`, `treeCheckable` 等
|
|
632
|
+
* - `OrcFormTable` → `height`, `hideTools`, `hideToolbar` 等
|
|
643
633
|
* @example
|
|
644
634
|
* ```ts
|
|
645
635
|
* // 静态值
|
|
@@ -1123,7 +1113,7 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
|
|
|
1123
1113
|
default: string;
|
|
1124
1114
|
};
|
|
1125
1115
|
toolbar: {
|
|
1126
|
-
type: (
|
|
1116
|
+
type: (StringConstructor | ArrayConstructor)[];
|
|
1127
1117
|
default: string;
|
|
1128
1118
|
};
|
|
1129
1119
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -1134,14 +1124,14 @@ export declare const OrcQuill: DefineComponent<ExtractPropTypes<{
|
|
|
1134
1124
|
default: string;
|
|
1135
1125
|
};
|
|
1136
1126
|
toolbar: {
|
|
1137
|
-
type: (
|
|
1127
|
+
type: (StringConstructor | ArrayConstructor)[];
|
|
1138
1128
|
default: string;
|
|
1139
1129
|
};
|
|
1140
1130
|
}>> & Readonly<{
|
|
1141
1131
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1142
1132
|
}>, {
|
|
1143
|
-
modelValue: string;
|
|
1144
1133
|
toolbar: string | unknown[];
|
|
1134
|
+
modelValue: string;
|
|
1145
1135
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1146
1136
|
|
|
1147
1137
|
export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_4<{
|
|
@@ -1214,7 +1204,7 @@ export declare interface OrcSearchItem extends RecordAny {
|
|
|
1214
1204
|
* - `'date'` — 日期选择器(配合 `multiple: true` 可实现日期范围)
|
|
1215
1205
|
* - `'number'` — 数字输入框(配合 `min`/`max` 限制范围)
|
|
1216
1206
|
*/
|
|
1217
|
-
type?: 'input' | 'select' | 'date' | 'number';
|
|
1207
|
+
type?: 'input' | 'select' | 'date' | 'number' | string;
|
|
1218
1208
|
/** 字段名(对应提交数据的 key) */
|
|
1219
1209
|
name: string;
|
|
1220
1210
|
/** 显示标签 */
|
|
@@ -1260,7 +1250,7 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1260
1250
|
getSelection(): RecordAny_2[];
|
|
1261
1251
|
getCheckboxKeySelection(keys?: string[] | undefined): RecordAny_2[];
|
|
1262
1252
|
getReserveSelection(): RecordAny_2[];
|
|
1263
|
-
clearSelection(): void;
|
|
1253
|
+
clearSelection(): void;
|
|
1264
1254
|
insertRow(record: RecordAny_2, row?: number | RecordAny_2 | undefined, isNext?: boolean | undefined): Promise<{
|
|
1265
1255
|
row: RecordAny_2;
|
|
1266
1256
|
rows: RecordAny_2[];
|
|
@@ -1273,16 +1263,14 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1273
1263
|
setSelectionRow(row: any, bool?: boolean | undefined): void;
|
|
1274
1264
|
loading: Ref<boolean, boolean>;
|
|
1275
1265
|
setLoading: typeof setLoading;
|
|
1276
|
-
/** 执行搜索 ,是否返回第一页 */
|
|
1277
1266
|
dataInit(isFirst?: boolean | undefined): Promise<void>;
|
|
1278
|
-
/** 加载数据 */
|
|
1279
1267
|
loadData(list: any[]): void;
|
|
1280
1268
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1281
1269
|
"update:selectedKeys": (...args: any[]) => void;
|
|
1282
1270
|
confirm: (...args: any[]) => void;
|
|
1283
1271
|
change: (...args: any[]) => void;
|
|
1284
|
-
cellClick: (...args: any[]) => void;
|
|
1285
1272
|
onReset: (...args: any[]) => void;
|
|
1273
|
+
cellClick: (...args: any[]) => void;
|
|
1286
1274
|
cellDblclick: (...args: any[]) => void;
|
|
1287
1275
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {
|
|
1288
1276
|
isHover: boolean;
|
|
@@ -1297,13 +1285,13 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1297
1285
|
"onUpdate:selectedKeys"?: ((...args: any[]) => any) | undefined;
|
|
1298
1286
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
1299
1287
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
1300
|
-
onCellClick?: ((...args: any[]) => any) | undefined;
|
|
1301
1288
|
onOnReset?: ((...args: any[]) => any) | undefined;
|
|
1289
|
+
onCellClick?: ((...args: any[]) => any) | undefined;
|
|
1302
1290
|
onCellDblclick?: ((...args: any[]) => any) | undefined;
|
|
1303
1291
|
}>, {
|
|
1304
1292
|
data: RecordAny_2[];
|
|
1305
1293
|
option: OrcTableOption;
|
|
1306
|
-
size: "
|
|
1294
|
+
size: "medium" | "large" | "small" | "mini";
|
|
1307
1295
|
locale: I18nType;
|
|
1308
1296
|
isHover: boolean;
|
|
1309
1297
|
selectedKeys: string[];
|
|
@@ -1317,7 +1305,7 @@ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<Extrac
|
|
|
1317
1305
|
rowIndex: number;
|
|
1318
1306
|
columnIndex: number;
|
|
1319
1307
|
value: any;
|
|
1320
|
-
updateValue: (
|
|
1308
|
+
updateValue: (newValue: any) => void;
|
|
1321
1309
|
formatValue: any;
|
|
1322
1310
|
}): any;
|
|
1323
1311
|
footer?(_: {}): any;
|
|
@@ -1432,6 +1420,14 @@ export declare interface OrcTableItem extends RecordAny_2 {
|
|
|
1432
1420
|
filterMultiple?: boolean;
|
|
1433
1421
|
/** 自定义过滤方法 */
|
|
1434
1422
|
filterMethod?: VxeColumnPropTypes.FilterMethod;
|
|
1423
|
+
/** 数据类型 */
|
|
1424
|
+
dataType?: 'link' | 'number' | 'date' | 'time' | 'string' | 'status';
|
|
1425
|
+
/** orc-search 联动 */
|
|
1426
|
+
search?: {
|
|
1427
|
+
show?: boolean;
|
|
1428
|
+
hidden?: boolean;
|
|
1429
|
+
options?: RecordAny_2[];
|
|
1430
|
+
} & RecordAny_2;
|
|
1435
1431
|
}
|
|
1436
1432
|
|
|
1437
1433
|
/**
|
|
@@ -1579,33 +1575,17 @@ declare interface Props {
|
|
|
1579
1575
|
}
|
|
1580
1576
|
|
|
1581
1577
|
declare type Props_2 = {
|
|
1582
|
-
/** 表格标题,显示在工具栏左侧 */
|
|
1583
1578
|
title?: string;
|
|
1584
|
-
/** 表格高度(像素或百分比) */
|
|
1585
1579
|
height?: number | string;
|
|
1586
|
-
/** 多语言 */
|
|
1587
1580
|
locale?: I18nType;
|
|
1588
|
-
/** 是否隐藏工具栏 */
|
|
1589
1581
|
hideToolbar?: boolean;
|
|
1590
|
-
/** 是否隐藏列设置按钮 */
|
|
1591
1582
|
hideSetting?: boolean;
|
|
1592
|
-
/** 是否隐藏底部分页 */
|
|
1593
1583
|
hidePagination?: boolean;
|
|
1594
|
-
/** 是否启用行悬停效果,默认 true */
|
|
1595
1584
|
isHover?: boolean;
|
|
1596
|
-
/** 表格尺寸 */
|
|
1597
1585
|
size?: 'large' | 'medium' | 'small' | 'mini';
|
|
1598
|
-
/** 选中行 key 列表(v-model) */
|
|
1599
1586
|
selectedKeys?: string[];
|
|
1600
|
-
/** 静态数据源 */
|
|
1601
1587
|
data?: RecordAny_2[];
|
|
1602
|
-
/** 表格配置 */
|
|
1603
1588
|
option?: OrcTableOption;
|
|
1604
|
-
/**
|
|
1605
|
-
* 列配置持久化钩子
|
|
1606
|
-
* - getColumn: 异步获取用户保存的列配置,返回 `[err, columns]`
|
|
1607
|
-
* - setColumn: 保存用户调整后的列配置
|
|
1608
|
-
*/
|
|
1609
1589
|
hook?: {
|
|
1610
1590
|
getColumn: () => Promise<[boolean, RecordAny_2[]]>;
|
|
1611
1591
|
setColumn: (list: RecordAny_2[]) => void;
|
|
@@ -1641,20 +1621,7 @@ declare type Props_4 = {
|
|
|
1641
1621
|
printData?: Record<string, any>;
|
|
1642
1622
|
};
|
|
1643
1623
|
|
|
1644
|
-
/**
|
|
1645
|
-
* 并发执行一组异步任务函数,并返回按顺序排列的结果数组。
|
|
1646
|
-
* 如果某个任务出错,则对应位置返回 `null`,不会中断其他任务。
|
|
1647
|
-
*
|
|
1648
|
-
* @description https://github.com/sindresorhus/p-queue
|
|
1649
|
-
* @template T - 每个任务成功时返回的数据类型
|
|
1650
|
-
* @param {(() => Promise<T>)[]} tasks - 要并发执行的一组无参异步任务函数数组
|
|
1651
|
-
* @param {number} [concurrency=5] - 最大并发数量,默认为 5
|
|
1652
|
-
* - 最小值:1
|
|
1653
|
-
* - 最大值:Infinity
|
|
1654
|
-
* @returns {Promise<(T | null)[]>} - 返回一个 Promise,解析为结果数组:
|
|
1655
|
-
* - 成功:T 类型的值
|
|
1656
|
-
* - 失败:null
|
|
1657
|
-
*/
|
|
1624
|
+
/** 并发执行异步任务,失败项null @example const results = await queueMap([fn1, fn2]) */
|
|
1658
1625
|
export declare function queueMap<T>(tasks: (() => Promise<T>)[], concurrency?: number): Promise<(T | null)[]>;
|
|
1659
1626
|
|
|
1660
1627
|
export declare type RecordAny = Record<string, any>;
|
|
@@ -1802,7 +1769,7 @@ export declare const useDictStore: StoreDefinition<"orc-dict", Pick<{
|
|
|
1802
1769
|
*/
|
|
1803
1770
|
export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSearchItem[]), local?: Ref<string>): readonly [Ref<{
|
|
1804
1771
|
[x: string]: any;
|
|
1805
|
-
type?:
|
|
1772
|
+
type?: string | undefined;
|
|
1806
1773
|
name: string;
|
|
1807
1774
|
label: string;
|
|
1808
1775
|
defaultValue?: string | number | boolean | string[] | undefined;
|
|
@@ -1821,7 +1788,7 @@ export declare function useOrcSearch(initialList: OrcSearchItem[] | (() => OrcSe
|
|
|
1821
1788
|
rules?: RecordAny | RecordAny[] | undefined;
|
|
1822
1789
|
}[], OrcSearchItem[] | {
|
|
1823
1790
|
[x: string]: any;
|
|
1824
|
-
type?:
|
|
1791
|
+
type?: string | undefined;
|
|
1825
1792
|
name: string;
|
|
1826
1793
|
label: string;
|
|
1827
1794
|
defaultValue?: string | number | boolean | string[] | undefined;
|