refactor: ♻️ eslint 代码规范调整

This commit is contained in:
ray
2024-10-13 10:42:48 +08:00
parent 72eb87d005
commit a4ef6eb696
66 changed files with 376 additions and 376 deletions

View File

@@ -1,6 +1,6 @@
<template>
<component :is="linkType" v-bind="linkProps(to)">
<slot></slot>
<slot />
</component>
</template>

View File

@@ -98,30 +98,30 @@
<!-- 导出 -->
<template v-else-if="item === 'exports'">
<el-button
v-hasPerm="[`${contentConfig.pageName}:export`]"
icon="download"
circle
title="导出"
v-hasPerm="[`${contentConfig.pageName}:export`]"
@click="handleToolbar(item)"
/>
</template>
<!-- 导入 -->
<template v-else-if="item === 'imports'">
<el-button
v-hasPerm="[`${contentConfig.pageName}:import`]"
icon="upload"
circle
title="导入"
v-hasPerm="[`${contentConfig.pageName}:import`]"
@click="handleToolbar(item)"
/>
</template>
<!-- 搜索 -->
<template v-else-if="item === 'search'">
<el-button
v-hasPerm="[`${contentConfig.pageName}:query`]"
icon="search"
circle
title="搜索"
v-hasPerm="[`${contentConfig.pageName}:query`]"
@click="handleToolbar(item)"
/>
</template>
@@ -130,10 +130,10 @@
<template v-else-if="typeof item === 'object'">
<template v-if="item.auth">
<el-button
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
:icon="item.icon"
circle
:title="item.title"
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
@click="handleToolbar(item.name)"
/>
</template>
@@ -332,7 +332,7 @@
:name="col.slotName ?? col.prop"
:prop="col.prop"
v-bind="scope"
></slot>
/>
</template>
</template>
</el-table-column>
@@ -437,9 +437,9 @@
>
<el-form-item label="文件名" prop="files">
<el-upload
class="w-full"
ref="uploadRef"
v-model:file-list="importFormData.files"
class="w-full"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
:drag="true"
:limit="1"

View File

@@ -11,7 +11,7 @@
<el-col v-show="!item.hidden" v-bind="item.col">
<el-form-item :label="item.label" :prop="item.prop">
<!-- Label -->
<template #label v-if="item.tips">
<template v-if="item.tips" #label>
<span>
{{ item.label }}
<el-tooltip
@@ -89,7 +89,7 @@
:prop="item.prop"
:formData="formData"
:attrs="item.attrs"
></slot>
/>
</template>
</el-form-item>
</el-col>

View File

@@ -20,7 +20,7 @@
<el-col v-show="!item.hidden" v-bind="item.col">
<el-form-item :label="item.label" :prop="item.prop">
<!-- Label -->
<template #label v-if="item.tips">
<template v-if="item.tips" #label>
<span>
{{ item.label }}
<el-tooltip
@@ -69,8 +69,8 @@
<!-- switch 开关 -->
<template v-else-if="item.type === 'switch'">
<el-switch
inline-prompt
v-model="formData[item.prop]"
inline-prompt
v-bind="item.attrs"
/>
</template>
@@ -122,7 +122,7 @@
:prop="item.prop"
:formData="formData"
:attrs="item.attrs"
></slot>
/>
</template>
</el-form-item>
</el-col>
@@ -165,7 +165,7 @@
<el-col v-show="!item.hidden" v-bind="item.col">
<el-form-item :label="item.label" :prop="item.prop">
<!-- Label -->
<template #label v-if="item.tips">
<template v-if="item.tips" #label>
<span>
{{ item.label }}
<el-tooltip
@@ -220,8 +220,8 @@
<!-- switch 开关 -->
<template v-else-if="item.type === 'switch'">
<el-switch
inline-prompt
v-model="formData[item.prop]"
inline-prompt
v-bind="item.attrs"
/>
</template>
@@ -273,7 +273,7 @@
:prop="item.prop"
:formData="formData"
:attrs="item.attrs"
></slot>
/>
</template>
</el-form-item>
</el-col>

View File

@@ -1,9 +1,9 @@
<template>
<el-card
shadow="never"
class="mb-[10px]"
v-show="visible"
v-hasPerm="[`${searchConfig.pageName}:query`]"
shadow="never"
class="mb-[10px]"
>
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<template v-for="(item, index) in formItems" :key="item.prop">
@@ -13,7 +13,7 @@
:prop="item.prop"
>
<!-- Label -->
<template #label v-if="item.tips">
<template v-if="item.tips" #label>
<span>
{{ item.label }}
<el-tooltip
@@ -41,8 +41,8 @@
<div class="flex-center">
<el-tag
v-for="tag in inputTagMap[item.prop].data"
class="mr-2"
:key="tag"
class="mr-2"
:closable="true"
v-bind="inputTagMap[item.prop].tagAttrs"
@close="handleCloseTag(item.prop, tag)"

View File

