فهرست منبع

style: 修改代码格式,修改错误单词

奔跑的面条 2 سال پیش
والد
کامیت
2f6bdcc8c8

+ 2 - 2
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)<ProejctDetail>(`${ModuleTypeEnum.PROJECT}/getData`, data)
+    const res = await http(RequestHttpEnum.GET)<ProjectDetail>(`${ModuleTypeEnum.PROJECT}/getData`, data)
     return res
   } catch {
     httpErrorHandle()

+ 1 - 1
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 {
   /**
    * 项目参数
    */

+ 3 - 5
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 () => {
       }
     }
   }
-}
+}

+ 15 - 13
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<ChartList>([])
@@ -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'))