From b91ae843757fcfb74af04ff85decf8c26b6f4591 Mon Sep 17 00:00:00 2001
From: Tcsm <1377977403@qq.com>
Date: 星期一, 17 七月 2023 23:23:54 +0800
Subject: [PATCH] 主要在成长经历阅历主要经历的修改做改动(未能成功修改数据)

---
 ruoyi-ui/src/views/self/show.vue                 |  208 +++++++++++++++++++++++++++++++----------
 ruoyi-ui/src/views/genealogy/index.vue           |    2 
 ruoyi-ui/src/views/collection/collectionInfo.vue |   44 ++++----
 3 files changed, 181 insertions(+), 73 deletions(-)

diff --git a/ruoyi-ui/src/views/collection/collectionInfo.vue b/ruoyi-ui/src/views/collection/collectionInfo.vue
index d8e663c..c514730 100644
--- a/ruoyi-ui/src/views/collection/collectionInfo.vue
+++ b/ruoyi-ui/src/views/collection/collectionInfo.vue
@@ -89,28 +89,28 @@
                 :preview-src-list="[file.url]"
               >
               <span class="el-upload-list__item-actions" >
-            <span
-              v-if="isShow"
-              class="el-upload-list__item-preview"
-              @click="handlePictureCardPreview(file)"
-            >
-              <i class="el-icon-zoom-in"></i>
-            </span>
-            <span
-              v-if="isShow"
-              class="el-upload-list__item-delete"
-              @click="handleDownload(file.url)"
-            >
-              <i class="el-icon-download"></i>
-            </span>
-            <span
-              v-if="isShow"
-              class="el-upload-list__item-delete"
-              @click="handleRemove(file)"
-            >
-              <i class="el-icon-delete"></i>
-            </span>
-          </span>
+                <span
+                  v-if="isShow"
+                  class="el-upload-list__item-preview"
+                  @click="handlePictureCardPreview(file)"
+                >
+                  <i class="el-icon-zoom-in"></i>
+                </span>
+                <span
+                  v-if="isShow"
+                  class="el-upload-list__item-delete"
+                  @click="handleDownload(file.url)"
+                >
+                  <i class="el-icon-download"></i>
+                </span>
+                <span
+                  v-if="isShow"
+                  class="el-upload-list__item-delete"
+                  @click="handleRemove(file)"
+                >
+                  <i class="el-icon-delete"></i>
+                </span>
+              </span>
 
 
             </div>
diff --git a/ruoyi-ui/src/views/genealogy/index.vue b/ruoyi-ui/src/views/genealogy/index.vue
index 4e1626f..5b654da 100644
--- a/ruoyi-ui/src/views/genealogy/index.vue
+++ b/ruoyi-ui/src/views/genealogy/index.vue
@@ -149,7 +149,7 @@
 
     <el-table v-loading="loading" :data="listRoot"  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
       <el-table-column type="selection" width="25"  align="center" />
-      <el-table-column  label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
+      <el-table-column fixed label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="80"/>
 
       <el-table-column label="韬唤" prop="identity" sortable width="100" >
         <template slot-scope="scope">
diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue
index 90bbe44..0e56f35 100644
--- a/ruoyi-ui/src/views/self/show.vue
+++ b/ruoyi-ui/src/views/self/show.vue
@@ -44,8 +44,17 @@
             <el-form ref="elForm" :model="individualList" :rules="rules" size="medium"  label-position="left">
               <el-row :span="5">
                 <el-form-item label="鎬у埆" prop="sex" label-width="40px">
-                  <el-input v-model="individualList.sex === 1 ? '鐢�':'濂�' " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
-                  </el-input>
+<!--                  <el-input v-model="individualList.sex === 1 ? '鐢�':'濂�' " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">-->
+<!--                  </el-input>-->
+                  <template v-if="!isEditing">
+                    <el-input v-model="individualList.sex === 1 ? '鐢�':'濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
+                  </template>
+                  <template v-else>
+                    <el-select v-model="individualList.sex" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}">
+                      <el-option label="鐢�" value="1"></el-option>
+                      <el-option label="濂�" value="0"></el-option>
+                    </el-select>
+                  </template>
                 </el-form-item>
               </el-row>
               <el-row :span="5">
@@ -76,8 +85,18 @@
               </el-row>
               <el-row :span="5">
                 <el-form-item label="濠氬Щ鐘跺喌" prop="maritalStatus" label-width="70px">