@@ -7,10 +7,10 @@ import type {
TableProps,
ColProps,
} from "element-plus";
import PageContent from "./PageContent.vue";
import PageForm from "./PageForm.vue";
import PageModal from "./PageModal.vue";
import PageSearch from "./PageSearch.vue";
import type PageContent from "./PageContent.vue";
import type PageForm from "./PageForm.vue";
import type PageModal from "./PageModal.vue";
import type PageSearch from "./PageSearch.vue";
export type PageSearchInstance = InstanceType<typeof PageSearch>;
export type PageContentInstance = InstanceType<typeof PageContent>;

View File

@@ -1,6 +1,6 @@
<!-- 复制组件 -->
<template>
<el-button link @click="handleClipboard" :style="style">
<el-button link :style="style" @click="handleClipboard">
<slot>
<el-icon><DocumentCopy color="var(--el-color-primary)" /></el-icon>
</slot>

View File

@@ -3,8 +3,8 @@
<el-popover :visible="popoverVisible" :width="width" placement="bottom-end">
<template #reference>
<el-input
class="reference"
v-model="selectedIcon"
class="reference"
readonly
placeholder="点击选择图标"
@click="popoverVisible = !popoverVisible"

View File

@@ -41,9 +41,9 @@
{{ item.title }}
</li>
</ul>
<div class="search-space" v-else>暂无数据</div>
<div v-else class="search-space">暂无数据</div>
</div>
<template #footer></template>
<template #footer />
</el-dialog>
</div>
</template>

View File

@@ -3,8 +3,8 @@
<el-dropdown class="flex-center wh-full align-middle">
<div class="wh-full">
<el-badge
:offset="[-10, 15]"
v-if="notices.length > 0"
:offset="[-10, 15]"
:value="notices.length"
:max="99"
class="wh-full"
@@ -26,23 +26,23 @@
<el-tab-pane label="通知" name="notice">
<template v-if="notices.length > 0">
<div
class="w400px flex-x-between p-1"
v-for="(item, index) in notices"
:key="index"
class="w400px flex-x-between p-1"
>
<div class="flex-center">
<DictLabel
code="notice_type"
v-model="item.type"
code="notice_type"
size="small"
class="mr-1"
/>
<el-text
type="primary"
@click="readNotice(item.id)"
size="small"
class="w200px cursor-pointer"
truncated
@click="readNotice(item.id)"
>
{{ item.title }}
</el-text>
@@ -78,20 +78,20 @@
<el-tab-pane label="消息" name="message">
<template v-if="messages.length > 0">
<div
class="w400px flex-x-between p-1"
v-for="(item, index) in messages"
:key="index"
class="w400px flex-x-between p-1"
>
<div>
<DictLabel
code="notice_type"
v-model="item.type"
code="notice_type"
size="small"
/>
<el-link
type="primary"
@click="readNotice(item.id)"
class="ml-1"
@click="readNotice(item.id)"
>
{{ item.title }}
</el-link>
@@ -128,20 +128,20 @@
<el-tab-pane label="待办" name="task">
<template v-if="tasks.length > 0">
<div
class="w400px flex-x-between p-1"
v-for="(item, index) in tasks"
:key="index"
class="w400px flex-x-between p-1"
>
<div>
<DictLabel
code="notice_type"
v-model="item.type"
code="notice_type"
size="small"
/>
<el-link
type="primary"
@click="readNotice(item.id)"
class="ml-1"
@click="readNotice(item.id)"
>
{{ item.title }}
</el-link>

View File

@@ -123,7 +123,7 @@
:name="col.slotName ?? col.prop"
:prop="col.prop"
v-bind="scope"
></slot>
/>
</template>
</el-table-column>
</template>

View File

@@ -19,13 +19,13 @@
:limit="props.limit"
>
<el-button
type="primary"
v-if="props.showUploadBtn"
type="primary"
:disabled="fileList.length >= props.limit"
>
{{ props.uploadBtnText }}
</el-button>
<template #tip v-if="props.showTip">
<template v-if="props.showTip" #tip>
<div class="el-upload__tip">
{{ props.tip }}
</div>
@@ -36,8 +36,8 @@
<el-icon><Document /></el-icon>
<span class="el-upload-list__item-file-name">{{ file.name }}</span>
<span
class="el-icon--close"
v-if="props.showDelBtn"
class="el-icon--close"
@click.stop="handleRemove(file)"
>
<el-icon><Close /></el-icon>
@@ -47,13 +47,13 @@
</template>
</el-upload>
<el-progress
v-if="showUploadPercent"
:style="{
display: showUploadPercent ? 'inline-flex' : 'none',
width: '100%',
}"
:percentage="uploadPercent"
:color="customColorMethod"
v-if="showUploadPercent"
/>
</div>
</template>

View File

@@ -39,9 +39,9 @@
<el-image-viewer
v-if="viewVisible"
:zoom-rate="1.2"
@close="closePreview"
:initialIndex="initialIndex"
:url-list="viewFileList"
@close="closePreview"
/>
</template>
<script setup lang="ts">