From 66a1da3dd28a6a373fe54649ea403bbb086d7651 Mon Sep 17 00:00:00 2001 From: xingyu <xingyu4j@vip.qq.com> Date: Tue, 19 Sep 2023 10:55:57 +0800 Subject: [PATCH] fix: eslint --- src/components/Drawer/src/BasicDrawer.vue | 12 ++++++++---- .../Form/src/components/ApiTransfer.vue | 6 ++++-- .../VFormDesign/components/FormNodeOperate.vue | 4 ++-- .../VFormDesign/components/JsonModal.vue | 6 +++--- .../VFormDesign/modules/FormComponentPanel.vue | 14 +++++++------- .../src/components/VFormItem/index.vue | 12 ++++++------ .../src/components/VFormPreview/index.vue | 12 ++++++------ src/components/FormDesign/src/utils/index.ts | 2 +- src/components/Page/src/PageWrapper.vue | 6 ++++-- .../header/components/user-dropdown/index.vue | 12 ++++++++---- src/layouts/default/header/index.vue | 18 ++++++++++++------ src/store/modules/multipleTab.ts | 3 ++- src/utils/props.ts | 2 +- 13 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/components/Drawer/src/BasicDrawer.vue b/src/components/Drawer/src/BasicDrawer.vue index 9ff9469..c4f6612 100644 --- a/src/components/Drawer/src/BasicDrawer.vue +++ b/src/components/Drawer/src/BasicDrawer.vue @@ -135,8 +135,10 @@ function handleOk() { <template> <Drawer :root-class-name="prefixCls" v-bind="getBindValues" @close="onClose"> <template v-if="!$slots.title" #title> - <DrawerHeader :title="getMergeProps.title as any" :is-detail="isDetail" :show-detail-back="showDetailBack" - @close="onClose"> + <DrawerHeader + :title="getMergeProps.title as any" :is-detail="isDetail" :show-detail-back="showDetailBack" + @close="onClose" + > <template #titleToolbar> <slot name="titleToolbar" /> </template> @@ -146,8 +148,10 @@ function handleOk() { <slot name="title" /> </template> - <ScrollContainer v-loading="getLoading" :style="getScrollContentStyle" - :loading-tip="loadingText || t('common.loadingText')"> + <ScrollContainer + v-loading="getLoading" :style="getScrollContentStyle" + :loading-tip="loadingText || t('common.loadingText')" + > <slot /> </ScrollContainer> <DrawerFooter v-bind="getProps" :height="getFooterHeight" @close="onClose" @ok="handleOk"> diff --git a/src/components/Form/src/components/ApiTransfer.vue b/src/components/Form/src/components/ApiTransfer.vue index 866819d..e163aaa 100644 --- a/src/components/Form/src/components/ApiTransfer.vue +++ b/src/components/Form/src/components/ApiTransfer.vue @@ -114,7 +114,9 @@ function emitChange() { </script> <template> - <Transfer v-bind="getAttrs" :data-source="getdataSource" :filter-option="filterOption" :render="(item) => item.title" + <Transfer + v-bind="getAttrs" :data-source="getdataSource" :filter-option="filterOption" :render="(item) => item.title" :show-select-all="showSelectAll" :selected-keys="selectedKeys" :target-keys="getTargetKeys" :show-search="showSearch" - @change="handleChange" /> + @change="handleChange" + /> </template> diff --git a/src/components/FormDesign/src/components/VFormDesign/components/FormNodeOperate.vue b/src/components/FormDesign/src/components/VFormDesign/components/FormNodeOperate.vue index 2ef9aaf..4cf5953 100644 --- a/src/components/FormDesign/src/components/VFormDesign/components/FormNodeOperate.vue +++ b/src/components/FormDesign/src/components/VFormDesign/components/FormNodeOperate.vue @@ -24,8 +24,8 @@ const activeClass = computed(() => { return props.schema.key === props.currentItem.key ? 'active' : 'unactivated' }) /** - * 删除当前项 - */ + * 删除当前项 + */ function handleDelete() { const traverse = (schemas: IVFormComponent[]) => { schemas.some((formItem, index) => { diff --git a/src/components/FormDesign/src/components/VFormDesign/components/JsonModal.vue b/src/components/FormDesign/src/components/VFormDesign/components/JsonModal.vue index cda46af..3cf5b05 100644 --- a/src/components/FormDesign/src/components/VFormDesign/components/JsonModal.vue +++ b/src/components/FormDesign/src/components/VFormDesign/components/JsonModal.vue @@ -18,9 +18,9 @@ const state = reactive<{ jsonData: {} as IFormConfig, // json数据 }) /** - * 显示Json数据弹框 - * @param jsonData - */ + * 显示Json数据弹框 + * @param jsonData + */ function showModal(jsonData: IFormConfig) { formatRules(jsonData.schemas) state.jsonData = jsonData diff --git a/src/components/FormDesign/src/components/VFormDesign/modules/FormComponentPanel.vue b/src/components/FormDesign/src/components/VFormDesign/modules/FormComponentPanel.vue index c3cca2c..91652b2 100644 --- a/src/components/FormDesign/src/components/VFormDesign/modules/FormComponentPanel.vue +++ b/src/components/FormDesign/src/components/VFormDesign/modules/FormComponentPanel.vue @@ -23,9 +23,9 @@ export default defineComponent({ const { formConfig } = useFormDesignState() /** - * 拖拽完成事件 - * @param newIndex - */ + * 拖拽完成事件 + * @param newIndex + */ const addItem = ({ newIndex }: any) => { formConfig.value.schemas = formConfig.value.schemas || [] @@ -35,9 +35,9 @@ export default defineComponent({ } /** - * 拖拽开始事件 - * @param e {Object} 事件对象 - */ + * 拖拽开始事件 + * @param e {Object} 事件对象 + */ const handleDragStart = (e: any) => { emit('handleSetSelectItem', formConfig.value.schemas[e.oldIndex]) } @@ -70,7 +70,7 @@ export default defineComponent({ <div class="draggable-box"> <Draggable v-model="formConfig.schemas" - class="ant-row list-main" + class="list-main ant-row" group="form-draggable" :component-data="{ name: 'list', tag: 'div', type: 'transition-group' }" ghost-class="moving" diff --git a/src/components/FormDesign/src/components/VFormItem/index.vue b/src/components/FormDesign/src/components/VFormItem/index.vue index cdccfa5..a02a13d 100644 --- a/src/components/FormDesign/src/components/VFormItem/index.vue +++ b/src/components/FormDesign/src/components/VFormItem/index.vue @@ -61,8 +61,8 @@ const formItemProps = computed(() => { : {} /** - * 将字符串正则格式化成正则表达式 - */ + * 将字符串正则格式化成正则表达式 + */ const newConfig = Object.assign( {}, @@ -97,8 +97,8 @@ function handleClick(schema: IVFormComponent) { emit(schema.componentProps?.handle) } /** - * 处理异步属性,异步属性会导致一些属性渲染错误,如defaultValue异步加载会导致渲染不出来,故而此处只处理options,treeData,同步属性在cmpProps中处理 - */ + * 处理异步属性,异步属性会导致一些属性渲染错误,如defaultValue异步加载会导致渲染不出来,故而此处只处理options,treeData,同步属性在cmpProps中处理 + */ const asyncProps = asyncComputed(async () => { let { options, treeData } = props.schema.componentProps ?? {} if (options) @@ -112,8 +112,8 @@ const asyncProps = asyncComputed(async () => { }) /** - * 处理同步属性 - */ + * 处理同步属性 + */ const cmpProps = computed(() => { const isCheck = props.schema && ['Switch', 'Checkbox', 'Radio'].includes(props.schema.component) diff --git a/src/components/FormDesign/src/components/VFormPreview/index.vue b/src/components/FormDesign/src/components/VFormPreview/index.vue index 2a569ca..afbff85 100644 --- a/src/components/FormDesign/src/components/VFormPreview/index.vue +++ b/src/components/FormDesign/src/components/VFormPreview/index.vue @@ -26,9 +26,9 @@ const state = reactive<{ }) /** - * 显示Json数据弹框 - * @param jsonData - */ + * 显示Json数据弹框 + * @param jsonData + */ function showModal(jsonData: IFormConfig) { // console.log('showModal-', jsonData); formatRules(jsonData.schemas) @@ -37,9 +37,9 @@ function showModal(jsonData: IFormConfig) { } /** - * 获取表单数据 - * @return {Promise<void>} - */ + * 获取表单数据 + * @return {Promise<void>} + */ function handleCancel() { state.open = false onCancel() diff --git a/src/components/FormDesign/src/utils/index.ts b/src/components/FormDesign/src/utils/index.ts index ea3a56a..0af46dc 100644 --- a/src/components/FormDesign/src/utils/index.ts +++ b/src/components/FormDesign/src/utils/index.ts @@ -67,7 +67,7 @@ export function getType(value: any): string { /** * 生成唯一guid - * @returns {String} 唯一id标识符 + * @returns {string} 唯一id标识符 */ export function randomUUID(): string { function S4() { diff --git a/src/components/Page/src/PageWrapper.vue b/src/components/Page/src/PageWrapper.vue index 1c78926..5ca3f2e 100644 --- a/src/components/Page/src/PageWrapper.vue +++ b/src/components/Page/src/PageWrapper.vue @@ -126,8 +126,10 @@ watch( <template> <div ref="wrapperRef" :class="getClass"> - <PageHeader v-if="getShowHeader" v-bind="omit($attrs, 'class')" ref="headerRef" :style="getHeaderStyle" - style="margin: 1rem; border-radius: 1rem;" :ghost="ghost" :title="title"> + <PageHeader + v-if="getShowHeader" v-bind="omit($attrs, 'class')" ref="headerRef" :style="getHeaderStyle" + style="margin: 1rem; border-radius: 1rem;" :ghost="ghost" :title="title" + > <template #default> <template v-if="content"> {{ content }} diff --git a/src/layouts/default/header/components/user-dropdown/index.vue b/src/layouts/default/header/components/user-dropdown/index.vue index b8b7035..3106145 100644 --- a/src/layouts/default/header/components/user-dropdown/index.vue +++ b/src/layouts/default/header/components/user-dropdown/index.vue @@ -94,11 +94,15 @@ function handleMenuClick(e: MenuInfo) { <template #overlay> <Menu @click="handleMenuClick"> <MenuItem key="profile" :text="t('layout.header.accountCenter')" icon="ion:person-outline" /> - <MenuItem v-if="getShowDoc" key="doc" :text="t('layout.header.dropdownItemDoc')" - icon="ion:document-text-outline" /> + <MenuItem + v-if="getShowDoc" key="doc" :text="t('layout.header.dropdownItemDoc')" + icon="ion:document-text-outline" + /> <MenuDivider v-if="getShowDoc" /> - <MenuItem v-if="getUseLockPage" key="lock" :text="t('layout.header.tooltipLock')" - icon="ion:lock-closed-outline" /> + <MenuItem + v-if="getUseLockPage" key="lock" :text="t('layout.header.tooltipLock')" + icon="ion:lock-closed-outline" + /> <MenuItem key="logout" :text="t('layout.header.dropdownItemLoginOut')" icon="ion:power-outline" /> </Menu> </template> diff --git a/src/layouts/default/header/index.vue b/src/layouts/default/header/index.vue index 0816e85..5d09274 100644 --- a/src/layouts/default/header/index.vue +++ b/src/layouts/default/header/index.vue @@ -87,10 +87,14 @@ const getMenuMode = computed(() => { <!-- left start --> <div :class="`${prefixCls}-left`"> <!-- logo --> - <AppLogo v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme" - :style="getLogoWidth" /> - <LayoutTrigger v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile" - :theme="getHeaderTheme" :sider="false" /> + <AppLogo + v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme" + :style="getLogoWidth" + /> + <LayoutTrigger + v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile" + :theme="getHeaderTheme" :sider="false" + /> <LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" /> </div> <!-- left end --> @@ -113,8 +117,10 @@ const getMenuMode = computed(() => { <AppSizePicker :show-text="false" :class="`${prefixCls}-action__item size-item`" /> - <AppLocalePicker v-if="getShowLocalePicker" :reload="true" :show-text="false" - :class="`${prefixCls}-action__item locale-item`" /> + <AppLocalePicker + v-if="getShowLocalePicker" :reload="true" :show-text="false" + :class="`${prefixCls}-action__item locale-item`" + /> <UserDropDown :theme="getHeaderTheme" /> diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index 49a6d2f..152f300 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -336,7 +336,8 @@ export const useMultipleTabStore = defineStore('app-multiple-tab', { }, /** * replace tab's path - * **/ + * * + */ updateTabPath(fullPath: string, route: RouteLocationNormalized) { const findTab = this.getTabList.find(item => item === route) if (findTab) { diff --git a/src/utils/props.ts b/src/utils/props.ts index a5c10a6..64981a8 100644 --- a/src/utils/props.ts +++ b/src/utils/props.ts @@ -64,7 +64,7 @@ export type BuildPropReturn<T, D, R, V, C> = { type: String, values: ['light', 'dark'], } as const) - * @example + * @example // limited options and other types // the type will be PropType<'small' | 'medium' | number> buildProp({