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