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