Q-ABAB 1 年間 前
コミット
334d13cf47
2 ファイル変更33 行追加9 行削除
  1. 31 8
      src/components/MakerSpaceWord.vue
  2. 2 1
      src/views/test.vue

+ 31 - 8
src/components/MakerSpaceWord.vue

@@ -103,6 +103,7 @@
               <div class="memberValue">学历</div>
               <div class="memberValue">所在教研室</div>
               <div class="memberValue">项目组角色分工</div>
+              <div></div>
             </div>
             <div class="memberHan" v-for="(item,index) in wordData['teacher']" :key="index">
               <div class="memberValue">
@@ -159,6 +160,10 @@
                   v-model="item['work']">
                 </el-input>
               </div>
+              <div class="operate">
+                <el-button v-if="wordData['teacher'].length!=1" @click="DelTeacher(index)" type="primary" size="mini">-</el-button>
+                <el-button @click="addTeacher" v-if="wordData['teacher'].length==index+1" type="primary" size="mini">+</el-button>
+              </div>
             </div>
           </div>
         </div>
@@ -176,6 +181,7 @@
               <div class="memberValue">班级</div>
               <div class="memberValue">年龄</div>
               <div class="memberValue">项目组角色分工</div>
+              <div></div>
             </div>
             <div class="memberHan" v-for="(item,index) in wordData['student']" :key="index">
               <div class="memberValue">
@@ -215,8 +221,8 @@
                 </el-input>
               </div>
               <div class="operate">
-                <el-button size="mini">-</el-button>
-                <el-button size="mini">+</el-button>
+                <el-button @click="DelStudent(index)" v-if="wordData['student'].length!=1"  type="primary" size="mini">-</el-button>
+                <el-button @click="addStudent" v-if="wordData['student'].length==index+1" type="primary" size="mini">+</el-button>
               </div>
             </div>
           </div>
@@ -614,16 +620,18 @@
       addTeacher(){
         this.wordData['teacher'].push({name:"",speciality:"",title:"",education:"",section:"",work:""});
       },
+      DelTeacher(index){
+        this.wordData['teacher'].splice(index,1)
+      },
       addStudent(){
         this.wordData['student'].push({name:"",class:"",age:"",work:""});
       },
+      DelStudent(index){
+        this.wordData['student'].splice(index,1)
+      },
       convertNumber(type,str){
         if(typeof str=='string'){
           this.wordData['fund'][type] = Number(str.replace(/\D/g,''));
-          //  = number==0?0:number;
-        // }else{
-          // this.wordData['fund'][type] = str==0?'':str;
-        // }
         }
         
       }
@@ -641,7 +649,8 @@
     flex-direction: column;
     align-items: center;
     background-color: white;
-    padding:50px;
+    padding:100px;
+    box-sizing:border-box;
     #title{
         width: 100%;
         display: flex;
@@ -775,6 +784,7 @@
           display: flex;
           box-sizing: border-box;
           border-bottom: solid 1px black;
+          position:relative;
           .memberValue{
             box-sizing: border-box;
             flex: 1;
@@ -783,13 +793,26 @@
             align-items: center;
             border-right: solid 1px black;
             min-height: 45px;
-            &:nth-last-child(1){
+            &:nth-last-child(2){
               border-right: none;
               flex: 3;
             }
           }
           .operate{
+            right:-100px;
+            width:100px;
+            height:40px;
+            display:flex;
+            // justify-content:center;
+            align-items:center;
             position:absolute;
+            .el-button{
+              max-width:10px;
+              display:flex;
+              justify-content:center;
+              align-items:center;
+              margin-left:10px;
+            }
           }
         }
       }

+ 2 - 1
src/views/test.vue

@@ -51,10 +51,11 @@ export default {
 #test{
   width: 100vw;
   display: flex;
+  background:blue;
   justify-content: center;
 }
 #word{
-  width: 1000px;
+  width: 1200px;
   height: auto;
 }
 </style>