修改界面
This commit is contained in:
parent
0dffa51796
commit
a9a6aeeaa1
@ -82,7 +82,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://47.115.23.82:3306/stdiet_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://47.115.23.82:3306/stdiet?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
password: gzDxPaZcSiXJpi2N
|
password: gzDxPaZcSiXJpi2N
|
||||||
username: root
|
username: root
|
||||||
slave:
|
slave:
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<sql id="selectSysIngreditentsByIdVo">
|
<sql id="selectSysIngreditentsByIdVo">
|
||||||
SELECT * FROM(
|
SELECT * FROM(
|
||||||
SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_unit
|
SELECT ingredient_id AS id, ingredient_weight AS weight, cus_weight, cus_unit, remark
|
||||||
FROM sys_dishes_ingredient
|
FROM sys_dishes_ingredient
|
||||||
WHERE dishes_id = #{id}
|
WHERE dishes_id = #{id}
|
||||||
) dishes
|
) dishes
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div v-for="item in mData" :key="item">
|
<div v-for="item in mData" :key="item">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showMore">
|
<div v-if="data.length > 3">
|
||||||
<div>...</div>
|
<div>...</div>
|
||||||
<el-popover placement="top-start" width="200" popper-class="autohideinfo_detial" trigger="hover">
|
<el-popover placement="top-start" width="200" popper-class="autohideinfo_detial" trigger="hover">
|
||||||
<div v-for="item in data" :key="item">{{ item }}</div>
|
<div v-for="item in data" :key="item">{{ item }}</div>
|
||||||
@ -14,30 +14,28 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "AutoHideInfo",
|
name: "AutoHideInfo",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mData: [],
|
|
||||||
showMore: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: '',
|
||||||
required: true,
|
// required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
computed: {
|
||||||
data: function (val, oldVal) {
|
mData: function () {
|
||||||
if (val) {
|
if (this.data instanceof Array) {
|
||||||
this.showMore = val.length > 3;
|
return this.data.slice(0, 3);
|
||||||
this.mData = val.slice(0, 3);
|
|
||||||
}
|
}
|
||||||
|
return [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@ -51,8 +51,16 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="dishesList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="dishesList" @selection-change="handleSelectionChange">
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
<el-table-column label="审核状态" align="center" width="80">
|
||||||
<!-- <el-table-column label="id" align="center" prop="id" />-->
|
<template slot-scope="scope">
|
||||||
|
<el-tag
|
||||||
|
:type="scope.row.reviewStatus === 'yes' ? 'success' : 'danger'"
|
||||||
|
disable-transitions
|
||||||
|
>
|
||||||
|
{{ scope.row.reviewStatus === "yes" ? "已审核" : "未审核" }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="菜品名称" align="center" prop="name"/>
|
<el-table-column label="菜品名称" align="center" prop="name"/>
|
||||||
<el-table-column label="菜品类型" align="center" prop="type" :formatter="typeFormat"/>
|
<el-table-column label="菜品类型" align="center" prop="type" :formatter="typeFormat"/>
|
||||||
<el-table-column label="包含食材" align="center">
|
<el-table-column label="包含食材" align="center">
|
||||||
@ -65,18 +73,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="推荐人群" align="center">
|
<el-table-column label="推荐人群" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="tag in scope.row.recTags"
|
<autohideinfo :data="scope.row.recTags"/>
|
||||||
:key="tag">
|
|
||||||
{{tag}}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="忌口人群" align="center">
|
<el-table-column label="忌口人群" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-for="tag in scope.row.notRecTags"
|
<autohideinfo :data="scope.row.notRecTags"/>
|
||||||
:key="tag">
|
|
||||||
{{tag}}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="做法" align="center" prop="methods"/>
|
<el-table-column label="做法" align="center" prop="methods"/>
|
||||||
@ -219,6 +221,10 @@
|
|||||||
prop="carbonRatio"
|
prop="carbonRatio"
|
||||||
label="C/100g">
|
label="C/100g">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="remark"
|
||||||
|
label="备注">
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="推荐人群">
|
<el-form-item label="推荐人群">
|
||||||
@ -255,9 +261,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import {addDishes, delDishes, exportDishes, getDishes, listDishes, updateDishes} from "@/api/custom/dishes";
|
import {addDishes, delDishes, exportDishes, getDishes, listDishes, updateDishes} from "@/api/custom/dishes";
|
||||||
import {listAllIngredient} from "@/api/custom/ingredient";
|
import {listAllIngredient} from "@/api/custom/ingredient";
|
||||||
|
import AutoHideInfo from "@/components/AutoHideInfo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Dishes",
|
name: "Dishes",
|
||||||
|
components: {
|
||||||
|
autohideinfo: AutoHideInfo,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -578,6 +588,10 @@
|
|||||||
const {columns, data} = param;
|
const {columns, data} = param;
|
||||||
return columns.reduce((arr, cur, idx) => {
|
return columns.reduce((arr, cur, idx) => {
|
||||||
if (idx > 1) {
|
if (idx > 1) {
|
||||||
|
if(idx === 6) {
|
||||||
|
// 备注
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
arr[idx] = data.reduce((acc, dAcc) => {
|
arr[idx] = data.reduce((acc, dAcc) => {
|
||||||
if (idx === 2) {
|
if (idx === 2) {
|
||||||
return acc + parseFloat(dAcc.weight);
|
return acc + parseFloat(dAcc.weight);
|
||||||
|
@ -96,10 +96,12 @@
|
|||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleQuery"
|
@click="handleQuery"
|
||||||
>搜索</el-button
|
>搜索
|
||||||
|
</el-button
|
||||||
>
|
>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
>重置</el-button
|
>重置
|
||||||
|
</el-button
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -190,19 +192,15 @@
|
|||||||
width="120"
|
width="120"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.notRec">
|
<autohideinfo :data="string2Arr(scope.row.notRec)"/>
|
||||||
<autohideinfo :data="scope.row.notRec.split(',')" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="推荐人群" align="center" prop="rec" width="120">
|
<el-table-column label="推荐人群" align="center" prop="rec" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.rec">
|
<autohideinfo :data="string2Arr(scope.row.rec)"/>
|
||||||
<autohideinfo :data="scope.row.rec.split(',')" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
@ -243,7 +241,7 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="食材名称" prop="name" label-width="90px">
|
<el-form-item label="食材名称" prop="name" label-width="90px">
|
||||||
<el-input v-model="form.name" placeholder="请输入食材名称" />
|
<el-input v-model="form.name" placeholder="请输入食材名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -378,20 +376,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addIngredient,
|
addIngredient,
|
||||||
delIngredient,
|
delIngredient,
|
||||||
exportIngredient,
|
exportIngredient,
|
||||||
getIngredient,
|
getIngredient,
|
||||||
listIngredient,
|
listIngredient,
|
||||||
updateIngredient,
|
updateIngredient,
|
||||||
} from "@/api/custom/ingredient";
|
} from "@/api/custom/ingredient";
|
||||||
|
|
||||||
import AutoHideInfo from "@/components/AutoHideInfo";
|
import AutoHideInfo from "@/components/AutoHideInfo";
|
||||||
|
|
||||||
import { listPhysicalSigns } from "@/api/custom/physicalSigns";
|
import {listPhysicalSigns} from "@/api/custom/physicalSigns";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Ingredient",
|
name: "Ingredient",
|
||||||
components: {
|
components: {
|
||||||
autohideinfo: AutoHideInfo,
|
autohideinfo: AutoHideInfo,
|
||||||
@ -593,7 +591,8 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.catch(function () {});
|
.catch(function () {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
@ -609,8 +608,12 @@ export default {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
})
|
})
|
||||||
.catch(function () {});
|
.catch(function () {
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
string2Arr(str) {
|
||||||
|
return str ? str.split(',') : []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user