addSmartRec.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <div class="container">
  3. <div class="header-bar">
  4. <el-button @click="goBack" type="primary" plain class="back-btn">
  5. <el-icon>
  6. <ArrowLeft />
  7. </el-icon>
  8. 返回
  9. </el-button>
  10. <span class="title">智能推荐</span>
  11. </div>
  12. <!-- 基本信息 -->
  13. <el-card class="content-card">
  14. <div class="card-title">基本信息</div>
  15. <div class="form-content">
  16. <div class="diet-type">
  17. <span class="required">基本膳食</span>
  18. <el-checkbox-group :model-value="dietTypes">
  19. <el-checkbox v-for="item in dietOptions" :key="item" :label="item"
  20. @click="(e) => onDietTypesChange(item, e)">
  21. {{ item }}
  22. </el-checkbox>
  23. </el-checkbox-group>
  24. </div>
  25. <div class="forbidden-food">
  26. <span>禁忌食材</span>
  27. <div class="food-select" @click="openFoodDialog">
  28. <div v-if="forbiddenFoods" class="selected-foods">
  29. <el-tag v-for="food in forbiddenFoods.split(',')" :key="food" size="small" closable
  30. @close="removeForbiddenFood(food)">
  31. {{ food }}
  32. </el-tag>
  33. </div>
  34. <div v-else class="placeholder">请选择</div>
  35. <el-icon class="select-icon">
  36. <ArrowDown />
  37. </el-icon>
  38. </div>
  39. </div>
  40. </div>
  41. </el-card>
  42. <!-- 热量计算 -->
  43. <el-card class="content-card">
  44. <div class="card-title">热量计算</div>
  45. <div class="form-content">
  46. <div class="form-row">
  47. <div class="form-item">
  48. <span class="required">身高</span>
  49. <div class="input-with-unit">
  50. <el-input v-model="height" placeholder="请输入" />
  51. <span class="unit">cm</span>
  52. </div>
  53. </div>
  54. <div class="form-item">
  55. <span class="required">体重</span>
  56. <div class="input-with-unit">
  57. <el-input v-model="weight" placeholder="请输入" />
  58. <span class="unit">kg</span>
  59. </div>
  60. </div>
  61. <div class="form-item">
  62. <span>理想体重:</span>
  63. <span class="value">{{ idealWeight }}kg</span>
  64. </div>
  65. </div>
  66. <div class="form-row">
  67. <div class="form-item physical-activity">
  68. <span class="required">体力活动</span>
  69. <el-radio-group :model-value="activityLevel">
  70. <el-radio label="静养活动" @click="(e) => onActivityLevelChange('静养活动', e)">静养活动</el-radio>
  71. <el-radio label="轻体力活动" @click="(e) => onActivityLevelChange('轻体力活动', e)">轻体力活动</el-radio>
  72. <el-radio label="中体力活动" @click="(e) => onActivityLevelChange('中体力活动', e)">中体力活动</el-radio>
  73. <el-radio label="重体力活动" @click="(e) => onActivityLevelChange('重体力活动', e)">重体力活动</el-radio>
  74. </el-radio-group>
  75. </div>
  76. </div>
  77. <div class="form-row">
  78. <div class="form-item">
  79. <span class="required">热量</span>
  80. <el-input v-model="calories" placeholder="请输入" style="width: 120px" />
  81. <span class="unit">kcal/(kg*d)</span>
  82. </div>
  83. <div class="form-item">
  84. <span>参考范围</span>
  85. <el-icon class="info-icon">
  86. <QuestionFilled />
  87. </el-icon>
  88. </div>
  89. <div class="form-item">
  90. <span>总热量</span>
  91. <span class="value">{{ totalCalories }} kcal/d</span>
  92. </div>
  93. <div class="form-item">
  94. <span>体质指标(BMI):</span>
  95. <span class="value">{{ bmi }}</span>
  96. <span class="status" :style="{ color: bmiColor }">正常</span>
  97. </div>
  98. <div class="form-item bmi-slider">
  99. <el-slider v-model="bmiValue" :min="18.5" :max="23.9" :step="0.1" :show-tooltip="false" :marks="{
  100. 18.5: '18.5',
  101. 23.9: '23.9'
  102. }" style="width: 160px" />
  103. <div class="bmi-status-text">
  104. <span>20.20(正常)</span>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </el-card>
  110. <!-- 比例设置 -->
  111. <el-card class="content-card">
  112. <div class="card-title">比例设置</div>
  113. <div class="form-content">
  114. <div class="ratio-section">
  115. <div class="ratio-header">
  116. <span>各餐比例:</span>
  117. <el-progress :stroke-width="10" :percentage="100" :format="() => '100.00%'" :color="'#00B42A'"
  118. :striped="true" :striped-flow="true" />
  119. </div>
  120. <div class="meal-ratios">
  121. <div class="ratio-items">
  122. <div class="ratio-item">
  123. <span>早餐</span>
  124. <div class="input-with-unit">
  125. <el-input v-model="breakfast" style="width: 120px" />
  126. <span class="unit">%</span>
  127. </div>
  128. </div>
  129. <div class="ratio-item">
  130. <span>早加</span>
  131. <div class="input-with-unit">
  132. <el-input v-model="morningSnack" style="width: 120px" />
  133. <span class="unit">%</span>
  134. </div>
  135. </div>
  136. <div class="ratio-item">
  137. <span>中餐</span>
  138. <div class="input-with-unit">
  139. <el-input v-model="lunch" style="width: 120px" />
  140. <span class="unit">%</span>
  141. </div>
  142. </div>
  143. <div class="ratio-item">
  144. <span>中加</span>
  145. <div class="input-with-unit">
  146. <el-input v-model="afternoonSnack" style="width: 120px" />
  147. <span class="unit">%</span>
  148. </div>
  149. </div>
  150. <div class="ratio-item">
  151. <span>晚餐</span>
  152. <div class="input-with-unit">
  153. <el-input v-model="dinner" style="width: 120px" />
  154. <span class="unit">%</span>
  155. </div>
  156. </div>
  157. <div class="ratio-item">
  158. <span>晚加</span>
  159. <div class="input-with-unit">
  160. <el-input v-model="eveningSnack" style="width: 120px" />
  161. <span class="unit">%</span>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <div class="nutrition-ratio">
  167. <span>三大营养素供能比:</span>
  168. <el-progress :stroke-width="10" :percentage="95" :format="() => '95%'" :color="'#00B42A'" :striped="true"
  169. :striped-flow="true" />
  170. </div>
  171. <div class="nutrition-ratios">
  172. <div class="ratio-item">
  173. <span>碳水化合物</span>
  174. <div class="input-with-unit">
  175. <el-input v-model="carbs" style="width: 120px" />
  176. <span class="unit">%</span>
  177. </div>
  178. </div>
  179. <div class="ratio-item">
  180. <span>蛋白质</span>
  181. <div class="input-with-unit">
  182. <el-input v-model="protein" style="width: 120px" />
  183. <span class="unit">%</span>
  184. </div>
  185. </div>
  186. <div class="ratio-item">
  187. <span>脂肪</span>
  188. <div class="input-with-unit">
  189. <el-input v-model="fat" style="width: 120px" />
  190. <span class="unit">%</span>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </el-card>
  197. <!-- 底部按钮 -->
  198. <div>
  199. <div class="btn-wrapper">
  200. <el-button @click="handleCancel">取消</el-button>
  201. <el-button type="primary" @click="handleGenerate">生成推荐方案</el-button>
  202. </div>
  203. </div>
  204. <!-- 添加食材选择弹窗 -->
  205. <common-dialog ref="foodDialogRef" type="food" title="添加食材" @confirm="handleFoodConfirm"
  206. @cancel="handleFoodCancel" />
  207. </div>
  208. </template>
  209. <script setup lang="ts">
  210. import { ref, computed } from 'vue';
  211. import { ArrowLeft, CircleCheck, QuestionFilled, ArrowDown } from '@element-plus/icons-vue';
  212. import CommonDialog from './components/CommonDialog.vue';
  213. // 基本信息
  214. const dietTypes = ref<string[]>(['普食']); // 确保是数组类型
  215. const dietOptions = ['普食', '软食', '半流食', '流食'];
  216. const forbiddenFoods = ref('');
  217. const foodDialogRef = ref();
  218. // 打开食材选择弹窗
  219. const openFoodDialog = () => {
  220. // 将当前已选择的食材传入
  221. const currentFoods = forbiddenFoods.value ? forbiddenFoods.value.split(',').map((name) => ({ name: name.trim() })) : [];
  222. foodDialogRef.value?.openDialog('food', currentFoods);
  223. };
  224. // 处理食材选择确认
  225. const handleFoodConfirm = (selectedFoods: any[]) => {
  226. forbiddenFoods.value = selectedFoods.map((item) => item.name).join(',');
  227. };
  228. // 处理食材选择取消
  229. const handleFoodCancel = () => {
  230. console.log('取消选择食材');
  231. };
  232. // 移除禁忌食材
  233. const removeForbiddenFood = (food: string) => {
  234. const foods = forbiddenFoods.value.split(',');
  235. forbiddenFoods.value = foods.filter((f) => f !== food).join(',');
  236. };
  237. // 热量计算
  238. const height = ref('165.00');
  239. const weight = ref('55.00');
  240. const idealWeight = ref(60);
  241. const activityLevel = ref('静养活动');
  242. const calories = ref('15.00');
  243. const totalCalories = computed(() => {
  244. const cal = parseFloat(calories.value) || 0;
  245. const w = parseFloat(weight.value) || 0;
  246. return (cal * w).toFixed(2);
  247. });
  248. // BMI计算
  249. const bmi = computed(() => {
  250. const h = parseFloat(height.value) || 0;
  251. const w = parseFloat(weight.value) || 0;
  252. if (!h || !w) return '0.00';
  253. return (w / Math.pow(h / 100, 2)).toFixed(2);
  254. });
  255. const bmiStatus = computed(() => {
  256. const bmiValue = parseFloat(bmi.value);
  257. if (bmiValue < 18.5) return '偏瘦';
  258. if (bmiValue <= 23.9) return '正常';
  259. return '偏胖';
  260. });
  261. const bmiPercentage = computed(() => {
  262. const bmiValue = parseFloat(bmi.value);
  263. return Math.min(Math.max(((bmiValue - 18.5) / (23.9 - 18.5)) * 100, 0), 100);
  264. });
  265. const bmiColor = computed(() => {
  266. const bmiValue = parseFloat(bmi.value);
  267. if (bmiValue < 18.5) return '#FF9900';
  268. if (bmiValue <= 23.9) return '#00B42A';
  269. return '#FF3A00';
  270. });
  271. // 比例设置
  272. const breakfast = ref('30.00');
  273. const morningSnack = ref('0.00');
  274. const lunch = ref('40.00');
  275. const afternoonSnack = ref('0.00');
  276. const dinner = ref('30.00');
  277. const eveningSnack = ref('0.00');
  278. // 营养素比例
  279. const carbs = ref('50.00');
  280. const protein = ref('15.00');
  281. const fat = ref('30.00');
  282. const bmiValue = ref(20.2);
  283. const emit = defineEmits(['goBack']);
  284. // 返回上一页
  285. const goBack = () => {
  286. emit('goBack');
  287. };
  288. const onDietTypesChange = (item: string, e: Event) => {
  289. e.stopPropagation();
  290. e.preventDefault();
  291. const newVals = toRaw(dietTypes.value);
  292. if (newVals.includes(item)) {
  293. newVals.splice(newVals.indexOf(item), 1);
  294. } else {
  295. newVals.push(item);
  296. }
  297. dietTypes.value = [...new Set(newVals)];
  298. };
  299. const onActivityLevelChange = (val: string, e: Event) => {
  300. e.stopPropagation();
  301. e.preventDefault();
  302. activityLevel.value = val;
  303. };
  304. // 按钮处理函数
  305. const handleCancel = () => {
  306. // 取消操作
  307. goBack();
  308. };
  309. const handleGenerate = () => {
  310. // 生成推荐方案
  311. console.log('生成推荐方案');
  312. };
  313. </script>
  314. <style lang="scss" scoped>
  315. .container {
  316. padding-bottom: 76px;
  317. }
  318. .header-bar {
  319. display: flex;
  320. align-items: center;
  321. margin-bottom: 16px;
  322. .back-btn {
  323. margin-right: 16px;
  324. display: flex;
  325. align-items: center;
  326. .el-icon {
  327. margin-right: 4px;
  328. }
  329. }
  330. .title {
  331. font-size: 20px;
  332. font-weight: 600;
  333. }
  334. }
  335. .content-card {
  336. margin-bottom: 16px;
  337. .card-title {
  338. font-size: 16px;
  339. font-weight: 600;
  340. color: #1d2129;
  341. margin-bottom: 16px;
  342. position: relative;
  343. padding-left: 12px;
  344. &::before {
  345. content: '';
  346. position: absolute;
  347. left: 0;
  348. top: 50%;
  349. transform: translateY(-50%);
  350. width: 4px;
  351. height: 16px;
  352. background-color: #165dff;
  353. border-radius: 2px;
  354. }
  355. }
  356. .form-content {
  357. padding: 0 12px;
  358. .form-row {
  359. display: flex;
  360. align-items: center;
  361. margin-bottom: 24px;
  362. gap: 32px;
  363. &:last-child {
  364. margin-bottom: 0;
  365. }
  366. .form-item {
  367. display: flex;
  368. align-items: center;
  369. gap: 8px;
  370. &:not(.physical-activity) {
  371. min-width: auto;
  372. }
  373. .input-with-unit {
  374. display: flex;
  375. align-items: center;
  376. gap: 8px;
  377. .el-input {
  378. width: 160px;
  379. }
  380. .unit {
  381. color: #4e5969;
  382. font-size: 14px;
  383. white-space: nowrap;
  384. }
  385. }
  386. .value {
  387. color: #1d2129;
  388. font-weight: 600;
  389. }
  390. .info-icon {
  391. color: #86909c;
  392. cursor: pointer;
  393. }
  394. .bmi-status {
  395. font-size: 14px;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .diet-type {
  402. margin-bottom: 16px;
  403. display: flex;
  404. align-items: center;
  405. gap: 16px;
  406. :deep(.el-checkbox-group) {
  407. display: flex;
  408. gap: 24px;
  409. }
  410. :deep(.el-checkbox) {
  411. margin-right: 0;
  412. height: 32px;
  413. .el-checkbox__label {
  414. font-size: 14px;
  415. color: #4e5969;
  416. }
  417. .el-checkbox__input {
  418. &.is-checked {
  419. .el-checkbox__inner {
  420. background-color: #409eff;
  421. border-color: #409eff;
  422. }
  423. }
  424. .el-checkbox__inner {
  425. &:hover {
  426. border-color: #409eff;
  427. }
  428. }
  429. }
  430. &:hover {
  431. .el-checkbox__label {
  432. color: #409eff;
  433. }
  434. }
  435. }
  436. }
  437. .forbidden-food {
  438. display: flex;
  439. align-items: flex-start;
  440. gap: 16px;
  441. span {
  442. min-width: 70px;
  443. line-height: 32px;
  444. }
  445. .food-select {
  446. flex: 1;
  447. min-height: 32px;
  448. padding: 4px 30px 4px 12px;
  449. border: 1px solid #dcdfe6;
  450. border-radius: 4px;
  451. cursor: pointer;
  452. position: relative;
  453. background-color: #fff;
  454. &:hover {
  455. border-color: #409eff;
  456. }
  457. .selected-foods {
  458. display: flex;
  459. flex-wrap: wrap;
  460. gap: 8px;
  461. }
  462. .placeholder {
  463. color: #909399;
  464. line-height: 24px;
  465. }
  466. .select-icon {
  467. position: absolute;
  468. right: 8px;
  469. top: 50%;
  470. transform: translateY(-50%);
  471. font-size: 14px;
  472. color: #c0c4cc;
  473. }
  474. }
  475. }
  476. .form-item {
  477. display: flex;
  478. align-items: center;
  479. gap: 8px;
  480. margin-bottom: 16px;
  481. .input-with-unit {
  482. display: flex;
  483. align-items: center;
  484. gap: 8px;
  485. }
  486. .unit {
  487. color: #4e5969;
  488. font-size: 14px;
  489. }
  490. .value {
  491. color: #1d2129;
  492. font-weight: 600;
  493. }
  494. .info-icon {
  495. color: #86909c;
  496. cursor: pointer;
  497. }
  498. }
  499. .required {
  500. position: relative;
  501. padding-left: 8px;
  502. &::before {
  503. content: '*';
  504. color: #ff3a00;
  505. position: absolute;
  506. left: 0;
  507. top: 50%;
  508. transform: translateY(-50%);
  509. }
  510. }
  511. .physical-activity {
  512. width: 100%;
  513. :deep(.el-radio-group) {
  514. display: flex;
  515. gap: 32px;
  516. }
  517. :deep(.el-radio) {
  518. margin-right: 0;
  519. height: 32px;
  520. .el-radio__label {
  521. font-size: 14px;
  522. color: #4e5969;
  523. }
  524. }
  525. }
  526. .calorie-info {
  527. display: flex;
  528. align-items: center;
  529. flex-wrap: nowrap;
  530. gap: 32px;
  531. margin-bottom: 16px;
  532. .info-item {
  533. display: flex;
  534. align-items: center;
  535. gap: 8px;
  536. white-space: nowrap;
  537. color: #4e5969;
  538. font-size: 14px;
  539. .required {
  540. position: relative;
  541. padding-left: 8px;
  542. &::before {
  543. content: '*';
  544. color: #ff3a00;
  545. position: absolute;
  546. left: 0;
  547. top: 50%;
  548. transform: translateY(-50%);
  549. }
  550. }
  551. .unit {
  552. color: #4e5969;
  553. }
  554. .value {
  555. color: #1d2129;
  556. font-weight: 600;
  557. }
  558. .info-icon {
  559. color: #86909c;
  560. cursor: pointer;
  561. }
  562. .status {
  563. color: #00b42a;
  564. }
  565. }
  566. }
  567. .bmi-info {
  568. width: 600px;
  569. margin: 0 auto;
  570. .bmi-header {
  571. display: flex;
  572. align-items: center;
  573. gap: 8px;
  574. margin-bottom: 8px;
  575. .value {
  576. color: #1d2129;
  577. font-weight: 600;
  578. }
  579. .bmi-status {
  580. font-size: 14px;
  581. }
  582. }
  583. .bmi-progress {
  584. margin-bottom: 4px;
  585. :deep(.el-progress) {
  586. .el-progress-bar__outer {
  587. background-color: #e5e6eb;
  588. height: 8px;
  589. border-radius: 4px;
  590. }
  591. }
  592. .bmi-range {
  593. display: flex;
  594. justify-content: space-between;
  595. color: #86909c;
  596. font-size: 13px;
  597. margin-top: 4px;
  598. }
  599. }
  600. .bmi-status-text {
  601. display: flex;
  602. align-items: center;
  603. gap: 4px;
  604. color: #00b42a;
  605. font-size: 13px;
  606. justify-content: flex-end;
  607. }
  608. }
  609. .total-ratio,
  610. .nutrition-ratio {
  611. margin-bottom: 24px;
  612. :deep(.el-progress) {
  613. margin-top: 8px;
  614. .el-progress-bar__outer {
  615. background-color: #e5e6eb;
  616. height: 8px;
  617. }
  618. }
  619. }
  620. .ratio-section {
  621. .ratio-header {
  622. margin-bottom: 24px;
  623. display: flex;
  624. align-items: center;
  625. gap: 8px;
  626. span {
  627. color: #1d2129;
  628. white-space: nowrap;
  629. }
  630. :deep(.el-progress) {
  631. width: 240px;
  632. .el-progress-bar__outer {
  633. background-color: #e5e6eb;
  634. height: 10px;
  635. border-radius: 20px;
  636. }
  637. .el-progress-bar__inner {
  638. border-radius: 20px;
  639. background-color: rgb(28, 202, 141) !important;
  640. }
  641. .el-progress__text {
  642. font-size: 13px !important;
  643. color: #fff;
  644. margin-left: 4px;
  645. background: #2cda9b;
  646. padding: 2px 8px;
  647. border-radius: 10px;
  648. }
  649. }
  650. }
  651. .meal-ratios {
  652. margin-bottom: 24px;
  653. .ratio-items {
  654. display: flex;
  655. flex-wrap: nowrap;
  656. gap: 16px;
  657. align-items: flex-start;
  658. }
  659. .ratio-item {
  660. display: flex;
  661. flex-direction: column;
  662. gap: 8px;
  663. flex: 0 0 auto;
  664. span {
  665. color: #4e5969;
  666. font-size: 14px;
  667. }
  668. .input-with-unit {
  669. display: flex;
  670. align-items: center;
  671. gap: 8px;
  672. .el-input {
  673. width: 120px;
  674. }
  675. .unit {
  676. color: #4e5969;
  677. font-size: 14px;
  678. }
  679. }
  680. }
  681. }
  682. .nutrition-ratio {
  683. margin-bottom: 24px;
  684. display: flex;
  685. align-items: center;
  686. gap: 8px;
  687. span {
  688. color: #1d2129;
  689. white-space: nowrap;
  690. }
  691. :deep(.el-progress) {
  692. width: 240px;
  693. .el-progress-bar__outer {
  694. background-color: #e5e6eb;
  695. height: 10px;
  696. border-radius: 20px;
  697. }
  698. .el-progress-bar__inner {
  699. border-radius: 20px;
  700. background-color: rgb(28, 202, 141) !important;
  701. }
  702. .el-progress__text {
  703. font-size: 13px !important;
  704. color: #fff;
  705. margin-left: 4px;
  706. background: #2cda9b;
  707. padding: 2px 8px;
  708. border-radius: 10px;
  709. }
  710. }
  711. }
  712. .nutrition-ratios {
  713. display: flex;
  714. gap: 80px;
  715. }
  716. }
  717. .bottom-btn-card {
  718. position: fixed;
  719. left: 228px;
  720. right: 0;
  721. bottom: 50px;
  722. padding: 8px 16px;
  723. background: #fff;
  724. box-shadow: 0 -2px 8px rgba(64, 158, 255, 0.08);
  725. z-index: 2000;
  726. .btn-wrapper {
  727. display: flex;
  728. justify-content: center;
  729. align-items: center;
  730. gap: 16px;
  731. .el-button {
  732. min-width: 120px;
  733. height: 44px;
  734. padding: 0 24px;
  735. }
  736. }
  737. }
  738. .food-dialog-content {
  739. .search-bar {
  740. margin-bottom: 16px;
  741. .el-input {
  742. width: 100%;
  743. }
  744. }
  745. .food-select-container {
  746. display: flex;
  747. gap: 16px;
  748. min-height: 400px;
  749. margin-bottom: 16px;
  750. .food-categories {
  751. width: 200px;
  752. border: 1px solid #e4e7ed;
  753. border-radius: 4px;
  754. overflow-y: auto;
  755. }
  756. .food-list {
  757. flex: 1;
  758. display: flex;
  759. flex-direction: column;
  760. :deep(.el-table) {
  761. flex: 1;
  762. .selected-row {
  763. background-color: #f0f7ff;
  764. }
  765. }
  766. .pagination {
  767. margin-top: 16px;
  768. display: flex;
  769. justify-content: flex-end;
  770. }
  771. }
  772. }
  773. .selected-tags {
  774. border-top: 1px solid #e4e7ed;
  775. padding-top: 16px;
  776. min-height: 32px;
  777. .selected-title {
  778. color: #606266;
  779. margin-bottom: 8px;
  780. }
  781. .tags-container {
  782. display: flex;
  783. flex-wrap: wrap;
  784. gap: 8px;
  785. .selected-tag {
  786. margin-right: 8px;
  787. margin-bottom: 8px;
  788. }
  789. }
  790. }
  791. }
  792. .dialog-footer {
  793. display: flex;
  794. justify-content: flex-end;
  795. gap: 16px;
  796. }
  797. </style>