cnhis-design-vue 3.4.0-beta.13 → 3.4.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
+ ```
@@ -70,6 +70,7 @@ export declare class Print {
70
70
  _base64ToBlob(fileBase64: string, fileType: string): Blob;
71
71
  preview({ iReportExecuteMode, hideButtons, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
72
72
  printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
73
+ isObject(o: any): boolean;
73
74
  printDirect({ iReportExecuteMode, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, apptype, uuid, printname, priority, isShowQueueProgressNotify, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, printQueueCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
74
75
  printToHiPrint({ templateId, formatId, params, authorizationKey }: any, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn): Promise<any>;
75
76
  private _downloadPDF;
@@ -308,11 +308,10 @@ class Print {
308
308
  }
309
309
  async getPicAndUpload(obj) {
310
310
  try {
311
- const isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
312
311
  if ((obj == null ? void 0 : obj.result) === "success" && (obj == null ? void 0 : obj.uploadTemplateFlag) == "Y" && !(obj == null ? void 0 : obj.filebase64) && this.queryServicesParams) {
313
- const params = isObject(this.queryServicesParams.params) ? this.queryServicesParams.params : JSON.parse(this.queryServicesParams.params);
312
+ const params = this.isObject(this.queryServicesParams.params) ? this.queryServicesParams.params : JSON.parse(this.queryServicesParams.params);
314
313
  params.uploadTemplateFlag = "Y";
315
- this.queryServicesParams.params = JSON.stringify(params);
314
+ this.queryServicesParams.params = params;
316
315
  this.queryServicesParams.cmdid = PRINT_CMD_ID;
317
316
  this.queryServicesParams.print = {
318
317
  print: 1,
@@ -320,7 +319,7 @@ class Print {
320
319
  zip: 0
321
320
  };
322
321
  this.queryServicesParams.paramsArr = [{
323
- params: JSON.stringify(params)
322
+ params
324
323
  }];
325
324
  const data = await this._queryBase64ServicesPrint(this.queryServicesParams);
326
325
  }
@@ -991,6 +990,9 @@ class Print {
991
990
  this._handleMonitorNotify(error);
992
991
  }
993
992
  }
993
+ isObject(o) {
994
+ return Object.prototype.toString.call(o) === "[object Object]";
995
+ }
994
996
  async printDirect({
995
997
  iReportExecuteMode,
996
998
  templateId,
@@ -1014,7 +1016,7 @@ class Print {
1014
1016
  isDownloadFile = true,
1015
1017
  messageTimeout = 0
1016
1018
  }, successCallbackFn, errorCallbackFn, cancelCallbackFn, printQueueCallbackFn, mode = "printDirect") {
1017
- const isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
1019
+ params = this.isObject(params) || !params ? params : JSON.parse(params);
1018
1020
  const iReportStatus = isIReport(originFormatId);
1019
1021
  const formatId = this.getIReportFormatId(iReportStatus, originFormatId);
1020
1022
  if (iReportStatus && (isDomestic || iReportExecuteMode == 2)) {
@@ -1059,7 +1061,7 @@ class Print {
1059
1061
  return false;
1060
1062
  try {
1061
1063
  if (formatItem == null ? void 0 : formatItem.queuePrint) {
1062
- const printParams = isObject(params) ? cloneDeep(params) : params;
1064
+ const printParams = this.isObject(params) ? cloneDeep(params) : params;
1063
1065
  paramsArr = [{
1064
1066
  params: printParams
1065
1067
  }];
@@ -553,9 +553,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
553
553
  hide: boolean;
554
554
  }>;
555
555
  draggable: boolean;
556
- isHighlightRow: boolean;
557
556
  idx: number;
558
557
  isHighlight: boolean;
558
+ isHighlightRow: boolean;
559
559
  isFieldSet: boolean;
560
560
  fieldDescribeMode: "column" | "tooltip";
561
561
  hideExpressionOption: AnyObject[];
@@ -594,9 +594,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
594
594
  hide: boolean;
595
595
  }>;
596
596
  draggable: boolean;
597
- isHighlightRow: boolean;
598
597
  idx: number;
599
598
  isHighlight: boolean;
599
+ isHighlightRow: boolean;
600
600
  isFieldSet: boolean;
601
601
  fieldDescribeMode: "column" | "tooltip";
602
602
  hideExpressionOption: AnyObject[];
@@ -773,9 +773,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
773
773
  hide: boolean;
774
774
  }>;
775
775
  draggable: boolean;
776
- isHighlightRow: boolean;
777
776
  idx: number;
778
777
  isHighlight: boolean;
778
+ isHighlightRow: boolean;
779
779
  isFieldSet: boolean;
780
780
  fieldDescribeMode: "column" | "tooltip";
781
781
  hideExpressionOption: AnyObject[];
@@ -384,9 +384,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
384
384
  hide: boolean;
385
385
  }>;
386
386
  draggable: boolean;
387
- isHighlightRow: boolean;
388
387
  idx: number;
389
388
  isHighlight: boolean;
389
+ isHighlightRow: boolean;
390
390
  isFieldSet: boolean;
391
391
  fieldDescribeMode: "column" | "tooltip";
392
392
  hideExpressionOption: AnyObject[];
@@ -601,7 +601,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
601
601
  }, {
602
602
  default: withCtx(() => [!unref(isAudioOrVideoMessage)(item.content) ? (openBlock(), createElementBlock(Fragment, {
603
603
  key: 0
604
- }, [createCommentVNode(' <n-button\r\n quaternary\r\n size="tiny"\r\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\r\n >\r\n <template #icon>\r\n <n-icon size="17" :component="HappyOutline" />\r\n </template>\r\n </n-button> '), createVNode(unref(NButton), {
604
+ }, [createCommentVNode(' <n-button\n quaternary\n size="tiny"\n @click="(event: MouseEvent) => handleSelectLabel(event, item.id)"\n >\n <template #icon>\n <n-icon size="17" :component="HappyOutline" />\n </template>\n </n-button> '), createVNode(unref(NButton), {
605
605
  quaternary: "",
606
606
  size: "tiny",
607
607
  onClick: () => setReferenceMsg(item)
@@ -170,7 +170,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
170
170
  round: "",
171
171
  size: 100,
172
172
  onClickCapture: _cache[0] || (_cache[0] = ($event) => showLargeAvatar.value = true)
173
- }, 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", {
173
+ }, 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", {
174
174
  class: normalizeClass(["iho-chatRole", unref(isDoctorRole)(userDetail.roleInfo) ? "isDoctor" : ""])
175
175
  }, toDisplayString(unref(getRoleName)(userDetail.roleInfo)), 3), [[vShow, unref(getRoleName)(userDetail.roleInfo)]])]), createElementVNode("p", null, toDisplayString(userDetail.orgName), 1)]), createVNode(unref(NButton), {
176
176
  strong: "",
@@ -610,7 +610,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
610
610
  checkedAll.value = isSearch.value = false;
611
611
  checkedKeys.value = [];
612
612
  expandedKeys.value = [];
613
- treeData.value = treeAsyncData.value = [];
613
+ treeData.value = [];
614
+ treeAsyncData.value = [];
614
615
  }
615
616
  watch(() => props.data, (value) => {
616
617
  resetParams();
@@ -19,8 +19,8 @@ function searchFilterTree(attr, data, keyword, filterKey) {
19
19
  return searchBasisTree(data, keyword, filterKey);
20
20
  }
21
21
  function searchBasisTree(data, keyword, filterKey) {
22
- transform(data, keyword, filterKey);
23
- return filterHandle(data);
22
+ const searchItems = transform(data, keyword, filterKey);
23
+ return filterHandle(searchItems);
24
24
  }
25
25
  function getAllChildren(children, childrenKey) {
26
26
  const cache = /* @__PURE__ */ new WeakMap();
@@ -46,20 +46,22 @@ function getAllChildren(children, childrenKey) {
46
46
  return Array.from(childrenIterator(children || []));
47
47
  }
48
48
  function transform(data, keyword, filterKey) {
49
- data.forEach((item) => {
49
+ return data.map((item) => {
50
50
  var _a;
51
+ const tree = { ...item };
51
52
  const filterValue = item[filterKey] ? item[filterKey].split(",") : [item.title || item.name];
52
- item.visible = filterValue.some((item2) => item2.includes(keyword.trim()));
53
+ tree.visible = filterValue.some((item2) => item2.includes(keyword.trim()));
53
54
  if ((_a = item.children) == null ? void 0 : _a.length) {
54
- transform(item.children, keyword, filterKey);
55
- if (item.visible) {
56
- setVisible(item.children);
55
+ tree.children = transform(item.children, keyword, filterKey);
56
+ if (tree.visible) {
57
+ setVisible(tree.children);
57
58
  } else {
58
- const isVisible = item.children.some((child) => child.visible);
59
+ const isVisible = tree.children.some((child) => child.visible);
59
60
  if (isVisible)
60
- item.visible = true;
61
+ tree.visible = true;
61
62
  }
62
63
  }
64
+ return tree;
63
65
  });
64
66
  }
65
67
  function getStaffByName(data, keyword, filterKey) {
package/es/env.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_APP_TYPE: string;
5
- // 更多环境变量...
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }
11
-
12
- declare module '*.vue' {
13
- // @ts-ignore
14
- import type { App, defineComponent } from 'vue';
15
- // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
- // // const component: DefineComponent<{}, {}, any>
17
- const component: ReturnType<typeof defineComponent> & {
18
- install(app: App): void;
19
- };
20
- // @ts-ignore
21
- export default component;
22
- }
23
-
24
- declare module '*.js';
25
-
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TYPE: string;
5
+ // 更多环境变量...
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }
11
+
12
+ declare module '*.vue' {
13
+ // @ts-ignore
14
+ import type { App, defineComponent } from 'vue';
15
+ // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
+ // // const component: DefineComponent<{}, {}, any>
17
+ const component: ReturnType<typeof defineComponent> & {
18
+ install(app: App): void;
19
+ };
20
+ // @ts-ignore
21
+ export default component;
22
+ }
23
+
24
+ declare module '*.js';
25
+
@@ -1,5 +1,5 @@
1
1
  var name = "@cnhis-design-vue/shared";
2
- var version = "3.4.0-beta.13";
2
+ var version = "3.4.0-beta.15";
3
3
  var main = "index.ts";
4
4
  var peerDependencies = {
5
5
  "naive-ui": "^2.30.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.4.0-beta.13",
3
+ "version": "3.4.0-beta.15",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -73,5 +73,5 @@
73
73
  "iOS 7",
74
74
  "last 3 iOS versions"
75
75
  ],
76
- "gitHead": "c01fe58ff9e6c3986b3a5aeddf066f8b0501944d"
76
+ "gitHead": "5550a536343c49dce585e0cff932473410fafacc"
77
77
  }