cnhis-design-vue 3.1.31-beta.7 → 3.1.31-beta.8

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 (54) hide show
  1. package/README.md +123 -123
  2. package/es/components/button-print/index.d.ts +64 -45
  3. package/es/components/button-print/src/ButtonPrint.vue.d.ts +64 -45
  4. package/es/components/button-print/src/components/EditFormat.vue.d.ts +65 -46
  5. package/es/components/button-print/src/components/EditFormat.vue.js +108 -88
  6. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +64 -45
  7. package/es/components/button-print/src/components/IdentityVerification.vue.js +7 -4
  8. package/es/components/button-print/style/index.css +1 -1
  9. package/es/components/form-render/index.js +1 -1
  10. package/es/components/form-render/src/components/renderer/select.js +3 -3
  11. package/es/components/form-render/src/hooks/useAutographOptions.js +2 -2
  12. package/es/components/form-render/src/utils/index.d.ts +2 -2
  13. package/es/components/form-render/src/utils/index.js +27 -3
  14. package/es/components/index.css +1 -1
  15. package/es/components/index.js +1 -1
  16. package/es/components/keyboard/index.d.ts +26 -16
  17. package/es/components/keyboard/src/Keyboard.vue.d.ts +27 -8
  18. package/es/components/keyboard/src/Keyboard.vue.js +8 -2
  19. package/es/components/steps-wheel/index.d.ts +3 -0
  20. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +3 -0
  21. package/es/components/steps-wheel/src/StepsWheel.vue.js +38 -9
  22. package/es/components/steps-wheel/style/index.css +1 -1
  23. package/es/shared/assets/img/failure.js +1 -1
  24. package/es/shared/assets/img/failure.png.js +1 -1
  25. package/es/shared/assets/img/icon-asc.js +1 -1
  26. package/es/shared/assets/img/icon-desc.js +1 -1
  27. package/es/shared/assets/img/no-permission.js +1 -1
  28. package/es/shared/assets/img/no-permission.png.js +1 -1
  29. package/es/shared/assets/img/nodata.js +1 -1
  30. package/es/shared/assets/img/nodata.png.js +1 -1
  31. package/es/shared/assets/img/notfound.js +1 -1
  32. package/es/shared/assets/img/notfound.png.js +1 -1
  33. package/es/shared/assets/img/qr.js +1 -1
  34. package/es/shared/assets/img/qr.png.js +1 -1
  35. package/es/shared/assets/img/success.js +1 -1
  36. package/es/shared/assets/img/success.png.js +1 -1
  37. package/es/shared/assets/img/video.js +1 -1
  38. package/es/shared/assets/img/video.png.js +1 -1
  39. package/es/shared/assets/img/video_default_cover.js +1 -1
  40. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  41. package/es/shared/assets/img/video_hover.js +1 -1
  42. package/es/shared/assets/img/video_play_hover.js +1 -1
  43. package/es/shared/assets/img/xb_big.js +1 -1
  44. package/es/shared/assets/img/xb_big.png.js +1 -1
  45. package/es/shared/assets/img/xb_small.js +1 -1
  46. package/es/shared/assets/img/xb_small.png.js +1 -1
  47. package/package.json +2 -2
  48. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  49. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  50. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  51. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  52. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  53. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  54. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, createElementBlock, Fragment, renderList, createElementVNode, createTextVNode, toDisplayString } from 'vue';
1
+ import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, createTextVNode } from 'vue';
2
2
  import { useMessage, NForm, NFormItem, NSpace, NUpload, NUploadDragger, NIcon, NText, NP } from 'naive-ui';
3
3
  import { Archive } from '@vicons/ionicons5';
4
4
  import axios from 'axios';
@@ -7,48 +7,75 @@ import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
7
7
  const _hoisted_1 = { style: { "margin-bottom": "12px" } };
