cnhis-design-vue 3.3.2-beta.17 → 3.3.2-beta.18

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
+ ```
@@ -130,7 +130,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
130
130
  onEnd,
131
131
  onFail: _cache[1] || (_cache[1] = (error) => emit("fail", error)),
132
132
  onSuccess
133
- }), null, 16, ["loading"])) : createCommentVNode("v-if", true), createCommentVNode(' <c-form\r\n v-if="isForm"\r\n :configs="configsAndBasicData.configs"\r\n :data="jsonData"\r\n @close="onFormClose"\r\n @finish="onFinish"\r\n /> ')], 64)) : (openBlock(), createBlock(RecordingModal$1, {
133
+ }), null, 16, ["loading"])) : createCommentVNode("v-if", true), createCommentVNode(' <c-form\n v-if="isForm"\n :configs="configsAndBasicData.configs"\n :data="jsonData"\n @close="onFormClose"\n @finish="onFinish"\n /> ')], 64)) : (openBlock(), createBlock(RecordingModal$1, {
134
134
  key: 1,
135
135
  content: unref(content)
136
136
  }, null, 8, ["content"]))], 4);
@@ -339,6 +339,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
339
339
  shortcut: {};
340
340
  buttonProps: {};
341
341
  showMaxHeight: null;
342
+ initLoadPrintParams: boolean;
342
343
  };
343
344
  };
344
345
  svrUpdateIp: {
@@ -457,6 +458,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
457
458
  shortcut: {};
458
459
  buttonProps: {};
459
460
  showMaxHeight: null;
461
+ initLoadPrintParams: boolean;
460
462
  };
461
463
  };
462
464
  svrUpdateIp: {
@@ -832,6 +834,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
832
834
  shortcut: {};
833
835
  buttonProps: {};
834
836
  showMaxHeight: null;
837
+ initLoadPrintParams: boolean;
835
838
  };
836
839
  };
837
840
  svrUpdateIp: {
@@ -345,6 +345,7 @@ declare const _default: import("vue").DefineComponent<{
345
345
  shortcut: {};
346
346
  buttonProps: {};
347
347
  showMaxHeight: null;
348
+ initLoadPrintParams: boolean;
348
349
  };
349
350
  };
350
351
  svrUpdateIp: {
@@ -463,6 +464,7 @@ declare const _default: import("vue").DefineComponent<{
463
464
  shortcut: {};
464
465
  buttonProps: {};
465
466
  showMaxHeight: null;
467
+ initLoadPrintParams: boolean;
466
468
  };
467
469
  };
468
470
  svrUpdateIp: {
@@ -838,6 +840,7 @@ declare const _default: import("vue").DefineComponent<{
838
840
  shortcut: {};
839
841
  buttonProps: {};
840
842
  showMaxHeight: null;
843
+ initLoadPrintParams: boolean;
841
844
  };
842
845
  };
843
846
  svrUpdateIp: {
@@ -104,6 +104,7 @@ declare const _default: import("vue").DefineComponent<{
104
104
  shortcut: {};
105
105
  buttonProps: {};
106
106
  showMaxHeight: null;
107
+ initLoadPrintParams: boolean;
107
108
  };
108
109
  };
109
110
  svrUpdateIp: {
@@ -225,6 +226,7 @@ declare const _default: import("vue").DefineComponent<{
225
226
  shortcut: {};
226
227
  buttonProps: {};
227
228
  showMaxHeight: null;
229
+ initLoadPrintParams: boolean;
228
230
  };
229
231
  };
230
232
  svrUpdateIp: {
@@ -603,6 +605,7 @@ declare const _default: import("vue").DefineComponent<{
603
605
  shortcut: {};
604
606
  buttonProps: {};
605
607
  showMaxHeight: null;
608
+ initLoadPrintParams: boolean;
606
609
  };
607
610
  };
608
611
  svrUpdateIp: {
@@ -222,7 +222,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
222
222
  defaultFormatId: "",
223
223
  shortcut: {},
224
224
  buttonProps: {},
225
- showMaxHeight: null
225
+ showMaxHeight: null,
226
+ initLoadPrintParams: false
226
227
  })
227
228
  },
228
229
  svrUpdateIp: {
@@ -1118,7 +1119,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1118
1119
  };
1119
1120
  onMounted(() => {
1120
1121
  state.isInited = false;
1121
- handleClickBtn(false);
1122
1122
  });
1123
1123
  onBeforeUnmount(() => {
1124
1124
  const shortcutKeys = Object.keys(shortcutFn.value);
@@ -1147,6 +1147,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1147
1147
  deep: true,
1148
1148
  immediate: true
1149
1149
  });
1150
+ watch(() => {
1151
+ var _a;
1152
+ return (_a = props.newPrintSetting) == null ? void 0 : _a.initLoadPrintParams;
1153
+ }, async (isInit) => {
1154
+ if (isInit) {
1155
+ await handleClickBtn(false);
1156
+ }
1157
+ }, {
1158
+ immediate: true
1159
+ });
1150
1160
  async function directPrint() {
1151
1161
  await handleClickBtn(false);
1152
1162
  handleClickPrintAll();
@@ -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;
@@ -534,12 +534,12 @@ declare const _default: import("vue").DefineComponent<{
534
534
  }>;
535
535
  developMode: boolean;
536
536
  draggable: boolean;
537
+ fieldDescribeMode: "column" | "tooltip";
538
+ isFieldSet: boolean;
539
+ hideExpressionOption: AnyObject[];
537
540
  idx: number;
538
541
  isHighlight: boolean;
539
542
  isHighlightRow: boolean;
540
- isFieldSet: boolean;
541
- fieldDescribeMode: "column" | "tooltip";
542
- hideExpressionOption: AnyObject[];
543
543
  }>;
544
544
  EditDialog: import("vue").DefineComponent<{
545
545
  visible: {
@@ -563,12 +563,12 @@ declare const _default: import("vue").DefineComponent<{
563
563
  }>;
564
564
  developMode: boolean;
565
565
  draggable: boolean;
566
+ fieldDescribeMode: "column" | "tooltip";
567
+ isFieldSet: boolean;
568
+ hideExpressionOption: AnyObject[];
566
569
  idx: number;
567
570
  isHighlight: boolean;
568
571
  isHighlightRow: boolean;
569
- isFieldSet: boolean;
570
- fieldDescribeMode: "column" | "tooltip";
571
- hideExpressionOption: AnyObject[];
572
572
  }>;
573
573
  setStyle: typeof setStyle;
574
574
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -722,12 +722,12 @@ declare const _default: import("vue").DefineComponent<{
722
722
  }>;
723
723
  developMode: boolean;
724
724
  draggable: boolean;
725
+ fieldDescribeMode: "column" | "tooltip";
726
+ isFieldSet: boolean;
727
+ hideExpressionOption: AnyObject[];
725
728
  idx: number;
726
729
  isHighlight: boolean;
727
730
  isHighlightRow: boolean;
728
- isFieldSet: boolean;
729
- fieldDescribeMode: "column" | "tooltip";
730
- hideExpressionOption: AnyObject[];
731
731
  }>;
732
732
  isArray: {
733
733
  (value?: any): value is any[];
@@ -857,9 +857,9 @@ declare const _default: import("vue").DefineComponent<{
857
857
  showSeq: boolean;
858
858
  developMode: boolean;
859
859
  footerFlag: boolean;
860
- fieldDescribeMode: "column" | "tooltip";
861
860
  customColumns: FieldSetColumnItem[];
862
861
  showSortPriority: boolean;
863
862
  showHeadFilter: boolean;
863
+ fieldDescribeMode: "column" | "tooltip";
864
864
  }>;
865
865
  export default _default;
@@ -383,11 +383,11 @@ declare const _default: import("vue").DefineComponent<{
383
383
  }>;
384
384
  developMode: boolean;
385
385
  draggable: boolean;
386
+ fieldDescribeMode: "column" | "tooltip";
387
+ isFieldSet: boolean;
388
+ hideExpressionOption: AnyObject[];
386
389
  idx: number;
387
390
  isHighlight: boolean;
388
391
  isHighlightRow: boolean;
389
- isFieldSet: boolean;
390
- fieldDescribeMode: "column" | "tooltip";
391
- hideExpressionOption: AnyObject[];
392
392
  }>;
393
393
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, ref, watch, inject, createVNode, mergeProps } from 'vue';
2
- import { LifeCycleTypes } from '@formily/core';
2
+ import { isField, LifeCycleTypes } from '@formily/core';
3
3
  import '../../../index.js';
4
4
  import { InjectionFormGlobalProps } from '../../constants/index.js';
5
5
  import '../../../../../shared/utils/index.js';
@@ -41,8 +41,9 @@ const script = /* @__PURE__ */ defineComponent({
41
41
  } = useFormField();
42
42
  const valueRef = computed({
43
43
  get: () => props.value,
44
- set: (v) => {
45
- emit("update:value", v);
44
+ set: (value) => {
45
+ isField(field.value) && field.value.modify();
46
+ emit("update:value", value);
46
47
  field.value.notify(LifeCycleTypes.ON_FIELD_INPUT_VALUE_CHANGE);
47
48
  }
48
49
  });
@@ -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: "",
@@ -193,7 +193,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
193
193
  }]),
194
194
  ref_key: "scaleViewDom",
195
195
  ref: scaleViewDom
196
- }, [createCommentVNode(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\r\n </template> '), !state.spinning && !state.hasFrontAddress ? (openBlock(), createElementBlock(Fragment, {
196
+ }, [createCommentVNode(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\n </template> '), !state.spinning && !state.hasFrontAddress ? (openBlock(), createElementBlock(Fragment, {
197
197
  key: 0
198
198
  }, [unref(noDataState).noData ? (openBlock(), createBlock(NoData, {
199
199
  key: 0,
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.3.2-beta.17";
2
+ var version = "3.3.2-beta.18";
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.3.2-beta.17",
3
+ "version": "3.3.2-beta.18",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -72,5 +72,5 @@
72
72
  "iOS 7",
73
73
  "last 3 iOS versions"
74
74
  ],
75
- "gitHead": "789c3dc4a481b5d47340a5200ce8967bae54600c"
75
+ "gitHead": "8203a9c52d4894a00ea2c49f7024c77675a5de2a"
76
76
  }