修改界面

This commit is contained in:
huangdeliang 2021-01-15 23:15:09 +08:00
parent 0dffa51796
commit a9a6aeeaa1
5 changed files with 288 additions and 273 deletions

View File

@ -82,7 +82,7 @@ spring:
druid:
# 主库数据源
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
username: root
slave:

View File

@ -44,7 +44,7 @@
<sql id="selectSysIngreditentsByIdVo">
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
WHERE dishes_id = #{id}
) dishes

View File

@ -3,7 +3,7 @@
<div v-for="item in mData" :key="item">
{{ item }}
</div>
<div v-if="showMore">
<div v-if="data.length > 3">
<div>...</div>
<el-popover placement="top-start" width="200" popper-class="autohideinfo_detial" trigger="hover">
<div v-for="item in data" :key="item">{{ item }}</div>
@ -14,30 +14,28 @@
</template>
<script>
export default {
export default {
name: "AutoHideInfo",
data() {
return {
mData: [],
showMore: false,
};
},
props: {
data: {
type: Array,
default: [],
required: true,
default: '',
// required: true,
},
},
watch: {
data: function (val, oldVal) {
if (val) {
this.showMore = val.length > 3;
this.mData = val.slice(0, 3);
computed: {
mData: function () {
if (this.data instanceof Array) {
return this.data.slice(0, 3);
}
return [];
},
},
};
};
</script>
<style>

View File

@ -51,8 +51,16 @@
</el-row>
<el-table v-loading="loading" :data="dishesList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="id" align="center" prop="id" />-->
<el-table-column label="审核状态" align="center" width="80">
<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="type" :formatter="typeFormat"/>
<el-table-column label="包含食材" align="center">
@ -65,18 +73,12 @@
</el-table-column>
<el-table-column label="推荐人群" align="center">
<template slot-scope="scope">
<div v-for="tag in scope.row.recTags"
:key="tag">
{{tag}}
</div>
<autohideinfo :data="scope.row.recTags"/>
</template>
</el-table-column>
<el-table-column label="忌口人群" align="center">
<template slot-scope="scope">
<div v-for="tag in scope.row.notRecTags"
:key="tag">
{{tag}}
</div>
<autohideinfo :data="scope.row.notRecTags"/>
</template>
</el-table-column>
<el-table-column label="做法" align="center" prop="methods"/>
@ -219,6 +221,10 @@
prop="carbonRatio"
label="C/100g">
</el-table-column>
<el-table-column
prop="remark"
label="备注">
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="推荐人群">
@ -255,9 +261,13 @@
<script>
import {addDishes, delDishes, exportDishes, getDishes, listDishes, updateDishes} from "@/api/custom/dishes";
import {listAllIngredient} from "@/api/custom/ingredient";
import AutoHideInfo from "@/components/AutoHideInfo";
export default {
name: "Dishes",
components: {
autohideinfo: AutoHideInfo,
},
data() {
return {
//
@ -578,6 +588,10 @@
const {columns, data} = param;
return columns.reduce((arr, cur, idx) => {
if (idx > 1) {
if(idx === 6) {
//
return arr;
}
arr[idx] = data.reduce((acc, dAcc) => {
if (idx === 2) {
return acc + parseFloat(dAcc.weight);

View File

@ -96,10 +96,12 @@
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>搜索
</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>重置
</el-button
>
</el-form-item>
</el-form>
@ -190,19 +192,15 @@
width="120"
>
<template slot-scope="scope">
<div v-if="scope.row.notRec">
<autohideinfo :data="scope.row.notRec.split(',')" />
</div>
<autohideinfo :data="string2Arr(scope.row.notRec)"/>
</template>
</el-table-column>
<el-table-column label="推荐人群" align="center" prop="rec" width="120">
<template slot-scope="scope">
<div v-if="scope.row.rec">
<autohideinfo :data="scope.row.rec.split(',')" />
</div>
<autohideinfo :data="string2Arr(scope.row.rec)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column
label="操作"
align="center"
@ -243,7 +241,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12">
<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-col>
<el-col :span="12">
@ -378,20 +376,20 @@
</template>
<script>
import {
import {
addIngredient,
delIngredient,
exportIngredient,
getIngredient,
listIngredient,
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",
components: {
autohideinfo: AutoHideInfo,
@ -593,7 +591,8 @@ export default {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
.catch(function () {
});
},
/** 导出按钮操作 */
handleExport() {
@ -609,8 +608,12 @@ export default {
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
.catch(function () {
});
},
string2Arr(str) {
return str ? str.split(',') : []
}
},
};
};
</script>