-                  <el-input v-model="individualList.maritalStatus === 1 ? '宸插':'鏈'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
-                  </el-input>
+                  <template v-if="!isEditing" >
+                    <el-input v-if="individualList.maritalStatus===0" placeholder="鏈"></el-input>
+                    <el-input v-if="individualList.maritalStatus===1" placeholder="宸插"></el-input>
+                    <el-input v-if="individualList.maritalStatus===2" placeholder="绂诲"></el-input>
+                  </template>
+                  <template v-else>
+                    <el-select v-model="individualList.maritalStatus" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}">
+                      <el-option label="鏈" value="0"></el-option>
+                      <el-option label="宸插" value="1"></el-option>
+                      <el-option label="绂诲" value="2"></el-option>
+                    </el-select>
+                  </template>
                 </el-form-item>
               </el-row>
 
@@ -88,44 +107,36 @@
       <div style="padding-left:30px;padding-top:30px">
         <el-col :span="6" :data="individualList">
           <div class="block" :model="individualList" >
-            <el-col v-model="individualList.url" prop="url">
+            <el-col v-model="individualList.img" prop="img">
               <el-avatar shape="square" :size=200 >
                 <el-image
-                  :src="'http://47.93.189.255:8080/'+ individualList.url"
-                  :fit="fit"
+                  :src="'http://47.93.189.255:8080/'+ individualList.img"
                 ></el-image>
               </el-avatar>
-            </el-col>
+<!--              <el-upload-->
+<!--                action="#"-->
+<!--                list-type="picture-card"-->
+<!--                multiple-->
+<!--                :http-request="requestUpload"-->
+<!--                :file-list="fileList"-->
+<!--              >-->
+<!--                <i slot="default" class="el-icon-plus"></i>-->
+<!--                <div slot="file" slot-scope="{file}">-->
+<!--                  <img-->
+<!--                    class="el-upload-list__item-thumbnail"-->
+<!--                    :src="file.url"-->
+<!--                    alt=""-->
+<!--                    style="width: 147px; height: 147px"-->
+<!--                    fit="cover"-->
+<!--                    :preview-src-list="[file.url]"-->
+<!--                  >-->
+<!--                </div>-->
+<!--              </el-upload>-->
+         </el-col>
           </div>
 
         </el-col>
 
-
-        <!--        <el-row>-->
-        <!--&lt;!&ndash;          <el-table  border style="width: 100%">&ndash;&gt;-->
-        <!--&lt;!&ndash;            <el-table-column&ndash;&gt;-->
-        <!--&lt;!&ndash;              prop="img"&ndash;&gt;-->
-        <!--&lt;!&ndash;              v-model="individualList.img"&ndash;&gt;-->
-        <!--&lt;!&ndash;              placeholder=""&ndash;&gt;-->
-        <!--&lt;!&ndash;              width="180">&ndash;&gt;-->
-        <!--&lt;!&ndash;              <template slot-scope="scope">&ndash;&gt;-->
-        <!--&lt;!&ndash;                <img :src="scope.row.src" style="width:100px;height:50px;"/>&ndash;&gt;-->
-        <!--&lt;!&ndash;              </template>&ndash;&gt;-->
-        <!--&lt;!&ndash;            </el-table-column>&ndash;&gt;-->
-
-        <!--&lt;!&ndash;          </el-table>&ndash;&gt;-->
-        <!--&lt;!&ndash;          <el-upload :class="{uoloadSty:showBtnDealImg,disUoloadSty:noneBtnImg}"&ndash;&gt;-->
-        <!--&lt;!&ndash;                      ref="ref1"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     action=""&ndash;&gt;-->
-        <!--&lt;!&ndash;                     :file-list="fileList"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     list-type="picture-card"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     accept="image/*"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     :auto-upload="false"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     :multiple="false"&ndash;&gt;-->
-        <!--&lt;!&ndash;                     :limit="limitCountImg">&ndash;&gt;-->
-        <!--&lt;!&ndash;            <i class="el-icon-plus"></i>&ndash;&gt;-->
-        <!--&lt;!&ndash;          </el-upload>&ndash;&gt;-->
-        <!--        </el-row>-->
       </div>
 
       <div style="padding-left:30px;padding-top:30px" >
@@ -137,6 +148,7 @@
               v-if="isShow"
               v-hasPermi="['system:role:edit']"
             >缂栬緫</el-button>
+            <el-button v-if="isShow_2" type="primary" @click="submitForm" :disabled="dsb">瀹屾垚</el-button>
             <br>
             <el-button
               type="primary"
@@ -144,7 +156,10 @@
               v-hasPermi="['family:note:export']"
             >瀵煎嚭</el-button>
             <br>
-            <el-button v-if="isShow_2" type="primary" @click="submitForm" :disabled="dsb">瀹屾垚</el-button>
+            <el-button
+              type="primary"
+              v-hasPermi="['family:note:export']"
+            >鎵撳嵃</el-button>
           </el-row>
 
         </el-container>
@@ -221,14 +236,45 @@
           </div>
         </template>
         <el-table v-loading="loading" :data="experienceList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
