From ecec72d382a83718d3b1d8e60a473829c8d90d40 Mon Sep 17 00:00:00 2001
From: Tcsm <1377977403@qq.com>
Date: 星期二, 15 八月 2023 21:38:03 +0800
Subject: [PATCH] 完善荣誉证书模块的类别和名称的选择输入功能;家根网可以按照身份、姓名搜索;成长经历阅历的各个小模块的时间在修改时变成可选形式

---
 ruoyi-ui/src/views/honor/index.vue     |   12 +++---
 ruoyi-ui/src/views/self/show.vue       |   17 +++++---
 ruoyi-ui/src/views/genealogy/index.vue |   21 ++++++----
 ruoyi-ui/src/views/honor/honorInfo.vue |   20 +++-------
 4 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/ruoyi-ui/src/views/genealogy/index.vue b/ruoyi-ui/src/views/genealogy/index.vue
index 394e113..c3238d9 100644
--- a/ruoyi-ui/src/views/genealogy/index.vue
+++ b/ruoyi-ui/src/views/genealogy/index.vue
@@ -48,14 +48,11 @@
       </el-form-item>
 
       <el-form-item label="鎬у埆" prop="sex">
-        <el-input
-          v-model="queryParams.sex"
-          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.sex" placeholder="璇烽�夋嫨鎬у埆" clearable
+                   style="width: 240px" @keyup.enter.native="handleQuery">
+          <el-option v-for="item in typeOption"
+                     :key="item.value" :label="item.label" :value="item.value"/>
+        </el-select>
       </el-form-item>
 
       <el-form-item label="鐢熸棩" prop="birth">
@@ -404,6 +401,14 @@
         }],
 
       },
+      typeOption: [{
+        value: '1',
+        label: '鐢�',
+      },
+        {
+          value: '0',
+          label: '濂�',
+        }],
       typeOptions: [{
         value:'1',
         label:'绗�1浠�'
diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue
index 2e1edb2..966daba 100644
--- a/ruoyi-ui/src/views/honor/honorInfo.vue
+++ b/ruoyi-ui/src/views/honor/honorInfo.vue
@@ -25,18 +25,10 @@
 <!--                </el-cow>-->
                 <el-cow :span="8">
                   <el-form-item label="绫诲埆" prop="type" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;" :disabled="dsb">
-                    <template v-if="!isEditing" >
-                      <el-input v-if="formData.type===0" placeholder="璇佷欢"></el-input>
-                      <el-input v-if="formData.type===1" placeholder="鑽h獕"></el-input>
-                      <el-input v-if="formData.type===2" placeholder="璧勮川"></el-input>
-                    </template>
-                    <template v-else>
-                    <el-select v-model="types" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}" >
-                      <el-option label="璇佷欢" value='0'></el-option>
-                      <el-option label="鑽h獕" value='1'></el-option>
-                      <el-option label="璧勮川" value='2'></el-option>
+                    <el-select v-model="formData.type" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}"   :disabled="dsb">
+                      <el-option v-for="(item, index) in typeOption" :key="index" :label="item.label" :value="item.value"
+                      ></el-option>
                     </el-select>
-                    </template>
                   </el-form-item>
                 </el-cow>
                 <el-cow :span="8">
@@ -299,9 +291,9 @@
       newOption: undefined,
       showInput: false,
       typeOption:[
-        {value:'0',label:'璇佷欢'},
-        {value:'1',label:'鑽h獕'},
-        {value:'2',label:'璧勮川'},],
+        {value:'璇佷欢',label:'璇佷欢'},
+        {value:'鑽h獕',label:'鑽h獕'},
+        {value:'璧勮川',label:'璧勮川'},],
       types:undefined
     }
   },
diff --git a/ruoyi-ui/src/views/honor/index.vue b/ruoyi-ui/src/views/honor/index.vue
index 96ba9d9..d2811e5 100644
--- a/ruoyi-ui/src/views/honor/index.vue
+++ b/ruoyi-ui/src/views/honor/index.vue
@@ -137,8 +137,8 @@
       <el-table-column type="selection" :reserve-selection="true" width="55"  align="center" />
       <el-table-column fixed label="搴忓彿" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
       <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">{{ getSrc1(scope.row.type) }}</template>
+        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>
+<!--        <template slot-scope="scope">{{ getSrc1(scope.row.type) }}</template>-->
       </el-table-column>
       <el-table-column label="鍚嶇О" prop="name" sortable  width="120" align="center" >
         <template slot-scope="scope">{{scope.row.name? scope.row.name: '鈥斺�斺�斺��'}}</template>
@@ -479,9 +479,9 @@
       newOption: undefined,
       showInput: true,
       typeOption:[
-        {value:'0',label:'璇佷欢'},
-        {value:'1',label:'鑽h獕'},
-        {value:'2',label:'璧勮川'},]
+        {value:'璇佷欢',label:'璇佷欢'},
+        {value:'鑽h獕',label:'鑽h獕'},
+        {value:'璧勮川',label:'璧勮川'},]
 
     };
   },
@@ -509,7 +509,7 @@
       const newOption = this.newOption.trim();
       if (newOption && !this.typeOptions.includes(newOption)) {
         this.typeOptions.push(newOption);
-        this.$set(this.formDat, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
+        this.$set(this.formDat, 'name', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
       }
     },
     /** 鏌ヨ璁板綍鍒楄〃 */
diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue
index df1df64..5c61880 100644
--- a/ruoyi-ui/src/views/self/show.vue
+++ b/ruoyi-ui/src/views/self/show.vue
@@ -1259,18 +1259,22 @@
     getAutobiographyInfor()
     {
       let _this = this
-      getCategory().then(response=>{
-
+      getCategory().then(response => {
         // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
         //   _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
         // })
         response.data.itemValues.replace("{", "").replace("}", "").split(",").map(elem => {
           const label = elem.split(":")[0].trim();
           const value = parseInt(elem.split(":")[1].trim());
-          _this.typeOptions.push({ "label": label, "value": value });
-          // this.getSrc1(value)
-        })
-      })
+
+          // 鍒ゆ柇 typeOptions 鏁扮粍涓槸鍚﹀凡瀛樺湪鐩稿悓鐨� value
+          if (!_this.typeOptions.some(option => option.value === value)) {
+            _this.typeOptions.push({ "label": label, "value": value });
+          }
+          // console.log(_this.typeOptions)
+          // _this.getSrc1(value)
+        });
+      });
 
       // if(AutobiographyList.ageEnd==null){
       //   this.AgeEnd='?'
@@ -1438,6 +1442,7 @@
       // 鍒锋柊椤甸潰
       // window.location.reload();
     },
+    //澶村儚淇敼
     uploadImage() {
       const inputElement = document.createElement("input");
       inputElement.type = "file";

--
Gitblit v1.9.1