cnhis-design-vue 3.1.39-beta.2 → 3.1.39-beta.4
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 +123 -123
- package/es/components/button-print/index.d.ts +15 -1
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +15 -1
- package/es/components/button-print/src/ButtonPrint.vue2.js +30 -6
- package/es/components/button-print/src/utils/print.d.ts +1 -0
- package/es/components/button-print/src/utils/print.js +10 -0
- package/es/components/fabric-chart/src/hooks/useCenter.js +3 -3
- package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -0
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/env.d.ts +24 -24
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
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
|
+
```
|
|
@@ -64,6 +64,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
64
64
|
type: StringConstructor;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
|
+
directPrint: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
67
71
|
}, {
|
|
68
72
|
$message: import("naive-ui").MessageApi;
|
|
69
73
|
printInstance: import("./src/utils").Print | null;
|
|
@@ -130,6 +134,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
130
134
|
type: StringConstructor;
|
|
131
135
|
default: string;
|
|
132
136
|
};
|
|
137
|
+
directPrint: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
133
141
|
}>> & {
|
|
134
142
|
onError?: ((...args: any[]) => any) | undefined;
|
|
135
143
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -154,6 +162,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
154
162
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
|
155
163
|
formatTitle: import("vue").ComputedRef<any>;
|
|
156
164
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
|
165
|
+
buttonClick: (origin: string) => Promise<false | undefined>;
|
|
157
166
|
renderLabel: (option: import("naive-ui").MenuOption) => JSX.Element;
|
|
158
167
|
callLocalServicesSuccessCb: (res: any, type: any) => void;
|
|
159
168
|
callLocalServicesErrorCb: (res: unknown) => void;
|
|
@@ -179,7 +188,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
179
188
|
}, params?: any[]) => any;
|
|
180
189
|
initCRM: (formatListResult: any) => Promise<boolean | undefined>;
|
|
181
190
|
init: () => Promise<boolean>;
|
|
182
|
-
handleClickBtn: () => Promise<false | undefined>;
|
|
191
|
+
handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
|
|
183
192
|
reformatPrintParams: () => void;
|
|
184
193
|
verifiySuccess: (token: string) => void;
|
|
185
194
|
NDropdown: any;
|
|
@@ -1878,6 +1887,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1878
1887
|
type: StringConstructor;
|
|
1879
1888
|
default: string;
|
|
1880
1889
|
};
|
|
1890
|
+
directPrint: {
|
|
1891
|
+
type: BooleanConstructor;
|
|
1892
|
+
default: boolean;
|
|
1893
|
+
};
|
|
1881
1894
|
}>> & {
|
|
1882
1895
|
onError?: ((...args: any[]) => any) | undefined;
|
|
1883
1896
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -1897,5 +1910,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1897
1910
|
noDataMsg: string;
|
|
1898
1911
|
printdlgshow: string;
|
|
1899
1912
|
btnprint: string;
|
|
1913
|
+
directPrint: boolean;
|
|
1900
1914
|
}>>;
|
|
1901
1915
|
export default ButtonPrint;
|
|
@@ -69,6 +69,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
69
|
type: StringConstructor;
|
|
70
70
|
default: string;
|
|
71
71
|
};
|
|
72
|
+
directPrint: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: boolean;
|
|
75
|
+
};
|
|
72
76
|
}, {
|
|
73
77
|
$message: import("naive-ui").MessageApi;
|
|
74
78
|
printInstance: Print | null;
|
|
@@ -138,6 +142,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
142
|
type: StringConstructor;
|
|
139
143
|
default: string;
|
|
140
144
|
};
|
|
145
|
+
directPrint: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
141
149
|
}>> & {
|
|
142
150
|
onError?: ((...args: any[]) => any) | undefined;
|
|
143
151
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -162,6 +170,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
162
170
|
currentFormatItem: import("vue").ComputedRef<{} | undefined>;
|
|
163
171
|
formatTitle: import("vue").ComputedRef<any>;
|
|
164
172
|
getTemplateIdByFormatId: import("vue").ComputedRef<any>;
|
|
173
|
+
buttonClick: (origin: string) => Promise<false | undefined>;
|
|
165
174
|
renderLabel: (option: DropdownOption) => JSX.Element;
|
|
166
175
|
callLocalServicesSuccessCb: (res: any, type: any) => void;
|
|
167
176
|
callLocalServicesErrorCb: (res: unknown) => void;
|
|
@@ -187,7 +196,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
196
|
}, params?: any[]) => any;
|
|
188
197
|
initCRM: (formatListResult: any) => Promise<boolean | undefined>;
|
|
189
198
|
init: () => Promise<boolean>;
|
|
190
|
-
handleClickBtn: () => Promise<false | undefined>;
|
|
199
|
+
handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
|
|
191
200
|
reformatPrintParams: () => void;
|
|
192
201
|
verifiySuccess: (token: string) => void;
|
|
193
202
|
NDropdown: any;
|
|
@@ -1889,6 +1898,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1889
1898
|
type: StringConstructor;
|
|
1890
1899
|
default: string;
|
|
1891
1900
|
};
|
|
1901
|
+
directPrint: {
|
|
1902
|
+
type: BooleanConstructor;
|
|
1903
|
+
default: boolean;
|
|
1904
|
+
};
|
|
1892
1905
|
}>> & {
|
|
1893
1906
|
onError?: ((...args: any[]) => any) | undefined;
|
|
1894
1907
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
@@ -1908,5 +1921,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1908
1921
|
noDataMsg: string;
|
|
1909
1922
|
printdlgshow: string;
|
|
1910
1923
|
btnprint: string;
|
|
1924
|
+
directPrint: boolean;
|
|
1911
1925
|
}>;
|
|
1912
1926
|
export default _default;
|
|
@@ -71,6 +71,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
71
|
btnprint: {
|
|
72
72
|
type: String,
|
|
73
73
|
default: "1"
|
|
74
|
+
},
|
|
75
|
+
directPrint: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
80
|
emits: ["success", "error", "clickoutside"],
|
|
@@ -118,6 +122,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
122
|
let find = state.formatList.find((item) => item.id === state.currentFormatId);
|
|
119
123
|
return find == null ? void 0 : find.templateId;
|
|
120
124
|
});
|
|
125
|
+
const buttonClick = async (origin) => {
|
|
126
|
+
if (props.directPrint) {
|
|
127
|
+
if (state.spinning)
|
|
128
|
+
return;
|
|
129
|
+
if (origin === "button") {
|
|
130
|
+
await handleClickBtn(false);
|
|
131
|
+
handleClickPrint();
|
|
132
|
+
return;
|
|
133
|
+
} else {
|
|
134
|
+
return handleClickBtn();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return handleClickBtn();
|
|
138
|
+
};
|
|
121
139
|
const renderLabel = (option) => {
|
|
122
140
|
return createVNode("span", {
|
|
123
141
|
"class": {
|
|
@@ -402,7 +420,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
402
420
|
state.spinning = false;
|
|
403
421
|
return true;
|
|
404
422
|
};
|
|
405
|
-
const handleClickBtn = async () => {
|
|
423
|
+
const handleClickBtn = async (visible = true) => {
|
|
406
424
|
var _a;
|
|
407
425
|
const status = await props.clickPrevFn();
|
|
408
426
|
if (!status)
|
|
@@ -416,7 +434,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
416
434
|
if (!result)
|
|
417
435
|
return false;
|
|
418
436
|
}
|
|
419
|
-
|
|
437
|
+
if (visible) {
|
|
438
|
+
state.visible = !state.visible;
|
|
439
|
+
}
|
|
420
440
|
};
|
|
421
441
|
const reformatPrintParams = () => {
|
|
422
442
|
state.watchPrintParamsReformatFn && state.watchPrintParamsReformatFn();
|
|
@@ -475,17 +495,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
475
495
|
printVisible: state.visible
|
|
476
496
|
}, () => [createVNode(unref(NButton), {
|
|
477
497
|
class: "dropdown-button",
|
|
478
|
-
onClick: withModifiers(
|
|
498
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => buttonClick("button"), ["stop"]))
|
|
479
499
|
}, {
|
|
480
500
|
default: withCtx(() => [createCommentVNode(' <n-spin v-show="state.spinning" size="small"></n-spin> '), createTextVNode(toDisplayString(__props.btnText) + " ", 1), createVNode(unref(NIcon), {
|
|
481
|
-
component: unref(ChevronDown)
|
|
501
|
+
component: unref(ChevronDown),
|
|
502
|
+
style: {
|
|
503
|
+
"margin-left": "5px"
|
|
504
|
+
},
|
|
505
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => buttonClick("icon"), ["stop"]))
|
|
482
506
|
}, null, 8, ["component"])]),
|
|
483
507
|
_: 1
|
|
484
|
-
}
|
|
508
|
+
})])]),
|
|
485
509
|
_: 3
|
|
486
510
|
}, 8, ["show", "options"]), createVNode(IdentityVerification, mergeProps(_ctx.$attrs, {
|
|
487
511
|
modelValue: state.identityVerification.visible,
|
|
488
|
-
"onUpdate:modelValue": _cache[
|
|
512
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.identityVerification.visible = $event),
|
|
489
513
|
formatId: state.currentFormatId,
|
|
490
514
|
templateId: unref(getTemplateIdByFormatId),
|
|
491
515
|
onSuccess: verifiySuccess
|
|
@@ -27,6 +27,7 @@ class Print {
|
|
|
27
27
|
this.dialog = new IdentityVerificationDialog();
|
|
28
28
|
this.dialogPreview = new PreviewDialog();
|
|
29
29
|
this.instance = null;
|
|
30
|
+
this.downloadPath = "";
|
|
30
31
|
this.messageHandlerQueue = [];
|
|
31
32
|
var _a;
|
|
32
33
|
const _window = window;
|
|
@@ -35,13 +36,19 @@ class Print {
|
|
|
35
36
|
return;
|
|
36
37
|
this.currentMessageHandler = this.messageHandler.bind(this);
|
|
37
38
|
this.webview.addEventListener("message", this.currentMessageHandler);
|
|
39
|
+
this.postMessage({ exec: "config", data: "" });
|
|
38
40
|
}
|
|
39
41
|
messageHandler(e) {
|
|
42
|
+
var _a;
|
|
40
43
|
const handler = this.messageHandlerQueue.pop();
|
|
41
44
|
if (!handler)
|
|
42
45
|
return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
|
|
43
46
|
const { resolve, reject } = handler;
|
|
44
47
|
try {
|
|
48
|
+
const { exec } = JSON.parse(e.data);
|
|
49
|
+
if (exec === "config") {
|
|
50
|
+
this.downloadPath = ((_a = JSON.parse(e.data).res) == null ? void 0 : _a.downloadpath) || "";
|
|
51
|
+
}
|
|
45
52
|
console.log(e);
|
|
46
53
|
resolve(JSON.parse(e.data).res);
|
|
47
54
|
} catch (e2) {
|
|
@@ -311,6 +318,9 @@ class Print {
|
|
|
311
318
|
return httpFn.get(PDF_URL, { params: { inputData } }).then(({ data }) => data);
|
|
312
319
|
}
|
|
313
320
|
downloadPDF(params, onResolve, onReject) {
|
|
321
|
+
if (this.webview && this.downloadPath) {
|
|
322
|
+
params.print.filename = this.downloadPath.replace(/\\/g, "/");
|
|
323
|
+
}
|
|
314
324
|
this.printDirect(
|
|
315
325
|
params,
|
|
316
326
|
async (res) => {
|
|
@@ -351,7 +351,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
function drawOther(points, v, _item, otherObj) {
|
|
354
|
-
var _a2;
|
|
354
|
+
var _a2, _b;
|
|
355
355
|
if (!(points == null ? void 0 : points.length) || !["temperature", "pain"].includes(type))
|
|
356
356
|
return;
|
|
357
357
|
const { lineAttr = {} } = _item;
|
|
@@ -391,13 +391,13 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
391
391
|
otherList.push(verifiedText);
|
|
392
392
|
}
|
|
393
393
|
if (isValidValue(v.physicsReduce) || isValidValue(v.drugReduce)) {
|
|
394
|
-
const reduceY = cumputedY(type, scaleValue.list, v.physicsReduce
|
|
394
|
+
const reduceY = cumputedY(type, scaleValue.list, (_a2 = v.physicsReduce) != null ? _a2 : v.drugReduce);
|
|
395
395
|
reduceLine = drawLine([...points, points[0], reduceY], {
|
|
396
396
|
...lineAttr,
|
|
397
397
|
...reduceStyle.line,
|
|
398
398
|
...defaultStyle
|
|
399
399
|
});
|
|
400
|
-
reducePoint = drawPoint(((
|
|
400
|
+
reducePoint = drawPoint(((_b = reduceStyle == null ? void 0 : reduceStyle.point) == null ? void 0 : _b.type) || "circle", {
|
|
401
401
|
left: points[0],
|
|
402
402
|
top: reduceY,
|
|
403
403
|
...reduceStyle.point,
|
|
@@ -304,7 +304,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
304
304
|
new fabric.Rect({
|
|
305
305
|
left: iconsWidth,
|
|
306
306
|
top: 0,
|
|
307
|
-
width: canvasWidth - iconsWidth,
|
|
307
|
+
width: canvasWidth - iconsWidth - 1,
|
|
308
308
|
height: canvasHeight - 1,
|
|
309
309
|
fill: "transparent",
|
|
310
310
|
...defaultBorderStyle
|
|
@@ -496,6 +496,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
496
496
|
showCountdown: import("vue").ComputedRef<any>;
|
|
497
497
|
getTotalLen: () => void;
|
|
498
498
|
countdown: (startTime: any) => void;
|
|
499
|
+
/**
|
|
500
|
+
* wacth
|
|
501
|
+
*/
|
|
499
502
|
clearTimer: () => void;
|
|
500
503
|
init: () => void;
|
|
501
504
|
checkType: (val: any) => string;
|
|
@@ -314,7 +314,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
314
314
|
return openBlock(), createElementBlock("div", {
|
|
315
315
|
class: normalizeClass(["c-scale", { "c-scale-nobtn": unref(showSaveBtn) }])
|
|
316
316
|
}, [
|
|
317
|
-
createCommentVNode(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\n </template> '),
|
|
317
|
+
createCommentVNode(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="\u52A0\u8F7D\u4E2D"></n-spin>\r\n </template> '),
|
|
318
318
|
!state.spinning && !state.hasFrontAddress ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
319
319
|
unref(noDataState).noData ? (openBlock(), createBlock(NoData, {
|
|
320
320
|
key: 0,
|
package/es/env.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
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';
|
|
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';
|