-          <el-table-column label="寮�濮嬫棩鏈�" prop="startDate" sortable width="300" align="center" >
-            <template slot-scope="scope">{{scope.row.startDate? scope.row.startDate: '鈥斺�斺�斺��'}}</template>
+          <el-table-column label="寮�濮嬫棩鏈�" prop="startDate" sortable width="250" align="center" >
+            <template slot-scope="scope">
+              <template v-if="!scope.row.isEdit">
+                {{ scope.row.startDate }}
+              </template>
+              <template v-else>
+                <el-input v-model="scope.row.startDate"></el-input>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column label="缁撴潫鏃ユ湡" prop="endDate" sortable width="250" align="center" >
+            <template slot-scope="scope">
+              <template v-if="!scope.row.isEdit">
+                {{ scope.row.endDate }}
+              </template>
+              <template v-else>
+                <el-input v-model="scope.row.endDate"></el-input>
+              </template>
+            </template>
           </el-table-column>
           <el-table-column label="涓昏瀛︿範缁忓巻銆佸伐浣滃崟浣嶅強浠昏亴鎯呭喌" prop="content" sortable width="350" align="center" >
-            <template slot-scope="scope">{{scope.row.content? scope.row.content: '鈥斺�斺�斺��'}}</template>
+            <template slot-scope="scope">
+              <template v-if="!scope.row.isEdit">
+                {{ scope.row.content }}
+              </template>
+              <template v-else>
+                <el-input v-model="scope.row.content"></el-input>
+              </template>
+            </template>
           </el-table-column>
           <el-table-column label="璇佹槑浜�" prop="witness" sortable width="300" align="center" >
-            <template slot-scope="scope">{{scope.row.witness? scope.row.witness: '鈥斺�斺�斺��'}}</template>
+            <template slot-scope="scope">
+              <template v-if="!scope.row.isEdit">
+                {{ scope.row.witness }}
+              </template>
+              <template v-else>
+                <el-input v-model="scope.row.witness"></el-input>
+              </template>
+            </template>
           </el-table-column>
           <!--      鎿嶄綔-->
           <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
@@ -238,9 +284,15 @@
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
-                @click="showDialog1"
+                v-if="!editStatus[scope.row.id]"
+                @click="editRow(scope.row)"
                 v-hasPermi="['system:role:edit']"
               >淇敼</el-button>
+              <el-button size="mini"
+                         type="text"
+                         v-if="editStatus[scope.row.id]"
+                         @click="saveRow(scope.row)"
+              >淇濆瓨</el-button>
               <el-button
                 size="mini"
                 type="text"
@@ -375,9 +427,11 @@
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
-                @click="handleAdd"
+                v-if="scope.row.isEdit"
+                @click="handleEdit"
                 v-hasPermi="['system:role:edit']"
               >淇敼</el-button>
+              <el-button v-if="scope.row.isEdit" @click="saveRow(scope.row)">淇濆瓨</el-button>
               <el-button
                 size="mini"
                 type="text"
@@ -475,9 +529,9 @@
             <div v-if="item.term === '缁撳鍚�'"> {{item.content}}</div>
           </el-tab-pane>
         </el-tabs>
-        <el-button size='mini' type="text" class="btn_autobiography" @click="showDialog('autobiography')" style='position: absolute;right:10px;top:5px;'>
-          <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn>
-        </el-button>
+<!--        <el-button size='mini' type="text" class="btn_autobiography" @click="showDialog('autobiography')" style='position: absolute;right:10px;top:5px;'>-->
+<!--          <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn>-->
+<!--        </el-button>-->
       </div>
 
     </div>
@@ -495,6 +549,9 @@
       <el-form ref="elForm1" :model="formDat" :rules="rules" size="medium" label-width="140px">
         <el-form-item label="寮�濮嬫棩鏈�" prop="startDate">
           <el-input v-model="formDat.startDate" type='date' placeholder='閫夋嫨鏃ユ湡' clearable :style="{width: '100%'}" ></el-input>
+        </el-form-item>
+        <el-form-item label="缁撴潫鏃ユ湡" prop="endDate">
+          <el-input v-model="formDat.endDate" type='date' placeholder='閫夋嫨鏃ユ湡' clearable :style="{width: '100%'}" ></el-input>
         </el-form-item>
         <el-form-item label="涓昏瀛︿範缁忓巻銆佸伐浣滃崟浣嶅強浠昏亴鎯呭喌" prop="content">
           <el-input v-model="formDat.content" type="textarea" :rows="5" placeholder="璇疯緭鍏ヤ富瑕佸涔犵粡鍘嗐�佸伐浣滃崟浣嶅強浠昏亴鎯呭喌" clearable :style="{width: '100%'}" >
