diff --git a/stdiet-ui/src/components/HealthyView/index.vue b/stdiet-ui/src/components/HealthyView/index.vue index 298d9abac..a9003f686 100644 --- a/stdiet-ui/src/components/HealthyView/index.vue +++ b/stdiet-ui/src/components/HealthyView/index.vue @@ -105,6 +105,24 @@ export default { open: false, basicInfo, healthyInvestigate: [ + { + title: "既往病史/用药史评估", + content: [ + { title: "病史体征", value: "physicalSigns" }, + { title: "湿气数据", value: "moistureDate" }, + { title: "气血数据", value: "bloodData" }, + { title: "家族疾病史", value: "familyIllnessHistory" }, + { title: "手术史", value: "operationHistory" }, + { title: "近期是否做过手术", value: "nearOperationFlag" }, + { title: "手术恢复情况", value: "recoveryeSituation" }, + { title: "是否长期服用药物", value: "longEatDrugFlag" }, + { title: "长期服用的药物", value: "longEatDrugClassify" }, + { title: "是否出现过过敏症状", value: "allergyFlag" }, + { title: "过敏症状", value: "allergySituation" }, + { title: "过敏源", value: "allergen" }, + { title: "忌口过敏食物", value: "dishesIngredient" }, + ], + }, { title: "减脂经历评估", content: [ @@ -198,24 +216,7 @@ export default { { title: "熬夜频次", value: "stayupLateWeekNum" }, ], }, - { - title: "既往病史/用药史评估", - content: [ - { title: "病史体征", value: "physicalSigns" }, - { title: "湿气数据", value: "moistureDate" }, - { title: "气血数据", value: "bloodData" }, - { title: "家族疾病史", value: "familyIllnessHistory" }, - { title: "手术史", value: "operationHistory" }, - { title: "近期是否做过手术", value: "nearOperationFlag" }, - { title: "手术恢复情况", value: "recoveryeSituation" }, - { title: "是否长期服用药物", value: "longEatDrugFlag" }, - { title: "长期服用的药物", value: "longEatDrugClassify" }, - { title: "是否出现过过敏症状", value: "allergyFlag" }, - { title: "过敏症状", value: "allergySituation" }, - { title: "过敏源", value: "allergen" }, - { title: "忌口过敏食物", value: "dishesIngredient" }, - ], - }, + { title: "体检报告", content: [ diff --git a/stdiet-ui/src/store/modules/recipes.js b/stdiet-ui/src/store/modules/recipes.js index 3f3d903d7..94e4ed2d9 100644 --- a/stdiet-ui/src/store/modules/recipes.js +++ b/stdiet-ui/src/store/modules/recipes.js @@ -254,21 +254,28 @@ const actions = { const tarDetail = cur.detail.find( obj => obj.id === igdData.id ); - if (tarDetail) { - igdArr.push({ - id: igdData.id, - name: igdData.name, - carbonRatio: igdData.carbonRatio, - fatRatio: igdData.fatRatio, - proteinRatio: igdData.proteinRatio, - cusUnit: tarDetail.cus_unit, - cusWeight: tarDetail.cus_weight, - weight: parseFloat(tarDetail.weight), - notRec: igdData.notRec, - rec: igdData.rec, - type: igdData.type - }); + if (tarDetail && tarDetail.weight === -1) { + return igdArr; } + igdArr.push({ + id: igdData.id, + name: igdData.name, + carbonRatio: igdData.carbonRatio, + fatRatio: igdData.fatRatio, + proteinRatio: igdData.proteinRatio, + cusUnit: tarDetail + ? tarDetail.cus_unit + : igdData.cusUnit, + cusWeight: tarDetail + ? tarDetail.cus_weight + : igdData.cusWeight, + weight: parseFloat( + tarDetail ? tarDetail.weight : igdData.weight + ), + notRec: igdData.notRec, + rec: igdData.rec, + type: igdData.type + }); } return igdArr; }, []) @@ -400,17 +407,12 @@ const actions = { })); } else if (actionType === "delIgd") { // 删除某食材 - params.detail = mTarDishes.igdList.reduce((arr, igd) => { - if (igd.id !== payload.igdId) { - arr.push({ - id: igd.id, - weight: igd.weight, - cus_unit: igd.cusUnit, - cus_weight: igd.cusWeight - }); - } - return arr; - }, []); + params.detail = mTarDishes.igdList.map(igd => ({ + id: igd.id, + weight: igd.id === payload.igdId ? -1 : igd.weight, + cus_unit: igd.cusUnit, + cus_weight: igd.cusWeight + })); } else if (actionType === "unit" || actionType === "weight") { // 修改食材 params.detail = mTarDishes.igdList.map(igd => { @@ -512,13 +514,13 @@ const getters = { (obj, cur) => { cur.igdList.forEach(igd => { obj.pWeight += (igd.weight / 100) * igd.proteinRatio; - obj.pHeat = obj.pWeight * 4; + obj.pCalories = obj.pWeight * 4; obj.fWeight += (igd.weight / 100) * igd.fatRatio; - obj.fHeat = obj.fWeight * 9; + obj.fCalories = obj.fWeight * 9; obj.cWeight += (igd.weight / 100) * igd.carbonRatio; - obj.cHeat = obj.cWeight * 4; - obj.totalHeat = obj.pHeat + obj.fHeat + obj.cHeat; - obj[`heat${cur.type}`] += + obj.cCalories = obj.cWeight * 4; + obj.totalCalories = obj.pCalories + obj.fCalories + obj.cCalories; + obj[`calories${cur.type}`] += (igd.weight / 100) * igd.proteinRatio * 4 + (igd.weight / 100) * igd.fatRatio * 9 + (igd.weight / 100) * igd.carbonRatio * 4; @@ -532,17 +534,17 @@ const getters = { pWeight: 0, fWeight: 0, cWeight: 0, - pHeat: 0, - fHeat: 0, - cHeat: 0, + pCalories: 0, + fCalories: 0, + cCalories: 0, // - totalHeat: 0, - heat1: 0, - heat2: 0, - heat3: 0, - heat4: 0, - heat5: 0, - heat6: 0, + totalCalories: 0, + calories1: 0, + calories2: 0, + calories3: 0, + calories4: 0, + calories5: 0, + calories6: 0, // totalWeight: 0, weight1: 0, @@ -554,7 +556,7 @@ const getters = { } ) ); - console.log(nutriData); + // console.log(nutriData); return nutriData; }, verifyNotRecData: state => { diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/BarChart/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/BarChart/index.vue deleted file mode 100644 index 6fdfab1c9..000000000 --- a/stdiet-ui/src/views/custom/recipesBuild/InfoView/BarChart/index.vue +++ /dev/null @@ -1,180 +0,0 @@ - - - diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/PieChart/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/PieChart/index.vue new file mode 100644 index 000000000..bf5d37a9b --- /dev/null +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/PieChart/index.vue @@ -0,0 +1,276 @@ + + + + diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/index.vue new file mode 100644 index 000000000..7945362bf --- /dev/null +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/DailyAnalyzeCom/index.vue @@ -0,0 +1,115 @@ + + + + diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/PieChart/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/PieChart/index.vue deleted file mode 100644 index 32c634733..000000000 --- a/stdiet-ui/src/views/custom/recipesBuild/InfoView/PieChart/index.vue +++ /dev/null @@ -1,421 +0,0 @@ - - - - diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/BarChart/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/BarChart/index.vue new file mode 100644 index 000000000..cc9489a3e --- /dev/null +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/BarChart/index.vue @@ -0,0 +1,221 @@ + + + diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/index.vue new file mode 100644 index 000000000..2a3dae557 --- /dev/null +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/WeaklyAnalyzeCom/index.vue @@ -0,0 +1,114 @@ + + + diff --git a/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue b/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue index 80f9ef9f2..e18a0633b 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/InfoView/index.vue @@ -1,50 +1,46 @@ diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/index.vue index 359613a1b..361e47bb1 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesCom/index.vue @@ -337,7 +337,8 @@ export default { } lastNameHit = arr[arr.length - 1].name === cur.name && - arr[arr.length - 1].type === cur.type; + arr[arr.length - 1].type === cur.type + // arr[arr.length - 1].dishesId === cur.dishesId; if (lastNameHit) { let namePos = arr.length - 1; for (let i = namePos; i >= 0; i--) { diff --git a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue index 11e030171..feed15795 100644 --- a/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue +++ b/stdiet-ui/src/views/custom/recipesBuild/RecipesView/RecipesHeaderCom/index.vue @@ -44,6 +44,7 @@ placement="bottom" trigger="click" title="修改食谱状态" + v-if="!!recipesId" style="margin-right: 12px" >
@@ -70,7 +71,6 @@ {{ getReviewStatusName(reviewStatus) }} diff --git a/stdiet-ui/src/views/custom/recipesShow/MenuDetail/index.vue b/stdiet-ui/src/views/custom/recipesShow/MenuDetail/index.vue index 247fff2f0..c8e37e277 100644 --- a/stdiet-ui/src/views/custom/recipesShow/MenuDetail/index.vue +++ b/stdiet-ui/src/views/custom/recipesShow/MenuDetail/index.vue @@ -15,7 +15,10 @@
-
+
{{ mObj.name }} {{ mObj.cusStr }} @@ -87,7 +90,7 @@ export default { typeName: this.menuTypeDict[type], values: mData[type], })); - // console.log(mMenus); + console.log(mMenus); return mMenus; }, ...mapState(["cusUnitDict", "cusWeightDict", "menuTypeDict"]), diff --git a/stdiet-ui/src/views/custom/recipesShow/utils.js b/stdiet-ui/src/views/custom/recipesShow/utils.js index 0d2dc6f37..2ded2c2b6 100644 --- a/stdiet-ui/src/views/custom/recipesShow/utils.js +++ b/stdiet-ui/src/views/custom/recipesShow/utils.js @@ -1,6 +1,5 @@ export function getProcessMenuData(menuData) { - // const igdPlanData = {}; - + // console.log(menuData) const menuList = menuData.reduce((arr, cur) => { if ( cur.dishesId > -1 && @@ -42,5 +41,6 @@ export function getProcessMenuData(menuData) { } return arr; }, []); + // console.log(menuList); return menuList; }