完成菜品修改
This commit is contained in:
@ -38,7 +38,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.autohideinfo_wrapper {
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.autohideinfo_wrapper {
|
||||
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.editor, .ql-toolbar {
|
||||
white-space: pre-wrap!important;
|
||||
line-height: normal !important;
|
||||
@ -192,4 +192,4 @@ export default {
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -473,7 +473,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.margin-top-20{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="aspect">指标</div>
|
||||
<div class="recipes">
|
||||
<el-table :data="mData" border :span-method="spanMethod" size="mini">
|
||||
<el-table-column :label="`${name}第${num}天`"></el-table-column>
|
||||
<el-table-column label="菜品" prop="name"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "RecipesCom",
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: [],
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
num: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
mounted() {
|
||||
// console.log(this.data);
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
mData() {
|
||||
if (!this.data.dishes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const mData = this.data.dishes.reduce((arr, cur) => {
|
||||
if (cur.id > 0) {
|
||||
cur.igdList.forEach((igd) => {
|
||||
if (igd.id > 0) {
|
||||
const tarDetail = cur.detail.find((det) => det.id == igd.id);
|
||||
arr.push({
|
||||
id: cur.id,
|
||||
name: cur.name,
|
||||
type: cur.type,
|
||||
isMain: cur.isMain,
|
||||
methods: cur.methods,
|
||||
igdId: igd.id,
|
||||
igdName: igd.name,
|
||||
proteinRatio: igd.proteinRatio,
|
||||
fatRatio: igd.fatRatio,
|
||||
carbonRatio: igd.carbonRatio,
|
||||
rec: igd.rec,
|
||||
notRec: igd.notRec,
|
||||
weight: tarDetail ? tarDetail.weight : igd.weight,
|
||||
cusWeight: tarDetail ? tarDetail.cus_weight : igd.cusWeight,
|
||||
cusUnit: tarDetail ? tarDetail.cus_unit : igd.cusUnit,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
// console.log(mData);
|
||||
return mData;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
spanMethod({ row, column, rowIndex, columnIndex }) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.main {
|
||||
.aspect {
|
||||
}
|
||||
|
||||
.recipies {
|
||||
}
|
||||
}
|
||||
</style>
|
52
stdiet-ui/src/components/TextInfo/index.vue
Normal file
52
stdiet-ui/src/components/TextInfo/index.vue
Normal file
@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<div :class="classname">
|
||||
<span class="title">{{ title }}:</span>
|
||||
<span v-if="newLine">
|
||||
<div v-for="value in mValue" :key="value">{{ value }}</div>
|
||||
</span>
|
||||
<span v-else class="value">{{ mValue }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "TextInfo",
|
||||
data() {
|
||||
return {
|
||||
classname: `text_info_wrapper ${this.extraclass || ""}`,
|
||||
newLine: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mValue: function () {
|
||||
if (
|
||||
this.value &&
|
||||
typeof this.value === "string" &&
|
||||
this.value.includes("</br>")
|
||||
) {
|
||||
this.newLine = true;
|
||||
return this.value.split("</br>");
|
||||
}
|
||||
return this.value;
|
||||
},
|
||||
},
|
||||
props: ["title", "value", "extraclass"],
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.text_info_wrapper {
|
||||
display: flex;
|
||||
margin-right: 24px;
|
||||
min-width: 120px;
|
||||
font-size: 14px;
|
||||
|
||||
.title {
|
||||
color: #8c8c8c;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.value {
|
||||
/* color: #696969; */
|
||||
flex: 1 1 0;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user