@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.
Files changed (42) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.d.vue.ts +86 -0
  3. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue +398 -0
  4. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/config.vue.d.ts +86 -0
  5. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.d.vue.ts +14 -0
  6. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue +39 -0
  7. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/expr-field.vue.d.ts +14 -0
  8. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.d.vue.ts +3 -0
  9. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.vue +20 -0
  10. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/items-colgroup.vue.d.ts +3 -0
  11. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.d.vue.ts +13 -0
  12. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue +19 -0
  13. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/json-scope-provider.vue.d.ts +13 -0
  14. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/rmb.d.ts +11 -0
  15. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/rmb.js +58 -0
  16. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.d.vue.ts +13 -0
  17. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue +22 -0
  18. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/row-scope-provider.vue.d.ts +13 -0
  19. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.d.vue.ts +86 -0
  20. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue +346 -0
  21. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/runtime.vue.d.ts +86 -0
  22. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.d.ts +109 -0
  23. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.digital/schema.js +189 -0
  24. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
  25. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
  26. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.d.vue.ts +34 -0
  27. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue +109 -1
  28. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue.d.ts +34 -0
  29. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +7 -0
  30. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +66 -22
  31. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +23 -0
  32. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +26 -0
  33. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.d.vue.ts +10 -0
  34. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue +1004 -0
  35. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue.d.ts +10 -0
  36. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/prompt.md +19 -0
  37. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.d.vue.ts +9 -0
  38. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue +503 -0
  39. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue.d.ts +9 -0
  40. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.d.ts +138 -0
  41. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.js +181 -0
  42. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shwfed",
3
3
  "configKey": "shwfed",
