feat(DictSelect): 支持多选模式并添加标签折叠功能
feat(meal): 修改用餐人数为成员选择并显示详细名单 feat: 新增用餐报表页面,包含数据统计和可视化图表
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<div style="display: flex; align-items: center;" v-loading="loading">
|
||||
<!-- 下拉选择器:绑定计算属性做双向绑定,保留原有样式+清空功能 -->
|
||||
<el-select v-model="innerValue" :placeholder="placeholder" clearable filterable style="width: 200px;">
|
||||
<el-select
|
||||
v-model="innerValue"
|
||||
:placeholder="placeholder"
|
||||
clearable filterable
|
||||
style="width: 200px;"
|
||||
:multiple="multiple" collapse-tags>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.dictValue"
|
||||
@@ -35,7 +40,6 @@
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<!-- 快捷新增表单区域【仅做新增,无编辑功能】 -->
|
||||
<el-form
|
||||
ref="dictFormRef"
|
||||
:model="form"
|
||||
@@ -140,7 +144,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDicts, addData, updateData, delData, listData } from '@/api/system/dict/data'
|
||||
import { addData, updateData, delData, listData } from '@/api/system/dict/data'
|
||||
import { listType } from '@/api/system/dict/type'
|
||||
|
||||
export default {
|
||||
@@ -152,6 +156,7 @@ export default {
|
||||
value: { type: String, default: '' },
|
||||
placeholder: { type: String, default: '请选择' },
|
||||
refresh: { type: Boolean, default: true },
|
||||
multiple: { type: Boolean, default: false },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -178,8 +183,22 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
innerValue: {
|
||||
get() { return this.value },
|
||||
set(val) { this.$emit('input', val) }
|
||||
get() {
|
||||
if (this.multiple) {
|
||||
if (!this.value) return []
|
||||
return this.value?.split(',') || []
|
||||
}
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
if (this.multiple) {
|
||||
this.$emit('input', val?.join(',') || '')
|
||||
this.$emit('change', val)
|
||||
} else {
|
||||
this.$emit('input', val)
|
||||
this.$emit('change', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user