cnhis-design-vue 3.3.3-beta.1 → 3.3.3-beta.3

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 (28) hide show
  1. package/README.md +87 -87
  2. package/es/components/button-print/index.d.ts +2 -1
  3. package/es/components/button-print/src/ButtonPrint.vue.d.ts +2 -1
  4. package/es/components/button-print/src/ButtonPrint.vue2.js +6 -1
  5. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -1
  6. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +8 -5
  7. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +4 -1
  8. package/es/components/button-print/src/utils/print.d.ts +2 -2
  9. package/es/components/button-print/src/utils/print.js +29 -20
  10. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  11. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  12. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  13. package/es/components/index.css +1 -1
  14. package/es/components/scale-view/index.d.ts +14 -14
  15. package/es/components/scale-view/src/ScaleView.vue.d.ts +14 -14
  16. package/es/components/scale-view/src/ScaleView.vue2.js +5 -6
  17. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +7 -7
  18. package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +4 -4
  19. package/es/components/scale-view/src/components/EvaluatePage.vue.d.ts +7 -7
  20. package/es/components/scale-view/src/components/EvaluatePage.vue2.js +2 -2
  21. package/es/components/scale-view/src/components/ScaleScore.js +2 -1
  22. package/es/components/scale-view/src/components/formitem/r-checkbox.js +4 -0
  23. package/es/components/scale-view/src/components/formitem/r-radio.js +2 -0
  24. package/es/components/scale-view/src/hooks/scaleview-computed.js +2 -2
  25. package/es/components/scale-view/style/index.css +1 -1
  26. package/es/env.d.ts +25 -25
  27. package/es/shared/package.json.js +1 -1
  28. package/package.json +2 -2
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -540,7 +540,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
540
540
  mergeTemplateList: (list: any[]) => any;
541
541
  initCRM: (formatListResult: any) => Promise<void>;
542
542
  init: () => Promise<boolean>;
543
- registerShort: () => Promise<void>;
543
+ registerShort: (obj?: any) => Promise<void>;
544
544
  handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
545
545
  reformatPrintParams: () => void;
546
546
  verifiySuccess: (token: string) => void;
@@ -1592,6 +1592,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1592
1592
  emits: (event: "success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint", ...args: any[]) => void;
1593
1593
  directPrint: () => Promise<void>;
1594
1594
  handleShortcutStartAndStop: (status: "start" | "stop") => void;
