Commit 3c441a05da0fcc2df7677f04cacd9bfc36f2a72d

Authored by Vben
1 parent 26adbc92

style(eslint): fix eslint error

src/components/Application/src/search/AppSearchKeyItem.vue
1 <template> 1 <template>
2 <span :class="$attrs.class"> 2 <span :class="$attrs.class">
3 - <g-icon :icon="icon" /> 3 + <Icon :icon="icon" />
4 </span> 4 </span>
5 </template> 5 </template>
6 <script lang="ts"> 6 <script lang="ts">
7 import { defineComponent } from 'vue'; 7 import { defineComponent } from 'vue';
  8 + import { Icon } from '/@/components/Icon';
8 export default defineComponent({ 9 export default defineComponent({
  10 + components: { Icon },
9 props: { 11 props: {
10 icon: String, 12 icon: String,
11 }, 13 },
src/components/Application/src/search/AppSearchModal.vue
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <div :class="getClass" @click.stop v-if="visible"> 4 <div :class="getClass" @click.stop v-if="visible">
5 <div :class="`${prefixCls}-content`" v-click-outside="handleClose"> 5 <div :class="`${prefixCls}-content`" v-click-outside="handleClose">
6 <div :class="`${prefixCls}-input__wrapper`"> 6 <div :class="`${prefixCls}-input__wrapper`">
7 - <a-input 7 + <Input
8 :class="`${prefixCls}-input`" 8 :class="`${prefixCls}-input`"
9 :placeholder="t('common.searchText')" 9 :placeholder="t('common.searchText')"
10 allow-clear 10 allow-clear
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <!-- <Icon icon="ion:search"/> --> 14 <!-- <Icon icon="ion:search"/> -->
15 <SearchOutlined /> 15 <SearchOutlined />
16 </template> 16 </template>
17 - </a-input> 17 + </Input>
18 <span :class="`${prefixCls}-cancel`" @click="handleClose"> 18 <span :class="`${prefixCls}-cancel`" @click="handleClose">
19 {{ t('common.cancelText') }} 19 {{ t('common.cancelText') }}
20 </span> 20 </span>
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 76
77 export default defineComponent({ 77 export default defineComponent({
78 name: 'AppSearchModal', 78 name: 'AppSearchModal',
79 - components: { Icon, SearchOutlined, AppSearchFooter, [Input.name]: Input }, 79 + components: { Icon, SearchOutlined, AppSearchFooter, Input },
80 directives: { 80 directives: {
81 clickOutside, 81 clickOutside,
82 }, 82 },
src/components/CountDown/src/CountButton.vue
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 name: 'CountButton', 21 name: 'CountButton',
22 components: { Button }, 22 components: { Button },
23 props: { 23 props: {
24 - value: propTypes.string, 24 + value: propTypes.any,
25 count: propTypes.number.def(60), 25 count: propTypes.number.def(60),
26 beforeStartFunc: { 26 beforeStartFunc: {
27 type: Function as PropType<() => boolean>, 27 type: Function as PropType<() => boolean>,
src/components/Cropper/src/index.vue
@@ -57,18 +57,19 @@ @@ -57,18 +57,19 @@
57 default: '360px', 57 default: '360px',
58 }, 58 },
59 crossorigin: { 59 crossorigin: {
60 - type: String, 60 + type: String as PropType<'' | 'anonymous' | 'use-credentials' | undefined>,
61 default: undefined, 61 default: undefined,
62 }, 62 },
63 imageStyle: { 63 imageStyle: {
64 type: Object as PropType<CSSProperties>, 64 type: Object as PropType<CSSProperties>,
65 - default: {}, 65 + default: () => {},
66 }, 66 },
67 options: { 67 options: {
68 type: Object as PropType<Options>, 68 type: Object as PropType<Options>,
69 - default: {}, 69 + default: () => {},
70 }, 70 },
71 }, 71 },
  72 + emits: ['cropperedInfo'],
72 setup(props, ctx) { 73 setup(props, ctx) {
73 const imgElRef = ref<ElRef<HTMLImageElement>>(null); 74 const imgElRef = ref<ElRef<HTMLImageElement>>(null);
74 const cropper: any = ref<Nullable<Cropper>>(null); 75 const cropper: any = ref<Nullable<Cropper>>(null);
@@ -109,17 +110,17 @@ @@ -109,17 +110,17 @@
109 // event: return base64 and width and height information after cropping 110 // event: return base64 and width and height information after cropping
110 const croppered = (): void => { 111 const croppered = (): void => {
111 let imgInfo = cropper.value.getData(); 112 let imgInfo = cropper.value.getData();
112 - cropper.value.getCroppedCanvas().toBlob(blob => {  
113 - let fileReader: FileReader = new FileReader() 113 + cropper.value.getCroppedCanvas().toBlob((blob) => {
  114 + let fileReader: FileReader = new FileReader();
114 fileReader.onloadend = (e: any) => { 115 fileReader.onloadend = (e: any) => {
115 - ctx.emit("cropperedInfo", { 116 + ctx.emit('cropperedInfo', {
116 imgBase64: e.target.result, 117 imgBase64: e.target.result,
117 - imgInfo  
118 - })  
119 - }  
120 - fileReader.readAsDataURL(blob)  
121 - }, 'image/jpeg')  
122 - } 118 + imgInfo,
  119 + });
  120 + };
  121 + fileReader.readAsDataURL(blob);
  122 + }, 'image/jpeg');
  123 + };
123 124
124 onMounted(init); 125 onMounted(init);
125 126
src/components/Form/src/components/FormAction.vue
@@ -67,15 +67,15 @@ @@ -67,15 +67,15 @@
67 showAdvancedButton: propTypes.bool.def(true), 67 showAdvancedButton: propTypes.bool.def(true),
68 resetButtonOptions: { 68 resetButtonOptions: {
69 type: Object as PropType<ButtonOptions>, 69 type: Object as PropType<ButtonOptions>,
70 - default: {}, 70 + default: () => {},
71 }, 71 },
72 submitButtonOptions: { 72 submitButtonOptions: {
73 type: Object as PropType<ButtonOptions>, 73 type: Object as PropType<ButtonOptions>,
74 - default: {}, 74 + default: () => {},
75 }, 75 },
76 actionColOptions: { 76 actionColOptions: {
77 type: Object as PropType<Partial<ColEx>>, 77 type: Object as PropType<Partial<ColEx>>,
78 - default: {}, 78 + default: () => {},
79 }, 79 },
80 actionSpan: propTypes.number.def(6), 80 actionSpan: propTypes.number.def(6),
81 isAdvanced: propTypes.bool, 81 isAdvanced: propTypes.bool,
src/components/Form/src/components/FormItem.vue
@@ -28,15 +28,15 @@ @@ -28,15 +28,15 @@
28 }, 28 },
29 formProps: { 29 formProps: {
30 type: Object as PropType<FormProps>, 30 type: Object as PropType<FormProps>,
31 - default: {}, 31 + default: () => {},
32 }, 32 },
33 allDefaultValues: { 33 allDefaultValues: {
34 type: Object as PropType<Recordable>, 34 type: Object as PropType<Recordable>,
35 - default: {}, 35 + default: () => {},
36 }, 36 },
37 formModel: { 37 formModel: {
38 type: Object as PropType<Recordable>, 38 type: Object as PropType<Recordable>,
39 - default: {}, 39 + default: () => {},
40 }, 40 },
41 setFormModel: { 41 setFormModel: {
42 type: Function as PropType<(key: string, value: any) => void>, 42 type: Function as PropType<(key: string, value: any) => void>,
src/components/SimpleMenu/src/SimpleMenuTag.vue
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 props: { 14 props: {
15 item: { 15 item: {
16 type: Object as PropType<Menu>, 16 type: Object as PropType<Menu>,
17 - default: {}, 17 + default: () => {},
18 }, 18 },
19 dot: propTypes.bool, 19 dot: propTypes.bool,
20 collapseParent: propTypes.bool, 20 collapseParent: propTypes.bool,
src/components/SimpleMenu/src/SimpleSubMenu.vue
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 props: { 64 props: {
65 item: { 65 item: {
66 type: Object as PropType<Menu>, 66 type: Object as PropType<Menu>,
67 - default: {}, 67 + default: () => {},
68 }, 68 },
69 parent: propTypes.bool, 69 parent: propTypes.bool,
70 collapsedShowTitle: propTypes.bool, 70 collapsedShowTitle: propTypes.bool,
src/components/SimpleMenu/src/components/Menu.vue
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 activeName: propTypes.oneOfType([propTypes.string, propTypes.number]), 30 activeName: propTypes.oneOfType([propTypes.string, propTypes.number]),
31 openNames: { 31 openNames: {
32 type: Array as PropType<string[]>, 32 type: Array as PropType<string[]>,
33 - default: [], 33 + default: () => [],
34 }, 34 },
35 accordion: propTypes.bool.def(true), 35 accordion: propTypes.bool.def(true),
36 width: propTypes.string.def('100%'), 36 width: propTypes.string.def('100%'),
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 collapse: propTypes.bool.def(true), 39 collapse: propTypes.bool.def(true),
40 activeSubMenuNames: { 40 activeSubMenuNames: {
41 type: Array as PropType<(string | number)[]>, 41 type: Array as PropType<(string | number)[]>,
42 - default: [], 42 + default: () => [],
43 }, 43 },
44 }, 44 },
45 emits: ['select', 'open-change'], 45 emits: ['select', 'open-change'],
src/components/Table/src/components/HeaderCell.vue
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 props: { 23 props: {
24 column: { 24 column: {
25 type: Object as PropType<BasicColumn>, 25 type: Object as PropType<BasicColumn>,
26 - default: {}, 26 + default: () => {},
27 }, 27 },
28 }, 28 },
29 setup(props) { 29 setup(props) {
src/components/Table/src/components/editable/EditableCell.vue
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 }, 60 },
61 column: { 61 column: {
62 type: Object as PropType<BasicColumn>, 62 type: Object as PropType<BasicColumn>,
63 - default: {}, 63 + default: () => {},
64 }, 64 },
65 index: propTypes.number, 65 index: propTypes.number,
66 }, 66 },
src/components/Table/src/components/settings/index.vue
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 props: { 30 props: {
31 setting: { 31 setting: {
32 type: Object as PropType<TableSetting>, 32 type: Object as PropType<TableSetting>,
33 - default: {}, 33 + default: () => {},
34 }, 34 },
35 }, 35 },
36 setup(props) { 36 setup(props) {
src/layouts/default/setting/components/SelectItem.vue
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 }, 41 },
42 options: { 42 options: {
43 type: Array as PropType<LabelValueOptions>, 43 type: Array as PropType<LabelValueOptions>,
44 - default: [], 44 + default: () => [],
45 }, 45 },
46 }, 46 },
47 setup(props) { 47 setup(props) {
src/locales/useLocale.ts
@@ -34,8 +34,8 @@ export function useLocale() { @@ -34,8 +34,8 @@ export function useLocale() {
34 const getLocale = computed(() => localeStore.getLocale); 34 const getLocale = computed(() => localeStore.getLocale);
35 const getShowLocalePicker = computed(() => localeStore.getShowPicker); 35 const getShowLocalePicker = computed(() => localeStore.getShowPicker);
36 36
37 - const getAntdLocale = computed(() => {  
38 - return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale; 37 + const getAntdLocale = computed((): any => {
  38 + return i18n.global.getLocaleMessage(unref(getLocale))?.antdLocale ?? {};
39 }); 39 });
40 40
41 // Switching the language will change the locale of useI18n 41 // Switching the language will change the locale of useI18n
src/views/demo/comp/cropper/index.vue
1 <template> 1 <template>
2 <PageWrapper title="图片裁剪示例" contentBackground> 2 <PageWrapper title="图片裁剪示例" contentBackground>
3 <div class="cropper-container"> 3 <div class="cropper-container">
4 - <CropperImage ref="refCropper" src="https://fengyuanchen.github.io/cropperjs/images/picture.jpg" @cropperedInfo="cropperedInfo" style="width:40%" /> 4 + <CropperImage
  5 + ref="refCropper"
  6 + src="https://fengyuanchen.github.io/cropperjs/images/picture.jpg"
  7 + @cropperedInfo="cropperedInfo"
  8 + style="width: 40%"
  9 + />
5 <a-button type="primary" @click="onCropper"> 裁剪 </a-button> 10 <a-button type="primary" @click="onCropper"> 裁剪 </a-button>
6 <img :src="cropperImg" class="croppered" v-if="cropperImg" /> 11 <img :src="cropperImg" class="croppered" v-if="cropperImg" />
7 </div> 12 </div>
@@ -20,41 +25,42 @@ @@ -20,41 +25,42 @@
20 }, 25 },
21 setup() { 26 setup() {
22 let vm: any; 27 let vm: any;
23 - let info = ref("");  
24 - let cropperImg = ref(""); 28 + let info = ref('');
  29 + let cropperImg = ref('');
25 30
26 const onCropper = (): void => { 31 const onCropper = (): void => {
27 vm.refs.refCropper.croppered(); 32 vm.refs.refCropper.croppered();
28 - } 33 + };
29 34
30 - onBeforeMount(()=>{ 35 + onBeforeMount(() => {
31 vm = getCurrentInstance(); 36 vm = getCurrentInstance();
32 - }) 37 + });
33 38
34 - function cropperedInfo({ imgBase64, imgInfo }) {  
35 - info.value = imgInfo  
36 - cropperImg.value = imgBase64  
37 - } 39 + function cropperedInfo({ imgBase64, imgInfo }) {
  40 + info.value = imgInfo;
  41 + cropperImg.value = imgBase64;
  42 + }
38 43
39 return { 44 return {
40 img, 45 img,
41 info, 46 info,
42 cropperImg, 47 cropperImg,
43 onCropper, 48 onCropper,
44 - cropperedInfo 49 + cropperedInfo,
45 }; 50 };
46 }, 51 },
47 }); 52 });
48 </script> 53 </script>
49 54
50 <style scoped> 55 <style scoped>
51 -.cropper-container {  
52 - display:flex;  
53 - justify-content: space-around;  
54 - align-items: center;  
55 -}  
56 -.croppered {  
57 - width: 50%;  
58 - height: 100%;  
59 -} 56 + .cropper-container {
  57 + display: flex;
  58 + justify-content: space-around;
  59 + align-items: center;
  60 + }
  61 +
  62 + .croppered {
  63 + width: 50%;
  64 + height: 100%;
  65 + }
60 </style> 66 </style>