matrix_components 2.0.382 → 2.0.385

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.
@@ -0,0 +1,229 @@
1
+ // 全局类型定义文件,用于ESLint校验,放开所有限制
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
8
+
9
+ declare module '*.css' {
10
+ const content: Record<string, string>
11
+ export default content
12
+ }
13
+
14
+ declare module '*.scss' {
15
+ const content: Record<string, string>
16
+ export default content
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const content: Record<string, string>
21
+ export default content
22
+ }
23
+
24
+ declare module '*.json' {
25
+ const content: Record<string, any>
26
+ export default content
27
+ }
28
+
29
+ declare module '*.png' {
30
+ const content: string
31
+ export default content
32
+ }
33
+
34
+ declare module '*.jpg' {
35
+ const content: string
36
+ export default content
37
+ }
38
+
39
+ declare module '*.jpeg' {
40
+ const content: string
41
+ export default content
42
+ }
43
+
44
+ declare module '*.gif' {
45
+ const content: string
46
+ export default content
47
+ }
48
+
49
+ declare module '*.svg' {
50
+ const content: string
51
+ export default content
52
+ }
53
+
54
+ declare module '*.ico' {
55
+ const content: string
56
+ export default content
57
+ }
58
+
59
+ declare module '*.woff' {
60
+ const content: string
61
+ export default content
62
+ }
63
+
64
+ declare module '*.woff2' {
65
+ const content: string
66
+ export default content
67
+ }
68
+
69
+ declare module '*.ttf' {
70
+ const content: string
71
+ export default content
72
+ }
73
+
74
+ declare module '*.eot' {
75
+ const content: string
76
+ export default content
77
+ }
78
+
79
+ declare module '*.wasm' {
80
+ const content: any
81
+ export default content
82
+ }
83
+
84
+ // 引用HTTP请求相关类型定义
85
+ // 注意:这些类型已在 packages/api/types.d.ts 中详细定义
86
+
87
+ // 矩阵组件库类型声明
88
+ declare module 'matrix_components' {
89
+ import type { App } from 'vue'
90
+
91
+ const components: {
92
+ NsVideo: any
93
+ NsExcel: any
94
+ NsPdf: any
95
+ NsWord: any
96
+ NsOffice: any
97
+ NsForm: any
98
+ NsFormTitle: any
99
+ NsSaturationline: any
100
+ NsImage: any
101
+ NsImg: any
102
+ NsMD: any
103
+ }
104
+
105
+ const install: (app: App, params?: any) => void
106
+
107
+ const NsDialog: any
108
+
109
+ const sacle_x: any
110
+ const sacle_y: any
111
+ const autoScaleInit: any
112
+
113
+ const loadAccess: any
114
+ const removeDynamicAccess: any
115
+
116
+ const getEncryptSm2: any
117
+
118
+ /** GET请求函数 */
119
+ const get: <T = any>(
120
+ url: string,
121
+ params?: Record<string, any>,
122
+ base?: string,
123
+ customConfig?: HttpCustomConfig,
124
+ errorCallback?: ErrorCallback
125
+ ) => Promise<T>
126
+
127
+ /** POST请求函数 */
128
+ const post: <T = any>(
129
+ url: string,
130
+ data?: any,
131
+ base?: string,
132
+ customConfig?: HttpCustomConfig,
133
+ errorCallback?: ErrorCallback
134
+ ) => Promise<T>
135
+
136
+ /** PUT请求函数 */
137
+ const put: <T = any>(
138
+ url: string,
139
+ data?: any,
140
+ base?: string,
141
+ customConfig?: HttpCustomConfig,
142
+ errorCallback?: ErrorCallback
143
+ ) => Promise<T>
144
+
145
+ /** DELETE请求函数 */
146
+ const del: <T = any>(
147
+ url: string,
148
+ data?: any,
149
+ base?: string,
150
+ customConfig?: HttpCustomConfig,
151
+ errorCallback?: ErrorCallback
152
+ ) => Promise<T>
153
+
154
+ /** 下载文件函数 */
155
+ const download: (
156
+ url: string,
157
+ filename?: string,
158
+ method?: string,
159
+ data?: any,
160
+ base?: string,
161
+ customConfig?: HttpCustomConfig,
162
+ errorCallback?: ErrorCallback
163
+ ) => Promise<any>
164
+
165
+ /** 下载本地文件函数 */
166
+ const downLoadLocalFile: (
167
+ path: string,
168
+ name: string,
169
+ errorCallback?: ErrorCallback
170
+ ) => void
171
+
172
+ /** 获取Token信息函数 */
173
+ const getTokenInfo: () => Record<string, string>
174
+
175
+ export default {
176
+ install,
177
+ ...components
178
+ }
179
+
180
+ export {
181
+ install,
182
+ components,
183
+ NsDialog,
184
+ sacle_x,
185
+ sacle_y,
186
+ autoScaleInit,
187
+ loadAccess,
188
+ removeDynamicAccess,
189
+ getEncryptSm2,
190
+ post,
191
+ get,
192
+ put,
193
+ del,
194
+ download,
195
+ downLoadLocalFile,
196
+ getTokenInfo,
197
+ NsVideo,
198
+ NsExcel,
199
+ NsPdf,
200
+ NsWord,
201
+ NsOffice,
202
+ NsForm,
203
+ NsFormTitle,
204
+ NsSaturationline,
205
+ NsImage,
206
+ NsImg,
207
+ NsMD
208
+ }
209
+ }
210
+
211
+ // 声明全局变量
212
+ declare global {
213
+ interface Window {
214
+ [key: string]: any
215
+ }
216
+
217
+ interface NodeRequire {
218
+ context: any
219
+ }
220
+
221
+ const process: {
222
+ env: {
223
+ [key: string]: string | undefined
224
+ }
225
+ }
226
+ }
227
+
228
+ // 允许使用任意类型
229
+ declare type AnyType = any
@@ -77352,7 +77352,7 @@ const get = async (url, params, base = "", customConfig = {}, errorCallback = nu
77352
77352
  // 支持timeout等配置
77353
77353
  });
