每日菜品
This commit is contained in:
1 parent
53d8d1f811
commit
293beedcf8
2 files changed
+42
-115
No files matched your search
+4
-4
@@ -8,16 +8,16 @@ VITE_OPEN = true
|
|||||||
ENV = 'development'
|
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
|
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
|
||||||
@@ -1,44 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div style="margin-left: 4.5%; margin-top: 1.5%">
|
<el-form-item label="商户" prop="merchantId" class="w-60 ml-10 my-6">
|
||||||
<el-form-item label="商户" prop="merchantId">
|
<select-mch v-model="merchantId" />
|
||||||
<select-mch v-model="merchantId" style="width: 200px" />
|
</el-form-item>
|
||||||
</el-form-item>
|
<h1 class="mx-auto text-5xl">今日菜谱</h1>
|
||||||
<h1 class="title">今日菜谱</h1>
|
|
||||||
</div>
|
<table class="w-11/12 border-collapse cursor-pointer mx-auto">
|
||||||
<table width="100%" class="titleTable">
|
<tr>
|
||||||
<tr class="trclass">
|
<td class="text-6xl" @click="addClick(-1)"><</td>
|
||||||
<td @click="addClick(-1)"><</td>
|
|
||||||
<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="tdclass"
|
|
||||||
:class="{ selectedSpan: isActive === index ? 'selected' : '' }"
|
:class="{ selectedSpan: isActive === index ? 'selected' : '' }"
|
||||||
|
class="border-2 border-solid border-gray-200 text-center"
|
||||||
>
|
>
|
||||||
<span>{{ item }}</span>
|
<span>{{ item }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td @click="addClick(1)">></td>
|
<td class="text-6xl" @click="addClick(1)">></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="dataDiv">
|
|
||||||
<table :style="{ width: tableWitch + 'px' }" class="foodTable">
|
<div class="overflow-y-auto">
|
||||||
<tr class="food">
|
<table class="my-4">
|
||||||
<td @click="addFood(1)">早餐</td>
|
<tr>
|
||||||
<td v-for="(item, index) in foodData1" :key="index">
|
<td class="w-16 h-48 text-4xl text-center cursor-pointer text-blue-500" @click="addFood(1)">早餐</td>
|
||||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
<td class="w-64 h-48 text-center" v-for="(item, index) in foodData1" :key="index">
|
||||||
|
<img @click="delteData(item.tid)" :src="item.picUrl" class="p-3 w-full h-full object-cover" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="food" style="margin: 0px 5px 5px 0px">
|
<tr>
|
||||||
<td @click="addFood(2)">中餐</td>
|
<td class="w-16 h-48 text-4xl text-center cursor-pointer text-blue-500" @click="addFood(2)">中餐</td>
|
||||||
<td v-for="(item, index) in foodData2" :key="index">
|
<td class="w-64 h-48 text-center" v-for="(item, index) in foodData2" :key="index">
|
||||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
<img @click="delteData(item.tid)" :src="item.picUrl" class="p-3 w-full h-full object-cover" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="food">
|
<tr>
|
||||||
<td @click="addFood(3)">晚餐</td>
|
<td class="w-16 h-48 text-4xl text-center cursor-pointer text-blue-500" @click="addFood(3)">晚餐</td>
|
||||||
<td v-for="(item, index) in foodData3" :key="index">
|
<td class="w-64 h-48 text-center" v-for="(item, index) in foodData3" :key="index">
|
||||||
<img @click="delteData(item.tid)" :src="item.picUrl" class="imageCss" />
|
<img @click="delteData(item.tid)" :src="item.picUrl" class="p-3 w-full h-full object-cover" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -66,21 +66,21 @@ const loading = ref(true); // 列表的加载中
|
|||||||
|
|
||||||
// ---------新增业务变量
|
// ---------新增业务变量
|
||||||
const message = useMessage(); // 消息弹窗
|
const message = useMessage(); // 消息弹窗
|
||||||
const weekData = reactive({
|
|
||||||
data: [],
|
|
||||||
}); //时间数组
|
|
||||||
const weekParams = reactive({
|
|
||||||
index: 0,
|
|
||||||
});
|
|
||||||
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 isActive = ref(-1);
|
|
||||||
let timedata = '';
|
let timedata = '';
|
||||||
|
let isActive = ref(-1);
|
||||||
|
const weekParams = reactive({
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
const weekData = reactive({
|
||||||
|
data: [],
|
||||||
|
}); //时间数组
|
||||||
const merchantId = ref();
|
const merchantId = ref();
|
||||||
const merchantStatus = ref(true);
|
|
||||||
const merchantInfo = ref<any>([]);
|
const merchantInfo = ref<any>([]);
|
||||||
let tableWitch = 1000;
|
|
||||||
|
|
||||||
const addFood = async (hourType: number) => {
|
const addFood = async (hourType: number) => {
|
||||||
if (!merchantId.value) {
|
if (!merchantId.value) {
|
||||||
@@ -114,11 +114,11 @@ watch(merchantId, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
let weekDataRes = await selectWeekInfo(weekParams);
|
const weekDataRes = await selectWeekInfo(weekParams);
|
||||||
weekData.data = weekDataRes.data;
|
weekData.data = weekDataRes.data;
|
||||||
isActive.value = 0;
|
isActive.value = 0;
|
||||||
timedata = weekData.data[0];
|
timedata = weekData.data[0];
|
||||||
//时间格式
|
// 时间格式
|
||||||
timedata = timedata.substring(0, timedata.indexOf('('));
|
timedata = timedata.substring(0, timedata.indexOf('('));
|
||||||
selectTimeFood();
|
selectTimeFood();
|
||||||
};
|
};
|
||||||
@@ -127,7 +127,6 @@ const selectTimeFood = async () => {
|
|||||||
foodData1.value = [];
|
foodData1.value = [];
|
||||||
foodData2.value = [];
|
foodData2.value = [];
|
||||||
foodData3.value = [];
|
foodData3.value = [];
|
||||||
tableWitch = 1000;
|
|
||||||
let params = {
|
let params = {
|
||||||
time: timedata,
|
time: timedata,
|
||||||
merchantId: merchantId.value,
|
merchantId: merchantId.value,
|
||||||
@@ -151,11 +150,6 @@ const selectTimeFood = async () => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (count > 0) {
|
|
||||||
tableWitch = count * 300 + 100;
|
|
||||||
} else {
|
|
||||||
tableWitch = 600;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
/** 删除数据源按钮 */
|
/** 删除数据源按钮 */
|
||||||
const delteData = async (tid: number) => {
|
const delteData = async (tid: number) => {
|
||||||
@@ -185,90 +179,23 @@ const delteData = async (tid: number) => {
|
|||||||
/** 初始化下拉框 */
|
/** 初始化下拉框 */
|
||||||
const merchantInit = async () => {
|
const merchantInit = async () => {
|
||||||
// 获取下拉框选项
|
// 获取下拉框选项
|
||||||
let res = await pageJoin({ current: 1, size: 9999 });
|
const res = await pageJoin({ current: 1, size: 9999 });
|
||||||
merchantInfo.value = res.data.records;
|
merchantInfo.value = res.data.records;
|
||||||
|
|
||||||
//默认选中第一个
|
//默认选中第一个
|
||||||
if (merchantInfo.value) {
|
if (merchantInfo.value) {
|
||||||
merchantId.value = merchantInfo.value[0].id;
|
merchantId.value = merchantInfo.value[0].id;
|
||||||
|
|
||||||
if (merchantInfo.value.length > 1) {
|
|
||||||
merchantStatus.value = false;
|
|
||||||
}
|
|
||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/** 初始化 **/
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
merchantInit();
|
merchantInit();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.title {
|
|
||||||
font-size: 28px;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleTable {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0;
|
|
||||||
margin-top: 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tdclass {
|
|
||||||
border: 1px solid rgb(233, 233, 233);
|
|
||||||
width: 13%;
|
|
||||||
height: 36px;
|
|
||||||
text-align: center;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trclass > td:first-child {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.trclass > td:last-child {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.foodTable {
|
|
||||||
margin-top: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.food td {
|
|
||||||
width: 250px;
|
|
||||||
height: 200px;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: white;
|
|
||||||
margin-left: 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.imageCss {
|
|
||||||
width: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.food td:first-child {
|
|
||||||
width: 60px;
|
|
||||||
height: 200px;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 4%;
|
|
||||||
background-color: transparent;
|
|
||||||
font-size: 26px;
|
|
||||||
cursor: pointer;
|
|
||||||
// text-decoration: blue underline;
|
|
||||||
color: rgb(0, 118, 228);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dataDiv {
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selectedSpan {
|
.selectedSpan {
|
||||||
border: 1px solid rgb(255, 187, 0);
|
border: 2px solid rgb(255, 187, 0);
|
||||||
color: rgb(255, 187, 0);
|
color: rgb(255, 187, 0);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user