feat:更新朋友圈功能

This commit is contained in:
2025-06-27 15:58:06 +08:00
parent 233d7de144
commit 4276e9466a
9 changed files with 51 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ import {
import type { IDialog, IHandleApi, IStatsChart } from 'vue3-common/types'
import { ElMessage } from 'element-plus'
import { getCurrentMonth, getCurrentYear, getStartEndDate } from 'vue3-common/utils/dateUtil'
import { addCommentApi, addMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment'
import { addCommentApi, addMomentApi, deleteMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment'
export const useFoodStore = defineStore('food', {
state: () => ({
@@ -75,7 +75,8 @@ export const useFoodStore = defineStore('food', {
recordApiType: 'ADD' as IHandleApi,
editRecordIndex: 0,
currentMoment: {
content: ''
content: '',
imageList: []
} as IMoment,
momentApiType: 'ADD' as IHandleApi,
imagePath: 'food-hub',
@@ -179,7 +180,7 @@ export const useFoodStore = defineStore('food', {
ElMessage.success('更新朋友圈成功')
break
case 'DELETE':
// await deleteRecordApi(record.id as number)
await deleteMomentApi(moment.id as number)
ElMessage.success('删除朋友圈成功')
break
default:
@@ -233,7 +234,8 @@ export const useFoodStore = defineStore('food', {
},
getEmptyMoment(): IMoment {
return {
content: ''
content: '',
imageList: []
}
}
}