From b8fad6218f769b52967b58fc1fb6feb439d283d6 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Wed, 3 Mar 2021 16:43:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlanPauseDrawer/index.vue | 8 +- stdiet-ui/src/views/custom/dishes/index.vue | 43 +- .../src/views/custom/ingredient/index.vue | 495 +++++++++--------- 3 files changed, 283 insertions(+), 263 deletions(-) diff --git a/stdiet-ui/src/components/RecipesPlanDrawer/PlanPauseDrawer/index.vue b/stdiet-ui/src/components/RecipesPlanDrawer/PlanPauseDrawer/index.vue index bf19309b1..21f35b212 100644 --- a/stdiet-ui/src/components/RecipesPlanDrawer/PlanPauseDrawer/index.vue +++ b/stdiet-ui/src/components/RecipesPlanDrawer/PlanPauseDrawer/index.vue @@ -14,7 +14,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - v-hasPermi="['orderPause:pause:add']" + v-hasPermi="['recipes:pause:add']" >新增 @@ -24,7 +24,7 @@ icon="el-icon-download" size="mini" @click="handleExport" - v-hasPermi="['orderPause:pause:export']" + v-hasPermi="['recipes:pause:export']" >导出 @@ -96,7 +96,7 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - v-hasPermi="['orderPause:pause:edit']" + v-hasPermi="['recipes:pause:edit']" >修改 删除 diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue index 2293142c8..d64acc459 100644 --- a/stdiet-ui/src/views/custom/dishes/index.vue +++ b/stdiet-ui/src/views/custom/dishes/index.vue @@ -247,17 +247,10 @@ :summary-method="getSummaries" style="width: 100%" > - - + + - + - - - - - + + + + + diff --git a/stdiet-ui/src/views/custom/ingredient/index.vue b/stdiet-ui/src/views/custom/ingredient/index.vue index b44ef216f..61fbff02c 100644 --- a/stdiet-ui/src/views/custom/ingredient/index.vue +++ b/stdiet-ui/src/views/custom/ingredient/index.vue @@ -96,13 +96,11 @@ icon="el-icon-search" size="mini" @click="handleQuery" - >搜索 - + >搜索 + 重置 - + >重置 + @@ -114,7 +112,7 @@ size="mini" @click="handleAdd" v-hasPermi="['custom:ingredient:add']" - >新增 + >新增 @@ -124,7 +122,7 @@ size="mini" @click="handleExport" v-hasPermi="['custom:ingredient:export']" - >导出 + >导出 + + + - + 修改 + >修改 删除 + >删除 @@ -241,7 +250,7 @@ - + @@ -376,244 +385,242 @@ From 96a405a314bb297cc7323735c434e86df253224d Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Wed, 3 Mar 2021 19:25:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=EF=BC=8C=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=A0=87=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/BodySignView/index.vue | 176 ++++++++++++------ .../src/components/HealthyView/index.vue | 116 +++++++++--- .../components/PhysicalSignsRemark/index.vue | 2 +- stdiet-ui/src/utils/healthyData.js | 10 + stdiet-ui/src/views/custom/dishes/index.vue | 35 ++-- .../RecipesView/RecipesAspectCom/BarChart.vue | 14 +- .../RecipesView/RecipesAspectCom/index.vue | 12 +- .../src/views/custom/recipesBuild/index.vue | 4 +- 8 files changed, 271 insertions(+), 98 deletions(-) diff --git a/stdiet-ui/src/components/BodySignView/index.vue b/stdiet-ui/src/components/BodySignView/index.vue index 89b1f13bf..417dc8b4c 100644 --- a/stdiet-ui/src/components/BodySignView/index.vue +++ b/stdiet-ui/src/components/BodySignView/index.vue @@ -1,7 +1,15 @@ - diff --git a/stdiet-ui/src/components/HealthyView/index.vue b/stdiet-ui/src/components/HealthyView/index.vue index a6b0135ac..ee00f0956 100644 --- a/stdiet-ui/src/components/HealthyView/index.vue +++ b/stdiet-ui/src/components/HealthyView/index.vue @@ -1,7 +1,15 @@ - diff --git a/stdiet-ui/src/components/PhysicalSignsRemark/index.vue b/stdiet-ui/src/components/PhysicalSignsRemark/index.vue index 8c3d57b71..a2d43b832 100644 --- a/stdiet-ui/src/components/PhysicalSignsRemark/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsRemark/index.vue @@ -4,7 +4,7 @@ { if (customerHealthy.hasOwnProperty(name)) { customerHealthy[name] = (String(customerHealthy[name]) || "") diff --git a/stdiet-ui/src/views/custom/dishes/index.vue b/stdiet-ui/src/views/custom/dishes/index.vue index d64acc459..8f0bb00d1 100644 --- a/stdiet-ui/src/views/custom/dishes/index.vue +++ b/stdiet-ui/src/views/custom/dishes/index.vue @@ -279,7 +279,7 @@ controls-position="right" @change="handleInputChange" :min="0" - :step="50" + :step="5" /> @@ -298,13 +298,14 @@ label="碳水/100g" align="center" /> - + @@ -753,21 +754,25 @@ export default { }, getSummaries(param) { const { columns, data } = param; + console.log(data); return columns.reduce( (arr, cur, idx) => { if (idx > 1) { if (idx === 6) { - // 备注 - return arr; + arr[6] = arr[3] * 4 + arr[4] * 9 + arr[5] * 4 + ' kcal'; + } else { + arr[idx] = data.reduce((acc, dAcc) => { + if (idx === 2) { + return acc + parseFloat(dAcc.weight); + } + return parseFloat( + ( + acc + + (dAcc[cur.property] * parseFloat(dAcc.weight)) / 100 + ).toFixed(1) + ); + }, 0); } - arr[idx] = data.reduce((acc, dAcc) => { - if (idx === 2) { - return acc + parseFloat(dAcc.weight); - } - return parseFloat( - (acc + (dAcc[cur.property] * dAcc.weight) / 100).toFixed(1) - ); - }, 0); } return arr; }, diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue index 91fd440ad..531961636 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/BarChart.vue @@ -30,6 +30,10 @@ export default { type: Array, default: [], }, + max: { + type: Number, + default: 0, + }, }, data() { return { @@ -64,6 +68,7 @@ export default { this.updateChart(this.data.length > 0 ? this.data : {}); }, updateChart(source) { + console.log(this.max); this.chart.clear(); this.chart.setOption({ title: { @@ -112,7 +117,7 @@ export default { grid: { top: 55, left: 20, - right: 20, + right: 50, bottom: 10, containLabel: true, }, @@ -135,6 +140,13 @@ export default { y: dim, x: 0, }, + markLine: { + data: [{ name: "BMR", yAxis: this.max - 400 }], + symbol: "none", + lineStyle: { + color: "red", + }, + }, itemStyle: { borderWidth: 2, borderColor: "#fff", diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue index 9c7705d47..65b73303b 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesAspectCom/index.vue @@ -58,6 +58,16 @@ :data="data" height="170px" width="500px" + :max=" + healthyData.basicBMR + ? parseFloat( + healthyData.basicBMR.substring( + 0, + healthyData.basicBMR.indexOf('千卡') + ) + ) + : 0 + " />
- - + +