From 2f6bdcc8c828e0cb67640c93ab975ce93aedf8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Mon, 28 Nov 2022 10:54:54 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=8D=95=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/path/project.api.ts | 4 +-- src/api/path/project.d.ts | 2 +- src/views/preview/utils/storage.ts | 8 ++---- .../ProjectItemsList/hooks/useData.hook.ts | 28 ++++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/api/path/project.api.ts b/src/api/path/project.api.ts index bcda8efd..164df1d3 100644 --- a/src/api/path/project.api.ts +++ b/src/api/path/project.api.ts @@ -1,7 +1,7 @@ import { http } from '@/api/http' import { httpErrorHandle } from '@/utils' import { ContentTypeEnum, RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum' -import { ProjectItem, ProejctDetail } from './project' +import { ProjectItem, ProjectDetail } from './project' // * 项目列表 export const projectListApi = async (data: object) => { @@ -31,7 +31,7 @@ export const createProjectApi = async (data: object) => { // * 获取项目 export const fetchProjectApi = async (data: object) => { try { - const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/getData`, data) + const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/getData`, data) return res } catch { httpErrorHandle() diff --git a/src/api/path/project.d.ts b/src/api/path/project.d.ts index 6a86458e..c9e20096 100644 --- a/src/api/path/project.d.ts +++ b/src/api/path/project.d.ts @@ -31,7 +31,7 @@ export type ProjectItem = { remarks: string } -export interface ProejctDetail extends ProjectItem { +export interface ProjectDetail extends ProjectItem { /** * 项目参数 */ diff --git a/src/views/preview/utils/storage.ts b/src/views/preview/utils/storage.ts index f924d43a..94831009 100644 --- a/src/views/preview/utils/storage.ts +++ b/src/views/preview/utils/storage.ts @@ -11,10 +11,8 @@ export interface ChartEditStorageType extends ChartEditStorage { // 根据路由 id 获取存储数据的信息 export const getSessionStorageInfo = async () => { const id = fetchRouteParamsLocation() - const storageList: ChartEditStorageType[] = getSessionStorage( - StorageEnum.GO_CHART_STORAGE_LIST - ) - + const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST) + // 是否本地预览 if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) { // 接口调用 @@ -37,4 +35,4 @@ export const getSessionStorageInfo = async () => { } } } -} \ No newline at end of file +} diff --git a/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts b/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts index 61a42124..d54d1290 100644 --- a/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts +++ b/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts @@ -1,4 +1,4 @@ -import { ref, reactive } from 'vue'; +import { ref, reactive } from 'vue' import { goDialog, httpErrorHandle } from '@/utils' import { DialogEnum } from '@/enums/pluginEnum' import { projectListApi, deleteProjectApi, changeProjectReleaseApi } from '@/api/path' @@ -7,16 +7,15 @@ import { ResultEnum } from '@/enums/httpEnum' // 数据初始化 export const useDataListInit = () => { - const loading = ref(true) const paginat = reactive({ - // 当前页数 + // 当前页数 page: 1, // 每页值 limit: 12, // 总数 - count: 10, + count: 10 }) const list = ref([]) @@ -27,11 +26,11 @@ export const useDataListInit = () => { const res = await projectListApi({ page: paginat.page, limit: paginat.limit - }); - if (res &&res.data) { - const { count } = res as any; // 这里的count与data平级,不在Response结构中 + }) + if (res && res.data) { + const { count } = res as any // 这里的count与data平级,不在Response结构中 paginat.count = count - list.value = res.data.map((e) => { + list.value = res.data.map(e => { const { id, projectName, state, createTime, indexImage, createUserId } = e return { id: id, @@ -67,11 +66,14 @@ export const useDataListInit = () => { goDialog({ type: DialogEnum.DELETE, promise: true, - onPositiveCallback: () => new Promise(res => { - res(deleteProjectApi({ - ids: cardData.id - })) - }), + onPositiveCallback: () => + new Promise(res => { + res( + deleteProjectApi({ + ids: cardData.id + }) + ) + }), promiseResCallback: (res: any) => { if (res.code === ResultEnum.SUCCESS) { window['$message'].success(window['$t']('global.r_delete_success'))