@@ -688,12 +745,16 @@
       //澶村儚涓婁紶
       showBtnDealImg:true,
       noneBtnImg:false,
-      limitCountImg:1,//涓婁紶鍥剧墖鐨勬渶澶ф暟閲�
+      //涓婁紶鍥剧墖鐨勬渶澶ф暟閲�
+      limitCountImg:1,
       //涓汉淇℃伅鏁版嵁
       individualList:[],
-      fit:['fill'],
+      isEditing: false,
+      // fit:['fill'],
       // 涓汉缁忓巻鏁版嵁
       experienceList: [],
+      // isEdit:true,
+      editStatus: {},
       //瀹跺涵鎴愬憳鍏崇郴鏁版嵁
       relationList:[],
       //鍑哄叆澧冭瘉浠舵儏鍐�
@@ -782,6 +843,7 @@
         id:undefined,
         userId:undefined,
         startDate:undefined,
+        endDate:undefined,
         content:undefined,
         witness:undefined,
         remark: undefined,
@@ -890,6 +952,11 @@
           message: '璇疯緭鍏ヨ捣濮嬫棩鏈�',
           trigger: 'blur'
         }],
+        endDate: [{
+          // required: true,
+          message: '璇疯緭鍏ョ粨鏉熸棩鏈�',
+          trigger: 'blur'
+        }],
         content: [{
           // required: true,
           message: '璇疯緭鍏�',
@@ -902,6 +969,7 @@
         }],
 
       },
+      typeOptions:[],
       typeOption: [{
         value:'鎶ょ収',
         label:'鎶ょ収'
@@ -917,6 +985,9 @@
   created() {
     this.getList();
     this.getAutobiographyInfor()
+    // this.experienceList.forEach(item => {
+    //   this.$set(this.editStatus, item.id, false);
+    // });
   },
   methods: {
     // 鍙栨秷鎸夐挳
@@ -964,7 +1035,6 @@
         return '鈥斺�斺�斺�斺�斺��'
       }
     },
-
 
     /** 鏌ヨ瑙掕壊鍒楄〃 */
     getList() {
@@ -1037,7 +1107,6 @@
 
     //鍥剧墖鐨勪笂浼犲強涓婁紶鎸夐挳闅愯棌
 
-
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -1049,6 +1118,7 @@
       this.reset();
     },
 
+    //涓汉鍩烘湰淇℃伅
     submitForm() {
       let ul = this.fileList.map(function (elem){
         return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
@@ -1060,7 +1130,7 @@
 
       this.$refs['elForm'].validate(valid => {
         if (valid) {
-          if (this.individualList.id !== undefined) {
+          if (this.individualList.userId !== undefined) {
             updateIndividual(this.individualList).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
               // this.open = false;
@@ -1072,6 +1142,41 @@
           }
         }
       })
+      // 鍒锋柊椤甸潰
+      window.location.reload();
+    },
+    //涓昏缁忓巻
+    editRow(row) {
+      this.$set(row, 'isEdit', true);
+      this.$set(this.editStatus, row.id, true);
+    },
+    saveRow(row) {
+      // 鍦ㄨ繖閲屽鐞嗕繚瀛樹慨鏀瑰悗鐨勬暟鎹殑閫昏緫锛屽彲浠ュ彂閫佺粰鍚庣淇濆瓨
+      let ul = this.fileList.map(function (elem){
+        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+      }).join(",")
+      let uls = this.fileListOther.map(function (elem){
+        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+      }).join(",")
+      this.experienceList.url = ul+","+uls
+
+      this.$refs['elForm'].validate(valid => {
+        if (valid) {
+          if (this.experienceList.id !== undefined) {
+            updateExperience(this.experienceList).then(response => {
+              this.$modal.msgSuccess("淇敼鎴愬姛");
+              // this.open = false;
+              // this.btn=false
+
+            });
+          } else {
+            this.$modal.msgSuccess("淇敼澶辫触");
+
+          }
+        }
+      })
+      this.$set(row, 'isEdit', false);
+      this.$set(this.editStatus, row.id, false);
     },
     // 琛ㄥ崟閲嶇疆
     reset() {
@@ -1172,8 +1277,9 @@
       this.btn = true
       this.isShow=false
       this.isShow_2=true
+      this.isEditing=true
+      // this.isEdit=false
     },
-    //淇敼鎸夐挳
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       this.reset();
@@ -1337,6 +1443,8 @@
 
     },
 
+    //淇敼涓昏缁忓巻
+
     /** 鍒犻櫎涓汉缁忓巻鎸夐挳鎿嶄綔 */
     handleExperienceDelete(row) {
       const Ids = row.id || this.ids;

--
Gitblit v1.9.1