8
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  __name: "EditFormat",
10
+ props: {
11
+ formatId: null,
12
+ token: null
13
+ },
10
14
  setup(__props, { expose }) {
15
+ const props = __props;
11
16
  const PROTOCOL = window.location.protocol;
12
17
  const HOST = window.location.host;
13
- const SAVEIREPORT = `${PROTOCOL}//${HOST}/bi-api/reprot/print/open/client/saveIReportFormat`;
18
+ const BASEURL = `${PROTOCOL}//${HOST}/bi-api`;
19
+ const SAVEIREPORT = `${BASEURL}/reprot/print/open/client/saveIReportFormat`;
20
+ const QUERYFILELIST = `${BASEURL}/reprot/print/open/client/getIReportFiles`;
21
+ const DELETEFILE = `${BASEURL}/reprot/print/open/client/delIReportFiles`;
14
22
  const instance = axios.create({});
15
23
  const $message = useMessage();
16
- const fileList = ref([
17
- {
18
- key: "jrxml",
19
- value: []
20
- },
21
- {
22
- key: "jasper",
23
- value: []
24
- }
25
- ]);
24
+ const fileList = ref([]);
25
+ queryFileList();
26
+ function queryFileList() {
27
+ var _a;
28
+ instance.get(`${QUERYFILELIST}?formatId=${(_a = props.formatId) == null ? void 0 : _a.split("_")[1]}&authorizationKey=${props.token}`).then(({ data }) => {
29
+ (data.list || []).forEach((file) => {
30
+ fileList.value.push({
31
+ id: Date.now().toString(),
32
+ name: file,
33
+ status: "finished"
34
+ });
35
+ });
36
+ });
37
+ }
38
+ function onRemove(options) {
39
+ return new Promise((resolve, reject) => {
40
+ var _a;
41
+ instance.get(
42
+ `${DELETEFILE}?formatId=${(_a = props.formatId) == null ? void 0 : _a.split("_")[1]}&authorizationKey=${props.token}&fileName=${options.file.name}`
43
+ ).then(({ data }) => {
44
+ if ((data == null ? void 0 : data.result) !== "SUCCESS") {
45
+ $message.error((data == null ? void 0 : data.resultMsg) || "\u5220\u9664\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
46
+ reject();
47
+ } else {
48
+ $message.success("\u5220\u9664\u6587\u4EF6\u6210\u529F\uFF01");
49
+ resolve("SUCCESS");
50
+ }
51
+ });
52
+ });
53
+ }
26
54
  function submit(datas) {
27
55
  return new Promise((resolve, reject) => {
28
- var _a, _b, _c, _d;
29
- const isOk = fileList.value.every((file) => file.value.length > 0);
30
- if (!isOk) {
31
- $message.warning("\u8BF7\u5148\u4E0A\u4F20\u6587\u4EF6");
56
+ if (!validateFormat()) {
57
+ $message.warning("\u8BF7\u81F3\u5C11\u4E0A\u4F20\u4E00\u4E2Ajrxml\u6587\u4EF6\u548C\u4E00\u4E2Ajasper\u6587\u4EF6\uFF01");
58
+ return;
59
+ }
60
+ const files = fileList.value.filter((file) => file.file);
61
+ if (files.length === 0) {
62
+ $message.warning("\u672C\u6B21\u65E0\u65B0\u6587\u4EF6\u589E\u52A0\uFF0C\u8BF7\u5148\u6DFB\u52A0\u65B0\u6587\u4EF6\uFF01");
32
63
  return;
33
64
  }
34
- const jrxml = (_b = (_a = fileList.value.find((file) => file.key === "jrxml")) == null ? void 0 : _a.value) == null ? void 0 : _b[0];
35
- const jasper = (_d = (_c = fileList.value.find((file) => file.key === "jasper")) == null ? void 0 : _c.value) == null ? void 0 : _d[0];
36
- const data = {
37
- jrxml: jrxml == null ? void 0 : jrxml.file,
38
- jasper: jasper == null ? void 0 : jasper.file,
39
- ...datas
40
- };
41
65
  const params = new FormData();
42
- Object.keys(data).forEach((v) => {
43
- params.append(v, data[v]);
66
+ Object.keys(datas).forEach((v) => {
67
+ params.append(v, datas[v]);
68
+ });
69
+ fileList.value.forEach((file) => {
70
+ file.file && params.append("files", file.file);
44
71
  });
45
72
  instance.post(SAVEIREPORT, params, {
46
73
  headers: {
47
74
  "Content-Type": "application/x-www-form-urlencoded"
48
75
  }
49
- }).then(({ data: data2 }) => {
50
- if ((data2 == null ? void 0 : data2.result) !== "SUCCESS") {
51
- $message.error((data2 == null ? void 0 : data2.resultMsg) || "\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
76
+ }).then(({ data }) => {
77
+ if ((data == null ? void 0 : data.result) !== "SUCCESS") {
78
+ $message.error((data == null ? void 0 : data.resultMsg) || "\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
52
79
  reject();
53
80
  } else {
54
81
  resolve("SUCCESS");
@@ -56,29 +83,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
83
  });
57
84
  });
58
85
  }
59
- function onChange(data, index) {
60
- fileList.value[index].value = data.fileList;
61
- }
62
- async function onBeforeUpload(data) {
63
- if (!validateFormat(data.file, ".jrxml,.jasper")) {
64
- $message.warning("\u53EA\u80FD\u4E0A\u4F20.jrxml\u6216\u8005.jasper\u683C\u5F0F\u7684\u6587\u4EF6\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20");
86
+ function validateFormat() {
87
+ if (fileList.value.length < 2)
65
88
  return false;
66
- }
67
- return true;
68
- }
69
- function validateFormat(file, format) {
70
- let res = false;
71
- if (!format || format.includes("*")) {
72
- return true;
73
- }
74
- let list = format.split(",");
75
- if (!list.length) {
89
+ let isJrxml = false;
90
+ let isJasper = false;
91
+ const rExt = /\.([^.]+)$/;
92
+ fileList.value.forEach((file) => {
93
+ var _a;
94
+ const name = ((_a = file.file) == null ? void 0 : _a.name) || file.name || "";
95
+ const ext = rExt.exec(name) ? RegExp.$1.toLowerCase() : "";
96
+ if (ext && ".jrxml".includes(ext))
97
+ isJrxml = true;
98
+ if (ext && ".jasper".includes(ext))
99
+ isJasper = true;
100
+ });
101
+ if (isJrxml && isJasper)
76
102
  return true;
77
- }
78
- let rExt = /\.([^.]+)$/;
79
- let ext = rExt.exec(file.name) ? RegExp.$1.toLowerCase() : "";
80
- res = format.includes(ext);
81
- return res;
103
+ return false;
82
104
  }
83
105
  expose({
84
106
  submit
@@ -96,46 +118,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
118
  default: withCtx(() => [
97
119
  createVNode(unref(NSpace), { vertical: "" }, {
98
120
  default: withCtx(() => [
99
- (openBlock(true), createElementBlock(Fragment, null, renderList(fileList.value, (file, index) => {
100
- return openBlock(), createBlock(unref(NUpload), {
101
- "directory-dnd": "",
102
- max: 1,
103
- key: file.key,
104
- onBeforeUpload,
105
- onChange: (data) => onChange(data, index)
106
- }, {
107
- default: withCtx(() => [
108
- createVNode(unref(NUploadDragger), null, {
109
- default: withCtx(() => [
110
- createElementVNode("div", _hoisted_1, [
111
- createVNode(unref(NIcon), {
112
- size: "36",
113
- depth: 3,
114
- component: unref(Archive)
115
- }, null, 8, ["component"])
116
- ]),
117
- createVNode(unref(NText), { style: { "font-size": "14px" } }, {
118
- default: withCtx(() => [
119
- createTextVNode("\u70B9\u51FB\u6216\u8005\u62D6\u52A8\u6587\u4EF6\u5230\u8BE5\u533A\u57DF\u6765\u4E0A\u4F20")
120
- ]),
121
- _: 1
122
- }),
123
- createVNode(unref(NP), {
124
- depth: "3",
125
- style: { "margin": "5px 0 0 0" }
126
- }, {
127
- default: withCtx(() => [
128
- createTextVNode("xxxxxx." + toDisplayString(file.key), 1)
129
- ]),
130
- _: 2
131
- }, 1024)
121
+ createVNode(unref(NUpload), {
122
+ multiple: "",
123
+ "directory-dnd": "",
124
+ "file-list": fileList.value,
125
+ "onUpdate:file-list": _cache[0] || (_cache[0] = ($event) => fileList.value = $event),
126
+ onRemove
127
+ }, {
128
+ default: withCtx(() => [
129
+ createVNode(unref(NUploadDragger), null, {
130
+ default: withCtx(() => [
131
+ createElementVNode("div", _hoisted_1, [
132
+ createVNode(unref(NIcon), {
133
+ size: "36",
134
+ depth: 3,
135
+ component: unref(Archive)
136
+ }, null, 8, ["component"])
132
137
  ]),
133
- _: 2
134
- }, 1024)
135
- ]),
136
- _: 2
137
- }, 1032, ["onChange"]);
138
- }), 128))
138
+ createVNode(unref(NText), { style: { "font-size": "12px" } }, {
139
+ default: withCtx(() => [
140
+ createTextVNode("\u70B9\u51FB\u6216\u8005\u62D6\u52A8\u6587\u4EF6\u5230\u8BE5\u533A\u57DF\u6765\u4E0A\u4F20")
141
+ ]),
142
+ _: 1
143
+ }),
144
+ createVNode(unref(NP), {
145
+ depth: "3",
146
+ style: { "margin": "5px 0 0 0", "font-size": "13px" }
147
+ }, {
148
+ default: withCtx(() => [
149
+ createTextVNode("\u81F3\u5C11\u5305\u542B\u4E00\u4E2Ajxml\u6587\u4EF6\u548C\u4E00\u4E2Ajasper\u6587\u4EF6")
150
+ ]),
151
+ _: 1
152
+ })
153
+ ]),
154
+ _: 1
155
+ })
156
+ ]),
157
+ _: 1
158
+ }, 8, ["file-list"])
139
159
  ]),
140
160
  _: 1
141
161
  })
@@ -358,59 +358,69 @@ declare const _default: import("vue").DefineComponent<{
358
358
  readonly ignorePathChange: boolean;
359
359
  }>;
360
360
  NInput: any;
361
- EditFormat: import("vue").DefineComponent<{}, {
361
+ EditFormat: import("vue").DefineComponent<{
362
+ formatId: {
363
+ type: StringConstructor;
364
+ required: false;
365
+ };
366
+ token: {
367
+ type: StringConstructor;
368
+ required: true;
369
+ };
370
+ }, {
362
371
  PROTOCOL: string;
363
372
  HOST: string;
373
+ BASEURL: string;
364
374
  SAVEIREPORT: string;
375
+ QUERYFILELIST: string;
376
+ DELETEFILE: string;
365
377
  instance: import("axios").AxiosInstance;
366
378
  $message: import("naive-ui").MessageApi;
379
+ props: {
380
+ formatId?: string | undefined;
381
+ token: string;
382
+ };
367
383
  fileList: import("vue").Ref<{
368
- key: string;
369
- value: {
370
- id: string;
371
- name: string;
372
- batchId?: string | null | undefined;
373
- percentage?: number | null | undefined;
374
- status: "error" | "pending" | "uploading" | "finished" | "removed";
375
- url?: string | null | undefined;
376
- file?: {
377
- readonly lastModified: number;
378
- readonly name: string;
379
- readonly webkitRelativePath: string;
380
- readonly size: number;
381
- readonly type: string;
382
- arrayBuffer: {
383
- (): Promise<ArrayBuffer>;
384
- (): Promise<ArrayBuffer>;
385
- };
386
- slice: {
387
- (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
388
- (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
389
- };
390
- stream: {
391
- (): ReadableStream<Uint8Array>;
392
- (): NodeJS.ReadableStream;
393
- };
394
- text: {
395
- (): Promise<string>;
396
- (): Promise<string>;
397
- };
398
- } | null | undefined;
399
- thumbnailUrl?: string | null | undefined;
400
- type?: string | null | undefined;
401
- fullPath?: string | null | undefined;
402
- }[];
384
+ id: string;
385
+ name: string;
386
+ batchId?: string | null | undefined;
387
+ percentage?: number | null | undefined;
388
+ status: "error" | "pending" | "uploading" | "finished" | "removed";
389
+ url?: string | null | undefined;
390
+ file?: {
391
+ readonly lastModified: number;
392
+ readonly name: string;
393
+ readonly webkitRelativePath: string;
394
+ readonly size: number;
395
+ readonly type: string;
396
+ arrayBuffer: {
397
+ (): Promise<ArrayBuffer>;
398
+ (): Promise<ArrayBuffer>;
399
+ };
400
+ slice: {
401
+ (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
402
+ (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
403
+ };
404
+ stream: {
405
+ (): ReadableStream<Uint8Array>;
406
+ (): NodeJS.ReadableStream;
407
+ };
408
+ text: {
409
+ (): Promise<string>;
410
+ (): Promise<string>;
411
+ };
412
+ } | null | undefined;
413
+ thumbnailUrl?: string | null | undefined;
414
+ type?: string | null | undefined;
415
+ fullPath?: string | null | undefined;
403
416
  }[]>;
404
- submit: (datas: import("../../../../shared/types").AnyObject) => Promise<unknown>;
405
- onChange: (data: {
417
+ queryFileList: () => void;
418
+ onRemove: (options: {
406
419
  file: import("naive-ui").UploadFileInfo;
407
420
  fileList: import("naive-ui").UploadFileInfo[];
408
- }, index: number) => void;
409
- onBeforeUpload: (data: {
410
- file: import("naive-ui").UploadFileInfo;
411
- fileList: import("naive-ui").UploadFileInfo[];
412
- }) => Promise<boolean>;
413
- validateFormat: (file: import("naive-ui").UploadFileInfo, format: string) => boolean;
421
+ }) => Promise<unknown>;
422
+ submit: (datas: import("../../../../shared/types").AnyObject) => Promise<unknown>;
423
+ validateFormat: () => boolean;
414
424
  NForm: any;
415
425
  NFormItem: import("vue").DefineComponent<{
416
426
  readonly label: StringConstructor;
@@ -1578,7 +1588,16 @@ declare const _default: import("vue").DefineComponent<{
1578
1588
  }>;
1579
1589
  NSpace: any;
1580
1590
  Archive: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1581
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1591
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1592
+ formatId: {
1593
+ type: StringConstructor;
1594
+ required: false;
1595
+ };
1596
+ token: {
1597
+ type: StringConstructor;
1598
+ required: true;
1599
+ };
1600
+ }>>, {}>;
1582
1601
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "update:modelValue")[], "close" | "success" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1583
1602
  verifyUser: {
1584
1603
  type: FunctionConstructor;
@@ -71,12 +71,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
71
71
  });
72
72
  };
73
73
  const submitEditFile = async () => {
74
- var _a;
74
+ var _a, _b;
75
75
  try {
76
76
  loading.value = true;
77
- const data = await ((_a = editFormRef.value) == null ? void 0 : _a.submit({
77
+ const data = await ((_b = editFormRef.value) == null ? void 0 : _b.submit({
78
78
  authorizationKey: token.value,
79
- id: props.formatId,
79
+ id: (_a = props.formatId) == null ? void 0 : _a.split("_")[1],
80
80
  templateId: props.templateId,
81
81
  datasourceName: null,
82
82
  dataSourceId: null
@@ -117,7 +117,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
117
  key: 0,
118
118
  ref_key: "editFormRef",
119
119
  ref: editFormRef
120
- }, _ctx.$attrs), null, 16)) : (openBlock(), createBlock(unref(NForm), {
120
+ }, _ctx.$attrs, {
121
+ formatId: __props.formatId,
122
+ token: token.value
123
+ }), null, 16, ["formatId", "token"])) : (openBlock(), createBlock(unref(NForm), {
121
124
  key: 1,
122
125
  class: "login-form-button-print",
123
126
  ref_key: "formRef",
@@ -1 +1 @@
1
- .dropdown-button{border-color:#d5d5d5!important;color:#212121}.c-dropdown .n-dropdown-menu-wrapper span.active{color:#5585f5}.login-form-button{border-radius:24px;color:#fff;font-size:16px;height:50px;width:100%}.login-form-button-print{padding-top:15px}.login-form-button-print .n-input{border-radius:6px;color:#757575;font-size:14px;height:50px;line-height:50px}.c-button-print-modal .n-form-item-feedback-wrapper{display:none}.c-button-preview-modal{max-width:none}.c-button-preview-modal .n-dialog__content{height:98%}
1
+ .dropdown-button{border-color:#d5d5d5!important;color:#212121}.c-dropdown .n-dropdown-menu-wrapper span.active{color:#5585f5}.login-form-button{border-radius:24px;color:#fff;font-size:16px;height:50px;width:100%}.login-form-button-print{padding-top:15px}.login-form-button-print .n-input{border-radius:6px;color:#757575;font-size:14px;height:50px;line-height:50px}.c-button-print-modal .n-form-item-feedback-wrapper{display:none}.n-dialog.n-modal.c-button-preview-modal{max-width:none}.n-dialog.n-modal.c-button-preview-modal .n-dialog__content{height:98%}
@@ -16,7 +16,7 @@ export { useAnchor } from './src/hooks/useAnchor.js';
16
16
  export { useAutographOptions } from './src/hooks/useAutographOptions.js';
17
17
  export { useFormContext } from './src/hooks/useFormContext.js';
18
18
  export { useCommonInjection, useSelectOptionProps } from './src/hooks/useCommonInjection.js';
19
- export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, formRenderLog, injectOrProvide, isNestedFieldType, isNestedType, mergeDeepProperties, optionMatcher, parseNumberFromMaybeString, presetRequestHandler, splitExtendKey, validateMessageParser } from './src/utils/index.js';
19
+ export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, formRenderLog, injectOrProvide, isNestedFieldType, isNestedType, mergeDeepProperties, optionMatcherWithKeyword, parseNumberFromMaybeString, presetRequestHandler, splitExtendKey, validateMessageParser } from './src/utils/index.js';
20
20
  export * from '@formily/core';
21
21
  export { businessDateParser, isIdCard, isMobile, parseAge2Birthday, parseAge2FromContext, parseBirthday, parseIdCard, transformDateFormat } from './src/utils/business.js';
22
22
  export { findNextWidget, queryDecorator, queryInput } from './src/utils/dom.js';
@@ -5,7 +5,7 @@ import { useCommonInjection, useSelectOptionProps } from '../../hooks/useCommonI
5
5
  import { InjectionAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index.js';
6
6
  import '../../../../../shared/utils/index.js';
7
7
  import '../../../index.js';
8
- import { createUrlConfigParams, formRenderLog, optionMatcher } from '../../utils/index.js';
8
+ import { createUrlConfigParams, formRenderLog, optionMatcherWithKeyword } from '../../utils/index.js';
9
9
  import { useFormField } from '../../hooks/useFormField.js';
10
10
  import '../../../../../shared/utils/tapable/SyncHook.js';
11
11
  import '../../../../../shared/utils/tapable/SyncBailHook.js';
@@ -91,10 +91,10 @@ const script = defineComponent({
91
91
  }, 300);
92
92
  const parsedOptions = computed(() => {
93
93
  if (remoteOptions.value)
94
- return optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value);
94
+ return optionMatcherWithKeyword(remoteOptions.value, lastSearch.value, labelKey.value);
95
95
  if (!Array.isArray(props.options))
96
96
  return [];
97
- return optionMatcher(props.options, lastSearch.value, labelKey.value);
97
+ return optionMatcherWithKeyword(props.options, lastSearch.value, labelKey.value);
98
98
  });
99
99
  const changeContextCollector = inject(InjectionChangeContextCollector);
100
100
  changeContextCollector.setContext(fieldKey.value, (v) => {
@@ -3,7 +3,7 @@ import { isString, isEqual } from 'lodash-es';
3
3
  import { getCurrentInstance, inject, computed, ref, watch } from 'vue';
4
4
  import '../../index.js';
5
5
  import { InjectionAsyncQueue } from '../constants/index.js';
6
- import { formRenderLog, optionMatcher } from '../utils/index.js';
6
+ import { formRenderLog, optionMatcherWithKeyword } from '../utils/index.js';
7
7
  import { useFormField } from './useFormField.js';
8
8
  import { useFormRequest } from './useFormRequest.js';
9
9
 
@@ -50,7 +50,7 @@ function useAutographOptions(props, valueRef) {
50
50
  }, 300);
51
51
  const options = computed(() => {
52
52
  var _a;
53
- return remoteOptions.value ? optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value) : (_a = props.options) != null ? _a : [];
53
+ return remoteOptions.value ? optionMatcherWithKeyword(remoteOptions.value, lastSearch.value, labelKey.value) : (_a = props.options) != null ? _a : [];
54
54
  });
55
55
  watch(
56
56
  () => props.wordbook,
@@ -13,8 +13,8 @@ export declare function createSlot(renderer: unknown, props: AnyObject, defaultR
13
13
  default(): any;
14
14
  };
15
15
  export declare function createInputSlot(props: AnyObject, defaultRenderer?: (v: unknown) => unknown[]): import("vue").ComputedRef<Record<string, FunctionalComponent<{}, {}>>>;
16
- export declare function presetRequestHandler(res: unknown): any;
17
- export declare function optionMatcher(options: AnyObject[], input: Nullable<string>, key: string, matcherOption?: {
16
+ export declare function presetRequestHandler(res: unknown): AnyObject[];
17
+ export declare function optionMatcherWithKeyword(options: AnyObject[], input: Nullable<string>, key: string, matcherOption?: {
18
18
  keyword?: string;
19
19
  }): AnyObject[];
20
20
  export declare function validateMessageParser(message: string, fieldItem: Omit<FieldItem, 'reactions'>): string;
@@ -83,7 +83,10 @@ function createInputSlot(props, defaultRenderer) {
83
83
  function presetRequestHandler(res) {
84
84
  if (!isObject(res))
85
85
  throw res;
86
- return res.result && res.map ? handlerSearch(res) : handlerSelect(res);
86
+ return isSearchResult(res) ? handlerSearch(res) : isRecommendResult(res) ? handlerRecommend(res) : isSelectResult(res) ? handlerSelect(res) : [];
87
+ function isSelectResult(res2) {
88
+ return Reflect.has(res2, "data") && Reflect.has(res2, "success");
89
+ }
87
90
  function handlerSelect(res2) {
88
91
  const {
89
92
  data,
@@ -93,6 +96,9 @@ function presetRequestHandler(res) {
93
96
  throw res2;
94
97
  return data;
95
98
  }
99
+ function isSearchResult(res2) {
100
+ return Reflect.has(res2, "map") && Reflect.has(res2, "result");
101
+ }
96
102
  function handlerSearch(res2) {
97
103
  const {
98
104
  result,
@@ -102,6 +108,24 @@ function presetRequestHandler(res) {
102
108
  throw res2;
103
109
  return map.rows;
104
110
  }
111
+ function isRecommendResult(res2) {
112
+ return Reflect.has(res2, "result") && Reflect.has(res2, "obj");
113
+ }
114
+ function handlerRecommend(res2) {
115
+ const {
116
+ obj,
117
+ result
118
+ } = res2;
119
+ if (result !== "SUCCESS" || !isObject(obj))
120
+ throw res2;
121
+ return Object.entries(obj).reduce((res3, [type, list]) => {
122
+ list.forEach((item) => res3.push({
123
+ ...item,
124
+ type
125
+ }));
126
+ return res3;
127
+ }, []);
128
+ }
105
129
  }
106
130
  const keywordMatcher = useMemoize(function(text, keyword) {
107
131
  if (!isString(keyword) || !isString(text))
@@ -114,7 +138,7 @@ const keywordMatcher = useMemoize(function(text, keyword) {
114
138
  }, "");
115
139
  }
116
140
  });
117
- function optionMatcher(options, input, key, matcherOption = {
141
+ function optionMatcherWithKeyword(options, input, key, matcherOption = {
118
142
  keyword: "keyword"
119
143
  }) {
120
144
  if (!input)
@@ -228,4 +252,4 @@ async function createUrlConfigParams({
228
252
  };
229
253
  }
230
254
 
231
- export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, formRenderLog, injectOrProvide, isNestedFieldType, isNestedType, mergeDeepProperties, optionMatcher, parseNumberFromMaybeString, presetRequestHandler, splitExtendKey, validateMessageParser };
255
+ export { combineExtendKey, createInputSlot, createSlot, createUrlConfigParams, formRenderLog, injectOrProvide, isNestedFieldType, isNestedType, mergeDeepProperties, optionMatcherWithKeyword, parseNumberFromMaybeString, presetRequestHandler, splitExtendKey, validateMessageParser };