mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
style: 修改代码格式,修改错误单词
This commit is contained in:
parent
4886af4bb5
commit
2f6bdcc8c8
@ -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()
|
||||||
|
2
src/api/path/project.d.ts
vendored
2
src/api/path/project.d.ts
vendored
@ -31,7 +31,7 @@ export type ProjectItem = {
|
|||||||
remarks: string
|
remarks: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProejctDetail extends ProjectItem {
|
export interface ProjectDetail extends ProjectItem {
|
||||||
/**
|
/**
|
||||||
* 项目参数
|
* 项目参数
|
||||||
*/
|
*/
|
||||||
|
@ -11,9 +11,7 @@ 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) {
|
||||||
|
@ -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,7 +7,6 @@ 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({
|
||||||
@ -16,7 +15,7 @@ export const useDataListInit = () => {
|
|||||||
// 每页值
|
// 每页值
|
||||||
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'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user