Browse Source

修改注册管理员的清空及不可改样式

plg 5 months ago
parent
commit
609275500f
2 changed files with 48 additions and 33 deletions
  1. 38 26
      src/components/PlanRegister.vue
  2. 10 7
      src/components/manageRegister.vue

+ 38 - 26
src/components/PlanRegister.vue

@@ -32,7 +32,7 @@
               class="form_main"
             >
               <el-form-item label="计划名称" prop="planName">
-                <el-input v-model="ruleForm.planName"></el-input>
+                <el-input v-model="ruleForm.planName" ></el-input>
               </el-form-item>
               <el-form-item label="结束时间" prop="endTime">
                 <el-date-picker
@@ -86,19 +86,24 @@
                   </el-col>
                 </el-row>
               </el-form-item>
-              <el-form-item label="组织架构" prop="checkedList">
-                <el-tree
-                  :data="treeData"
-                  show-checkbox
-                  node-key="id"
-                  default-expand-all
-                  :default-checked-keys="ruleForm.checkedList"
-                  :props="defaultProps"
-                  ref="tree"
-                >
-                </el-tree>
-              </el-form-item>
-              <el-button @click="getCheckedNodes"> 获取已选 </el-button>
+              <div style="display: flex;"> 
+                <el-form-item label="组织架构" prop="checkedList">
+                 
+                  <el-tree
+                    :data="treeData"
+                    show-checkbox
+                    node-key="id"
+                    default-expand-all
+                    :default-checked-keys="ruleForm.checkedList"
+                    :props="defaultProps"
+                    ref="tree"
+                  >
+                  </el-tree>
+                </el-form-item>
+                <el-button type="info" style="height: 100%;margin-top:20px" round @click="clearDataOrg()">清空组织架构</el-button>
+              </div>
+
+              <!-- <el-button @click="getCheckedNodes"> 获取已选 </el-button> -->
               <el-form-item label="任务选择" class="taskSelect">
                 <el-checkbox-group v-model="ruleForm.checkboxGroup2" size="mini">
                   <el-checkbox
@@ -123,7 +128,7 @@
             </div>
           </el-form>
           <div class="dig_button">
-            <el-button type="info" round @click="resetData()">重置</el-button>
+            <el-button type="info" round @click="resetData()">取消</el-button>
             <el-button :disabled="disableFlag" type="success" round @click="submitCom()"
               >提交</el-button
             >
@@ -674,17 +679,24 @@ export default {
         }
       });
     },
-    //调用查询详情的接口
-    resetData() {
-      this.$refs["ruleForm"].clearValidate();
-      //清空表单
+    clearDataOrg(){
       this.grade = [];
       this.instructor = [];
-      this.ruleForm.planName = "";
-      this.ruleForm.endTime = "";
-      this.ruleForm.checkboxGroup2 = [];
       this.$refs.tree.setCheckedKeys([]);
-      this.ruleForm.checkedList = [];
+    },
+    //调用查询详情的接口
+    resetData() {
+      //修改编辑计划--关闭该弹出框
+      this.dialogVisible = false;
+      // this.$refs["ruleForm"].clearValidate();
+      // //清空表单
+      // this.grade = [];
+      // this.instructor = [];
+      // this.ruleForm.planName = "";
+      // this.ruleForm.endTime = "";
+      // this.ruleForm.checkboxGroup2 = [];
+      // this.$refs.tree.setCheckedKeys([]);
+      // this.ruleForm.checkedList = [];
     },
     cancle() {
       this.$refs["ruleForm"].clearValidate();
@@ -763,7 +775,7 @@ export default {
           isDisplayed: listTmp[i].isDisplayed,
           isAvailable: listTmp[i].isAvailable,
           name: listTmp[i].name,
-          expectTime: listTmp[i].expectTime
+          expectTime: listTmp[i].expectTime,
         };
         list.push(obj);
       }
@@ -778,7 +790,7 @@ export default {
           isDisplayed: listTmpNo[i].isDisplayed,
           isAvailable: listTmpNo[i].isAvailable,
           name: listTmpNo[i].name,
-          expectTime: listTmpNo[i].expectTime
+          expectTime: listTmpNo[i].expectTime,
         };
         list.push(obj);
       }
@@ -867,7 +879,7 @@ export default {
           isDisplayed: listTmpNo[i].isDisplayed,
           isAvailable: listTmpNo[i].isAvailable,
           name: listTmpNo[i].name,
-          expectTime: listTmpNo[i].expectTime
+          expectTime: listTmpNo[i].expectTime,
         };
         list.push(obj);
       }

+ 10 - 7
src/components/manageRegister.vue

@@ -26,6 +26,7 @@
             <!-- :props="{ checkStrictly: true }" -->
             <el-form-item label="所属组织架构" prop="group">
               <el-cascader
+                :disabled="!isView"
                 placeholder="请选择组织架构"
                 v-model="ruleForm.group"
                 :options="groupData"
@@ -83,7 +84,7 @@
               ></el-input>
             </el-form-item> -->
             <div class="dig_button">
-              <el-button type="info" round @click="resetData()">重置</el-button>
+              <el-button type="info" round @click="resetData()">清空</el-button>
               <!-- <el-button type="success" round @click="submitForm('ruleForm')"
                 >提交</el-button
               > -->
@@ -151,7 +152,7 @@ export default {
         {
           value: "3",
           label: "2022级计算机科学与技术专业3班",
-        }
+        },
       ],
       disableFlag: false,
       phoneFlag: false,
@@ -199,7 +200,10 @@ export default {
     resetData() {
       this.$refs["ruleForm"].clearValidate();
       //清空表单
-      this.ruleForm.group = "";
+      if (this.isView) {
+        this.ruleForm.group = "";
+      }
+
       this.ruleForm.name = "";
       this.ruleForm.studentNumber = "";
       // this.ruleForm.password = "";
@@ -479,9 +483,8 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-
-.el-form-item{
- margin-bottom: 5px !important;
+.el-form-item {
+  margin-bottom: 5px !important;
 }
 .dig_update /deep/.el-cascader {
   position: relative;
@@ -522,7 +525,7 @@ export default {
 }
 
 .dig_button {
-  margin-top:20px;
+  margin-top: 20px;
   display: flex;
   width: 100%;
   justify-content: space-around;