cnhis-design-vue 3.3.2-beta.19 → 3.3.2-beta.22

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
+ ```
@@ -217,6 +217,7 @@ declare const AudioSdk: SFCWithInstall<import("vue").DefineComponent<{
217
217
  onPause: () => Promise<void>;
218
218
  onPlay: () => Promise<void>;
219
219
  onZoom: () => Promise<void>;
220
+ isSpining: import("vue").ComputedRef<boolean>;
220
221
  isFailStatus: import("vue").ComputedRef<boolean>;
221
222
  isActiveStatus: import("vue").ComputedRef<boolean>;
222
223
  isWarningStatus: import("vue").ComputedRef<boolean>;
@@ -215,6 +215,7 @@ declare const _default: import("vue").DefineComponent<{
215
215
  onPause: () => Promise<void>;
216
216
  onPlay: () => Promise<void>;
217
217
  onZoom: () => Promise<void>;
218
+ isSpining: import("vue").ComputedRef<boolean>;
218
219
  isFailStatus: import("vue").ComputedRef<boolean>;
219
220
  isActiveStatus: import("vue").ComputedRef<boolean>;
220
221
  isWarningStatus: import("vue").ComputedRef<boolean>;
@@ -156,8 +156,7 @@ const _AudioSDK = class {
156
156
  props: {
157
157
  contentRef: this.contentRef,
158
158
  wsConnected: this.wsConnected,
159
- recorderStatus: this.recorderStatus,
160
- recorderClosing: this.recorderClosing
159
+ recorderStatus: this.recorderStatus
161
160
  }
162
161
  });
163
162
  }
@@ -135,6 +135,7 @@ declare const _default: import("vue").DefineComponent<{
135
135
  onPause: () => Promise<void>;
136
136
  onPlay: () => Promise<void>;
137
137
  onZoom: () => Promise<void>;
138
+ isSpining: import("vue").ComputedRef<boolean>;
138
139
  isFailStatus: import("vue").ComputedRef<boolean>;
139
140
  isActiveStatus: import("vue").ComputedRef<boolean>;
140
141
  isWarningStatus: import("vue").ComputedRef<boolean>;
@@ -123,6 +123,7 @@ declare const _default: import("vue").DefineComponent<{
123
123
  onPause: () => Promise<void>;
124
124
  onPlay: () => Promise<void>;
125
125
  onZoom: () => Promise<void>;
126
+ isSpining: import("vue").ComputedRef<boolean>;
126
127
  isFailStatus: import("vue").ComputedRef<boolean>;
127
128
  isActiveStatus: import("vue").ComputedRef<boolean>;
128
129
  isWarningStatus: import("vue").ComputedRef<boolean>;
@@ -146,6 +146,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
146
146
  const onPause = useDebounceFn(handlePause, 500);
147
147
  const onPlay = useDebounceFn(handlePlay, 500);
148
148
  const onZoom = useDebounceFn(handleZoom, 500);
149
+ const isSpining = computed(() => !wsConnected.value || loading.value);
149
150
  const isFailStatus = computed(() => recorderStatus.value === "fail");
150
151
  const isActiveStatus = computed(() => !loading.value && isActive.value && !isWarning.value);
151
152
  const isWarningStatus = computed(() => isFailStatus.value || !loading.value && isActive.value && isWarning.value);
@@ -219,7 +220,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
219
220
  "c-recording-wrapper-show_content": unref(showContent)
220
221
  }])
221
222
  }, [createVNode(unref(NSpin), {
222
- show: !unref(wsConnected)
223
+ show: unref(isSpining)
223
224
  }, {
224
225
  default: withCtx(() => [unref(isZoomSmall) ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("div", {
225
226
  ref_key: "audioChartSamllRef",
@@ -120,9 +120,9 @@ function useChartAudioContext(props, emit, options) {
120
120
  emit("resume");
121
121
  };
122
122
  const handleHeightChange = (showContent) => {
123
- let cH = isZoomSmall.value ? 60 : 284;
123
+ let cH = isZoomSmall.value ? 58 : 284;
124
124
  if (showContent) {
125
- cH = isZoomSmall.value ? 212 : 404;
125
+ cH = isZoomSmall.value ? 210 : 436;
126
126
  }
127
127
  emit("heightChange", cH);
128
128
  };
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  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">\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", {
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", {
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: "",
@@ -1,3 +1,5 @@
1
+ import { isArray } from 'lodash-es';
2
+
1
3
  function getDefaultValue(row, item, options = []) {
2
4
  const {
3
5
  aliasField = "",
@@ -5,17 +7,29 @@ function getDefaultValue(row, item, options = []) {
5
7
  valueField = "value"
6
8
  } = (item == null ? void 0 : item.componentProps) || {};
7
9
  const value = row[item.columnName];
8
- if (Array.isArray(value))
10
+ if (isArray(value))
9
11
  return value.map((v) => getValue(v));
10
12
  return getValue(value);
11
13
  function getValue(value2) {
12
14
  var _a, _b, _c;
13
- const findItem = (_a = getArray(options)) == null ? void 0 : _a.find((v) => v[valueField] == value2);
15
+ const findItem = (_a = getGoupFlatten(options)) == null ? void 0 : _a.find((v) => v[valueField] == value2);
14
16
  return (_c = (_b = findItem == null ? void 0 : findItem[aliasField]) != null ? _b : findItem == null ? void 0 : findItem[labelField]) != null ? _c : value2;
15
17
  }
16
18
  }
17
19
  function getArray(list) {
18
- return Array.isArray(list) && !list.length ? null : list;
20
+ return isArray(list) && !list.length ? null : list;
21
+ }
22
+ function getGoupFlatten(list) {
23
+ if (!isArray(list) || !list.length)
24
+ return [];
25
+ return list.reduce((acc, cur) => {
26
+ if (cur.type === "group" && cur.children) {
27
+ acc.push(...getGoupFlatten(cur.children));
28
+ } else if (cur.type !== "group") {
29
+ acc.push(cur);
30
+ }
31
+ return acc;
32
+ }, []);
19
33
  }
20
34
 
21
35
  export { getArray, getDefaultValue };
@@ -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">\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\n </template> '), !state.spinning && !state.hasFrontAddress ? (openBlock(), createElementBlock(Fragment, {
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, {
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.19";
2
+ var version = "3.3.2-beta.22";
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.19",
3
+ "version": "3.3.2-beta.22",
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": "becad0d727c3a59994fdcc8ce30e930b51f2a358"
75
+ "gitHead": "ae0c2810ea9a49dae34fccb6e531a900292155ba"
76
76
  }