Merge branches 'master', 'master' and 'master' of http://124.223.211.244:8418/zianxin/biz-pc-cloud

This commit is contained in:
dzc committed 2025-01-16 12:08:20 +08:00
commit 2b52329aaf
6 files changed
+155 -126

No files matched your search

+4 -4
View File
@@ -10,14 +10,14 @@ ENV = 'development'
# ADMIN 服务地址 # ADMIN 服务地址
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上 # VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/ # VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/ VITE_ADMIN_PROXY_PATH = http://localhost:9999/
VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地 #VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地
# 图片访问基础地址 # 图片访问基础地址
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上 # VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999 VITE_IMAGE_BASE_PATH = http://localhost:9999
VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地 #VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
# 代码生成服务地址 # 代码生成服务地址
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003 VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
+4 -2
View File
@@ -8,10 +8,12 @@ VITE_OPEN = true
ENV = 'prod' ENV = 'prod'
# ADMIN 服务地址 # ADMIN 服务地址
VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089 #VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089
VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81
# 图片访问基础地址 # 图片访问基础地址
VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api #VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api
VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api
# 代码生成服务地址 # 代码生成服务地址
VITE_GEN_PROXY_PATH = http://123.156.230.15:5003 VITE_GEN_PROXY_PATH = http://123.156.230.15:5003
+51 -45
View File
@@ -1,72 +1,78 @@
<!-- 图片预览 --> <!-- 图片预览 -->
<script lang="ts" setup name="PreviewImage"> <script lang="ts" setup name="PreviewImage">
type Props = { type Props = {
src?: string src?: string
width?: string | number width?: string | number
height?: string | number height?: string | number
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
width: 50, width: 50,
height: 50, height: 50,
}) })
const realSrc = computed(() => { const realSrc = computed(() => {
if (!props.src) return ""; if (!props.src) return ""
let real_src = props.src.split(",")[0]; let real_src = props.src.split(",")[0]
return dispatchUrl(real_src) ?? ""; return dispatchUrl(real_src) ?? ""
}) })
const realSrcList = computed(() => { const realSrcList = computed(() => {
if (!props.src) return ""; if (!props.src) return ""
let real_src = props.src.split(",")?.map(v => dispatchUrl(v)); let real_src = props.src.split(",")?.map((v) => dispatchUrl(v))
return real_src ?? []; return real_src ?? []
}) })
const realWidth = computed(() => typeof props.width == "string" ? props.width : `${props.width}px`) const realWidth = computed(() => (typeof props.width == "string" ? props.width : `${props.width}px`))
const realHeight = computed(() => typeof props.height == "string" ? props.height : `${props.height}px`) const realHeight = computed(() => (typeof props.height == "string" ? props.height : `${props.height}px`))
function dispatchUrl(url?: string) { function dispatchUrl(url?: string) {
if (!url) return "" if (!url) return ""
return url.includes('http') ? url : import.meta.env.VITE_IMAGE_BASE_PATH + url return url.includes("http") ? url : import.meta.env.VITE_IMAGE_BASE_PATH + url
} }
</script> </script>
<template> <template>
<el-image v-if="props.src" hide-on-click-modal preview-teleported :src="`${realSrc}`" fit="cover" <el-image
:style="`width:${realWidth};height:${realHeight};`" :preview-src-list="realSrcList"> v-if="props.src"
<template #error> hide-on-click-modal
<div class="image-slot"> preview-teleported
<i class="el-icon-picture-outline"></i> :src="`${realSrc}`"
</div> fit="cover"
</template> :style="`width:${realWidth};height:${realHeight};`"
</el-image> :preview-src-list="realSrcList"
<div v-else :style="`width:${realWidth};height:${realHeight};`" /> loading="lazy"
>
<template #error>
<div class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</template>
</el-image>
<div v-else :style="`width:${realWidth};height:${realHeight};`" />
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-image { .el-image {
border-radius: 5px; border-radius: 5px;
background-color: #ebeef5; background-color: #ebeef5;
box-shadow: 0 0 5px 1px #ccc; box-shadow: 0 0 5px 1px #ccc;
:deep(.el-image__inner) { :deep(.el-image__inner) {
transition: all 0.3s; transition: all 0.3s;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
transform: scale(1.2); transform: scale(1.2);
} }
} }
:deep(.image-slot) { :deep(.image-slot) {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #909399; color: #909399;
font-size: 30px; font-size: 30px;
} }
} }
</style> </style>
+44 -42
View File
@@ -92,53 +92,55 @@
</el-form> </el-form>
</el-row> </el-row>
<el-table <div style="overflow: auto; max-height: 60vh">
ref="foodMultipleTableRef" <el-table
:data="foodDataList" ref="foodMultipleTableRef"
v-loading="loading" :data="foodDataList"
@selection-change="selectionChangeHandle" v-loading="loading"
> @selection-change="selectionChangeHandle"
<el-table-column type="selection" width="40" align="center" /> >
<el-table-column type="index" label="#" width="50" /> <el-table-column type="selection" width="40" align="center" />
<el-table-column prop="name" label="商品名称" width="120px" show-overflow-tooltip /> <el-table-column type="index" label="#" width="50" align="center" />
<el-table-column prop="categoryId" label="商品分类" width="100px" show-overflow-tooltip> <el-table-column prop="name" label="商品名称" width="100px" align="center" show-overflow-tooltip />
<template #default="{ row }"> <el-table-column prop="categoryId" label="商品分类" width="100px" align="center" show-overflow-tooltip>
{{ categoryOptions?.find((item: any) => item?.id === row?.categoryId)?.name }} <template #default="{ row }">
</template> {{ categoryOptions?.find((item: any) => item?.id === row?.categoryId)?.name }}
</el-table-column> </template>
<el-table-column prop="picUrl" label="商品封面图" align="center" width="160px" show-overflow-tooltip> </el-table-column>
<template #default="scope"> <el-table-column prop="picUrl" label="商品封面图" align="center" show-overflow-tooltip>
<preview-image :src="scope.row.picUrl" /> <template #default="scope">
</template> <preview-image :src="scope.row.picUrl" />
</el-table-column> </template>
<el-table-column prop="sort" label="排序字段" show-overflow-tooltip /> </el-table-column>
<el-table-column prop="status" label="上架状态" show-overflow-tooltip> <el-table-column prop="sort" label="排序字段" align="center" show-overflow-tooltip />
<template #default="scope"> <el-table-column prop="status" label="上架状态" align="center" show-overflow-tooltip>
<dict-tag :options="spu_status" :value="scope.row.status" /> <template #default="scope">
</template> <dict-tag :options="spu_status" :value="scope.row.status" />
</el-table-column> </template>
<el-table-column prop="price" label="商品价格" show-overflow-tooltip> </el-table-column>
<template #default="scope"> <el-table-column prop="price" label="商品价格" align="center" show-overflow-tooltip>
{{ displayPrice(scope.row.price) }} <template #default="scope">
</template> {{ displayPrice(scope.row.price) }}
</el-table-column> </template>
<el-table-column prop="marketPrice" label="市场价" show-overflow-tooltip> </el-table-column>
<template #default="scope"> <el-table-column prop="marketPrice" label="市场价" align="center" show-overflow-tooltip>
{{ displayPrice(scope.row.marketPrice) }} <template #default="scope">
</template> {{ displayPrice(scope.row.marketPrice) }}
</el-table-column> </template>
<el-table-column prop="costPrice" label="成本价" show-overflow-tooltip /> </el-table-column>
<el-table-column prop="stock" label="库存" show-overflow-tooltip /> <el-table-column prop="costPrice" label="成本价" align="center" show-overflow-tooltip />
<el-table-column prop="salesCount" label="商品销量" show-overflow-tooltip /> <el-table-column prop="stock" label="库存" align="center" show-overflow-tooltip />
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" /> <el-table-column prop="salesCount" label="商品销量" align="center" show-overflow-tooltip />
</el-table> <el-table-column prop="createTime" label="创建时间" align="center" show-overflow-tooltip />
<pagination </el-table>
</div>
<!-- <pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@current-change="currentChangeHandle" @current-change="currentChangeHandle"
v-model:current-page="foodQueryForm.current" v-model:current-page="foodQueryForm.current"
v-model:page-size="foodQueryForm.size" v-model:page-size="foodQueryForm.size"
:total="total" :total="total"
/> /> -->
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
+47 -28
View File
@@ -1,18 +1,18 @@
<template> <template>
<div class="layout-padding"> <div class="layout-padding" v-loading="loading">
<el-form-item label="商户" prop="merchantId" class="w-60 ml-10 my-6"> <el-form-item label="商户" prop="merchantId" class="w-60 ml-10 my-6">
<select-mch v-model="merchantId" /> <select-mch v-model="merchantId" />
</el-form-item> </el-form-item>
<h1 class="mx-auto text-5xl mt-[-40px]">今日菜谱</h1> <h1 class="mx-auto text-5xl mt-[-40px]">今日菜谱</h1>
<table class="w-11/12 border-collapse cursor-pointer mx-auto"> <table v-if="weekData.data.length > 0" class="w-11/12 border-collapse cursor-pointer mx-auto">
<tr> <tr>
<div class="text-4xl mr-2 text-right" @click="addClick(-1)">&lt;</div> <div class="text-4xl mr-2 text-right" @click="addClick(-1)">&lt;</div>
<td <td
v-for="(item, index) in weekData.data" v-for="(item, index) in weekData.data"
:key="index" :key="index"
@click="timeClick(item, index)" @click="timeClick(item, index)"
:class="{ selectedSpan: isActive === index ? 'selected' : '' }" :class="{ selectedSpan: isActive === index }"
class="border-2 border-solid border-gray-200 text-center" class="border-2 border-solid border-gray-200 text-center"
> >
<span>{{ item }}</span> <span>{{ item }}</span>
@@ -24,7 +24,7 @@
<div class="dataDiv"> <div class="dataDiv">
<table> <table>
<tr class="food"> <tr class="food">
<td class="text-center" @click="addFood(1)">早餐</td> <td v-if="!loading" class="text-center" @click="addFood(1)">早餐</td>
<div class="food_list"> <div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData1" :key="index" @click="delteData(item.tid)"> <td class="food_list_item" v-for="(item, index) in foodData1" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" /> <el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
@@ -38,7 +38,7 @@
</div> </div>
</tr> </tr>
<tr class="food"> <tr class="food">
<td class="text-center" @click="addFood(2)">中餐</td> <td v-if="!loading" class="text-center" @click="addFood(2)">中餐</td>
<div class="food_list"> <div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData2" :key="index" @click="delteData(item.tid)"> <td class="food_list_item" v-for="(item, index) in foodData2" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" /> <el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" />
@@ -52,10 +52,15 @@
</div> </div>
</tr> </tr>
<tr class="food"> <tr class="food">
<td class="text-center" @click="addFood(3)">晚餐</td> <td v-if="!loading" class="text-center" @click="addFood(3)">晚餐</td>
<div class="food_list"> <div class="food_list">
<td class="food_list_item" v-for="(item, index) in foodData3" :key="index" @click="delteData(item.tid)"> <td class="food_list_item" v-for="(item, index) in foodData3" :key="index" @click="delteData(item.tid)">
<el-image style="width: 80px; height: 80px" :src="imageBaseUrl + item.picUrl" fit="cover" /> <el-image
style="width: 80px; height: 80px"
loading="lazy"
:src="imageBaseUrl + item.picUrl"
fit="cover"
/>
<div class="w-full flex justify-around items-center text-black mt-2"> <div class="w-full flex justify-around items-center text-black mt-2">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span class="mx-1">|</span> <span class="mx-1">|</span>
@@ -74,6 +79,7 @@
</template> </template>
<script setup lang="ts" name="systemCanteenDailyMenu"> <script setup lang="ts" name="systemCanteenDailyMenu">
import { ElMessageBox } from "element-plus"
import { delObjs, selectTimeFoodApi, selectWeekInfo } from "/@/api/canteen/canteenDailyMenu" import { delObjs, selectTimeFoodApi, selectWeekInfo } from "/@/api/canteen/canteenDailyMenu"
import { fetchList } from "/@/api/canteen/canteenCategory" import { fetchList } from "/@/api/canteen/canteenCategory"
import { useMessage } from "/@/hooks/message" import { useMessage } from "/@/hooks/message"
@@ -88,9 +94,9 @@ const loading = ref(true)
const message = useMessage() // 消息弹窗 const message = useMessage() // 消息弹窗
const foodData1 = ref<any>({}) const foodData1 = ref<any>([])
const foodData2 = ref<any>({}) const foodData2 = ref<any>([])
const foodData3 = ref<any>({}) const foodData3 = ref<any>([])
let timedata = "" let timedata = ""
let isActive = ref(-1) let isActive = ref(-1)
@@ -114,7 +120,7 @@ const addFood = async (hourType: number) => {
//选中具体时间数据 //选中具体时间数据
const timeClick = async (time: string, index: number) => { const timeClick = async (time: string, index: number) => {
//数据查询操作 //数据查询操作
if (time) { if (time && isActive.value !== index) {
//时间处理 //时间处理
time = time.substring(0, time.indexOf("(")) time = time.substring(0, time.indexOf("("))
timedata = time timedata = time
@@ -135,10 +141,10 @@ watch(merchantId, () => {
}) })
const fetchData = async () => { const fetchData = async () => {
const weekDataRes = await selectWeekInfo(weekParams) const weekDataRes = await selectWeekInfo(weekParams).finally(() => (loading.value = false))
weekData.data = weekDataRes.data weekData.data = weekDataRes.data
isActive.value = 0 isActive.value = new Date().getDay() === 0 ? 6 : new Date().getDay() - 1
timedata = weekData.data[0] timedata = weekData.data[isActive.value]
// 时间格式 // 时间格式
timedata = timedata.substring(0, timedata.indexOf("(")) timedata = timedata.substring(0, timedata.indexOf("("))
selectTimeFood() selectTimeFood()
@@ -154,7 +160,8 @@ const selectTimeFood = async () => {
} }
//最大长度 //最大长度
let count = 0 let count = 0
const result = await selectTimeFoodApi(params) loading.value = true
const result = await selectTimeFoodApi(params).finally(() => (loading.value = false))
result.data.forEach((r: any) => { result.data.forEach((r: any) => {
if (r.dailyMenuVOS.length > count) { if (r.dailyMenuVOS.length > count) {
count = r.dailyMenuVOS.length count = r.dailyMenuVOS.length
@@ -175,19 +182,33 @@ const selectTimeFood = async () => {
// 删除菜品 // 删除菜品
const delteData = async (tid: number) => { const delteData = async (tid: number) => {
await message.delConfirm("确定删除菜品吗?", "今日菜品?") ElMessageBox.confirm("确定删除菜品吗?", "今日菜品?", {
try { confirmButtonText: "确定",
await delObjs([tid], merchantId.value) cancelButtonText: "取消",
message.success("删除成功") type: "warning",
} catch (error) { })
message.error("删除失败") .then(async () => {
} try {
selectTimeFood() loading.value = true
const { code } = await delObjs([tid], merchantId.value)
if (code === 0) {
message.success("删除成功")
selectTimeFood()
} else {
message.error("删除失败")
}
} catch (error) {
message.error("删除失败")
} finally {
loading.value = false
}
})
.catch(() => {})
} }
// 获取下拉框选项 // 获取下拉框选项
const merchantInit = async () => { const merchantInit = async () => {
const res = await pageJoin({ current: 1, size: 9999 }) const res = await pageJoin({ current: 1, size: 9999 }).finally(() => (loading.value = false))
merchantInfo.value = res.data.records merchantInfo.value = res.data.records
//默认选中第一个 //默认选中第一个
@@ -200,10 +221,7 @@ const merchantInit = async () => {
const canteenCategoryOption = ref<any>([]) const canteenCategoryOption = ref<any>([])
// 获取菜品分类 // 获取菜品分类
const getCanteenCategory = async () => { const getCanteenCategory = async () => {
const res = await fetchList({ const res = await fetchList({ current: 1, size: 9999 })
current: 1,
size: 9999,
})
if (res.code === 0) { if (res.code === 0) {
canteenCategoryOption.value = res.data.records canteenCategoryOption.value = res.data.records
} }
@@ -264,6 +282,7 @@ onMounted(async () => {
border-left: 2px solid transparent; border-left: 2px solid transparent;
color: rgb(255, 187, 0); color: rgb(255, 187, 0);
position: relative; position: relative;
cursor: default;
} }
.selectedSpan::before { .selectedSpan::before {
content: ""; content: "";
+5 -5
View File
@@ -2,11 +2,11 @@
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable> <el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading"> <el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="14" class="mb20"> <!-- <el-col :span="14" class="mb20">-->
<el-form-item label="商户" prop="merchantId"> <!-- <el-form-item label="商户" prop="merchantId">-->
<select-mch v-model="form.merchantId" /> <!-- <select-mch v-model="form.merchantId" />-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="14" class="mb20"> <el-col :span="14" class="mb20">
<el-form-item label="商品名称" prop="name"> <el-form-item label="商品名称" prop="name">
<el-input v-model.trim="form.name" placeholder="请输入商品名称" /> <el-input v-model.trim="form.name" placeholder="请输入商品名称" />