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 { 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()

View File

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

View File

@ -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 () => {
}
}
}
}
}

View File

@ -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'))