4
- "version": "3.0.10",
4
+ "version": "3.0.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -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
+ 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.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:modelValue"?: ((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,398 @@
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import { Icon } from "@iconify/vue";
4
+ import { Field, FieldLabel } from "../../../../ui/field";
5
+ import { InputGroup, InputGroupInput } from "../../../../ui/input-group";
6
+ import { Markdown } from "../../../../ui/markdown";
7
+ import { ScrollArea } from "../../../../ui/scroll-area";
8
+ import {
9
+ Select,
10
+ SelectContent,
11
+ SelectItem,
12
+ SelectTrigger,
13
+ SelectValue
14
+ } from "../../../../ui/select";
15
+ import ExprField from "./expr-field.vue";
16
+ import JsonScopeProvider from "./json-scope-provider.vue";
17
+ import RowScopeProvider from "./row-scope-provider.vue";
18
+ import {
19
+ getStructFieldDescription,
20
+ getStructFieldTitle,
21
+ INVOICE_KINDS,
22
+ INVOICE_KIND_LABELS,
23
+ lineSchema,
24
+ partySchema,
25
+ schema
26
+ } from "./schema";
27
+ defineOptions({ name: "ShwfedBlockInvoiceDigitalConfig" });
28
+ const block = defineModel({ type: null, ...{ required: true } });
29
+ defineProps({
30
+ configure: { type: Function, required: false }
31
+ });
32
+ const blockSchema = schema(() => {
33
+ });
34
+ const buyerSchema = partySchema(() => {
35
+ }, "\u8D2D\u4E70\u65B9");
36
+ const sellerSchema = partySchema(() => {
37
+ }, "\u9500\u552E\u65B9");
38
+ const lineSchemaObj = lineSchema(() => {
39
+ });
40
+ const fieldTitle = (f) => getStructFieldTitle(blockSchema, f) ?? f;
41
+ const fieldDescription = (f) => getStructFieldDescription(blockSchema, f);
42
+ const buyerTitle = (f) => getStructFieldTitle(buyerSchema, f) ?? f;
43
+ const buyerDescription = (f) => getStructFieldDescription(buyerSchema, f);
44
+ const sellerTitle = (f) => getStructFieldTitle(sellerSchema, f) ?? f;
45
+ const sellerDescription = (f) => getStructFieldDescription(sellerSchema, f);
46
+ const lineTitle = (f) => getStructFieldTitle(lineSchemaObj, f) ?? f;
47
+ const lineDescription = (f) => getStructFieldDescription(lineSchemaObj, f);
48
+ const SECTIONS = [
49
+ { key: "general", label: "\u901A\u7528\u914D\u7F6E", icon: "fluent:settings-20-regular" },
50
+ { key: "head", label: "\u62AC\u5934", icon: "fluent:receipt-20-regular" },
51
+ { key: "parties", label: "\u8D2D\u9500\u53CC\u65B9", icon: "fluent:people-20-regular" },
52
+ { key: "items", label: "\u660E\u7EC6", icon: "fluent:apps-list-20-regular" },
53
+ { key: "totals", label: "\u5408\u8BA1", icon: "fluent:calculator-20-regular" },
54
+ { key: "remark", label: "\u5907\u6CE8\u4E0E\u7B7E\u53D1", icon: "fluent:note-20-regular" }
55
+ ];
56
+ const section = ref("general");
57
+ function setDisplayName(v) {
58
+ const s = String(v ?? "");
59
+ block.value = { ...block.value, displayName: s.length > 0 ? s : void 0 };
60
+ }
61
+ function setKind(v) {
62
+ const k = v;
63
+ block.value = { ...block.value, kind: k === "special" ? void 0 : k };
64
+ }
65
+ function setRequired(field, v) {
66
+ block.value = { ...block.value, [field]: v };
67
+ }
68
+ function setOptional(field, v) {
69
+ block.value = { ...block.value, [field]: v.trim().length > 0 ? v : void 0 };
70
+ }
71
+ function setItemsMaxHeight(v) {
72
+ const s = String(v ?? "").trim();
73
+ block.value = { ...block.value, itemsMaxHeight: s.length > 0 ? s : void 0 };
74
+ }
75
+ function setParty(party, field, v) {
76
+ block.value = { ...block.value, [party]: { ...block.value[party], [field]: v } };
77
+ }
78
+ function setLineRequired(field, v) {
79
+ block.value = { ...block.value, line: { ...block.value.line, [field]: v } };
80
+ }
81
+ function setLineOptional(field, v) {
82
+ block.value = {
83
+ ...block.value,
84
+ line: { ...block.value.line, [field]: v.trim().length > 0 ? v : void 0 }
85
+ };
86
+ }
87
+ const kindValue = computed(() => block.value.kind ?? "special");
88
+ </script>
89
+
90
+ <template>
91
+ <div class="flex min-w-0 gap-2 min-h-128">
92
+ <!-- 左栏:票面分区 -->
93
+ <div class="flex w-44 shrink-0 flex-col">
94
+ <ScrollArea class="flex-1">
95
+ <div
96
+ v-for="s in SECTIONS"
97
+ :key="s.key"
98
+ class="row"
99
+ :class="section === s.key ? 'bg-[color-mix(in_srgb,var(--primary)_10%,white)] text-(--primary)' : 'text-zinc-700 hover:bg-zinc-50'"
100
+ @click="section = s.key"
101
+ >
102
+ <Icon
103
+ :icon="s.icon"
104
+ class="size-4 shrink-0"
105
+ />
106
+ <span class="flex-1 truncate">{{ s.label }}</span>
107
+ </div>
108
+ </ScrollArea>
109
+ </div>
110
+
111
+ <!-- 右栏 -->
112
+ <div class="flex min-w-0 flex-1 flex-col gap-3">
113
+ <template v-if="section === 'general'">
114
+ <Field orientation="vertical">
115
+ <FieldLabel class="text-xs text-zinc-500">
116
+ <template
117
+ v-if="fieldDescription('displayName')"
118
+ #tooltip
119
+ >
120
+ <Markdown
121
+ :source="fieldDescription('displayName')"
122
+ block
123
+ class="prose prose-sm prose-zinc"
124
+ />
125
+ </template>
126
+ {{ fieldTitle("displayName") }}
127
+ </FieldLabel>
128
+ <InputGroup>
129
+ <InputGroupInput
130
+ :model-value="block.displayName ?? ''"
131
+ placeholder="例:进项发票预览"
132
+ @update:model-value="setDisplayName"
133
+ />
134
+ </InputGroup>
135
+ </Field>
136
+
137
+ <Field orientation="vertical">
138
+ <FieldLabel class="text-xs text-zinc-500">
139
+ <template
140
+ v-if="fieldDescription('kind')"
141
+ #tooltip
142
+ >
143
+ <Markdown
144
+ :source="fieldDescription('kind')"
145
+ block
146
+ class="prose prose-sm prose-zinc"
147
+ />
148
+ </template>
149
+ {{ fieldTitle("kind") }}
150
+ </FieldLabel>
151
+ <Select
152
+ :model-value="kindValue"
153
+ @update:model-value="setKind"
154
+ >
155
+ <SelectTrigger class="w-full">
156
+ <SelectValue />
157
+ </SelectTrigger>
158
+ <SelectContent>
159
+ <SelectItem
160
+ v-for="k in INVOICE_KINDS"
161
+ :key="k"
162
+ :value="k"
163
+ >
164
+ {{ INVOICE_KIND_LABELS[k] }}
165
+ </SelectItem>
166
+ </SelectContent>
167
+ </Select>
168
+ </Field>
169
+
170
+ <!-- 「请求」在 JsonScopeProvider 之外 —— 它是产出 `json` 的表达式,自己看不到
171
+ `json`(schema 侧的 `bodyConfigure` 同样不给它注册)。 -->
172
+ <ExprField
173
+ :label="fieldTitle('request')"
174
+ :description="fieldDescription('request')"
175
+ :model-value="block.request ?? ''"
176
+ placeholder="可选;如 http.get('/api/invoice/' + item.id)"
177
+ multiline
178
+ @update:model-value="(v) => setOptional('request', v)"
179
+ />
180
+ </template>
181
+
182
+ <!-- 除「通用配置」外的每个分区都在 `json` 作用域内 —— `请求` 的响应体票面各栏
183
+ 都能读。Provider 本身不渲染元素,所以外层 flex 布局不受影响。 -->
184
+ <JsonScopeProvider v-else>
185
+ <template v-if="section === 'head'">
186
+ <ExprField
187
+ :label="fieldTitle('invoiceNumber')"
188
+ :description="fieldDescription('invoiceNumber')"
189
+ :model-value="block.invoiceNumber"
190
+ placeholder="如 json.fphm"
191
+ @update:model-value="(v) => setRequired('invoiceNumber', v)"
192
+ />
193
+ <ExprField
194
+ :label="fieldTitle('issueDate')"
195
+ :description="fieldDescription('issueDate')"
196
+ :model-value="block.issueDate"
197
+ placeholder="如 json.kprq"
198
+ @update:model-value="(v) => setRequired('issueDate', v)"
199
+ />
200
+ </template>
201
+
202
+ <template v-else-if="section === 'parties'">
203
+ <div class="text-xs font-medium text-zinc-500">
204
+ 购买方信息
205
+ </div>
206
+ <ExprField
207
+ :label="buyerTitle('name')"
208
+ :description="buyerDescription('name')"
209
+ :model-value="block.buyer.name"
210
+ placeholder="如 json.gf.mc"
211
+ @update:model-value="(v) => setParty('buyer', 'name', v)"
212
+ />
213
+ <ExprField
214
+ :label="buyerTitle('taxId')"
215
+ :description="buyerDescription('taxId')"
216
+ :model-value="block.buyer.taxId"
217
+ placeholder="如 json.gf.nsrsbh"
218
+ @update:model-value="(v) => setParty('buyer', 'taxId', v)"
219
+ />
220
+
221
+ <div class="mt-2 text-xs font-medium text-zinc-500">
222
+ 销售方信息
223
+ </div>
224
+ <ExprField
225
+ :label="sellerTitle('name')"
226
+ :description="sellerDescription('name')"
227
+ :model-value="block.seller.name"
228
+ placeholder="如 json.xf.mc"
229
+ @update:model-value="(v) => setParty('seller', 'name', v)"
230
+ />
231
+ <ExprField
232
+ :label="sellerTitle('taxId')"
233
+ :description="sellerDescription('taxId')"
234
+ :model-value="block.seller.taxId"
235
+ placeholder="如 json.xf.nsrsbh"
236
+ @update:model-value="(v) => setParty('seller', 'taxId', v)"
237
+ />
238
+ </template>
239
+
240
+ <template v-else-if="section === 'items'">
241
+ <Field orientation="vertical">
242
+ <FieldLabel class="text-xs text-zinc-500">
243
+ <template
244
+ v-if="fieldDescription('itemsMaxHeight')"
245
+ #tooltip
246
+ >
247
+ <Markdown
248
+ :source="fieldDescription('itemsMaxHeight')"
249
+ block
250
+ class="prose prose-sm prose-zinc"
251
+ />
252
+ </template>
253
+ {{ fieldTitle("itemsMaxHeight") }}
254
+ </FieldLabel>
255
+ <InputGroup>
256
+ <InputGroupInput
257
+ :model-value="block.itemsMaxHeight ?? ''"
258
+ placeholder="可选;如 24rem。留空则明细区随行数增长"
259
+ @update:model-value="setItemsMaxHeight"
260
+ />
261
+ </InputGroup>
262
+ </Field>
263
+
264
+ <!-- `明细列表` 在页面作用域求值(没有「当前行」),故在 RowScopeProvider 之外 -->
265
+ <ExprField
266
+ :label="fieldTitle('items')"
267
+ :description="fieldDescription('items')"
268
+ :model-value="block.items"
269
+ placeholder="返回明细列表的表达式,如 json.mxList"
270
+ multiline
271
+ @update:model-value="(v) => setRequired('items', v)"
272
+ />
273
+
274
+ <!-- 行内栏位可见 item / index;广告作用域与 schema 的 lineSchema 一致 -->
275
+ <RowScopeProvider>
276
+ <div class="flex flex-col gap-3">
277
+ <div class="text-xs font-medium text-zinc-500">
278
+ 明细行
279
+ </div>
280
+ <ExprField
281
+ :label="lineTitle('name')"
282
+ :description="lineDescription('name')"
283
+ :model-value="block.line.name"
284
+ placeholder="如 item.xmmc"
285
+ @update:model-value="(v) => setLineRequired('name', v)"
286
+ />
287
+ <ExprField
288
+ :label="lineTitle('spec')"
289
+ :description="lineDescription('spec')"
290
+ :model-value="block.line.spec ?? ''"
291
+ placeholder="可选;如 item.ggxh"
292
+ @update:model-value="(v) => setLineOptional('spec', v)"
293
+ />
294
+ <ExprField
295
+ :label="lineTitle('unit')"
296
+ :description="lineDescription('unit')"
297
+ :model-value="block.line.unit ?? ''"
298
+ placeholder="可选;如 item.dw"
299
+ @update:model-value="(v) => setLineOptional('unit', v)"
300
+ />
301
+ <ExprField
302
+ :label="lineTitle('quantity')"
303
+ :description="lineDescription('quantity')"
304
+ :model-value="block.line.quantity ?? ''"
305
+ placeholder="可选;如 item.sl"
306
+ @update:model-value="(v) => setLineOptional('quantity', v)"
307
+ />
308
+ <ExprField
309
+ :label="lineTitle('unitPrice')"
310
+ :description="lineDescription('unitPrice')"
311
+ :model-value="block.line.unitPrice ?? ''"
312
+ placeholder="可选;如 item.dj"
313
+ @update:model-value="(v) => setLineOptional('unitPrice', v)"
314
+ />
315
+ <ExprField
316
+ :label="lineTitle('amount')"
317
+ :description="lineDescription('amount')"
318
+ :model-value="block.line.amount"
319
+ placeholder="如 item.je"
320
+ @update:model-value="(v) => setLineRequired('amount', v)"
321
+ />
322
+ <ExprField
323
+ :label="lineTitle('taxRate')"
324
+ :description="lineDescription('taxRate')"
325
+ :model-value="block.line.taxRate ?? ''"
326
+ placeholder="可选;如 item.slv(原样打印,可为「免税」)"
327
+ @update:model-value="(v) => setLineOptional('taxRate', v)"
328
+ />
329
+ <ExprField
330
+ :label="lineTitle('taxAmount')"
331
+ :description="lineDescription('taxAmount')"
332
+ :model-value="block.line.taxAmount ?? ''"
333
+ placeholder="可选;如 item.se"
334
+ @update:model-value="(v) => setLineOptional('taxAmount', v)"
335
+ />
336
+ </div>
337
+ </RowScopeProvider>
338
+ </template>
339
+
340
+ <template v-else-if="section === 'totals'">
341
+ <ExprField
342
+ :label="fieldTitle('totalAmount')"
343
+ :description="fieldDescription('totalAmount')"
344
+ :model-value="block.totalAmount"
345
+ placeholder="如 json.hjje"
346
+ @update:model-value="(v) => setRequired('totalAmount', v)"
347
+ />
348
+ <ExprField
349
+ :label="fieldTitle('totalTax')"
350
+ :description="fieldDescription('totalTax')"
351
+ :model-value="block.totalTax"
352
+ placeholder="如 json.hjse"
353
+ @update:model-value="(v) => setRequired('totalTax', v)"
354
+ />
355
+ <ExprField
356
+ :label="fieldTitle('grandTotal')"
357
+ :description="fieldDescription('grandTotal')"
358
+ :model-value="block.grandTotal"
359
+ placeholder="如 json.jshj"
360
+ @update:model-value="(v) => setRequired('grandTotal', v)"
361
+ />
362
+ <p class="text-xs text-zinc-400">
363
+ 大写栏由「价税合计」本地推导,无需配置。
364
+ </p>
365
+ </template>
366
+
367
+ <template v-else-if="section === 'remark'">
368
+ <ExprField
369
+ :label="fieldTitle('remark')"
370
+ :description="fieldDescription('remark')"
371
+ :model-value="block.remark ?? ''"
372
+ placeholder="可选;如 json.bz。开户行、账号、红字确认单编号均属此栏"
373
+ multiline
374
+ @update:model-value="(v) => setOptional('remark', v)"
375
+ />
376
+ <ExprField
377
+ :label="fieldTitle('issuer')"
378
+ :description="fieldDescription('issuer')"
379
+ :model-value="block.issuer ?? ''"
380
+ placeholder="可选;如 json.kpr"
381
+ @update:model-value="(v) => setOptional('issuer', v)"
382
+ />
383
+ <ExprField
384
+ :label="fieldTitle('redLetter')"
385
+ :description="fieldDescription('redLetter')"
386
+ :model-value="block.redLetter ?? ''"
387
+ placeholder="可选;返回 bool,如 json.jshj < 0.0"
388
+ @update:model-value="(v) => setOptional('redLetter', v)"
389
+ />
390
+ </template>
391
+ </JsonScopeProvider>
392
+ </div>
393
+ </div>
394
+ </template>
395
+
396
+ <style scoped>
397
+ .row{align-items:center;border-radius:.25rem;cursor:pointer;display:flex;font-size:.875rem;gap:.375rem;padding-block:.375rem;padding-left:.5rem;padding-right:.5rem;position:relative;transition:background-color .1s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}
398
+ </style>
@@ -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
+ 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.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:modelValue"?: ((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,14 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ description?: string;
4
+ modelValue: string;
5
+ placeholder?: string;
6
+ multiline?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ "update:modelValue": (payload: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:modelValue"?: ((payload: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,39 @@
1
+ <script setup>
2
+ import { ExpressionEditor } from "../../../../ui/expression-editor";
3
+ import { Field, FieldLabel } from "../../../../ui/field";
4
+ import { Markdown } from "../../../../ui/markdown";
5
+ defineOptions({ name: "ShwfedBlockInvoiceDigitalExprField" });
6
+ defineProps({
7
+ label: { type: String, required: true },
8
+ description: { type: String, required: false },
9
+ modelValue: { type: String, required: true },
10
+ placeholder: { type: String, required: false },
11
+ multiline: { type: Boolean, required: false }
12
+ });
13
+ defineEmits(["update:modelValue"]);
14
+ </script>
15
+
16
+ <template>
17
+ <Field orientation="vertical">
18
+ <FieldLabel class="text-xs text-zinc-500">
19
+ <template
20
+ v-if="description"
21
+ #tooltip
22
+ >
23
+ <Markdown
24
+ :source="description"
25
+ block
26
+ class="prose prose-sm prose-zinc"
27
+ />
28
+ </template>
29
+ {{ label }}
30
+ </FieldLabel>
31
+ <ExpressionEditor
32
+ :model-value="modelValue"
33
+ :placeholder="placeholder"
34
+ :multiline="multiline"
35
+ :class="multiline ? 'min-h-16' : void 0"
36
+ @update:model-value="(v) => $emit('update:modelValue', v)"
37
+ />
38
+ </Field>
39
+ </template>
@@ -0,0 +1,14 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ description?: string;
4
+ modelValue: string;
5
+ placeholder?: string;
6
+ multiline?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ "update:modelValue": (payload: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:modelValue"?: ((payload: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ 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;
@@ -0,0 +1,20 @@
1
+ <script setup>
2
+ defineOptions({ name: "ShwfedBlockInvoiceDigitalItemsColgroup" });
3
+ </script>
4
+
5
+ <template>
6
+ <colgroup>
7
+ <col class="col-name">
8
+ <col class="col-spec">
9
+ <col class="col-unit">
10
+ <col class="col-num">
11
+ <col class="col-num">
12
+ <col class="col-num">
13
+ <col class="col-rate">
14
+ <col class="col-num">
15
+ </colgroup>
16
+ </template>
17
+
18
+ <style scoped>
19
+ .col-name{width:22%}.col-spec{width:14%}.col-unit{width:8%}.col-num,.col-rate{width:11%}
20
+ </style>