cnhis-design-vue 3.1.28-beta.5 → 3.1.28

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,123 +1,123 @@
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. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
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. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -55,6 +55,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
55
55
  token: {
56
56
  type: StringConstructor;
57
57
  };
58
+ printdlgshow: {
59
+ default: string;
60
+ type: StringConstructor;
61
+ };
58
62
  }, {
59
63
  $message: import("naive-ui").MessageApi;
60
64
  printInstance: any;
@@ -113,6 +117,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
113
117
  token: {
114
118
  type: StringConstructor;
115
119
  };
120
+ printdlgshow: {
121
+ default: string;
122
+ type: StringConstructor;
123
+ };
116
124
  }>> & {
117
125
  onError?: ((...args: any[]) => any) | undefined;
118
126
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -592,6 +600,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
592
600
  token: {
593
601
  type: StringConstructor;
594
602
  };
603
+ printdlgshow: {
604
+ default: string;
605
+ type: StringConstructor;
606
+ };
595
607
  }>> & {
596
608
  onError?: ((...args: any[]) => any) | undefined;
597
609
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -609,5 +621,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
609
621
  strategy: string;
610
622
  clickPrevFn: Function;
611
623
  noDataMsg: string;
624
+ printdlgshow: string;
612
625
  }>>;
613
626
  export default ButtonPrint;
@@ -56,6 +56,10 @@ declare const _default: import("vue").DefineComponent<{
56
56
  token: {
57
57
  type: StringConstructor;
58
58
  };
59
+ printdlgshow: {
60
+ default: string;
61
+ type: StringConstructor;
62
+ };
59
63
  }, {
60
64
  $message: import("naive-ui").MessageApi;
61
65
  printInstance: any;
@@ -117,6 +121,10 @@ declare const _default: import("vue").DefineComponent<{
117
121
  token: {
118
122
  type: StringConstructor;
119
123
  };
124
+ printdlgshow: {
125
+ default: string;
126
+ type: StringConstructor;
127
+ };
120
128
  }>> & {
121
129
  onError?: ((...args: any[]) => any) | undefined;
122
130
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -601,6 +609,10 @@ declare const _default: import("vue").DefineComponent<{
601
609
  token: {
602
610
  type: StringConstructor;
603
611
  };
612
+ printdlgshow: {
613
+ default: string;
614
+ type: StringConstructor;
615
+ };
604
616
  }>> & {
605
617
  onError?: ((...args: any[]) => any) | undefined;
606
618
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -618,5 +630,6 @@ declare const _default: import("vue").DefineComponent<{
618
630
  strategy: string;
619
631
  clickPrevFn: Function;
620
632
  noDataMsg: string;
633
+ printdlgshow: string;
621
634
  }>;
622
635
  export default _default;
@@ -62,6 +62,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
62
62
  },
63
63
  token: {
64
64
  type: String
65
+ },
66
+ printdlgshow: {
67
+ default: "0",
68
+ type: String
65
69
  }
66
70
  },
67
71
  emits: ["success", "error", "clickoutside"],
@@ -186,7 +190,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
186
190
  }).then(() => {
187
191
  const queryParams = {
188
192
  formatId: state.currentFormatId,
189
- templateId: getTemplateIdByFormatId.value
193
+ templateId: getTemplateIdByFormatId.value,
194
+ printdlgshow: props.printdlgshow
190
195
  };
191
196
  if (props.strategy === "MULTI") {
192
197
  for (let i = 0; i < state.printParams.length; i++) {
@@ -101,7 +101,7 @@ function useCanvasEvent(canvas, propItems, emits) {
101
101
  const { button, pointer } = event;
102
102
  if (button == 1) {
103
103
  const _key = obj.key.replace("All", "");
104
- const key = pointer.x <= originX ? _key + "Title" : _key;
104
+ const key = (pointer == null ? void 0 : pointer.x) && (pointer == null ? void 0 : pointer.x) <= originX ? _key + "Title" : _key;
105
105
  obj.sendToBack();
106
106
  select(key);
107
107
  emits("select", key);