Commit a248e20013d83c4acf01b45816588cd9cf4b8fbd

Authored by vben
1 parent ed40b333

chore: fix type

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