feat:更新朋友圈功能

This commit is contained in:
2025-06-28 15:54:02 +08:00
parent c77c3ff512
commit 0969af5ade
22 changed files with 598 additions and 70 deletions

View File

@@ -28,7 +28,7 @@
<div class="button-info">
<el-button type="primary" :icon="Edit" circle :size="'small'"
@click="editClick"/>
<el-button type="primary" :icon="MoreFilled" circle :size="'small'"
<el-button type="primary" :icon="Collection" circle :size="'small'"
@click="viewClick()" />
<el-button type="danger" :icon="DeleteFilled" circle :size="'small'"
@click="deleteClick()" />
@@ -59,7 +59,7 @@
</template>
<script setup lang="ts">
import { Edit, MoreFilled, DeleteFilled } from '@element-plus/icons-vue'
import { Edit, Collection, DeleteFilled } from '@element-plus/icons-vue'
import { useFoodStore } from '@/store/food'
import { defineProps, onMounted, reactive } from 'vue'
import type { PropType } from 'vue'

View File

@@ -44,7 +44,7 @@
<script lang="ts" setup>
import { useFoodStore } from '@/store/food'
import { nextTick, reactive, ref } from 'vue'
import { FormRules } from 'element-plus'
import type { FormRules } from 'element-plus'
import { foodMaterialRules } from '@/utils/element/elRules'
const rules = reactive<FormRules>(foodMaterialRules)

View File

@@ -1,13 +1,13 @@
<template>
<el-dialog v-model="foodStore.stepDialog.visible"
:title="foodStore.stepDialog.title"
:title="`${foodStore.stepDialog.title}${foodStore.editStepIndex + 1}`"
center @open="openDialogEvent"
class="food-step-dialog">
<el-form ref="formRef" :model="foodStore.stepDialog.data"
:rules="rules" label-width="60px">
<el-form-item label="内容" prop="content">
<el-input v-model="foodStore.stepDialog.data.content" autocomplete="off"
placeholder="请输入内容" clearable
:placeholder="`请输入步骤${foodStore.editStepIndex + 1}`" clearable
type="textarea" :rows="3"
show-word-limit maxlength="50">
</el-input>
@@ -36,7 +36,7 @@
import { UploadImage } from 'vue3-common'
import { useFoodStore } from '@/store/food'
import { ref, reactive, nextTick } from 'vue'
import { FormRules } from 'element-plus'
import type { FormRules } from 'element-plus'
import { foodStepRules } from '@/utils/element/elRules'
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
@@ -60,11 +60,13 @@ const openDialogEvent = () => {
const confirmClick = () => {
formRef.value.validate()
.then(async () => {
const { editStepIndex: index } = foodStore
if (foodStore.stepApiType === 'UPDATE') {
const { editStepIndex: index } = foodStore
foodStore.currentRecipe.stepList[index] = foodStore.stepDialog.data
} else {
foodStore.stepDialog.data.sort = foodStore.editStepIndex
foodStore.currentRecipe.stepList.push(foodStore.stepDialog.data)
foodStore.editStepIndex++
}
foodStore.stepDialog.visible = false
})