chore: pnpm eslint . --fix
This commit is contained in:
parent
28ed4c0977
commit
d47428ccc7
@ -22,6 +22,7 @@ export default antfu(
|
|||||||
rules: {
|
rules: {
|
||||||
// vue
|
// vue
|
||||||
"vue/block-order": ["error", { order: ["script", "template", "style"] }],
|
"vue/block-order": ["error", { order: ["script", "template", "style"] }],
|
||||||
|
"vue/attributes-order": "off",
|
||||||
// ts
|
// ts
|
||||||
"ts/no-use-before-define": "off",
|
"ts/no-use-before-define": "off",
|
||||||
// node
|
// node
|
||||||
|
@ -10,7 +10,7 @@ const props = defineProps<Props>()
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-empty v-if="props.list.length === 0" />
|
<el-empty v-if="props.list.length === 0" />
|
||||||
<el-card v-for="(item, index) in props.list" v-else :key="index" shadow="never" class="card-container">
|
<el-card v-else v-for="(item, index) in props.list" :key="index" shadow="never" class="card-container">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { ElScrollbar } from "element-plus"
|
||||||
import type { RouteRecordName, RouteRecordRaw } from "vue-router"
|
import type { RouteRecordName, RouteRecordRaw } from "vue-router"
|
||||||
import { useDevice } from "@/hooks/useDevice"
|
import { useDevice } from "@/hooks/useDevice"
|
||||||
import { usePermissionStore } from "@/store/modules/permission"
|
import { usePermissionStore } from "@/store/modules/permission"
|
||||||
import { isExternal } from "@/utils/validate"
|
import { isExternal } from "@/utils/validate"
|
||||||
import { ElMessage, ElScrollbar } from "element-plus"
|
import { ElMessage } from "element-plus"
|
||||||
import { cloneDeep, debounce } from "lodash-es"
|
import { cloneDeep, debounce } from "lodash-es"
|
||||||
import { computed, ref, shallowRef } from "vue"
|
import { computed, ref, shallowRef } from "vue"
|
||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
@ -171,7 +172,7 @@ function handleReleaseUpOrDown() {
|
|||||||
<el-empty v-if="resultList.length === 0" description="暂无搜索结果" :image-size="100" />
|
<el-empty v-if="resultList.length === 0" description="暂无搜索结果" :image-size="100" />
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<p>搜索结果</p>
|
<p>搜索结果</p>
|
||||||
<ElScrollbar ref="scrollbarRef" max-height="40vh" always>
|
<el-scrollbar ref="scrollbarRef" max-height="40vh" always>
|
||||||
<SearchResult
|
<SearchResult
|
||||||
ref="searchResultRef"
|
ref="searchResultRef"
|
||||||
v-model="activeRouteName"
|
v-model="activeRouteName"
|
||||||
@ -179,7 +180,7 @@ function handleReleaseUpOrDown() {
|
|||||||
:is-press-up-or-down="isPressUpOrDown"
|
:is-press-up-or-down="isPressUpOrDown"
|
||||||
@click="handleEnter"
|
@click="handleEnter"
|
||||||
/>
|
/>
|
||||||
</ElScrollbar>
|
</el-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<SearchFooter :total="resultList.length" />
|
<SearchFooter :total="resultList.length" />
|
||||||
|
@ -74,7 +74,7 @@ defineExpose({ getScrollTop })
|
|||||||
@mouseenter="handleMouseenter(item)"
|
@mouseenter="handleMouseenter(item)"
|
||||||
>
|
>
|
||||||
<SvgIcon v-if="item.meta?.svgIcon" :name="item.meta.svgIcon" />
|
<SvgIcon v-if="item.meta?.svgIcon" :name="item.meta.svgIcon" />
|
||||||
<component :is="item.meta.elIcon" v-else-if="item.meta?.elIcon" class="el-icon" />
|
<component v-else-if="item.meta?.elIcon" :is="item.meta.elIcon" class="el-icon" />
|
||||||
<span class="result-item-title">
|
<span class="result-item-title">
|
||||||
{{ item.meta?.title }}
|
{{ item.meta?.title }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { ElLoading, type LoadingOptions } from "element-plus"
|
import type { LoadingOptions } from "element-plus"
|
||||||
|
import { ElLoading } from "element-plus"
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
lock: true,
|
lock: true,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import type { Ref } from "vue"
|
||||||
import { debounce } from "lodash-es"
|
import { debounce } from "lodash-es"
|
||||||
import { onBeforeUnmount, type Ref, ref } from "vue"
|
import { onBeforeUnmount, ref } from "vue"
|
||||||
|
|
||||||
interface Observer {
|
interface Observer {
|
||||||
watermarkElMutationObserver?: MutationObserver
|
watermarkElMutationObserver?: MutationObserver
|
||||||
|
@ -58,7 +58,7 @@ function resolvePath(routePath: string) {
|
|||||||
<SidebarItemLink v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
|
<SidebarItemLink v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
|
||||||
<el-menu-item :index="resolvePath(theOnlyOneChild.path)">
|
<el-menu-item :index="resolvePath(theOnlyOneChild.path)">
|
||||||
<SvgIcon v-if="theOnlyOneChild.meta.svgIcon" :name="theOnlyOneChild.meta.svgIcon" />
|
<SvgIcon v-if="theOnlyOneChild.meta.svgIcon" :name="theOnlyOneChild.meta.svgIcon" />
|
||||||
<component :is="theOnlyOneChild.meta.elIcon" v-else-if="theOnlyOneChild.meta.elIcon" class="el-icon" />
|
<component v-else-if="theOnlyOneChild.meta.elIcon" :is="theOnlyOneChild.meta.elIcon" class="el-icon" />
|
||||||
<template v-if="theOnlyOneChild.meta.title" #title>
|
<template v-if="theOnlyOneChild.meta.title" #title>
|
||||||
{{ theOnlyOneChild.meta.title }}
|
{{ theOnlyOneChild.meta.title }}
|
||||||
</template>
|
</template>
|
||||||
@ -68,7 +68,7 @@ function resolvePath(routePath: string) {
|
|||||||
<el-sub-menu v-else :index="resolvePath(props.item.path)" teleported>
|
<el-sub-menu v-else :index="resolvePath(props.item.path)" teleported>
|
||||||
<template #title>
|
<template #title>
|
||||||
<SvgIcon v-if="props.item.meta?.svgIcon" :name="props.item.meta.svgIcon" />
|
<SvgIcon v-if="props.item.meta?.svgIcon" :name="props.item.meta.svgIcon" />
|
||||||
<component :is="props.item.meta.elIcon" v-else-if="props.item.meta?.elIcon" class="el-icon" />
|
<component v-else-if="props.item.meta?.elIcon" :is="props.item.meta.elIcon" class="el-icon" />
|
||||||
<span v-if="props.item.meta?.title">{{ props.item.meta.title }}</span>
|
<span v-if="props.item.meta?.title">{{ props.item.meta.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="props.item.children">
|
<template v-if="props.item.children">
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { ElScrollbar } from "element-plus"
|
||||||
import type { RouterLink } from "vue-router"
|
import type { RouterLink } from "vue-router"
|
||||||
import Screenfull from "@/components/Screenfull/index.vue"
|
import Screenfull from "@/components/Screenfull/index.vue"
|
||||||
import { useRouteListener } from "@/hooks/useRouteListener"
|
import { useRouteListener } from "@/hooks/useRouteListener"
|
||||||
import { useSettingsStore } from "@/store/modules/settings"
|
import { useSettingsStore } from "@/store/modules/settings"
|
||||||
import { ArrowLeft, ArrowRight } from "@element-plus/icons-vue"
|
import { ArrowLeft, ArrowRight } from "@element-plus/icons-vue"
|
||||||
import { ElScrollbar } from "element-plus"
|
|
||||||
import { nextTick, ref } from "vue"
|
import { nextTick, ref } from "vue"
|
||||||
import { useRoute } from "vue-router"
|
import { useRoute } from "vue-router"
|
||||||
|
|
||||||
@ -107,11 +107,11 @@ listenerRouteChange(() => {
|
|||||||
<el-icon class="arrow left" @click="scrollTo('left')">
|
<el-icon class="arrow left" @click="scrollTo('left')">
|
||||||
<ArrowLeft />
|
<ArrowLeft />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<ElScrollbar ref="scrollbarRef" @wheel.passive="wheelScroll" @scroll="scroll">
|
<el-scrollbar ref="scrollbarRef" @wheel.passive="wheelScroll" @scroll="scroll">
|
||||||
<div ref="scrollbarContentRef" class="scrollbar-content">
|
<div ref="scrollbarContentRef" class="scrollbar-content">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</ElScrollbar>
|
</el-scrollbar>
|
||||||
<el-icon class="arrow right" @click="scrollTo('right')">
|
<el-icon class="arrow right" @click="scrollTo('right')">
|
||||||
<ArrowRight />
|
<ArrowRight />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { TagView } from "@/store/modules/tags-view"
|
import type { TagView } from "@/store/modules/tags-view"
|
||||||
import type { RouteLocationNormalizedLoaded, RouteRecordRaw } from "vue-router"
|
import type { RouteLocationNormalizedLoaded, RouteRecordRaw, RouterLink } from "vue-router"
|
||||||
import { useRouteListener } from "@/hooks/useRouteListener"
|
import { useRouteListener } from "@/hooks/useRouteListener"
|
||||||
import { usePermissionStore } from "@/store/modules/permission"
|
import { usePermissionStore } from "@/store/modules/permission"
|
||||||
import { useTagsViewStore } from "@/store/modules/tags-view"
|
import { useTagsViewStore } from "@/store/modules/tags-view"
|
||||||
import { Close } from "@element-plus/icons-vue"
|
import { Close } from "@element-plus/icons-vue"
|
||||||
import path from "path-browserify"
|
import path from "path-browserify"
|
||||||
import { ref, watch } from "vue"
|
import { ref, watch } from "vue"
|
||||||
import { RouterLink, useRoute, useRouter } from "vue-router"
|
import { useRoute, useRouter } from "vue-router"
|
||||||
import ScrollPane from "./ScrollPane.vue"
|
import ScrollPane from "./ScrollPane.vue"
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -163,10 +163,10 @@ listenerRouteChange((route) => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="tags-view-container">
|
<div class="tags-view-container">
|
||||||
<ScrollPane class="tags-view-wrapper" :tag-refs="tagRefs">
|
<ScrollPane class="tags-view-wrapper" :tag-refs="tagRefs">
|
||||||
<RouterLink
|
<router-link
|
||||||
v-for="tag in tagsViewStore.visitedViews"
|
v-for="tag in tagsViewStore.visitedViews"
|
||||||
ref="tagRefs"
|
|
||||||
:key="tag.path"
|
:key="tag.path"
|
||||||
|
ref="tagRefs"
|
||||||
:class="{ active: isActive(tag) }"
|
:class="{ active: isActive(tag) }"
|
||||||
class="tags-view-item"
|
class="tags-view-item"
|
||||||
:to="{ path: tag.path, query: tag.query }"
|
:to="{ path: tag.path, query: tag.query }"
|
||||||
@ -177,7 +177,7 @@ listenerRouteChange((route) => {
|
|||||||
<el-icon v-if="!isAffix(tag)" :size="12" @click.prevent.stop="closeSelectedTag(tag)">
|
<el-icon v-if="!isAffix(tag)" :size="12" @click.prevent.stop="closeSelectedTag(tag)">
|
||||||
<Close />
|
<Close />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</RouterLink>
|
</router-link>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
<ul v-show="visible" class="contextmenu" :style="{ left: `${left}px`, top: `${top}px` }">
|
<ul v-show="visible" class="contextmenu" :style="{ left: `${left}px`, top: `${top}px` }">
|
||||||
<li @click="refreshSelectedTag(selectedTag)">
|
<li @click="refreshSelectedTag(selectedTag)">
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
|
import type { Router, RouteRecordNormalized, RouteRecordRaw } from "vue-router"
|
||||||
import { cloneDeep, omit } from "lodash-es"
|
import { cloneDeep, omit } from "lodash-es"
|
||||||
import {
|
import { createRouter, createWebHashHistory, createWebHistory } from "vue-router"
|
||||||
createRouter,
|
|
||||||
createWebHashHistory,
|
|
||||||
createWebHistory,
|
|
||||||
type Router,
|
|
||||||
type RouteRecordNormalized,
|
|
||||||
type RouteRecordRaw
|
|
||||||
} from "vue-router"
|
|
||||||
|
|
||||||
/** 路由模式 */
|
/** 路由模式 */
|
||||||
export const history
|
export const history = import.meta.env.VITE_ROUTER_HISTORY === "hash"
|
||||||
= import.meta.env.VITE_ROUTER_HISTORY === "hash"
|
|
||||||
? createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH)
|
? createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH)
|
||||||
: createWebHistory(import.meta.env.VITE_PUBLIC_PATH)
|
: createWebHistory(import.meta.env.VITE_PUBLIC_PATH)
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import type { RouteRecordRaw } from "vue-router"
|
||||||
import routeSettings from "@/config/route"
|
import routeSettings from "@/config/route"
|
||||||
import { createRouter, type RouteRecordRaw } from "vue-router"
|
import { createRouter } from "vue-router"
|
||||||
import { flatMultiLevelRoutes, history } from "./helper"
|
import { flatMultiLevelRoutes, history } from "./helper"
|
||||||
|
|
||||||
const Layouts = () => import("@/layouts/index.vue")
|
const Layouts = () => import("@/layouts/index.vue")
|
||||||
|
@ -34,23 +34,20 @@ export const useTagsViewStore = defineStore("tags-view", () => {
|
|||||||
const addCachedView = (view: TagView) => {
|
const addCachedView = (view: TagView) => {
|
||||||
if (typeof view.name !== "string") return
|
if (typeof view.name !== "string") return
|
||||||
if (cachedViews.value.includes(view.name)) return
|
if (cachedViews.value.includes(view.name)) return
|
||||||
if (view.meta?.keepAlive)
|
if (view.meta?.keepAlive) cachedViews.value.push(view.name)
|
||||||
cachedViews.value.push(view.name)
|
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region del
|
// #region del
|
||||||
const delVisitedView = (view: TagView) => {
|
const delVisitedView = (view: TagView) => {
|
||||||
const index = visitedViews.value.findIndex(v => v.path === view.path)
|
const index = visitedViews.value.findIndex(v => v.path === view.path)
|
||||||
if (index !== -1)
|
if (index !== -1) visitedViews.value.splice(index, 1)
|
||||||
visitedViews.value.splice(index, 1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const delCachedView = (view: TagView) => {
|
const delCachedView = (view: TagView) => {
|
||||||
if (typeof view.name !== "string") return
|
if (typeof view.name !== "string") return
|
||||||
const index = cachedViews.value.indexOf(view.name)
|
const index = cachedViews.value.indexOf(view.name)
|
||||||
if (index !== -1)
|
if (index !== -1) cachedViews.value.splice(index, 1)
|
||||||
cachedViews.value.splice(index, 1)
|
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import type { AxiosInstance, AxiosRequestConfig } from "axios"
|
||||||
import { useUserStore } from "@/store/modules/user"
|
import { useUserStore } from "@/store/modules/user"
|
||||||
import axios, { type AxiosInstance, type AxiosRequestConfig } from "axios"
|
import axios from "axios"
|
||||||
import { ElMessage } from "element-plus"
|
import { ElMessage } from "element-plus"
|
||||||
import { get, merge } from "lodash-es"
|
import { get, merge } from "lodash-es"
|
||||||
import { getToken } from "./cache/cookies"
|
import { getToken } from "./cache/cookies"
|
||||||
@ -27,8 +28,7 @@ function createService() {
|
|||||||
const apiData = response.data
|
const apiData = response.data
|
||||||
// 二进制数据则直接返回
|
// 二进制数据则直接返回
|
||||||
const responseType = response.request?.responseType
|
const responseType = response.request?.responseType
|
||||||
if (responseType === "blob" || responseType === "arraybuffer")
|
if (responseType === "blob" || responseType === "arraybuffer") return apiData
|
||||||
return apiData
|
|
||||||
// 这个 code 是和后端约定的业务 code
|
// 这个 code 是和后端约定的业务 code
|
||||||
const code = apiData.code
|
const code = apiData.code
|
||||||
// 如果没有 code, 代表这不是项目后端开发的 api
|
// 如果没有 code, 代表这不是项目后端开发的 api
|
||||||
|
@ -64,21 +64,18 @@ export function isEmail(email: string) {
|
|||||||
|
|
||||||
/** 判断是否为 MAC 地址 */
|
/** 判断是否为 MAC 地址 */
|
||||||
export function isMAC(mac: string) {
|
export function isMAC(mac: string) {
|
||||||
const reg
|
const reg = /^(([a-f0-9][0,2468ace]:([a-f0-9]{2}:){4})|([a-f0-9][0,2468ace]-([a-f0-9]{2}-){4}))[a-f0-9]{2}$/i
|
||||||
= /^(([a-f0-9][0,2468ace]:([a-f0-9]{2}:){4})|([a-f0-9][0,2468ace]-([a-f0-9]{2}-){4}))[a-f0-9]{2}$/i
|
|
||||||
return reg.test(mac)
|
return reg.test(mac)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 判断是否为 IPv4 地址 */
|
/** 判断是否为 IPv4 地址 */
|
||||||
export function isIPv4(ip: string) {
|
export function isIPv4(ip: string) {
|
||||||
const reg
|
const reg = /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/
|
||||||
= /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/
|
|
||||||
return reg.test(ip)
|
return reg.test(ip)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 判断是否为车牌(兼容新能源车牌) */
|
/** 判断是否为车牌(兼容新能源车牌) */
|
||||||
export function isLicensePlate(str: string) {
|
export function isLicensePlate(str: string) {
|
||||||
const reg
|
const reg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/
|
||||||
= /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/
|
|
||||||
return reg.test(str)
|
return reg.test(str)
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { CreateOrUpdateTableRequestData, TableData } from "@/api/table/types/table"
|
import type { CreateOrUpdateTableRequestData, TableData } from "@/api/table/types/table"
|
||||||
|
import type { FormInstance, FormRules } from "element-plus"
|
||||||
import { createTableDataApi, deleteTableDataApi, getTableDataApi, updateTableDataApi } from "@/api/table"
|
import { createTableDataApi, deleteTableDataApi, getTableDataApi, updateTableDataApi } from "@/api/table"
|
||||||
import { usePagination } from "@/hooks/usePagination"
|
import { usePagination } from "@/hooks/usePagination"
|
||||||
import { CirclePlus, Delete, Download, Refresh, RefreshRight, Search } from "@element-plus/icons-vue"
|
import { CirclePlus, Delete, Download, Refresh, RefreshRight, Search } from "@element-plus/icons-vue"
|
||||||
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from "element-plus"
|
import { ElMessage, ElMessageBox } from "element-plus"
|
||||||
import { cloneDeep } from "lodash-es"
|
import { cloneDeep } from "lodash-es"
|
||||||
import { reactive, ref, watch } from "vue"
|
import { reactive, ref, watch } from "vue"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user