1595
+ registerShort: (obj: any) => void;
1595
1596
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint")[], "success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1596
1597
  printParams: {
1597
1598
  type: import("vue").PropType<import("../../shared/types").AnyObject[]>;
@@ -546,7 +546,7 @@ declare const _default: import("vue").DefineComponent<{
546
546
  mergeTemplateList: (list: any[]) => any;
547
547
  initCRM: (formatListResult: any) => Promise<void>;
548
548
  init: () => Promise<boolean>;
549
- registerShort: () => Promise<void>;
549
+ registerShort: (obj?: any) => Promise<void>;
550
550
  handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
551
551
  reformatPrintParams: () => void;
552
552
  verifiySuccess: (token: string) => void;
@@ -1601,6 +1601,7 @@ declare const _default: import("vue").DefineComponent<{
1601
1601
  emits: (event: "success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint", ...args: any[]) => void;
1602
1602
  directPrint: () => Promise<void>;
1603
1603
  handleShortcutStartAndStop: (status: 'start' | 'stop') => void;
1604
+ registerShort: (obj: any) => void;
1604
1605
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint")[], "success" | "error" | "cancel" | "clickoutside" | "saveOuterPrint", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1605
1606
  printParams: {
1606
1607
  type: PropType<AnyObject[]>;
@@ -191,9 +191,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
191
191
  var _a;
192
192
  (_a = printComponentRef.value) == null ? void 0 : _a.handleShortcutStartAndStop(status);
193
193
  };
194
+ const registerShort = (obj) => {
195
+ var _a;
196
+ (_a = printComponentRef.value) == null ? void 0 : _a.registerShort(obj);
197
+ };
194
198
  expose({
195
199
  directPrint,
196
- handleShortcutStartAndStop
200
+ handleShortcutStartAndStop,
201
+ registerShort
197
202
  });
198
203
  return (_ctx, _cache) => {
199
204
  return openBlock(), createBlock(resolveDynamicComponent(unref(isComponent)), mergeProps({
@@ -308,7 +308,7 @@ declare const _default: import("vue").DefineComponent<{
308
308
  mergeTemplateList: (list: any[]) => any;
309
309
  initCRM: (formatListResult: any) => Promise<void>;
310
310
  init: () => Promise<boolean>;
311
- registerShort: () => Promise<void>;
311
+ registerShort: (obj?: any) => Promise<void>;
312
312
  handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
313
313
  reformatPrintParams: () => void;
314
314
  verifiySuccess: (token: string) => void;
@@ -634,9 +634,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
634
634
  templateId,
635
635
  params: curPrintParamList
636
636
  }).then(() => {
637
- var _a;
637
+ var _a, _b;
638
638
  state.curPrintParamList = curPrintParamList;
639
639
  const curPrintdlgshow = ((_a = printCustomProps.value) == null ? void 0 : _a.printdlgshow) || props.printdlgshow;
640
+ const curFormatIdObj = (_b = state == null ? void 0 : state.formatList) == null ? void 0 : _b.find((item) => item.id == formatId);
640
641
  const queryParams = {
641
642
  formatId,
642
643
  iReportExecuteMode: state.iReportExecuteMode,
@@ -646,7 +647,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
646
647
  printdlgshow: curPrintdlgshow,
647
648
  signature: props.signature,
648
649
  copies: props.printCopies,
649
- svrUpdateIp: props.svrUpdateIp
650
+ svrUpdateIp: props.svrUpdateIp,
651
+ formatItem: curFormatIdObj
650
652
  };
651
653
  if (props.strategy === "MULTI") {
652
654
  for (let i = 0; i < curPrintParamList.length; i++) {
@@ -1039,8 +1041,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1039
1041
  state.spinning = false;
1040
1042
  return true;
1041
1043
  };
1042
- const registerShort = async () => {
1043
- const keys = Object.keys(shortcutSettings.value);
1044
+ const registerShort = async (obj) => {
1045
+ const keys = Object.keys(obj || shortcutSettings.value);
1044
1046
  if (keys.length > 0) {
1045
1047
  for (let i = 0; i < keys.length; i++) {
1046
1048
  const key = keys[i];
@@ -1181,7 +1183,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1181
1183
  }
1182
1184
  expose({
1183
1185
  directPrint,
1184
- handleShortcutStartAndStop
1186
+ handleShortcutStartAndStop,
1187
+ registerShort
1185
1188
  });
1186
1189
  return (_ctx, _cache) => {
1187
1190
  return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", _hoisted_1, [createCommentVNode(" \u5916\u663E\u6309\u94AE\u96C6\u5408 "), createVNode(unref(NButtonGroup), {
@@ -346,6 +346,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
346
346
  formatId: state.currentFormatId,
347
347
  templateId: getTemplateIdByFormatId.value
348
348
  }).then(() => {
349
+ var _a2;
350
+ const curFormatIdObj = (_a2 = state == null ? void 0 : state.formatList) == null ? void 0 : _a2.find((item) => item.id == state.currentFormatId);
349
351
  const queryParams = {
350
352
  iReportExecuteMode: state.iReportExecuteMode,
351
353
  number: state.number,
@@ -355,7 +357,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
355
357
  printdlgshow: props.printdlgshow,
356
358
  signature: props.signature,
357
359
  copies: props.printCopies,
358
- svrUpdateIp: props.svrUpdateIp
360
+ svrUpdateIp: props.svrUpdateIp,
361
+ formatItem: curFormatIdObj
359
362
  };
360
363
  if (props.strategy === "MULTI") {
361
364
  for (let i = 0; i < state.printParams.length; i++) {
@@ -41,7 +41,7 @@ export declare class Print {
41
41
  _queryBase64ServicesPrint(params: AnyObject): Promise<any>;
42
42
  _callPrintWithFile(queryParams: AnyObject): Promise<any>;
43
43
  _handleMonitorNotify(message: string | unknown): void;
44
- _handleResult(data: AnyObject, errorCallbackFn?: AnyFn, cancelCallbackFn?: AnyFn): false | AnyObject;
44
+ _handleResult(data: AnyObject, errorCallbackFn?: AnyFn, cancelCallbackFn?: AnyFn): false | AnyObject | undefined;
45
45
  _handleResultTest(result: unknown, errorCallbackFn?: AnyFn): boolean;
46
46
  _handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?: AnyFn): Promise<false | {
47
47
  file: any;
@@ -68,7 +68,7 @@ export declare class Print {
68
68
  _base64ToBlob(fileBase64: string, fileType: string): Blob;
69
69
  preview({ iReportExecuteMode, hideButtons, templateId, number, formatId: originFormatId, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
70
70
  printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
71
- printDirect({ iReportExecuteMode, templateId, number, formatId: originFormatId, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
71
+ printDirect({ iReportExecuteMode, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
72
72
  printToHiPrint({ templateId, formatId, params, authorizationKey }: any, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn): Promise<any>;
73
73
  private _downloadPDF;
74
74
  /**
@@ -461,7 +461,7 @@ class Print {
461
461
  }
462
462
  _handleResult(data, errorCallbackFn, cancelCallbackFn) {
463
463
  if (!data) {
464
- const message = function() {
464
+ const message2 = function() {
465
465
  var _a, _b, _c;
466
466
  try {
467
467
  return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.497")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.497")) || "\u6253\u5370\u547D\u4EE4\u8FD4\u56DE\u7A7A\u6570\u636E";
@@ -472,34 +472,34 @@ class Print {
472
472
  this._handleMonitorNotify("");
473
473
  errorCallbackFn == null ? void 0 : errorCallbackFn({
474
474
  type: "printError",
475
- message,
475
+ message: message2,
476
476
  result: "error",
477
- errinfo: message
477
+ errinfo: message2
478
478
  });
479
479
  return false;
480
480
  }
481
- if (data.result !== "success") {
482
- const message = data.message || data.Message;
483
- this._handleMonitorNotify(message);
484
- const errorMsgObj = {
485
- type: "printError",
481
+ if (data.result === "success" || data.returncode === "1") {
482
+ data.message = data.message || data.returnmsg;
483
+ return data;
484
+ }
485
+ const message = data.message || data.Message;
486
+ this._handleMonitorNotify(message);
487
+ const errorMsgObj = {
488
+ type: "printError",
489
+ message,
490
+ result: data.result,
491
+ errinfo: data.errinfo
492
+ };
493
+ if (data.result == "cancel") {
494
+ cancelCallbackFn && cancelCallbackFn({
495
+ type: "printCancel",
486
496
  message,
487
497
  result: data.result,
488
498
  errinfo: data.errinfo
489
- };
490
- if (data.result == "cancel") {
491
- cancelCallbackFn && cancelCallbackFn({
492
- type: "printCancel",
493
- message,
494
- result: data.result,
495
- errinfo: data.errinfo
496
- });
497
- return false;
498
- }
499
- errorCallbackFn == null ? void 0 : errorCallbackFn(errorMsgObj);
499
+ });
500
500
  return false;
501
501
  }
502
- return data;
502
+ errorCallbackFn == null ? void 0 : errorCallbackFn(errorMsgObj);
503
503
  }
504
504
  _handleResultTest(result, errorCallbackFn) {
505
505
  if (!result) {
@@ -905,6 +905,7 @@ class Print {
905
905
  templateId,
906
906
  number,
907
907
  formatId: originFormatId,
908
+ formatItem,
908
909
  params = "",
909
910
  paramsArr,
910
911
  authorizationKey,
@@ -917,6 +918,7 @@ class Print {
917
918
  isDownloadFile = true,
918
919
  messageTimeout = 0
919
920
  }, successCallbackFn, errorCallbackFn, cancelCallbackFn, mode = "printDirect") {
921
+ const isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
920
922
  const iReportStatus = isIReport(originFormatId);
921
923
  const formatId = this.getIReportFormatId(iReportStatus, originFormatId);
922
924
  if (iReportStatus && (isDomestic || iReportExecuteMode == 2)) {
@@ -974,6 +976,13 @@ class Print {
974
976
  if (!this._handleResultTest(testResult, errorCallbackFn))
975
977
  return false;
976
978
  try {
979
+ if (formatItem == null ? void 0 : formatItem.queuePrint) {
980
+ const printParams = isObject(params) ? cloneDeep(params) : params;
981
+ paramsArr = [{
982
+ params: printParams
983
+ }];
984
+ params = "";
985
+ }
977
986
  const result = await this._handleEventDirect({
978
987
  templateId,
979
988
  number,
@@ -175,9 +175,6 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
- /**
179
- * 改变弹窗大小
180
- */
181
178
  itemKey?: string | Function | undefined;
182
179
  }>, {
183
180
  move: Function;
@@ -225,7 +225,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
225
225
  round: "",
226
226
  size: 100,
227
227
  onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
228
- }, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\r\n <n-upload-trigger #="{ handleClick }" abstract>\r\n <n-button\r\n circle\r\n secondary\r\n class="edit-avatar"\r\n v-show="userDetail.id === state.userInfo.id"\r\n @click="handleClick"\r\n >\r\n <template #icon>\r\n <n-icon size="16" color="#666666" :component="Camera" />\r\n </template>\r\n </n-button>\r\n </n-upload-trigger>\r\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
228
+ }, null, 8, ["src"]), createCommentVNode(' <n-upload abstract accept="image/*" @change="onChange">\n <n-upload-trigger #="{ handleClick }" abstract>\n <n-button\n circle\n secondary\n class="edit-avatar"\n v-show="userDetail.id === state.userInfo.id"\n @click="handleClick"\n >\n <template #icon>\n <n-icon size="16" color="#666666" :component="Camera" />\n </template>\n </n-button>\n </n-upload-trigger>\n </n-upload> '), createElementVNode("div", _hoisted_4, [createElementVNode("h4", null, [createElementVNode("label", _hoisted_5, toDisplayString(userDetail.name), 1), withDirectives(createElementVNode("label", {
229
229
  class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
230
230
  }, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
231
231
  strong: "",
@@ -182,7 +182,7 @@ var EditSelect = /* @__PURE__ */ defineComponent({
182
182
  } finally {
183
183
  loading.value = false;
184
184
  }
185
- }, 400);
185
+ }, 200);
186
186
  const uuid = inject(InjectionIhoTableUUID);
187
187
  onBeforeUnmount(() => {
188
188
  return setFixedTableRowHeight(true);