From 8b62a3ca3b67fd8e45b666043e48a7049dce08ce Mon Sep 17 00:00:00 2001
From: Tcsm <1377977403@qq.com>
Date: 星期日, 28 五月 2023 02:13:06 +0800
Subject: [PATCH] 1.将家庭小医生和收藏荣誉模块的的类别改为选择的形式 2.荣誉证书页面的选择式类别暂时无法搜索和新增

---
 ruoyi-ui/src/views/honor/index.vue |   74 ++++++++++++++++++++++++++----------
 1 files changed, 53 insertions(+), 21 deletions(-)

diff --git a/ruoyi-ui/src/views/honor/index.vue b/ruoyi-ui/src/views/honor/index.vue
index a5f3bf5..732a9c1 100644
--- a/ruoyi-ui/src/views/honor/index.vue
+++ b/ruoyi-ui/src/views/honor/index.vue
@@ -38,7 +38,6 @@
                   </tablemax>
                 </div>-->
 
-
         <!--        v-model="queryParams.id"
 
                   v-model:phone="queryParams.phone"
@@ -61,16 +60,31 @@
         </el-input>
       </el-form-item>
       <el-form-item label="绫诲埆" prop="type" >
-        <el-input
+<!--        <el-input-->
+<!--          v-model="queryParams.type"-->
+<!--          placeholder="璇疯緭鍏ョ被鍒�"-->
+<!--          clearable-->
+<!--          style="width: 240px"-->
+<!--          @keyup.enter.native="handleQuery">-->
+<!--          <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
+<!--        </el-input>-->
+        <el-select
           v-model="queryParams.type"
-          placeholder="璇疯緭鍏ョ被鍒�"
+          placeholder="鎵�鏈夌被鍒�"
           clearable
           style="width: 240px"
-          @keyup.enter.native="handleQuery">
-          <i slot="prefix" class="el-input__icon el-icon-search"></i>
-        </el-input>
+          @keyup.enter.native="handleQuery"
+        >
+          <el-option
+            v-for="dict in typeOptions"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
 
       </el-form-item>
+
 
       <el-form-item label="绾у埆" prop="grade">
         <el-input
@@ -170,7 +184,8 @@
         <template slot-scope="scope">{{scope.row.createTime? scope.row.createTime: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
       <el-table-column label="绫诲埆" prop="type" sortable :show-overflow-tooltip="true" width="120" align="center" >
-        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>
+<!--        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>-->
+        <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>
       </el-table-column>
       <el-table-column label="鍚嶇О" prop="name" sortable :show-overflow-tooltip="true" width="120" align="center" >
         <template slot-scope="scope">{{scope.row.name? scope.row.name: '鈥斺�斺�斺��'}}</template>
@@ -259,8 +274,12 @@
           </el-input>
         </el-form-item>
         <el-form-item label="绫诲埆" prop="type">
-          <el-input v-model="formDat.type" placeholder="璇疯緭鍏ョ被鍒�" clearable :style="{width: '100%'}" >
-          </el-input>
+<!--          <el-input v-model="formDat.type" placeholder="璇疯緭鍏ョ被鍒�" clearable :style="{width: '100%'}" >-->
+<!--          </el-input>-->
+          <el-select v-model="formDat.type" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}"  >
+            <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="鍚嶇О" prop="name">
           <el-input v-model="formDat.name" placeholder="璇疯緭鍏ュ悕绉�" clearable :style="{width: '100%'}" ></el-input>
@@ -370,7 +389,7 @@
 
 
 //瀵煎叆鎺ュ彛鍑芥暟
-import {listHonor,enload, addHonor,updateHonor, delHonor,uploadPic} from "@/api/honor/index";
+import {listHonor,enload, addHonor,updateHonor, delHonor,uploadPic,getCategory} from "@/api/honor/index";
 
 import { Notification, MessageBox, Message, Loading } from 'element-ui'
 export default {
@@ -501,12 +520,13 @@
           trigger: 'blur'
         }],
       },
+      selected:'',
       typeOptions: [],
     };
   },
   created() {
     this.getList();
-    // this.getCateInfor()
+    this.getCateInfor()
     // for (let i = 0; i < this.contactList.length; i++) {
     //   this.formDat[i] = this.contactList[i];
     // }
@@ -542,16 +562,28 @@
       );
     },
     /** 鏌ヨ绫诲埆淇℃伅 */
-    // getCateInfor()
-    // {
-    //   let _this = this
-    //   getCategory().then(response=>{
-    //
-    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
-    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
-    //     })
-    //   })
-    // },
+    getCateInfor()
+    {
+      let _this = this
+      getCategory().then(response=>{
+
+        response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
+          _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
+        })
+      })
+    },
+    //绫诲埆閫夋嫨
+    getSrc(type) {
+      if (type === '鍑虹敓璇�'){
+        return '鍑虹敓璇�'
+      }else if(type === '鐗欑'){
+        return '鐗欑'
+      }else if(type === '鍐呯'){
+        return '鍐呯'
+      }else {
+        return '鍏跺畠'
+      }
+    },
 
     handleRemove(file) {
       alert(323)

--
Gitblit v1.9.1