update 优化 执行eslint:fix优化代码

This commit is contained in:
疯狂的狮子Li
2025-05-15 14:52:31 +08:00
parent 7b48bd44a2
commit 7f15f0e15a
39 changed files with 117 additions and 124 deletions

View File

@@ -44,7 +44,7 @@ const findPathNum = (str, char = '/') => {
return str.split(char).length - 1;
};
const getMatched = (pathList, routeList, matched) => {
let data = routeList.find((item) => item.path == pathList[0] || (item.name += '').toLowerCase() == pathList[0]);
const data = routeList.find((item) => item.path == pathList[0] || (item.name += '').toLowerCase() == pathList[0]);
if (data) {
matched.push(data);
if (data.children && pathList.length) {

View File

@@ -95,7 +95,7 @@ const options = ref<any>({
});
const styles = computed(() => {
let style: any = {};
const style: any = {};
if (props.minHeight) {
style.minHeight = `${props.minHeight}px`;
}
@@ -121,9 +121,9 @@ const handleUploadSuccess = (res: any) => {
// 如果上传成功
if (res.code === 200) {
// 获取富文本实例
let quill = toRaw(quillEditorRef.value).getQuill();
const quill = toRaw(quillEditorRef.value).getQuill();
// 获取光标位置
let length = quill.selection.savedRange.index;
const length = quill.selection.savedRange.index;
// 插入图片res为服务器返回的图片链接地址
quill.insertEmbed(length, 'image', res.data.url);
// 调整光标到最后

View File

@@ -176,7 +176,7 @@ const handleUploadSuccess = (res: any, file: UploadFile) => {
// 删除文件
const handleDelete = (index: number) => {
let ossId = fileList.value[index].ossId;
const ossId = fileList.value[index].ossId;
delOss(ossId);
fileList.value.splice(index, 1);
emit('update:modelValue', listToString(fileList.value));

View File

@@ -27,7 +27,7 @@ const realSrc = computed(() => {
if (!props.src) {
return;
}
let real_src = props.src.split(',')[0];
const real_src = props.src.split(',')[0];
return real_src;
});
@@ -35,8 +35,8 @@ const realSrcList = computed(() => {
if (!props.src) {
return [];
}
let real_src_list = props.src.split(',');
let srcList: string[] = [];
const real_src_list = props.src.split(',');
const srcList: string[] = [];
real_src_list.forEach((item: string) => {
if (item.trim() === '') {
return;

View File

@@ -189,7 +189,7 @@ const handleUploadSuccess = (res: any, file: UploadFile) => {
const handleDelete = (file: UploadFile): boolean => {
const findex = fileList.value.map((f) => f.name).indexOf(file.name);
if (findex > -1 && uploadList.value.length === number.value) {
let ossId = fileList.value[findex].ossId;
const ossId = fileList.value[findex].ossId;
delOss(ossId);
fileList.value.splice(findex, 1);
emit('update:modelValue', listToString(fileList.value));
@@ -225,7 +225,7 @@ const handlePictureCardPreview = (file: any) => {
const listToString = (list: any[], separator?: string) => {
let strs = '';
separator = separator || ',';
for (let i in list) {
for (const i in list) {
if (undefined !== list[i].ossId && list[i].url.indexOf('blob:') !== 0) {
strs += list[i].ossId + separator;
}

View File

@@ -47,7 +47,7 @@ const routers = computed(() => permissionStore.getTopbarRoutes());
// 顶部显示菜单
const topMenus = computed(() => {
let topMenus: RouteRecordRaw[] = [];
const topMenus: RouteRecordRaw[] = [];
routers.value.map((menu) => {
if (menu.hidden !== true) {
// 兼容顶部栏一级菜单内部跳转
@@ -63,7 +63,7 @@ const topMenus = computed(() => {
// 设置子路由
const childrenMenus = computed(() => {
let childrenMenus: RouteRecordRaw[] = [];
const childrenMenus: RouteRecordRaw[] = [];
routers.value.map((router) => {
router.children?.forEach((item) => {
if (item.parentPath === undefined) {
@@ -118,7 +118,7 @@ const handleSelect = (key: string) => {
// 没有子路由路径内部打开
const routeMenu = childrenMenus.value.find((item) => item.path === key);
if (routeMenu && routeMenu.query) {
let query = JSON.parse(routeMenu.query);
const query = JSON.parse(routeMenu.query);
router.push({ path: key, query: query });
} else {
router.push({ path: key });
@@ -132,7 +132,7 @@ const handleSelect = (key: string) => {
};
const activeRoutes = (key: string) => {
let routes: RouteRecordRaw[] = [];
const routes: RouteRecordRaw[] = [];
if (childrenMenus.value && childrenMenus.value.length > 0) {
childrenMenus.value.map((item) => {
if (key == item.parentPath || (key == 'index' && '' == item.path)) {