@shwfed/config 3.0.12 → 3.0.14

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.
Files changed (91) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +2 -2
  3. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +2 -2
  4. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +2 -2
  5. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +2 -2
  6. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.d.vue.ts +2 -2
  7. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue.d.ts +2 -2
  8. package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.d.vue.ts +8 -8
  9. package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.vue.d.ts +8 -8
  10. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.d.vue.ts +10 -8
  11. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue +272 -286
  12. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue.d.ts +10 -8
  13. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.d.vue.ts +10 -8
  14. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue +91 -291
  15. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue.d.ts +10 -8
  16. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.d.ts +4 -28
  17. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.js +14 -33
  18. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.d.vue.ts +96 -0
  19. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue +385 -0
  20. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue.d.ts +96 -0
  21. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.d.vue.ts +3 -0
  22. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.vue +20 -0
  23. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/items-colgroup.vue.d.ts +3 -0
  24. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.d.vue.ts +96 -0
  25. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue +177 -0
  26. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue.d.ts +96 -0
  27. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/schema.d.ts +102 -0
  28. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/schema.js +186 -0
  29. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
  30. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
  31. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
  32. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
  33. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +22 -22
  34. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +22 -22
  35. package/dist/runtime/components/form/utils/validation.js +9 -7
  36. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  37. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  38. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
  39. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
  40. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  41. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  42. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
  43. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
  44. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
  45. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
  46. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
  47. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
  48. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  49. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  50. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  51. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  52. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
  53. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
  54. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
  55. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
  56. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue +57 -247
  57. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/prompt.md +2 -2
  58. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue +29 -126
  59. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.d.ts +5 -27
  60. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.js +10 -37
  61. package/dist/runtime/components/ui/invoice/InvoiceSheet.d.vue.ts +66 -0
  62. package/dist/runtime/components/ui/invoice/InvoiceSheet.vue +182 -0
  63. package/dist/runtime/components/ui/invoice/InvoiceSheet.vue.d.ts +66 -0
  64. package/dist/runtime/components/ui/invoice/index.d.ts +1 -0
  65. package/dist/runtime/components/ui/invoice/index.js +1 -0
  66. package/dist/runtime/components/ui/invoice-config/InvoiceConfigShell.d.vue.ts +36 -0
  67. package/dist/runtime/components/ui/invoice-config/InvoiceConfigShell.vue +41 -0
  68. package/dist/runtime/components/ui/invoice-config/InvoiceConfigShell.vue.d.ts +36 -0
  69. package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue → ui/invoice-config/InvoiceExprField.vue} +4 -4
  70. package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue → ui/invoice-config/InvoiceJsonScope.vue} +3 -3
  71. package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue → ui/invoice-config/InvoiceRowScope.vue} +2 -2
  72. package/dist/runtime/components/ui/invoice-config/index.d.ts +4 -0
  73. package/dist/runtime/components/ui/invoice-config/index.js +4 -0
  74. package/dist/runtime/share/invoice-eval.d.ts +13 -0
  75. package/dist/runtime/share/invoice-eval.js +88 -0
  76. package/dist/runtime/share/invoice.d.ts +68 -0
  77. package/dist/runtime/share/invoice.js +35 -0
  78. package/dist/runtime/share/slot-renderer.vue +83 -24
  79. package/dist/runtime/vendor/cel-js/CLAUDE.md +3 -1
  80. package/dist/runtime/vendor/cel-js/PROMPT.md +31 -2
  81. package/dist/runtime/vendor/cel-js/lib/functions.js +28 -1
  82. package/dist/runtime/vendor/cel-js/lib/registry.js +2 -1
  83. package/package.json +1 -1
  84. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.d.vue.ts → ui/invoice-config/InvoiceExprField.d.vue.ts} +0 -0
  85. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue.d.ts → ui/invoice-config/InvoiceExprField.vue.d.ts} +0 -0
  86. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.d.vue.ts → ui/invoice-config/InvoiceJsonScope.d.vue.ts} +0 -0
  87. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue.d.ts → ui/invoice-config/InvoiceJsonScope.vue.d.ts} +0 -0
  88. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.d.vue.ts → ui/invoice-config/InvoiceRowScope.d.vue.ts} +0 -0
  89. /package/dist/runtime/components/{config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue.d.ts → ui/invoice-config/InvoiceRowScope.vue.d.ts} +0 -0
  90. /package/dist/runtime/{components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital → share}/rmb.d.ts +0 -0
  91. /package/dist/runtime/{components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital → share}/rmb.js +0 -0
