@shwfed/config 3.0.10 → 3.0.12
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/dist/module.json +1 -1
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.d.vue.ts +86 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue +398 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue.d.ts +86 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.d.vue.ts +14 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue +39 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue.d.ts +14 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.d.vue.ts +3 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.vue +20 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.vue.d.ts +3 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.d.vue.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue +19 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue.d.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/rmb.d.ts +11 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/rmb.js +58 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.d.vue.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue +22 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue.d.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.d.vue.ts +86 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue +346 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue.d.ts +86 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.d.ts +109 -0
- package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.js +189 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.d.vue.ts +34 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue +109 -1
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue.d.ts +34 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +7 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +66 -22
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +23 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +26 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue +1004 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/prompt.md +19 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue +503 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.d.ts +138 -0
- package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.js +181 -0
- package/package.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
2
|
+
import { type Value } from './schema.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
configure?: (env: Environment) => void;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
'block': Value;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:block": (value: {
|
|
12
|
+
readonly type: "com.shwfed.block.invoice.digital";
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly line: {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly spec?: string | undefined;
|
|
17
|
+
readonly unit?: string | undefined;
|
|
18
|
+
readonly quantity?: string | undefined;
|
|
19
|
+
readonly unitPrice?: string | undefined;
|
|
20
|
+
readonly amount: string;
|
|
21
|
+
readonly taxRate?: string | undefined;
|
|
22
|
+
readonly taxAmount?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
readonly displayName?: string | undefined;
|
|
25
|
+
readonly kind?: "normal" | "special" | undefined;
|
|
26
|
+
readonly compatibilityDate: "2026-07-17";
|
|
27
|
+
readonly items: string;
|
|
28
|
+
readonly request?: string | undefined;
|
|
29
|
+
readonly itemsMaxHeight?: string | undefined;
|
|
30
|
+
readonly invoiceNumber: string;
|
|
31
|
+
readonly issueDate: string;
|
|
32
|
+
readonly buyer: {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly taxId: string;
|
|
35
|
+
};
|
|
36
|
+
readonly seller: {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly taxId: string;
|
|
39
|
+
};
|
|
40
|
+
readonly totalAmount: string;
|
|
41
|
+
readonly totalTax: string;
|
|
42
|
+
readonly grandTotal: string;
|
|
43
|
+
readonly remark?: string | undefined;
|
|
44
|
+
readonly issuer?: string | undefined;
|
|
45
|
+
readonly redLetter?: string | undefined;
|
|
46
|
+
}) => any;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
48
|
+
"onUpdate:block"?: ((value: {
|
|
49
|
+
readonly type: "com.shwfed.block.invoice.digital";
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly line: {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly spec?: string | undefined;
|
|
54
|
+
readonly unit?: string | undefined;
|
|
55
|
+
readonly quantity?: string | undefined;
|
|
56
|
+
readonly unitPrice?: string | undefined;
|
|
57
|
+
readonly amount: string;
|
|
58
|
+
readonly taxRate?: string | undefined;
|
|
59
|
+
readonly taxAmount?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
readonly displayName?: string | undefined;
|
|
62
|
+
readonly kind?: "normal" | "special" | undefined;
|
|
63
|
+
readonly compatibilityDate: "2026-07-17";
|
|
64
|
+
readonly items: string;
|
|
65
|
+
readonly request?: string | undefined;
|
|
66
|
+
readonly itemsMaxHeight?: string | undefined;
|
|
67
|
+
readonly invoiceNumber: string;
|
|
68
|
+
readonly issueDate: string;
|
|
69
|
+
readonly buyer: {
|
|
70
|
+
readonly name: string;
|
|
71
|
+
readonly taxId: string;
|
|
72
|
+
};
|
|
73
|
+
readonly seller: {
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly taxId: string;
|
|
76
|
+
};
|
|
77
|
+
readonly totalAmount: string;
|
|
78
|
+
readonly totalTax: string;
|
|
79
|
+
readonly grandTotal: string;
|
|
80
|
+
readonly remark?: string | undefined;
|
|
81
|
+
readonly issuer?: string | undefined;
|
|
82
|
+
readonly redLetter?: string | undefined;
|
|
83
|
+
}) => any) | undefined;
|
|
84
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
85
|
+
declare const _default: typeof __VLS_export;
|
|
86
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
export { getStructFieldDescription, getStructFieldTitle } from '../../../../table/utils/schema-meta.js';
|
|
4
|
+
type AnySchema = Schema.Schema<any, any, never>;
|
|
5
|
+
type Configure = (env: Environment) => void;
|
|
6
|
+
export declare const type: "com.shwfed.block.invoice.digital";
|
|
7
|
+
export declare const compatibilityDate: "2026-07-17";
|
|
8
|
+
export declare const metadata: {
|
|
9
|
+
readonly name: "数电票";
|
|
10
|
+
readonly icon: "fluent:receipt-20-regular";
|
|
11
|
+
readonly description: "按国家税务总局版式渲染一张数电票(增值税专用发票 / 普通发票),票面各栏由 CEL 表达式映射";
|
|
12
|
+
readonly w: {
|
|
13
|
+
readonly initial: 24;
|
|
14
|
+
readonly min: 12;
|
|
15
|
+
readonly max: number;
|
|
16
|
+
};
|
|
17
|
+
readonly h: {
|
|
18
|
+
readonly initial: 12;
|
|
19
|
+
readonly min: 8;
|
|
20
|
+
readonly max: number;
|
|
21
|
+
readonly grow: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 票面自己的(可选)取数:`request` 求值出的 HTTP 响应体,票面**每一栏**都能读。
|
|
26
|
+
*
|
|
27
|
+
* 与「不内建 DataSource」的边界不冲突 —— 这里只有 `request`,没有 `data`:票面各栏
|
|
28
|
+
* 本来就是逐栏 CEL 映射,`json` 只是多了一个可读的上下文变量,而不是又一层「列表 →
|
|
29
|
+
* 行」的取数抽象。不配置时 `json` 为 `none`,票面照旧从外层上下文(`item` / 详情页
|
|
30
|
+
* 变量)取值,行为与加这个字段之前完全一致。
|
|
31
|
+
*
|
|
32
|
+
* 导出给 `config.vue` —— 它直接渲染 `ExpressionEditor`(不经过本 schema),不共享
|
|
33
|
+
* 这份声明的话,编辑器会把 `json` 误报成 `Unknown variable`。镜像 card 块的 `JSON_VAR`。
|
|
34
|
+
*/
|
|
35
|
+
export declare const JSON_VAR: {
|
|
36
|
+
readonly type: "optional<dyn>";
|
|
37
|
+
readonly label: "HTTP 响应体";
|
|
38
|
+
readonly description: "HTTP 响应体(配置了「请求」时为已解析 JSON,否则为 none)";
|
|
39
|
+
};
|
|
40
|
+
/** 票种:决定票面标题(「电子发票(增值税专用发票)」/「…(普通发票)」)。 */
|
|
41
|
+
export declare const INVOICE_KINDS: readonly ["special", "normal"];
|
|
42
|
+
export declare const INVOICE_KIND_LABELS: Record<(typeof INVOICE_KINDS)[number], string>;
|
|
43
|
+
/**
|
|
44
|
+
* 购买方 / 销售方信息栏。票面只有「名称」与「统一社会信用代码/纳税人识别号」两栏 ——
|
|
45
|
+
* 开户行与账号在真实发票上属于「备注」栏的自由文本(不是独立栏位),因此不建模,
|
|
46
|
+
* 由 `remark` 承载。
|
|
47
|
+
*/
|
|
48
|
+
export declare function partySchema(configure: Configure, role: '购买方' | '销售方'): Schema.Struct<{
|
|
49
|
+
name: Schema.Schema<string, string, never>;
|
|
50
|
+
taxId: Schema.Schema<string, string, never>;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* 明细行的列映射。每个表达式对一行求值,可访问 `item`(当前明细项)与 `index`
|
|
54
|
+
* (序号,从 0 开始)—— 与 `loop` 块同一套行作用域(`registerLoopVariablesIfAbsent`)。
|
|
55
|
+
*
|
|
56
|
+
* 只有「项目名称」与「金额」必填:真实发票上规格型号 / 单位 / 数量 / 单价 常为空
|
|
57
|
+
* (如服务费类目),留空即该单元格不渲染内容。
|
|
58
|
+
*/
|
|
59
|
+
export declare function lineSchema(configure: Configure): Schema.Struct<{
|
|
60
|
+
name: Schema.Schema<string, string, never>;
|
|
61
|
+
spec: Schema.optional<Schema.Schema<string, string, never>>;
|
|
62
|
+
unit: Schema.optional<Schema.Schema<string, string, never>>;
|
|
63
|
+
quantity: Schema.optional<Schema.Schema<string, string, never>>;
|
|
64
|
+
unitPrice: Schema.optional<Schema.Schema<string, string, never>>;
|
|
65
|
+
amount: Schema.Schema<string, string, never>;
|
|
66
|
+
taxRate: Schema.optional<Schema.Schema<string, string, never>>;
|
|
67
|
+
taxAmount: Schema.optional<Schema.Schema<string, string, never>>;
|
|
68
|
+
}>;
|
|
69
|
+
export declare function schema(configure: Configure, _blockRef?: AnySchema): Schema.Struct<{
|
|
70
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
71
|
+
type: Schema.tag<"com.shwfed.block.invoice.digital">;
|
|
72
|
+
compatibilityDate: Schema.tag<"2026-07-17">;
|
|
73
|
+
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
74
|
+
kind: Schema.optional<Schema.Literal<["special", "normal"]>>;
|
|
75
|
+
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
76
|
+
itemsMaxHeight: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
77
|
+
invoiceNumber: Schema.Schema<string, string, never>;
|
|
78
|
+
issueDate: Schema.Schema<string, string, never>;
|
|
79
|
+
buyer: Schema.Struct<{
|
|
80
|
+
name: Schema.Schema<string, string, never>;
|
|
81
|
+
taxId: Schema.Schema<string, string, never>;
|
|
82
|
+
}>;
|
|
83
|
+
seller: Schema.Struct<{
|
|
84
|
+
name: Schema.Schema<string, string, never>;
|
|
85
|
+
taxId: Schema.Schema<string, string, never>;
|
|
86
|
+
}>;
|
|
87
|
+
items: Schema.Schema<string, string, never>;
|
|
88
|
+
line: Schema.Struct<{
|
|
89
|
+
name: Schema.Schema<string, string, never>;
|
|
90
|
+
spec: Schema.optional<Schema.Schema<string, string, never>>;
|
|
91
|
+
unit: Schema.optional<Schema.Schema<string, string, never>>;
|
|
92
|
+
quantity: Schema.optional<Schema.Schema<string, string, never>>;
|
|
93
|
+
unitPrice: Schema.optional<Schema.Schema<string, string, never>>;
|
|
94
|
+
amount: Schema.Schema<string, string, never>;
|
|
95
|
+
taxRate: Schema.optional<Schema.Schema<string, string, never>>;
|
|
96
|
+
taxAmount: Schema.optional<Schema.Schema<string, string, never>>;
|
|
97
|
+
}>;
|
|
98
|
+
totalAmount: Schema.Schema<string, string, never>;
|
|
99
|
+
totalTax: Schema.Schema<string, string, never>;
|
|
100
|
+
grandTotal: Schema.Schema<string, string, never>;
|
|
101
|
+
remark: Schema.optional<Schema.Schema<string, string, never>>;
|
|
102
|
+
issuer: Schema.optional<Schema.Schema<string, string, never>>;
|
|
103
|
+
redLetter: Schema.optional<Schema.Schema<string, string, never>>;
|
|
104
|
+
}>;
|
|
105
|
+
export declare function defaultBody(): Record<string, unknown>;
|
|
106
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
107
|
+
export type PartyValue = Value['buyer'];
|
|
108
|
+
export type LineValue = Value['line'];
|
|
109
|
+
export type InvoiceKind = (typeof INVOICE_KINDS)[number];
|
package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Expression, HttpRequestResult } from "../../../../../share/expression.js";
|
|
3
|
+
import { registerLoopVariablesIfAbsent } from "../../../../../share/loop-item-var.js";
|
|
4
|
+
export { getStructFieldDescription, getStructFieldTitle } from "../../../../table/utils/schema-meta.js";
|
|
5
|
+
export const type = "com.shwfed.block.invoice.digital";
|
|
6
|
+
export const compatibilityDate = "2026-07-17";
|
|
7
|
+
export const metadata = {
|
|
8
|
+
name: "\u6570\u7535\u7968",
|
|
9
|
+
icon: "fluent:receipt-20-regular",
|
|
10
|
+
description: "\u6309\u56FD\u5BB6\u7A0E\u52A1\u603B\u5C40\u7248\u5F0F\u6E32\u67D3\u4E00\u5F20\u6570\u7535\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968 / \u666E\u901A\u53D1\u7968\uFF09\uFF0C\u7968\u9762\u5404\u680F\u7531 CEL \u8868\u8FBE\u5F0F\u6620\u5C04",
|
|
11
|
+
w: { initial: 24, min: 12, max: Infinity },
|
|
12
|
+
// `grow: true`:票面高度由明细行数决定(内容驱动),需要脱离网格 `1fr` 等分、
|
|
13
|
+
// 顶部锚定向下生长,否则行数变化会让整张票在过大的轨道里重新定位。
|
|
14
|
+
// 与 `loop` / `tree.single` 同理,见 `config/utils/resolve.ts` 的 `BlockSizeRange.grow`。
|
|
15
|
+
h: { initial: 12, min: 8, max: Infinity, grow: true }
|
|
16
|
+
};
|
|
17
|
+
export const JSON_VAR = {
|
|
18
|
+
type: "optional<dyn>",
|
|
19
|
+
label: "HTTP \u54CD\u5E94\u4F53",
|
|
20
|
+
description: "HTTP \u54CD\u5E94\u4F53\uFF08\u914D\u7F6E\u4E86\u300C\u8BF7\u6C42\u300D\u65F6\u4E3A\u5DF2\u89E3\u6790 JSON\uFF0C\u5426\u5219\u4E3A none\uFF09"
|
|
21
|
+
};
|
|
22
|
+
function registerJsonIfAbsent(env) {
|
|
23
|
+
const declared = env.getDefinitions().variables.some((v) => v.name === "json");
|
|
24
|
+
if (declared) return;
|
|
25
|
+
env.registerVariable("json", JSON_VAR.type, {
|
|
26
|
+
label: JSON_VAR.label,
|
|
27
|
+
description: JSON_VAR.description
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export const INVOICE_KINDS = ["special", "normal"];
|
|
31
|
+
export const INVOICE_KIND_LABELS = {
|
|
32
|
+
special: "\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968",
|
|
33
|
+
normal: "\u589E\u503C\u7A0E\u666E\u901A\u53D1\u7968"
|
|
34
|
+
};
|
|
35
|
+
const textResult = (t) => t === "string" || t === "dyn" || t.startsWith("optional");
|
|
36
|
+
const moneyResult = (t) => t === "number" || t === "string" || t === "dyn" || t.startsWith("optional");
|
|
37
|
+
const listResult = (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional");
|
|
38
|
+
const boolResult = (t) => t === "bool" || t === "dyn" || t.startsWith("optional");
|
|
39
|
+
export function partySchema(configure, role) {
|
|
40
|
+
const CelText = Expression({ configure, resultType: textResult });
|
|
41
|
+
return Schema.Struct({
|
|
42
|
+
name: CelText.annotations({
|
|
43
|
+
title: "\u540D\u79F0",
|
|
44
|
+
description: `\u8FD4\u56DE${role}\u540D\u79F0\uFF08\`string\`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F`
|
|
45
|
+
}),
|
|
46
|
+
taxId: CelText.annotations({
|
|
47
|
+
title: "\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
|
|
48
|
+
description: `\u8FD4\u56DE${role}\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801\u6216\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7\uFF08\`string\`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F`
|
|
49
|
+
})
|
|
50
|
+
}).annotations({
|
|
51
|
+
title: `${role}\u4FE1\u606F`,
|
|
52
|
+
description: `${role}\u7684\u540D\u79F0\u4E0E\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7\uFF1B\u5F00\u6237\u884C / \u8D26\u53F7\u8BF7\u5199\u5165\u300C\u5907\u6CE8\u300D`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export function lineSchema(configure) {
|
|
56
|
+
const rowConfigure = (env) => {
|
|
57
|
+
configure(env);
|
|
58
|
+
registerLoopVariablesIfAbsent(env);
|
|
59
|
+
};
|
|
60
|
+
const CelText = Expression({ configure: rowConfigure, resultType: textResult });
|
|
61
|
+
const CelMoney = Expression({ configure: rowConfigure, resultType: moneyResult });
|
|
62
|
+
return Schema.Struct({
|
|
63
|
+
name: CelText.annotations({
|
|
64
|
+
title: "\u9879\u76EE\u540D\u79F0",
|
|
65
|
+
description: "\u8FD4\u56DE\u9879\u76EE\u540D\u79F0\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5982 `item.xmmc`\u3002\u7968\u9762\u60EF\u4F8B\u5E26\u7C7B\u76EE\u524D\u7F00\uFF0C\u5982 `*\u96C6\u6210\u7535\u8DEF*\u96C6\u6210\u7535\u8DEF`"
|
|
66
|
+
}),
|
|
67
|
+
spec: Schema.optional(CelText.annotations({
|
|
68
|
+
title: "\u89C4\u683C\u578B\u53F7",
|
|
69
|
+
description: "\u8FD4\u56DE\u89C4\u683C\u578B\u53F7\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u7559\u7A7A\u5219\u8BE5\u680F\u4E3A\u7A7A"
|
|
70
|
+
})),
|
|
71
|
+
unit: Schema.optional(CelText.annotations({
|
|
72
|
+
title: "\u5355\u4F4D",
|
|
73
|
+
description: "\u8FD4\u56DE\u8BA1\u91CF\u5355\u4F4D\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5982 `\u4E2A` / `\u4EF6`\uFF1B\u7559\u7A7A\u5219\u8BE5\u680F\u4E3A\u7A7A"
|
|
74
|
+
})),
|
|
75
|
+
quantity: Schema.optional(CelMoney.annotations({
|
|
76
|
+
title: "\u6570\u91CF",
|
|
77
|
+
description: "\u8FD4\u56DE\u6570\u91CF\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u8FD4\u56DE `number` \u65F6\u539F\u6837\u5C55\u793A\uFF08\u4E0D\u8865\u5C0F\u6570\u4F4D\uFF09\uFF0C\u8FD4\u56DE `string` \u65F6\u539F\u6837\u6253\u5370\uFF1B\u7559\u7A7A\u5219\u8BE5\u680F\u4E3A\u7A7A"
|
|
78
|
+
})),
|
|
79
|
+
unitPrice: Schema.optional(CelMoney.annotations({
|
|
80
|
+
title: "\u5355\u4EF7",
|
|
81
|
+
description: "\u8FD4\u56DE\u5355\u4EF7\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u8FD4\u56DE `number` \u65F6\u539F\u6837\u5C55\u793A\uFF08\u7968\u9762\u5355\u4EF7\u5E38\u5E26\u591A\u4F4D\u5C0F\u6570\uFF0C\u5982 `272.5663716814`\uFF0C\u6545\u4E0D\u505A\u56DB\u820D\u4E94\u5165\uFF09\uFF1B\u7559\u7A7A\u5219\u8BE5\u680F\u4E3A\u7A7A"
|
|
82
|
+
})),
|
|
83
|
+
amount: CelMoney.annotations({
|
|
84
|
+
title: "\u91D1\u989D",
|
|
85
|
+
description: "\u8FD4\u56DE\u4E0D\u542B\u7A0E\u91D1\u989D\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u8FD4\u56DE `number` \u65F6\u683C\u5F0F\u5316\u4E3A\u4E24\u4F4D\u5C0F\u6570\u5E76\u52A0\u5343\u5206\u4F4D\uFF1B\u8FD4\u56DE `string` \u65F6\u539F\u6837\u6253\u5370"
|
|
86
|
+
}),
|
|
87
|
+
taxRate: Schema.optional(CelText.annotations({
|
|
88
|
+
title: "\u7A0E\u7387/\u5F81\u6536\u7387",
|
|
89
|
+
description: "\u8FD4\u56DE\u7A0E\u7387\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u539F\u6837\u6253\u5370\uFF0C\u5982 `13%`\u3002\u523B\u610F\u4E0D\u662F\u6570\u5B57 \u2014\u2014 \u8BE5\u680F\u5408\u6CD5\u53D6\u503C\u8FD8\u5305\u62EC `\u514D\u7A0E` / `\u4E0D\u5F81\u7A0E` / `***`"
|
|
90
|
+
})),
|
|
91
|
+
taxAmount: Schema.optional(CelMoney.annotations({
|
|
92
|
+
title: "\u7A0E\u989D",
|
|
93
|
+
description: "\u8FD4\u56DE\u7A0E\u989D\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u8FD4\u56DE `number` \u65F6\u683C\u5F0F\u5316\u4E3A\u4E24\u4F4D\u5C0F\u6570\u5E76\u52A0\u5343\u5206\u4F4D\uFF1B\u7559\u7A7A\u5219\u8BE5\u680F\u4E3A\u7A7A"
|
|
94
|
+
}))
|
|
95
|
+
}).annotations({
|
|
96
|
+
title: "\u660E\u7EC6\u884C",
|
|
97
|
+
description: "\u660E\u7EC6\u5404\u680F\u7684\u53D6\u503C\u8868\u8FBE\u5F0F\uFF0C\u5BF9\u6BCF\u4E00\u884C\u6C42\u503C\uFF1B\u53EF\u8BBF\u95EE `item`\uFF08\u5F53\u524D\u660E\u7EC6\u9879\uFF09\u4E0E `index`\uFF08\u5E8F\u53F7\uFF0C\u4ECE 0 \u5F00\u59CB\uFF09"
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export function schema(configure, _blockRef) {
|
|
101
|
+
const CelRequest = Expression({ configure, resultType: HttpRequestResult });
|
|
102
|
+
const bodyConfigure = (env) => {
|
|
103
|
+
configure(env);
|
|
104
|
+
registerJsonIfAbsent(env);
|
|
105
|
+
};
|
|
106
|
+
const CelText = Expression({ configure: bodyConfigure, resultType: textResult });
|
|
107
|
+
const CelMoney = Expression({ configure: bodyConfigure, resultType: moneyResult });
|
|
108
|
+
const CelItems = Expression({ configure: bodyConfigure, resultType: listResult });
|
|
109
|
+
const CelBool = Expression({ configure: bodyConfigure, resultType: boolResult });
|
|
110
|
+
return Schema.Struct({
|
|
111
|
+
id: Schema.UUID.annotations({ description: "\u5757\u552F\u4E00\u6807\u8BC6" }),
|
|
112
|
+
type: Schema.tag(type),
|
|
113
|
+
compatibilityDate: Schema.tag(compatibilityDate),
|
|
114
|
+
displayName: Schema.optional(Schema.String.annotations({
|
|
115
|
+
title: "\u5185\u90E8\u540D\u79F0",
|
|
116
|
+
description: "\u4EC5\u5728\u7F16\u8F91\u5668\u5185\u53EF\u89C1\u7684\u5757\u540D\uFF0C\u7528\u4E8E\u5728\u4FA7\u8FB9\u680F\u548C\u5E03\u5C40\u7F16\u8F91\u5668\u4E2D\u8BC6\u522B\u5757\uFF1B\u8FD0\u884C\u65F6\u4E0D\u5C55\u793A"
|
|
117
|
+
})),
|
|
118
|
+
kind: Schema.optional(Schema.Literal(...INVOICE_KINDS).annotations({
|
|
119
|
+
title: "\u7968\u79CD",
|
|
120
|
+
description: "\u51B3\u5B9A\u7968\u9762\u6807\u9898\uFF1A`special` \u4E3A\u300C\u7535\u5B50\u53D1\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968\uFF09\u300D\uFF0C`normal` \u4E3A\u300C\u7535\u5B50\u53D1\u7968\uFF08\u589E\u503C\u7A0E\u666E\u901A\u53D1\u7968\uFF09\u300D\uFF1B\u7559\u7A7A\u7B49\u540C `special`"
|
|
121
|
+
})),
|
|
122
|
+
request: Schema.optional(CelRequest.annotations({
|
|
123
|
+
title: "\u8BF7\u6C42",
|
|
124
|
+
description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF08\u8FD4\u56DE `HttpRequest`\uFF09\uFF1B\u54CD\u5E94\u4F53\u4EE5 `json` \u63D0\u4F9B\u7ED9\u7968\u9762\u6240\u6709\u680F\u4F4D\uFF08\u542B\u660E\u7EC6\u5217\u8868\u4E0E\u9010\u884C\u680F\u4F4D\uFF09\u3002\u7559\u7A7A\u5219 `json` \u4E3A none\uFF0C\u5404\u680F\u4ECE\u5916\u5C42\u4E0A\u4E0B\u6587\u53D6\u503C"
|
|
125
|
+
})),
|
|
126
|
+
itemsMaxHeight: Schema.optional(Schema.String.annotations({
|
|
127
|
+
title: "\u660E\u7EC6\u533A\u9AD8\u5EA6",
|
|
128
|
+
description: "\u660E\u7EC6\u533A\u7684\u6700\u5927\u9AD8\u5EA6\uFF08CSS \u957F\u5EA6\uFF0C\u5982 `24rem` / `50vh`\uFF09\uFF1B\u8D85\u51FA\u540E\u660E\u7EC6\u5185\u5BB9\u6EDA\u52A8\uFF0C\u5217\u6807\u9898\u4E0E\u5408\u8BA1\u884C\u4FDD\u6301\u53EF\u89C1\u3002\u7559\u7A7A\u5219\u660E\u7EC6\u533A\u968F\u884C\u6570\u589E\u957F\uFF0C\u7968\u9762\u6574\u4F53\u53D8\u9AD8"
|
|
129
|
+
})),
|
|
130
|
+
invoiceNumber: CelText.annotations({
|
|
131
|
+
title: "\u53D1\u7968\u53F7\u7801",
|
|
132
|
+
description: "\u8FD4\u56DE\u53D1\u7968\u53F7\u7801\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5C55\u793A\u5728\u7968\u9762\u53F3\u4E0A\u89D2"
|
|
133
|
+
}),
|
|
134
|
+
issueDate: CelText.annotations({
|
|
135
|
+
title: "\u5F00\u7968\u65E5\u671F",
|
|
136
|
+
description: "\u8FD4\u56DE\u5F00\u7968\u65E5\u671F\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u539F\u6837\u6253\u5370\u3002\u7968\u9762\u60EF\u4F8B\u4E3A `2026\u5E7406\u670801\u65E5`\uFF0C\u683C\u5F0F\u5316\u8BF7\u5728\u8868\u8FBE\u5F0F\u5185\u5B8C\u6210"
|
|
137
|
+
}),
|
|
138
|
+
buyer: partySchema(bodyConfigure, "\u8D2D\u4E70\u65B9"),
|
|
139
|
+
seller: partySchema(bodyConfigure, "\u9500\u552E\u65B9"),
|
|
140
|
+
items: CelItems.annotations({
|
|
141
|
+
title: "\u660E\u7EC6\u5217\u8868",
|
|
142
|
+
description: "\u8FD4\u56DE\u660E\u7EC6\u884C\u5217\u8868\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5982 `json.mxList`\uFF1B\u6BCF\u4E00\u9879\u6309\u300C\u660E\u7EC6\u884C\u300D\u7684\u5217\u6620\u5C04\u6E32\u67D3\u4E00\u884C\u3002\u8FD4\u56DE `none` / \u975E\u5217\u8868\u65F6\u4E0D\u6E32\u67D3\u4EFB\u4F55\u660E\u7EC6\u884C"
|
|
143
|
+
}),
|
|
144
|
+
line: lineSchema(bodyConfigure).annotations({
|
|
145
|
+
title: "\u660E\u7EC6\u884C",
|
|
146
|
+
description: "\u660E\u7EC6\u5404\u680F\u7684\u53D6\u503C\u8868\u8FBE\u5F0F\uFF0C\u5BF9\u300C\u660E\u7EC6\u5217\u8868\u300D\u7684\u6BCF\u4E00\u9879\u6C42\u503C"
|
|
147
|
+
}),
|
|
148
|
+
totalAmount: CelMoney.annotations({
|
|
149
|
+
title: "\u5408\u8BA1\u91D1\u989D",
|
|
150
|
+
description: "\u8FD4\u56DE\u5408\u8BA1\u680F\u4E0D\u542B\u7A0E\u91D1\u989D\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u523B\u610F\u4E0D\u7531\u660E\u7EC6\u81EA\u52A8\u6C42\u548C \u2014\u2014 \u7968\u9762\u5408\u8BA1\u4EE5\u5F00\u7968\u6570\u636E\u4E3A\u51C6\uFF0C\u4E0D\u5E94\u7531\u524D\u7AEF\u91CD\u7B97"
|
|
151
|
+
}),
|
|
152
|
+
totalTax: CelMoney.annotations({
|
|
153
|
+
title: "\u5408\u8BA1\u7A0E\u989D",
|
|
154
|
+
description: "\u8FD4\u56DE\u5408\u8BA1\u680F\u7A0E\u989D\u7684 CEL \u8868\u8FBE\u5F0F"
|
|
155
|
+
}),
|
|
156
|
+
grandTotal: CelMoney.annotations({
|
|
157
|
+
title: "\u4EF7\u7A0E\u5408\u8BA1",
|
|
158
|
+
description: "\u8FD4\u56DE\u4EF7\u7A0E\u5408\u8BA1\uFF08\u5C0F\u5199\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\u3002\u5927\u5199\u680F\u7531\u8BE5\u503C\u672C\u5730\u63A8\u5BFC\uFF08\u5982 `\u9646\u4EDF\u67D2\u4F70\u96F6\u9646\u5706\u58F9\u89D2\u6574`\u3001\u8D1F\u6570\u4E3A `\uFF08\u8D1F\u6570\uFF09\u53C1\u4F70\u96F6\u634C\u5706\u6574`\uFF09\uFF0C\u65E0\u9700\u53E6\u884C\u914D\u7F6E"
|
|
159
|
+
}),
|
|
160
|
+
remark: Schema.optional(CelText.annotations({
|
|
161
|
+
title: "\u5907\u6CE8",
|
|
162
|
+
description: "\u8FD4\u56DE\u5907\u6CE8\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u6309\u6362\u884C\u539F\u6837\u6E32\u67D3\u3002\u5F00\u6237\u884C\u3001\u94F6\u884C\u8D26\u53F7\u3001\u7EA2\u5B57\u53D1\u7968\u4FE1\u606F\u786E\u8BA4\u5355\u7F16\u53F7\u7B49\u5747\u5C5E\u6B64\u680F"
|
|
163
|
+
})),
|
|
164
|
+
issuer: Schema.optional(CelText.annotations({
|
|
165
|
+
title: "\u5F00\u7968\u4EBA",
|
|
166
|
+
description: "\u8FD4\u56DE\u5F00\u7968\u4EBA\u59D3\u540D\uFF08`string`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u7559\u7A7A\u5219\u4E0D\u5C55\u793A"
|
|
167
|
+
})),
|
|
168
|
+
redLetter: Schema.optional(CelBool.annotations({
|
|
169
|
+
title: "\u7EA2\u5B57\u53D1\u7968",
|
|
170
|
+
description: "\u8FD4\u56DE `bool` \u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u4E3A `true` \u65F6\u7968\u9762\u4E2D\u592E\u53E0\u52A0\u300C\u7EA2\u5B57\u53D1\u7968\u300D\u6C34\u5370\u3002\u7559\u7A7A\u5219\u4E0D\u5C55\u793A\u6C34\u5370"
|
|
171
|
+
}))
|
|
172
|
+
}).annotations({
|
|
173
|
+
title: "\u6570\u7535\u7968\u5757",
|
|
174
|
+
description: "\u6309\u56FD\u5BB6\u7A0E\u52A1\u603B\u5C40\u7248\u5F0F\u6E32\u67D3\u4E00\u5F20\u6570\u7535\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968 / \u666E\u901A\u53D1\u7968\uFF09\uFF0C\u7968\u9762\u5404\u680F\u7531 CEL \u8868\u8FBE\u5F0F\u6620\u5C04"
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
export function defaultBody() {
|
|
178
|
+
return {
|
|
179
|
+
invoiceNumber: "",
|
|
180
|
+
issueDate: "",
|
|
181
|
+
buyer: { name: "", taxId: "" },
|
|
182
|
+
seller: { name: "", taxId: "" },
|
|
183
|
+
items: "[]",
|
|
184
|
+
line: { name: "", amount: "" },
|
|
185
|
+
totalAmount: "",
|
|
186
|
+
totalTax: "",
|
|
187
|
+
grandTotal: ""
|
|
188
|
+
};
|
|
189
|
+
}
|
|
@@ -39,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
+
readonly maxLength?: number | undefined;
|
|
42
43
|
readonly validations?: readonly {
|
|
43
44
|
readonly message: readonly [{
|
|
44
45
|
readonly locale: "zh";
|
|
@@ -50,7 +51,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
51
|
readonly warning?: boolean | undefined;
|
|
51
52
|
readonly when: string;
|
|
52
53
|
}[] | undefined;
|
|
53
|
-
readonly maxLength?: number | undefined;
|
|
54
54
|
}) => any;
|
|
55
55
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
56
56
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,6 +89,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly mode: "formula" | "prefill";
|
|
90
90
|
readonly expression: string;
|
|
91
91
|
} | undefined;
|
|
92
|
+
readonly maxLength?: number | undefined;
|
|
92
93
|
readonly validations?: readonly {
|
|
93
94
|
readonly message: readonly [{
|
|
94
95
|
readonly locale: "zh";
|
|
@@ -100,7 +101,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
100
101
|
readonly warning?: boolean | undefined;
|
|
101
102
|
readonly when: string;
|
|
102
103
|
}[] | undefined;
|
|
103
|
-
readonly maxLength?: number | undefined;
|
|
104
104
|
}) => any) | undefined;
|
|
105
105
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
106
106
|
declare const _default: typeof __VLS_export;
|
|
@@ -39,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
+
readonly maxLength?: number | undefined;
|
|
42
43
|
readonly validations?: readonly {
|
|
43
44
|
readonly message: readonly [{
|
|
44
45
|
readonly locale: "zh";
|
|
@@ -50,7 +51,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
51
|
readonly warning?: boolean | undefined;
|
|
51
52
|
readonly when: string;
|
|
52
53
|
}[] | undefined;
|
|
53
|
-
readonly maxLength?: number | undefined;
|
|
54
54
|
}) => any;
|
|
55
55
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
56
56
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -89,6 +89,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
89
|
readonly mode: "formula" | "prefill";
|
|
90
90
|
readonly expression: string;
|
|
91
91
|
} | undefined;
|
|
92
|
+
readonly maxLength?: number | undefined;
|
|
92
93
|
readonly validations?: readonly {
|
|
93
94
|
readonly message: readonly [{
|
|
94
95
|
readonly locale: "zh";
|
|
@@ -100,7 +101,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
100
101
|
readonly warning?: boolean | undefined;
|
|
101
102
|
readonly when: string;
|
|
102
103
|
}[] | undefined;
|
|
103
|
-
readonly maxLength?: number | undefined;
|
|
104
104
|
}) => any) | undefined;
|
|
105
105
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
106
106
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.d.vue.ts
CHANGED
|
@@ -32,6 +32,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
32
32
|
}[]] | undefined;
|
|
33
33
|
readonly required?: string | undefined;
|
|
34
34
|
readonly displayName?: string | undefined;
|
|
35
|
+
readonly download?: {
|
|
36
|
+
readonly label?: readonly [{
|
|
37
|
+
readonly locale: "zh";
|
|
38
|
+
readonly message: string;
|
|
39
|
+
}, ...{
|
|
40
|
+
readonly locale: "en" | "ja" | "ko";
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}[]] | undefined;
|
|
43
|
+
readonly icon?: string | undefined;
|
|
44
|
+
readonly operations: readonly {
|
|
45
|
+
readonly id?: string | undefined;
|
|
46
|
+
readonly params?: unknown;
|
|
47
|
+
readonly compatibilityDate?: string | undefined;
|
|
48
|
+
readonly target: string;
|
|
49
|
+
readonly operation: string;
|
|
50
|
+
}[];
|
|
51
|
+
} | undefined;
|
|
35
52
|
readonly compatibilityDate: "2026-06-09";
|
|
36
53
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
37
54
|
readonly placeholder?: readonly [{
|
|
@@ -106,6 +123,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
106
123
|
}[]] | undefined;
|
|
107
124
|
readonly required?: string | undefined;
|
|
108
125
|
readonly displayName?: string | undefined;
|
|
126
|
+
readonly download?: {
|
|
127
|
+
readonly label?: readonly [{
|
|
128
|
+
readonly locale: "zh";
|
|
129
|
+
readonly message: string;
|
|
130
|
+
}, ...{
|
|
131
|
+
readonly locale: "en" | "ja" | "ko";
|
|
132
|
+
readonly message: string;
|
|
133
|
+
}[]] | undefined;
|
|
134
|
+
readonly icon?: string | undefined;
|
|
135
|
+
readonly operations: readonly {
|
|
136
|
+
readonly id?: string | undefined;
|
|
137
|
+
readonly params?: unknown;
|
|
138
|
+
readonly compatibilityDate?: string | undefined;
|
|
139
|
+
readonly target: string;
|
|
140
|
+
readonly operation: string;
|
|
141
|
+
}[];
|
|
142
|
+
} | undefined;
|
|
109
143
|
readonly compatibilityDate: "2026-06-09";
|
|
110
144
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
111
145
|
readonly placeholder?: readonly [{
|
package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { computed, defineComponent, ref, watch } from "vue";
|
|
4
4
|
import {
|
|
5
5
|
useTreeDnd
|
|
6
6
|
} from "../../../../../composables/useTreeDnd";
|
|
7
|
+
import TriggersField from "../../../../actions/components/triggers-field.vue";
|
|
8
|
+
import { provideCELContext } from "../../../../../utils/cel-context";
|
|
7
9
|
import {
|
|
8
10
|
DropdownMenu,
|
|
9
11
|
DropdownMenuContent,
|
|
@@ -273,6 +275,52 @@ function setMultiple(v) {
|
|
|
273
275
|
value.value = { ...value.value, multiple: true };
|
|
274
276
|
}
|
|
275
277
|
}
|
|
278
|
+
const downloadEnabled = computed(() => value.value.download != null);
|
|
279
|
+
function setDownloadEnabled(on) {
|
|
280
|
+
if (on) {
|
|
281
|
+
if (value.value.download) return;
|
|
282
|
+
value.value = { ...value.value, download: { operations: [] } };
|
|
283
|
+
} else {
|
|
284
|
+
const { download: _omit, ...rest } = value.value;
|
|
285
|
+
value.value = rest;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const downloadOperations = computed(() => value.value.download?.operations ?? []);
|
|
289
|
+
function updateDownloadOperations(next) {
|
|
290
|
+
const current = value.value.download;
|
|
291
|
+
if (!current) return;
|
|
292
|
+
value.value = { ...value.value, download: { ...current, operations: next } };
|
|
293
|
+
}
|
|
294
|
+
function updateDownloadIcon(icon) {
|
|
295
|
+
const current = value.value.download;
|
|
296
|
+
if (!current) return;
|
|
297
|
+
const trimmed = icon.trim();
|
|
298
|
+
if (trimmed.length === 0) {
|
|
299
|
+
const { icon: _omit, ...rest } = current;
|
|
300
|
+
value.value = { ...value.value, download: rest };
|
|
301
|
+
} else {
|
|
302
|
+
value.value = { ...value.value, download: { ...current, icon: trimmed } };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function updateDownloadLabel(label) {
|
|
306
|
+
const current = value.value.download;
|
|
307
|
+
if (!current) return;
|
|
308
|
+
if (label == null || label.length === 0) {
|
|
309
|
+
const { label: _omit, ...rest } = current;
|
|
310
|
+
value.value = { ...value.value, download: rest };
|
|
311
|
+
} else {
|
|
312
|
+
value.value = { ...value.value, download: { ...current, label } };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const DownloadScope = defineComponent({
|
|
316
|
+
name: "ShwfedUploadDownloadScope",
|
|
317
|
+
setup(_, { slots }) {
|
|
318
|
+
provideCELContext({
|
|
319
|
+
file: { type: FILE_VAR.type, label: FILE_VAR.label, description: FILE_VAR.description, value: () => void 0 }
|
|
320
|
+
});
|
|
321
|
+
return () => slots.default?.();
|
|
322
|
+
}
|
|
323
|
+
});
|
|
276
324
|
</script>
|
|
277
325
|
|
|
278
326
|
<template>
|
|
@@ -693,6 +741,66 @@ function setMultiple(v) {
|
|
|
693
741
|
</Field>
|
|
694
742
|
</div>
|
|
695
743
|
|
|
744
|
+
<!-- Per-file download -->
|
|
745
|
+
<div class="flex items-center gap-2">
|
|
746
|
+
<h3 class="text-xs font-medium text-zinc-500">
|
|
747
|
+
{{ fieldTitle("download") }}
|
|
748
|
+
</h3>
|
|
749
|
+
<Switch
|
|
750
|
+
size="sm"
|
|
751
|
+
:model-value="downloadEnabled"
|
|
752
|
+
aria-label="启用文件下载"
|
|
753
|
+
@update:model-value="setDownloadEnabled"
|
|
754
|
+
/>
|
|
755
|
+
</div>
|
|
756
|
+
|
|
757
|
+
<div
|
|
758
|
+
v-if="downloadEnabled"
|
|
759
|
+
class="flex flex-col gap-3"
|
|
760
|
+
>
|
|
761
|
+
<div class="grid grid-cols-2 gap-3">
|
|
762
|
+
<Field orientation="vertical">
|
|
763
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
764
|
+
下载按钮图标
|
|
765
|
+
</FieldLabel>
|
|
766
|
+
<IconPicker
|
|
767
|
+
:model-value="value.download?.icon ?? ''"
|
|
768
|
+
@update:model-value="updateDownloadIcon"
|
|
769
|
+
/>
|
|
770
|
+
</Field>
|
|
771
|
+
|
|
772
|
+
<Field orientation="vertical">
|
|
773
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
774
|
+
下载按钮文本
|
|
775
|
+
</FieldLabel>
|
|
776
|
+
<LocaleField
|
|
777
|
+
translate-hint="file download button label"
|
|
778
|
+
:model-value="value.download?.label"
|
|
779
|
+
@update:model-value="updateDownloadLabel"
|
|
780
|
+
/>
|
|
781
|
+
</Field>
|
|
782
|
+
</div>
|
|
783
|
+
|
|
784
|
+
<Field orientation="vertical">
|
|
785
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
786
|
+
<template #tooltip>
|
|
787
|
+
<Markdown
|
|
788
|
+
source="点击文件项的下载按钮时按顺序执行的操作;可用 `file` 引用该文件项。尚未上传的本地文件会直接从内存下载,不经过此列表"
|
|
789
|
+
block
|
|
790
|
+
class="prose prose-sm prose-zinc"
|
|
791
|
+
/>
|
|
792
|
+
</template>
|
|
793
|
+
触发操作
|
|
794
|
+
</FieldLabel>
|
|
795
|
+
<DownloadScope>
|
|
796
|
+
<TriggersField
|
|
797
|
+
:triggers="downloadOperations"
|
|
798
|
+
@update:triggers="updateDownloadOperations"
|
|
799
|
+
/>
|
|
800
|
+
</DownloadScope>
|
|
801
|
+
</Field>
|
|
802
|
+
</div>
|
|
803
|
+
|
|
696
804
|
<!-- Download templates -->
|
|
697
805
|
<Field orientation="vertical">
|
|
698
806
|
<FieldLabel class="text-xs text-zinc-500">
|