fix: eslint

pull/35/head
xingyu 2023-09-19 10:55:57 +08:00
parent 4730da70a1
commit 66a1da3dd2
13 changed files with 64 additions and 45 deletions

View File

@ -135,8 +135,10 @@ function handleOk() {
<template> <template>
<Drawer :root-class-name="prefixCls" v-bind="getBindValues" @close="onClose"> <Drawer :root-class-name="prefixCls" v-bind="getBindValues" @close="onClose">
<template v-if="!$slots.title" #title> <template v-if="!$slots.title" #title>
<DrawerHeader :title="getMergeProps.title as any" :is-detail="isDetail" :show-detail-back="showDetailBack" <DrawerHeader
@close="onClose"> :title="getMergeProps.title as any" :is-detail="isDetail" :show-detail-back="showDetailBack"
@close="onClose"
>
<template #titleToolbar> <template #titleToolbar>
<slot name="titleToolbar" /> <slot name="titleToolbar" />
</template> </template>
@ -146,8 +148,10 @@ function handleOk() {
<slot name="title" /> <slot name="title" />
</template> </template>
<ScrollContainer v-loading="getLoading" :style="getScrollContentStyle" <ScrollContainer
:loading-tip="loadingText || t('common.loadingText')"> v-loading="getLoading" :style="getScrollContentStyle"
:loading-tip="loadingText || t('common.loadingText')"
>
<slot /> <slot />
</ScrollContainer> </ScrollContainer>
<DrawerFooter v-bind="getProps" :height="getFooterHeight" @close="onClose" @ok="handleOk"> <DrawerFooter v-bind="getProps" :height="getFooterHeight" @close="onClose" @ok="handleOk">

View File

@ -114,7 +114,9 @@ function emitChange() {
</script> </script>
<template> <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" :show-select-all="showSelectAll" :selected-keys="selectedKeys" :target-keys="getTargetKeys" :show-search="showSearch"
@change="handleChange" /> @change="handleChange"
/>
</template> </template>

View File

@ -24,8 +24,8 @@ const activeClass = computed(() => {
return props.schema.key === props.currentItem.key ? 'active' : 'unactivated' return props.schema.key === props.currentItem.key ? 'active' : 'unactivated'
}) })
/** /**
* 删除当前项 * 删除当前项
*/ */
function handleDelete() { function handleDelete() {
const traverse = (schemas: IVFormComponent[]) => { const traverse = (schemas: IVFormComponent[]) => {
schemas.some((formItem, index) => { schemas.some((formItem, index) => {

View File

@ -18,9 +18,9 @@ const state = reactive<{
jsonData: {} as IFormConfig, // json jsonData: {} as IFormConfig, // json
}) })
/** /**
* 显示Json数据弹框 * 显示Json数据弹框
* @param jsonData * @param jsonData
*/ */
function showModal(jsonData: IFormConfig) { function showModal(jsonData: IFormConfig) {
formatRules(jsonData.schemas) formatRules(jsonData.schemas)
state.jsonData = jsonData state.jsonData = jsonData

View File

@ -23,9 +23,9 @@ export default defineComponent({
const { formConfig } = useFormDesignState() const { formConfig } = useFormDesignState()
/** /**
* 拖拽完成事件 * 拖拽完成事件
* @param newIndex * @param newIndex
*/ */
const addItem = ({ newIndex }: any) => { const addItem = ({ newIndex }: any) => {
formConfig.value.schemas = formConfig.value.schemas || [] formConfig.value.schemas = formConfig.value.schemas || []
@ -35,9 +35,9 @@ export default defineComponent({
} }
/** /**
* 拖拽开始事件 * 拖拽开始事件
* @param e {Object} 事件对象 * @param e {Object} 事件对象
*/ */
const handleDragStart = (e: any) => { const handleDragStart = (e: any) => {
emit('handleSetSelectItem', formConfig.value.schemas[e.oldIndex]) emit('handleSetSelectItem', formConfig.value.schemas[e.oldIndex])
} }
@ -70,7 +70,7 @@ export default defineComponent({
<div class="draggable-box"> <div class="draggable-box">
<Draggable <Draggable
v-model="formConfig.schemas" v-model="formConfig.schemas"
class="ant-row list-main" class="list-main ant-row"
group="form-draggable" group="form-draggable"
:component-data="{ name: 'list', tag: 'div', type: 'transition-group' }" :component-data="{ name: 'list', tag: 'div', type: 'transition-group' }"
ghost-class="moving" ghost-class="moving"

View File

@ -61,8 +61,8 @@ const formItemProps = computed(() => {
: {} : {}
/** /**
* 将字符串正则格式化成正则表达式 * 将字符串正则格式化成正则表达式
*/ */
const newConfig = Object.assign( const newConfig = Object.assign(
{}, {},
@ -97,8 +97,8 @@ function handleClick(schema: IVFormComponent) {
emit(schema.componentProps?.handle) emit(schema.componentProps?.handle)
} }
/** /**
* 处理异步属性异步属性会导致一些属性渲染错误如defaultValue异步加载会导致渲染不出来故而此处只处理optionstreeData同步属性在cmpProps中处理 * 处理异步属性异步属性会导致一些属性渲染错误如defaultValue异步加载会导致渲染不出来故而此处只处理optionstreeData同步属性在cmpProps中处理
*/ */
const asyncProps = asyncComputed(async () => { const asyncProps = asyncComputed(async () => {
let { options, treeData } = props.schema.componentProps ?? {} let { options, treeData } = props.schema.componentProps ?? {}
if (options) if (options)
@ -112,8 +112,8 @@ const asyncProps = asyncComputed(async () => {
}) })
/** /**
* 处理同步属性 * 处理同步属性
*/ */
const cmpProps = computed(() => { const cmpProps = computed(() => {
const isCheck const isCheck
= props.schema && ['Switch', 'Checkbox', 'Radio'].includes(props.schema.component) = props.schema && ['Switch', 'Checkbox', 'Radio'].includes(props.schema.component)

View File

@ -26,9 +26,9 @@ const state = reactive<{
}) })
/** /**
* 显示Json数据弹框 * 显示Json数据弹框
* @param jsonData * @param jsonData
*/ */
function showModal(jsonData: IFormConfig) { function showModal(jsonData: IFormConfig) {
// console.log('showModal-', jsonData); // console.log('showModal-', jsonData);
formatRules(jsonData.schemas) formatRules(jsonData.schemas)
@ -37,9 +37,9 @@ function showModal(jsonData: IFormConfig) {
} }
/** /**
* 获取表单数据 * 获取表单数据
* @return {Promise<void>} * @return {Promise<void>}
*/ */
function handleCancel() { function handleCancel() {
state.open = false state.open = false
onCancel() onCancel()

View File

@ -67,7 +67,7 @@ export function getType(value: any): string {
/** /**
* guid * guid
* @returns {String} id * @returns {string} id
*/ */
export function randomUUID(): string { export function randomUUID(): string {
function S4() { function S4() {

View File

@ -126,8 +126,10 @@ watch(
<template> <template>
<div ref="wrapperRef" :class="getClass"> <div ref="wrapperRef" :class="getClass">
<PageHeader v-if="getShowHeader" v-bind="omit($attrs, 'class')" ref="headerRef" :style="getHeaderStyle" <PageHeader
style="margin: 1rem; border-radius: 1rem;" :ghost="ghost" :title="title"> 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 #default>
<template v-if="content"> <template v-if="content">
{{ content }} {{ content }}

View File

@ -94,11 +94,15 @@ function handleMenuClick(e: MenuInfo) {
<template #overlay> <template #overlay>
<Menu @click="handleMenuClick"> <Menu @click="handleMenuClick">
<MenuItem key="profile" :text="t('layout.header.accountCenter')" icon="ion:person-outline" /> <MenuItem key="profile" :text="t('layout.header.accountCenter')" icon="ion:person-outline" />
<MenuItem v-if="getShowDoc" key="doc" :text="t('layout.header.dropdownItemDoc')" <MenuItem
icon="ion:document-text-outline" /> v-if="getShowDoc" key="doc" :text="t('layout.header.dropdownItemDoc')"
icon="ion:document-text-outline"
/>
<MenuDivider v-if="getShowDoc" /> <MenuDivider v-if="getShowDoc" />
<MenuItem v-if="getUseLockPage" key="lock" :text="t('layout.header.tooltipLock')" <MenuItem
icon="ion:lock-closed-outline" /> 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" /> <MenuItem key="logout" :text="t('layout.header.dropdownItemLoginOut')" icon="ion:power-outline" />
</Menu> </Menu>
</template> </template>

View File

@ -87,10 +87,14 @@ const getMenuMode = computed(() => {
<!-- left start --> <!-- left start -->
<div :class="`${prefixCls}-left`"> <div :class="`${prefixCls}-left`">
<!-- logo --> <!-- logo -->
<AppLogo v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme" <AppLogo
:style="getLogoWidth" /> v-if="getShowHeaderLogo || getIsMobile" :class="`${prefixCls}-logo`" :theme="getHeaderTheme"
<LayoutTrigger v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile" :style="getLogoWidth"
:theme="getHeaderTheme" :sider="false" /> />
<LayoutTrigger
v-if="(getShowContent && getShowHeaderTrigger && !getSplit && !getIsMixSidebar) || getIsMobile"
:theme="getHeaderTheme" :sider="false"
/>
<LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" /> <LayoutBreadcrumb v-if="getShowContent && getShowBread" :theme="getHeaderTheme" />
</div> </div>
<!-- left end --> <!-- left end -->
@ -113,8 +117,10 @@ const getMenuMode = computed(() => {
<AppSizePicker :show-text="false" :class="`${prefixCls}-action__item size-item`" /> <AppSizePicker :show-text="false" :class="`${prefixCls}-action__item size-item`" />
<AppLocalePicker v-if="getShowLocalePicker" :reload="true" :show-text="false" <AppLocalePicker
:class="`${prefixCls}-action__item locale-item`" /> v-if="getShowLocalePicker" :reload="true" :show-text="false"
:class="`${prefixCls}-action__item locale-item`"
/>
<UserDropDown :theme="getHeaderTheme" /> <UserDropDown :theme="getHeaderTheme" />

View File

@ -336,7 +336,8 @@ export const useMultipleTabStore = defineStore('app-multiple-tab', {
}, },
/** /**
* replace tab's path * replace tab's path
* **/ * *
*/
updateTabPath(fullPath: string, route: RouteLocationNormalized) { updateTabPath(fullPath: string, route: RouteLocationNormalized) {
const findTab = this.getTabList.find(item => item === route) const findTab = this.getTabList.find(item => item === route)
if (findTab) { if (findTab) {

View File

@ -64,7 +64,7 @@ export type BuildPropReturn<T, D, R, V, C> = {
type: String, type: String,
values: ['light', 'dark'], values: ['light', 'dark'],
} as const) } as const)
* @example * @example
// limited options and other types // limited options and other types
// the type will be PropType<'small' | 'medium' | number> // the type will be PropType<'small' | 'medium' | number>
buildProp({ buildProp({