feat:更新图片存储路径

This commit is contained in:
2026-02-01 22:34:38 +08:00
parent c0cfbbaa15
commit 7b96e60b8d
17 changed files with 295 additions and 261 deletions

View File

@@ -4,7 +4,7 @@
arrow="always" @change="changeFoodEvent">
<el-carousel-item v-for="(item, index) in getFoodRecord(props.foodItem?.recordList)"
:key="index">
<el-image :src="serviceFileRootPath + item.imageUrl"
<el-image :src="AListPath + item.imageUrl"
fit="contain" alt="暂无成果">
<template #error>
<div class="image-slot">
@@ -26,8 +26,7 @@
</div>
<div class="button-info">
<el-button v-if="!isMobile()"
type="primary" :icon="Edit" circle :size="'small'"
<el-button type="primary" :icon="Edit" circle :size="'small'"
@click="editFoodRecipeClick"/>
<el-button type="primary" :icon="MoreFilled" circle :size="'small'"
@click="viewFoodRecipeClick()" />
@@ -70,10 +69,8 @@ import { defineProps, onMounted, PropType, reactive } from 'vue'
import { IFoodRecipe, IFoodRecord } from '@/types/food.ts'
import { useRouter } from 'vue-router'
import { formatDate } from 'vue3-common/utils/dateUtil'
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
import { serviceFileRootPath } from '@/utils'
import { isMobile } from 'vue3-common/utils/layoutUtil'
import { AListPath } from '@/utils'
const router = useRouter()
const foodStore = useFoodStore()
@@ -102,11 +99,7 @@ const editFoodRecipeClick = async () => {
const id = props.foodItem?.id
foodStore.foodRecipeApiType = 'UPDATE'
await foodStore.queryFoodRecipe(id as number)
foodStore.foodRecipeDialog = {
title: '编辑菜谱',
visible: true,
data: deepCopyObject(foodStore.currentFoodRecipe)
}
await router.push({ name: 'FoodRecipeForm' })
}
const viewFoodRecipeClick = async () => {
@@ -116,7 +109,7 @@ const viewFoodRecipeClick = async () => {
const deleteFoodRecipeClick = () => {
foodStore.foodRecipeApiType = 'DELETE'
commonElMessageBox(`请确认是否删除该菜谱: ${props.foodItem?.name}?`).then(() => {
foodStore.handleFoodRecipeApi(props.foodItem?.id as number)
foodStore.handleFoodRecipeApi(props.foodItem)
})
}