Commit a248e20013d83c4acf01b45816588cd9cf4b8fbd

Authored by vben
1 parent ed40b333

chore: fix type

src/components/CardList/src/CardList.vue
1 <template> 1 <template>
2 <div class="p-2"> 2 <div class="p-2">
3 - <div class="bg-white mb-2 p-4"> 3 + <div class="p-4 mb-2 bg-white">
4 <BasicForm @register="registerForm" /> 4 <BasicForm @register="registerForm" />
5 </div> 5 </div>
6 {{ sliderProp.width }} 6 {{ sliderProp.width }}
7 - <div class="bg-white p-2"> 7 + <div class="p-2 bg-white">
8 <List 8 <List
9 :grid="{ gutter: 5, xs: 1, sm: 2, md: 4, lg: 4, xl: 6, xxl: grid }" 9 :grid="{ gutter: 5, xs: 1, sm: 2, md: 4, lg: 4, xl: 6, xxl: grid }"
10 :data-source="data" 10 :data-source="data"
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 pageSize.value = pz; 167 pageSize.value = pz;
168 fetch(); 168 fetch();
169 } 169 }
170 - function pageSizeChange(current, size) { 170 + function pageSizeChange(_current, size) {
171 pageSize.value = size; 171 pageSize.value = size;
172 fetch(); 172 fetch();
173 } 173 }
src/components/Form/src/hooks/useFormEvents.ts
@@ -242,7 +242,7 @@ export function useFormEvents({ @@ -242,7 +242,7 @@ export function useFormEvents({
242 const values = await validate(); 242 const values = await validate();
243 const res = handleFormValues(values); 243 const res = handleFormValues(values);
244 emit('submit', res); 244 emit('submit', res);
245 - } catch (error) { 245 + } catch (error: any) {
246 throw new Error(error); 246 throw new Error(error);
247 } 247 }
248 } 248 }
src/components/Table/src/components/editable/EditableCell.vue
@@ -265,7 +265,7 @@ @@ -265,7 +265,7 @@
265 result = await beforeEditSubmit({ 265 result = await beforeEditSubmit({
266 record: pick(record, keys), 266 record: pick(record, keys),
267 index, 267 index,
268 - key, 268 + key: key as string,
269 value, 269 value,
270 }); 270 });
271 } catch (e) { 271 } catch (e) {
src/components/Tree/src/Tree.vue
@@ -408,7 +408,7 @@ @@ -408,7 +408,7 @@
408 <span class={unref(getBindValues)?.blockNode ? `${prefixCls}__content` : ''}> 408 <span class={unref(getBindValues)?.blockNode ? `${prefixCls}__content` : ''}>
409 <span>{title.substr(0, searchIdx)}</span> 409 <span>{title.substr(0, searchIdx)}</span>
410 <span style={highlightStyle}>{searchText}</span> 410 <span style={highlightStyle}>{searchText}</span>
411 - <span>{title.substr(searchIdx + searchText.length)}</span> 411 + <span>{title.substr(searchIdx + (searchText as string).length)}</span>
412 </span> 412 </span>
413 ) : ( 413 ) : (
414 title 414 title
src/hooks/web/useCopyToClipboard.ts
@@ -51,7 +51,7 @@ export function copyTextToClipboard(input: string, { target = document.body }: O @@ -51,7 +51,7 @@ export function copyTextToClipboard(input: string, { target = document.body }: O
51 let isSuccess = false; 51 let isSuccess = false;
52 try { 52 try {
53 isSuccess = document.execCommand('copy'); 53 isSuccess = document.execCommand('copy');
54 - } catch (e) { 54 + } catch (e: any) {
55 throw new Error(e); 55 throw new Error(e);
56 } 56 }
57 57
src/layouts/default/setting/components/SettingFooter.vue
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 updateColorWeak(colorWeak); 65 updateColorWeak(colorWeak);
66 updateGrayMode(grayMode); 66 updateGrayMode(grayMode);
67 createMessage.success(t('layout.setting.resetSuccess')); 67 createMessage.success(t('layout.setting.resetSuccess'));
68 - } catch (error) { 68 + } catch (error: any) {
69 createMessage.error(error); 69 createMessage.error(error);
70 } 70 }
71 } 71 }
src/utils/file/download.ts
@@ -36,22 +36,19 @@ export function downloadByBase64(buf: string, filename: string, mime?: string, b @@ -36,22 +36,19 @@ export function downloadByBase64(buf: string, filename: string, mime?: string, b
36 export function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart) { 36 export function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart) {
37 const blobData = typeof bom !== 'undefined' ? [bom, data] : [data]; 37 const blobData = typeof bom !== 'undefined' ? [bom, data] : [data];
38 const blob = new Blob(blobData, { type: mime || 'application/octet-stream' }); 38 const blob = new Blob(blobData, { type: mime || 'application/octet-stream' });
39 - if (typeof window.navigator.msSaveBlob !== 'undefined') {  
40 - window.navigator.msSaveBlob(blob, filename);  
41 - } else {  
42 - const blobURL = window.URL.createObjectURL(blob);  
43 - const tempLink = document.createElement('a');  
44 - tempLink.style.display = 'none';  
45 - tempLink.href = blobURL;  
46 - tempLink.setAttribute('download', filename);  
47 - if (typeof tempLink.download === 'undefined') {  
48 - tempLink.setAttribute('target', '_blank');  
49 - }  
50 - document.body.appendChild(tempLink);  
51 - tempLink.click();  
52 - document.body.removeChild(tempLink);  
53 - window.URL.revokeObjectURL(blobURL); 39 +
  40 + const blobURL = window.URL.createObjectURL(blob);
  41 + const tempLink = document.createElement('a');
  42 + tempLink.style.display = 'none';
  43 + tempLink.href = blobURL;
  44 + tempLink.setAttribute('download', filename);
  45 + if (typeof tempLink.download === 'undefined') {
  46 + tempLink.setAttribute('target', '_blank');
54 } 47 }
  48 + document.body.appendChild(tempLink);
  49 + tempLink.click();
  50 + document.body.removeChild(tempLink);
  51 + window.URL.revokeObjectURL(blobURL);
55 } 52 }
56 53
57 /** 54 /**
src/utils/http/axios/Axios.ts
@@ -81,6 +81,7 @@ export class VAxios { @@ -81,6 +81,7 @@ export class VAxios {
81 this.axiosInstance.interceptors.request.use((config: AxiosRequestConfig) => { 81 this.axiosInstance.interceptors.request.use((config: AxiosRequestConfig) => {
82 // If cancel repeat request is turned on, then cancel repeat request is prohibited 82 // If cancel repeat request is turned on, then cancel repeat request is prohibited
83 const { 83 const {
  84 + // @ts-ignore
84 headers: { ignoreCancelToken }, 85 headers: { ignoreCancelToken },
85 } = config; 86 } = config;
86 87
@@ -149,6 +150,7 @@ export class VAxios { @@ -149,6 +150,7 @@ export class VAxios {
149 data: formData, 150 data: formData,
150 headers: { 151 headers: {
151 'Content-type': ContentTypeEnum.FORM_DATA, 152 'Content-type': ContentTypeEnum.FORM_DATA,
  153 + // @ts-ignore
152 ignoreCancelToken: true, 154 ignoreCancelToken: true,
153 }, 155 },
154 }); 156 });
src/utils/http/axios/helper.ts
@@ -35,7 +35,7 @@ export function formatRequestDate(params: Recordable) { @@ -35,7 +35,7 @@ export function formatRequestDate(params: Recordable) {
35 if (value) { 35 if (value) {
36 try { 36 try {
37 params[key] = isString(value) ? value.trim() : value; 37 params[key] = isString(value) ? value.trim() : value;
38 - } catch (error) { 38 + } catch (error: any) {
39 throw new Error(error); 39 throw new Error(error);
40 } 40 }
41 } 41 }