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

This commit is contained in:
奔跑的面条 2022-11-28 10:54:54 +08:00
parent 4886af4bb5
commit 2f6bdcc8c8
4 changed files with 21 additions and 21 deletions

View File

@ -1,7 +1,7 @@
import { http } from '@/api/http' import { http } from '@/api/http'
import { httpErrorHandle } from '@/utils' import { httpErrorHandle } from '@/utils'
import { ContentTypeEnum, RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum' import { ContentTypeEnum, RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum'
import { ProjectItem, ProejctDetail } from './project' import { ProjectItem, ProjectDetail } from './project'
// * 项目列表 // * 项目列表
export const projectListApi = async (data: object) => { export const projectListApi = async (data: object) => {
@ -31,7 +31,7 @@ export const createProjectApi = async (data: object) => {
// * 获取项目 // * 获取项目
export const fetchProjectApi = async (data: object) => { export const fetchProjectApi = async (data: object) => {
try { 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 return res
} catch { } catch {
httpErrorHandle() httpErrorHandle()

View File

@ -31,7 +31,7 @@ export type ProjectItem = {
remarks: string remarks: string
} }
export interface ProejctDetail extends ProjectItem { export interface ProjectDetail extends ProjectItem {
/** /**
* *
*/ */

View File

@ -11,10 +11,8 @@ export interface ChartEditStorageType extends ChartEditStorage {
// 根据路由 id 获取存储数据的信息 // 根据路由 id 获取存储数据的信息
export const getSessionStorageInfo = async () => { export const getSessionStorageInfo = async () => {
const id = fetchRouteParamsLocation() const id = fetchRouteParamsLocation()
const storageList: ChartEditStorageType[] = getSessionStorage( const storageList: ChartEditStorageType[] = getSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST)
StorageEnum.GO_CHART_STORAGE_LIST
)
// 是否本地预览 // 是否本地预览
if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) { if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) {
// 接口调用 // 接口调用
@ -37,4 +35,4 @@ export const getSessionStorageInfo = async () => {
} }
} }
} }
} }

View File

@ -1,4 +1,4 @@
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue'
import { goDialog, httpErrorHandle } from '@/utils' import { goDialog, httpErrorHandle } from '@/utils'
import { DialogEnum } from '@/enums/pluginEnum' import { DialogEnum } from '@/enums/pluginEnum'
import { projectListApi, deleteProjectApi, changeProjectReleaseApi } from '@/api/path' import { projectListApi, deleteProjectApi, changeProjectReleaseApi } from '@/api/path'
@ -7,16 +7,15 @@ import { ResultEnum } from '@/enums/httpEnum'
// 数据初始化 // 数据初始化
export const useDataListInit = () => { export const useDataListInit = () => {
const loading = ref(true) const loading = ref(true)
const paginat = reactive({ const paginat = reactive({
// 当前页数 // 当前页数
page: 1, page: 1,
// 每页值 // 每页值
limit: 12, limit: 12,
// 总数 // 总数
count: 10, count: 10
}) })
const list = ref<ChartList>([]) const list = ref<ChartList>([])
@ -27,11 +26,11 @@ export const useDataListInit = () => {
const res = await projectListApi({ const res = await projectListApi({
page: paginat.page, page: paginat.page,
limit: paginat.limit limit: paginat.limit
}); })
if (res &&res.data) { if (res && res.data) {
const { count } = res as any; // 这里的count与data平级不在Response结构中 const { count } = res as any // 这里的count与data平级不在Response结构中
paginat.count = count paginat.count = count
list.value = res.data.map((e) => { list.value = res.data.map(e => {
const { id, projectName, state, createTime, indexImage, createUserId } = e const { id, projectName, state, createTime, indexImage, createUserId } = e
return { return {
id: id, id: id,
@ -67,11 +66,14 @@ export const useDataListInit = () => {
goDialog({ goDialog({
type: DialogEnum.DELETE, type: DialogEnum.DELETE,
promise: true, promise: true,
onPositiveCallback: () => new Promise(res => { onPositiveCallback: () =>
res(deleteProjectApi({ new Promise(res => {
ids: cardData.id res(
})) deleteProjectApi({
}), ids: cardData.id
})
)
}),
promiseResCallback: (res: any) => { promiseResCallback: (res: any) => {
if (res.code === ResultEnum.SUCCESS) { if (res.code === ResultEnum.SUCCESS) {
window['$message'].success(window['$t']('global.r_delete_success')) window['$message'].success(window['$t']('global.r_delete_success'))