@@ -1,7 +1,16 @@
1
1
  import { Schema } from "effect";
2
2
  import { Expression, HttpRequestResult } from "../../../../../share/expression.js";
3
+ import {
4
+ boolResult,
5
+ listResult,
6
+ moneyResult,
7
+ partySchema,
8
+ registerJsonIfAbsent,
9
+ textResult
10
+ } from "../../../../../share/invoice.js";
3
11
  import { registerLoopVariablesIfAbsent } from "../../../../../share/loop-item-var.js";
4
12
  export { getStructFieldDescription, getStructFieldTitle } from "../../../../table/utils/schema-meta.js";
13
+ export { JSON_VAR, partySchema } from "../../../../../share/invoice.js";
5
14
  export const type = "com.shwfed.block.invoice.digital";
6
15
  export const compatibilityDate = "2026-07-17";
7
16
  export const metadata = {
@@ -14,44 +23,11 @@ export const metadata = {
14
23
  // 与 `loop` / `tree.single` 同理,见 `config/utils/resolve.ts` 的 `BlockSizeRange.grow`。
15
24
  h: { initial: 12, min: 8, max: Infinity, grow: true }
16
25
  };
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
26
  export const INVOICE_KINDS = ["special", "normal"];
31
27
  export const INVOICE_KIND_LABELS = {
32
28
  special: "\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968",
33
29
  normal: "\u589E\u503C\u7A0E\u666E\u901A\u53D1\u7968"
34
30
  };
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
31
  export function lineSchema(configure) {
56
32
  const rowConfigure = (env) => {
57
33
  configure(env);
@@ -99,6 +75,7 @@ export function lineSchema(configure) {
99
75
  }
100
76
  export function schema(configure, _blockRef) {
101
77
  const CelRequest = Expression({ configure, resultType: HttpRequestResult });
78
+ const CelHidden = Expression({ configure, resultType: boolResult });
102
79
  const bodyConfigure = (env) => {
103
80
  configure(env);
104
81
  registerJsonIfAbsent(env);
@@ -115,6 +92,10 @@ export function schema(configure, _blockRef) {
115
92
  title: "\u5185\u90E8\u540D\u79F0",
116
93
  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
94
  })),
95
+ hidden: Schema.optional(CelHidden.annotations({
96
+ title: "\u9690\u85CF\u6761\u4EF6",
97
+ description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u5757\u5728\u6240\u6709\u5E03\u5C40\u4E2D\u90FD\u4E0D\u6E32\u67D3\uFF0C\u5B83\u5360\u7528\u7684\u884C/\u5217\u8F68\u9053\u4F1A\u81EA\u52A8\u6536\u62E2\uFF08\u540C\u4E00\u7247\u533A\u57DF\u5185\u53E6\u4E00\u5F20\u7968\u53EF\u9876\u4E0A\u6765\uFF09\u3002\u5728**\u9875\u9762\u4F5C\u7528\u57DF**\u6C42\u503C \u2014\u2014 \u8BFB\u4E0D\u5230\u672C\u5757 `\u8BF7\u6C42` \u4EA7\u51FA\u7684 `json`\uFF0C\u7968\u79CD\u5224\u65AD\u9700\u53D6\u81EA\u5916\u5C42\u4E0A\u4E0B\u6587"
98
+ })),
118
99
  kind: Schema.optional(Schema.Literal(...INVOICE_KINDS).annotations({
119
100
  title: "\u7968\u79CD",
120
101
  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`"
@@ -0,0 +1,96 @@
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
+ modelValue: 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:modelValue": (value: {
12
+ readonly type: "com.shwfed.block.invoice.realestate.lease";
13
+ readonly id: string;
14
+ readonly line: {
15
+ readonly name: string;
16
+ readonly quantity?: string | undefined;
17
+ readonly unitPrice?: string | undefined;
18
+ readonly amount: string;
19
+ readonly taxRate?: string | undefined;
20
+ readonly taxAmount?: string | undefined;
21
+ readonly certNo?: string | undefined;
22
+ readonly areaUnit?: string | undefined;
23
+ };
24
+ readonly hidden?: string | undefined;
25
+ readonly displayName?: string | undefined;
26
+ readonly compatibilityDate: "2026-07-17";
27
+ readonly items: string;
28
+ readonly request?: string | undefined;
29
+ readonly invoiceNumber: string;
30
+ readonly issueDate: string;
31
+ readonly buyer: {
32
+ readonly name: string;
33
+ readonly taxId: string;
34
+ };
35
+ readonly seller: {
36
+ readonly name: string;
37
+ readonly taxId: string;
38
+ };
39
+ readonly grandTotal: string;
40
+ readonly issuer?: string | undefined;
41
+ readonly redLetter?: string | undefined;
42
+ readonly itemsMaxHeight?: string | undefined;
43
+ readonly remark: {
44
+ readonly address: string;
45
+ readonly leasePeriod: string;
46
+ readonly crossCity: string;
47
+ };
48
+ readonly totalAmount: string;
49
+ readonly totalTax: string;
50
+ readonly kindLabel: string;
51
+ }) => any;
52
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
53
+ "onUpdate:modelValue"?: ((value: {
54
+ readonly type: "com.shwfed.block.invoice.realestate.lease";
55
+ readonly id: string;
56
+ readonly line: {
57
+ readonly name: string;
58
+ readonly quantity?: string | undefined;
59
+ readonly unitPrice?: string | undefined;
60
+ readonly amount: string;
61
+ readonly taxRate?: string | undefined;
62
+ readonly taxAmount?: string | undefined;
63
+ readonly certNo?: string | undefined;
64
+ readonly areaUnit?: string | undefined;
65
+ };
66
+ readonly hidden?: string | undefined;
67
+ readonly displayName?: string | undefined;
68
+ readonly compatibilityDate: "2026-07-17";
69
+ readonly items: string;
70
+ readonly request?: string | undefined;
71
+ readonly invoiceNumber: string;
72
+ readonly issueDate: string;
73
+ readonly buyer: {
74
+ readonly name: string;
75
+ readonly taxId: string;
76
+ };
77
+ readonly seller: {
78
+ readonly name: string;
79
+ readonly taxId: string;
80
+ };
81
+ readonly grandTotal: string;
82
+ readonly issuer?: string | undefined;
83
+ readonly redLetter?: string | undefined;
84
+ readonly itemsMaxHeight?: string | undefined;
85
+ readonly remark: {
86
+ readonly address: string;
87
+ readonly leasePeriod: string;
88
+ readonly crossCity: string;
89
+ };
90
+ readonly totalAmount: string;
91
+ readonly totalTax: string;
92
+ readonly kindLabel: string;
93
+ }) => any) | undefined;
94
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
95
+ declare const _default: typeof __VLS_export;
96
+ export default _default;
@@ -0,0 +1,385 @@
1
+ <script setup>
2
+ import { ref } from "vue";
3
+ import { Field, FieldLabel } from "../../../../ui/field";
4
+ import { InputGroup, InputGroupInput } from "../../../../ui/input-group";
5
+ import {
6
+ InvoiceConfigShell,
7
+ InvoiceExprField,
8
+ InvoiceJsonScope,
9
+ InvoiceRowScope
10
+ } from "../../../../ui/invoice-config";
11
+ import { Markdown } from "../../../../ui/markdown";
12
+ import {
13
+ BUSINESS_LABEL,
14
+ getStructFieldDescription,
15
+ getStructFieldTitle,
16
+ lineSchema,
17
+ partySchema,
18
+ remarkSchema,
19
+ schema
20
+ } from "./schema";
21
+ defineOptions({ name: "ShwfedBlockInvoiceRealestateLeaseConfig" });
22
+ const block = defineModel({ type: null, ...{ required: true } });
23
+ defineProps({
24
+ configure: { type: Function, required: false }
25
+ });
26
+ const blockSchema = schema(() => {
27
+ });
28
+ const buyerSchema = partySchema(() => {
29
+ }, "\u8D2D\u4E70\u65B9");
30
+ const sellerSchema = partySchema(() => {
31
+ }, "\u9500\u552E\u65B9");
32
+ const lineSchemaObj = lineSchema(() => {
33
+ });
34
+ const remarkSchemaObj = remarkSchema(() => {
35
+ });
36
+ const fieldTitle = (f) => getStructFieldTitle(blockSchema, f) ?? f;
37
+ const fieldDescription = (f) => getStructFieldDescription(blockSchema, f);
38
+ const buyerTitle = (f) => getStructFieldTitle(buyerSchema, f) ?? f;
39
+ const buyerDescription = (f) => getStructFieldDescription(buyerSchema, f);
40
+ const sellerTitle = (f) => getStructFieldTitle(sellerSchema, f) ?? f;
41
+ const sellerDescription = (f) => getStructFieldDescription(sellerSchema, f);
42
+ const lineTitle = (f) => getStructFieldTitle(lineSchemaObj, f) ?? f;
43
+ const lineDescription = (f) => getStructFieldDescription(lineSchemaObj, f);
44
+ const remarkTitle = (f) => getStructFieldTitle(remarkSchemaObj, f) ?? f;
45
+ const remarkDescription = (f) => getStructFieldDescription(remarkSchemaObj, f);
46
+ const SECTIONS = [
47
+ { key: "general", label: "\u901A\u7528\u914D\u7F6E", icon: "fluent:settings-20-regular" },
48
+ { key: "head", label: "\u62AC\u5934", icon: "fluent:receipt-20-regular" },
49
+ { key: "parties", label: "\u8D2D\u9500\u53CC\u65B9", icon: "fluent:people-20-regular" },
50
+ { key: "items", label: "\u660E\u7EC6", icon: "fluent:apps-list-20-regular" },
51
+ { key: "totals", label: "\u5408\u8BA1", icon: "fluent:calculator-20-regular" },
52
+ { key: "remark", label: "\u5907\u6CE8\u4E0E\u7B7E\u53D1", icon: "fluent:note-20-regular" }
53
+ ];
54
+ const section = ref("general");
55
+ function setDisplayName(v) {
56
+ const s = String(v ?? "");
57
+ block.value = { ...block.value, displayName: s.length > 0 ? s : void 0 };
58
+ }
59
+ function setRequired(field, v) {
60
+ block.value = { ...block.value, [field]: v };
61
+ }
62
+ function setOptional(field, v) {
63
+ block.value = { ...block.value, [field]: v.trim().length > 0 ? v : void 0 };
64
+ }
65
+ function setItemsMaxHeight(v) {
66
+ const s = String(v ?? "").trim();
67
+ block.value = { ...block.value, itemsMaxHeight: s.length > 0 ? s : void 0 };
68
+ }
69
+ function setParty(party, field, v) {
70
+ block.value = { ...block.value, [party]: { ...block.value[party], [field]: v } };
71
+ }
72
+ function setLineRequired(field, v) {
73
+ block.value = { ...block.value, line: { ...block.value.line, [field]: v } };
74
+ }
75
+ function setLineOptional(field, v) {
76
+ block.value = {
77
+ ...block.value,
78
+ line: { ...block.value.line, [field]: v.trim().length > 0 ? v : void 0 }
79
+ };
80
+ }
81
+ function setRemark(field, v) {
82
+ block.value = { ...block.value, remark: { ...block.value.remark, [field]: v } };
83
+ }
84
+ </script>
85
+
86
+ <template>
87
+ <InvoiceConfigShell
88
+ v-model:section="section"
89
+ :sections="SECTIONS"
90
+ >
91
+ <template v-if="section === 'general'">
92
+ <Field orientation="vertical">
93
+ <FieldLabel class="text-xs text-zinc-500">
94
+ <template
95
+ v-if="fieldDescription('displayName')"
96
+ #tooltip
97
+ >
98
+ <Markdown
99
+ :source="fieldDescription('displayName')"
100
+ block
101
+ class="prose prose-sm prose-zinc"
102
+ />
103
+ </template>
104
+ {{ fieldTitle("displayName") }}
105
+ </FieldLabel>
106
+ <InputGroup>
107
+ <InputGroupInput
108
+ :model-value="block.displayName ?? ''"
109
+ placeholder="例:房租发票预览"
110
+ @update:model-value="setDisplayName"
111
+ />
112
+ </InputGroup>
113
+ </Field>
114
+
115
+ <!-- 业务标签印死在这张票上(见 schema 的 BUSINESS_LABEL)——它标识票种本身而不是
116
+ 一栏数据,故只陈述、不给编辑。 -->
117
+ <Field orientation="vertical">
118
+ <FieldLabel class="text-xs text-zinc-500">
119
+ 业务标签
120
+ </FieldLabel>
121
+ <p class="text-xs text-zinc-400">
122
+ 固定为「{{ BUSINESS_LABEL }}」,印在票面左上角,不可配置。
123
+ </p>
124
+ </Field>
125
+
126
+ <!-- 「隐藏条件」与「请求」同在 InvoiceJsonScope 之外:前者由宿主在渲染本块之前
127
+ 求值(`json` 尚不存在),后者就是产出 `json` 的那个表达式。 -->
128
+ <InvoiceExprField
129
+ :label="fieldTitle('hidden')"
130
+ :description="fieldDescription('hidden')"
131
+ :model-value="block.hidden ?? ''"
132
+ placeholder="可选;返回 bool,如 item.fplx != 'zl'"
133
+ @update:model-value="(v) => setOptional('hidden', v)"
134
+ />
135
+
136
+ <InvoiceExprField
137
+ :label="fieldTitle('request')"
138
+ :description="fieldDescription('request')"
139
+ :model-value="block.request ?? ''"
140
+ placeholder="可选;如 http.get('/api/invoice/' + item.id)"
141
+ multiline
142
+ @update:model-value="(v) => setOptional('request', v)"
143
+ />
144
+ </template>
145
+
146
+ <!-- 除「通用配置」外的每个分区都在 `json` 作用域内 —— `请求` 的响应体票面各栏
147
+ 都能读。Provider 本身不渲染元素,所以外层 flex 布局不受影响。 -->
148
+ <InvoiceJsonScope v-else>
149
+ <template v-if="section === 'head'">
150
+ <InvoiceExprField
151
+ :label="fieldTitle('kindLabel')"
152
+ :description="fieldDescription('kindLabel')"
153
+ :model-value="block.kindLabel"
154
+ placeholder="如 '增值税专用发票' 或 json.fpzl"
155
+ @update:model-value="(v) => setRequired('kindLabel', v)"
156
+ />
157
+ <InvoiceExprField
158
+ :label="fieldTitle('invoiceNumber')"
159
+ :description="fieldDescription('invoiceNumber')"
160
+ :model-value="block.invoiceNumber"
161
+ placeholder="如 json.fphm"
162
+ @update:model-value="(v) => setRequired('invoiceNumber', v)"
163
+ />
164
+ <InvoiceExprField
165
+ :label="fieldTitle('issueDate')"
166
+ :description="fieldDescription('issueDate')"
167
+ :model-value="block.issueDate"
168
+ placeholder="如 json.kprq"
169
+ @update:model-value="(v) => setRequired('issueDate', v)"
170
+ />
171
+ </template>
172
+
173
+ <template v-else-if="section === 'parties'">
174
+ <div class="text-xs font-medium text-zinc-500">
175
+ 购买方信息
176
+ </div>
177
+ <InvoiceExprField
178
+ :label="buyerTitle('name')"
179
+ :description="buyerDescription('name')"
180
+ :model-value="block.buyer.name"
181
+ placeholder="如 json.gf.mc"
182
+ @update:model-value="(v) => setParty('buyer', 'name', v)"
183
+ />
184
+ <InvoiceExprField
185
+ :label="buyerTitle('taxId')"
186
+ :description="buyerDescription('taxId')"
187
+ :model-value="block.buyer.taxId"
188
+ placeholder="如 json.gf.nsrsbh"
189
+ @update:model-value="(v) => setParty('buyer', 'taxId', v)"
190
+ />
191
+
192
+ <div class="mt-2 text-xs font-medium text-zinc-500">
193
+ 销售方信息
194
+ </div>
195
+ <InvoiceExprField
196
+ :label="sellerTitle('name')"
197
+ :description="sellerDescription('name')"
198
+ :model-value="block.seller.name"
199
+ placeholder="如 json.xf.mc"
200
+ @update:model-value="(v) => setParty('seller', 'name', v)"
201
+ />
202
+ <InvoiceExprField
203
+ :label="sellerTitle('taxId')"
204
+ :description="sellerDescription('taxId')"
205
+ :model-value="block.seller.taxId"
206
+ placeholder="如 json.xf.nsrsbh"
207
+ @update:model-value="(v) => setParty('seller', 'taxId', v)"
208
+ />
209
+ </template>
210
+
211
+ <template v-else-if="section === 'items'">
212
+ <Field orientation="vertical">
213
+ <FieldLabel class="text-xs text-zinc-500">
214
+ <template
215
+ v-if="fieldDescription('itemsMaxHeight')"
216
+ #tooltip
217
+ >
218
+ <Markdown
219
+ :source="fieldDescription('itemsMaxHeight')"
220
+ block
221
+ class="prose prose-sm prose-zinc"
222
+ />
223
+ </template>
224
+ {{ fieldTitle("itemsMaxHeight") }}
225
+ </FieldLabel>
226
+ <InputGroup>
227
+ <InputGroupInput
228
+ :model-value="block.itemsMaxHeight ?? ''"
229
+ placeholder="可选;如 24rem。留空则明细区随行数增长"
230
+ @update:model-value="setItemsMaxHeight"
231
+ />
232
+ </InputGroup>
233
+ </Field>
234
+
235
+ <!-- `明细列表` 在页面作用域求值(没有「当前行」),故在 InvoiceRowScope 之外 -->
236
+ <InvoiceExprField
237
+ :label="fieldTitle('items')"
238
+ :description="fieldDescription('items')"
239
+ :model-value="block.items"
240
+ placeholder="返回明细列表的表达式,如 json.mxList"
241
+ multiline
242
+ @update:model-value="(v) => setRequired('items', v)"
243
+ />
244
+
245
+ <!-- 行内栏位可见 item / index;广告作用域与 schema 的 lineSchema 一致 -->
246
+ <InvoiceRowScope>
247
+ <div class="flex flex-col gap-3">
248
+ <div class="text-xs font-medium text-zinc-500">
249
+ 明细行
250
+ </div>
251
+ <InvoiceExprField
252
+ :label="lineTitle('name')"
253
+ :description="lineDescription('name')"
254
+ :model-value="block.line.name"
255
+ placeholder="如 item.xmmc"
256
+ @update:model-value="(v) => setLineRequired('name', v)"
257
+ />
258
+ <InvoiceExprField
259
+ :label="lineTitle('certNo')"
260
+ :description="lineDescription('certNo')"
261
+ :model-value="block.line.certNo ?? ''"
262
+ placeholder="可选;如 item.cqzsh"
263
+ @update:model-value="(v) => setLineOptional('certNo', v)"
264
+ />
265
+ <InvoiceExprField
266
+ :label="lineTitle('areaUnit')"
267
+ :description="lineDescription('areaUnit')"
268
+ :model-value="block.line.areaUnit ?? ''"
269
+ placeholder="可选;如 item.mjdw(如「平方米」)"
270
+ @update:model-value="(v) => setLineOptional('areaUnit', v)"
271
+ />
272
+ <InvoiceExprField
273
+ :label="lineTitle('quantity')"
274
+ :description="lineDescription('quantity')"
275
+ :model-value="block.line.quantity ?? ''"
276
+ placeholder="可选;如 item.sl"
277
+ @update:model-value="(v) => setLineOptional('quantity', v)"
278
+ />
279
+ <InvoiceExprField
280
+ :label="lineTitle('unitPrice')"
281
+ :description="lineDescription('unitPrice')"
282
+ :model-value="block.line.unitPrice ?? ''"
283
+ placeholder="可选;如 item.dj"
284
+ @update:model-value="(v) => setLineOptional('unitPrice', v)"
285
+ />
286
+ <InvoiceExprField
287
+ :label="lineTitle('amount')"
288
+ :description="lineDescription('amount')"
289
+ :model-value="block.line.amount"
290
+ placeholder="如 item.je"
291
+ @update:model-value="(v) => setLineRequired('amount', v)"
292
+ />
293
+ <InvoiceExprField
294
+ :label="lineTitle('taxRate')"
295
+ :description="lineDescription('taxRate')"
296
+ :model-value="block.line.taxRate ?? ''"
297
+ placeholder="可选;如 item.slv(原样打印,可为「免税」)"
298
+ @update:model-value="(v) => setLineOptional('taxRate', v)"
299
+ />
300
+ <InvoiceExprField
301
+ :label="lineTitle('taxAmount')"
302
+ :description="lineDescription('taxAmount')"
303
+ :model-value="block.line.taxAmount ?? ''"
304
+ placeholder="可选;如 item.se"
305
+ @update:model-value="(v) => setLineOptional('taxAmount', v)"
306
+ />
307
+ </div>
308
+ </InvoiceRowScope>
309
+ </template>
310
+
311
+ <template v-else-if="section === 'totals'">
312
+ <InvoiceExprField
313
+ :label="fieldTitle('totalAmount')"
314
+ :description="fieldDescription('totalAmount')"
315
+ :model-value="block.totalAmount"
316
+ placeholder="如 json.hjje"
317
+ @update:model-value="(v) => setRequired('totalAmount', v)"
318
+ />
319
+ <InvoiceExprField
320
+ :label="fieldTitle('totalTax')"
321
+ :description="fieldDescription('totalTax')"
322
+ :model-value="block.totalTax"
323
+ placeholder="如 json.hjse"
324
+ @update:model-value="(v) => setRequired('totalTax', v)"
325
+ />
326
+ <InvoiceExprField
327
+ :label="fieldTitle('grandTotal')"
328
+ :description="fieldDescription('grandTotal')"
329
+ :model-value="block.grandTotal"
330
+ placeholder="如 json.jshj"
331
+ @update:model-value="(v) => setRequired('grandTotal', v)"
332
+ />
333
+ <p class="text-xs text-zinc-400">
334
+ 大写栏由「价税合计」本地推导,无需配置。
335
+ </p>
336
+ </template>
337
+
338
+ <template v-else-if="section === 'remark'">
339
+ <!-- 备注三栏是税总规定这张票必印的,故逐栏建模、逐栏必填;不是一段自由文本 -->
340
+ <div class="text-xs font-medium text-zinc-500">
341
+ 备注
342
+ </div>
343
+ <InvoiceExprField
344
+ :label="remarkTitle('address')"
345
+ :description="remarkDescription('address')"
346
+ :model-value="block.remark.address"
347
+ placeholder="如 json.bdcdz"
348
+ @update:model-value="(v) => setRemark('address', v)"
349
+ />
350
+ <InvoiceExprField
351
+ :label="remarkTitle('leasePeriod')"
352
+ :description="remarkDescription('leasePeriod')"
353
+ :model-value="block.remark.leasePeriod"
354
+ placeholder="如 json.zlqq + '-' + json.zlqz"
355
+ @update:model-value="(v) => setRemark('leasePeriod', v)"
356
+ />
357
+ <InvoiceExprField
358
+ :label="remarkTitle('crossCity')"
359
+ :description="remarkDescription('crossCity')"
360
+ :model-value="block.remark.crossCity"
361
+ placeholder="返回 bool,如 json.kdsbz"
362
+ @update:model-value="(v) => setRemark('crossCity', v)"
363
+ />
364
+
365
+ <div class="mt-2 text-xs font-medium text-zinc-500">
366
+ 签发
367
+ </div>
368
+ <InvoiceExprField
369
+ :label="fieldTitle('issuer')"
370
+ :description="fieldDescription('issuer')"
371
+ :model-value="block.issuer ?? ''"
372
+ placeholder="可选;如 json.kpr"
373
+ @update:model-value="(v) => setOptional('issuer', v)"
374
+ />
375
+ <InvoiceExprField
376
+ :label="fieldTitle('redLetter')"
377
+ :description="fieldDescription('redLetter')"
378
+ :model-value="block.redLetter ?? ''"
379
+ placeholder="可选;返回 bool,如 json.jshj < 0.0"
380
+ @update:model-value="(v) => setOptional('redLetter', v)"
381
+ />
382
+ </template>
383
+ </InvoiceJsonScope>
384
+ </InvoiceConfigShell>
385
+ </template>
@@ -0,0 +1,96 @@
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
+ modelValue: 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:modelValue": (value: {
12
+ readonly type: "com.shwfed.block.invoice.realestate.lease";
13
+ readonly id: string;
14
+ readonly line: {
15
+ readonly name: string;
16
+ readonly quantity?: string | undefined;
17
+ readonly unitPrice?: string | undefined;
18
+ readonly amount: string;
19
+ readonly taxRate?: string | undefined;
20
+ readonly taxAmount?: string | undefined;
21
+ readonly certNo?: string | undefined;
22
+ readonly areaUnit?: string | undefined;
23
+ };
24
+ readonly hidden?: string | undefined;
25
+ readonly displayName?: string | undefined;
26
+ readonly compatibilityDate: "2026-07-17";
27
+ readonly items: string;
28
+ readonly request?: string | undefined;
29
+ readonly invoiceNumber: string;
30
+ readonly issueDate: string;
31
+ readonly buyer: {
32
+ readonly name: string;
33
+ readonly taxId: string;
34
+ };
35
+ readonly seller: {
36
+ readonly name: string;
37
+ readonly taxId: string;
38
+ };
39
+ readonly grandTotal: string;
40
+ readonly issuer?: string | undefined;
41
+ readonly redLetter?: string | undefined;
42
+ readonly itemsMaxHeight?: string | undefined;
43
+ readonly remark: {
44
+ readonly address: string;
45
+ readonly leasePeriod: string;
46
+ readonly crossCity: string;
47
+ };
48
+ readonly totalAmount: string;
49
+ readonly totalTax: string;
50
+ readonly kindLabel: string;
51
+ }) => any;
52
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
53
+ "onUpdate:modelValue"?: ((value: {
54
+ readonly type: "com.shwfed.block.invoice.realestate.lease";
55
+ readonly id: string;
56
+ readonly line: {
57
+ readonly name: string;
58
+ readonly quantity?: string | undefined;
59
+ readonly unitPrice?: string | undefined;
60
+ readonly amount: string;
61
+ readonly taxRate?: string | undefined;
62
+ readonly taxAmount?: string | undefined;
63
+ readonly certNo?: string | undefined;
64
+ readonly areaUnit?: string | undefined;
65
+ };
66
+ readonly hidden?: string | undefined;
67
+ readonly displayName?: string | undefined;
68
+ readonly compatibilityDate: "2026-07-17";
69
+ readonly items: string;
70
+ readonly request?: string | undefined;
71
+ readonly invoiceNumber: string;
72
+ readonly issueDate: string;
73
+ readonly buyer: {
74
+ readonly name: string;
75
+ readonly taxId: string;
76
+ };
77
+ readonly seller: {
78
+ readonly name: string;
79
+ readonly taxId: string;
80
+ };
81
+ readonly grandTotal: string;
82
+ readonly issuer?: string | undefined;
83
+ readonly redLetter?: string | undefined;
84
+ readonly itemsMaxHeight?: string | undefined;
85
+ readonly remark: {
86
+ readonly address: string;
87
+ readonly leasePeriod: string;
88
+ readonly crossCity: string;
89
+ };
90
+ readonly totalAmount: string;
91
+ readonly totalTax: string;
92
+ readonly kindLabel: string;
93
+ }) => any) | undefined;
94
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
95
+ declare const _default: typeof __VLS_export;
96
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;