77354
77354
  };
77355
- const post = (url, data = {}, contentType = null, base = "", customConfig = {}, errorCallback = null) => {
77355
+ const post = (url, data = {}, base = "", customConfig = {}, errorCallback = null) => {
77356
77356
  const baseUrl = base || getBaseUrl();
77357
77357
  if (baseUrl.endsWith("/") || url.startsWith("/")) {
77358
77358
  if (baseUrl.endsWith("/") && url.startsWith("/")) {
@@ -77363,6 +77363,7 @@ const post = (url, data = {}, contentType = null, base = "", customConfig = {},
77363
77363
  } else {
77364
77364
  url = baseUrl + "/" + url;
77365
77365
  }
77366
+ const contentType = (customConfig == null ? void 0 : customConfig.contentType) || ContentTypeEnum.JSON;
77366
77367
  return createAxiosInstance(customConfig, errorCallback)({
77367
77368
  url,
77368
77369
  // url: import.meta.env.VITE_BASE_URL + url,
@@ -77370,13 +77371,13 @@ const post = (url, data = {}, contentType = null, base = "", customConfig = {},
77370
77371
  data: contentType == ContentTypeEnum.FORM_URLENCODED ? qs.stringify(data) : data,
77371
77372
  headers: {
77372
77373
  // 如果没有指定 headersType,则默认使用 JSON 类型
77373
- "Content-Type": contentType || ContentTypeEnum.JSON
77374
+ "Content-Type": contentType
77374
77375
  },
77375
77376
  ...customConfig
77376
77377
  // 支持timeout等配置
77377
77378
  });
77378
77379
  };
77379
- const put = (url, data = {}, headersType = null, base = "", customConfig = {}, errorCallback = null) => {
77380
+ const put = (url, data = {}, base = "", customConfig = {}, errorCallback = null) => {
77380
77381
  const baseUrl = base || getBaseUrl();
77381
77382
  if (baseUrl.endsWith("/") || url.startsWith("/")) {
77382
77383
  if (baseUrl.endsWith("/") && url.startsWith("/")) {
@@ -77387,10 +77388,11 @@ const put = (url, data = {}, headersType = null, base = "", customConfig = {}, e
77387
77388
  } else {
77388
77389
  url = baseUrl + "/" + url;
77389
77390
  }
77391
+ const contentType = (customConfig == null ? void 0 : customConfig.contentType) || ContentTypeEnum.JSON;
77390
77392
  return createAxiosInstance(customConfig, errorCallback).put(url, data, {
77391
77393
  headers: {
77392
77394
  // 如果没有指定 headersType,则默认使用 JSON 类型
77393
- "Content-Type": headersType || ContentTypeEnum.JSON
77395
+ "Content-Type": contentType
77394
77396
  },
77395
77397
  ...customConfig
77396
77398
  // 支持timeout等配置