Q-ABAB há 2 anos atrás
pai
commit
c9c699a261
3 ficheiros alterados com 244 adições e 113 exclusões
  1. 236 110
      src/components/MakerSpaceWord.vue
  2. 7 2
      src/components/tool/Date.js
  3. 1 1
      src/views/test.vue

+ 236 - 110
src/components/MakerSpaceWord.vue

@@ -3,10 +3,10 @@
     <div id="title">
         <div class="school">深圳技师学院</div>
         <div class="wordTitle">二级学院特色创客空间建设项目立项申报书</div>
-        <div class="date">申请日期: xxxx年 xx月 xx日</div>
+        <div class="date">申请日期: {{ wordData['applicationDate'] }}</div>
     </div>
     <div id="table">
-        <div class="han">
+        <div class="han" id="one">
           <div class="label">项目名称</div><div class="value">
             <el-input
               type="textarea"
@@ -27,7 +27,7 @@
             </el-select>
         </div>
         </div>
-        <div class="status">
+        <div class="status" id="two">
           <div class="statusLabel">项目状态</div>
           <div class="ValueDescribe">
             <div class="statusHan">
@@ -42,7 +42,7 @@
             </div>
           </div>
         </div>
-        <div class="han">
+        <div class="han" id="three">
           <div class="label">项目起始时间</div><div class="value">
             <el-date-picker
               v-model="wordData['begin_at']"
@@ -62,7 +62,7 @@
             </el-date-picker>
           </div>
         </div>
-        <div class="han">
+        <div class="han" id="four">
           <div class="label">项目负责人</div><div class="value">
             <el-input
               type="textarea"
@@ -87,10 +87,10 @@
           <div class="label">参与教师人数</div><div class="value">{{wordData['teacher'].length}}</div>
           <div class="label">参与学生人数</div><div class="value">{{wordData['student'].length }}</div>
         </div>
-        <div class="member">
+        <div class="member" id="five">
           <div class="memberLabel">
-            <span>项目组</span>
-            <span>教师团队</span>
+            <span class="fontBold">项目组</span>
+            <span class="fontBold">教师团队</span>
             <span>(团队3人以上,</span>
             <span>至少应包含1名教</span>
             <span>研室主任)</span>
@@ -162,15 +162,15 @@
               </div>
               <div class="operate">
                 <el-button @click="addTeacher" v-if="wordData['teacher'].length==index+1" type="primary" size="mini">+</el-button>
-                <el-button v-if="wordData['teacher'].length!=1" @click="DelTeacher(index)" type="primary" size="mini">-</el-button>
+                <el-button v-if="wordData['teacher'].length!=1  && wordData['teacher'].length>3" @click="DelTeacher(index)" type="primary" size="mini">-</el-button>
               </div>
             </div>
           </div>
         </div>
-        <div class="member">
+        <div class="member" id="six">
           <div class="memberLabel">
-            <span>项目组</span>
-            <span>学生团队</span>
+            <span class="fontBold">项目组</span>
+            <span class="fontBold">学生团队</span>
             <span>(团队5人以上,</span>
             <span>学生团队年级结构</span>
             <span>安排合理)</span>
@@ -222,17 +222,22 @@
               </div>
               <div class="operate">
                 <el-button @click="addStudent" v-if="wordData['student'].length==index+1" type="primary" size="mini">+</el-button>
-                <el-button @click="DelStudent(index)" v-if="wordData['student'].length!=1"  type="primary" size="mini">-</el-button>
+                <el-button @click="DelStudent(index)" v-if="wordData['student'].length!=1  && wordData['student'].length>5"  type="primary" size="mini">-</el-button>
               </div>
             </div>
           </div>
         </div>
         <div class="chapters">
           <div class="chaptersLabel">
-            <span>项目</span><span>建设</span><span>内容</span><span>及</span><span>目标</span><span>(说明项目建设内</span><span>容、拟解决的关键</span><span>问题、创新之处、</span><span>主要建设指标)</span>
+            <span class="fontBold">项目</span>
+            <span class="fontBold">建设</span>
+            <span class="fontBold">内容</span>
+            <span class="fontBold">及</span>
+            <span class="fontBold">目标</span>
+            <span>(说明项目建设内</span><span>容、拟解决的关键</span><span>问题、创新之处、</span><span>主要建设指标)</span>
           </div>
           <div class="chaptersTable">
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="seven">
                 <span>项目简介(200-300字)</span><br/>
                 <el-input
                   type="textarea"
@@ -244,7 +249,7 @@
                   v-model="wordData['brief']">
                 </el-input>
               </div>
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="eight">
                 <span>建设内容(空间优化/场馆规划方面拟解决的关键问题及主要建设指标)</span><br/>
                 <el-input
                   type="textarea"
@@ -257,11 +262,14 @@
           </div>
         </div>
         <div class="chapters">
-          <div class="chaptersLabel">
-            <span>项目</span><span>建设</span><span>论证</span><span>报告</span>
+          <div class="chaptersLabel fontBold">
+            <span>项目</span>
+            <span>建设</span>
+            <span>论证</span>
+            <span>报告</span>
           </div>
           <div class="chaptersTable">
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="nine">
                 <span>立项依据(说明本项目的目的、意义以及国内外高校现状、市场预测和发展趋势,预期达到的目标,研究的预期效果分析,成果受益面)</span><br/>
                 <el-input
                   type="textarea"
@@ -275,10 +283,12 @@
         </div>
         <div class="chapters">
           <div class="chaptersLabel">
-            <span>预期</span><span>成果</span><span>(项目预期成果、</span><span>数量及形式,结题</span><span>时:须附项目研究</span><span>报告)</span>
+            <span class="fontBold">预期</span>
+            <span class="fontBold">成果</span>
+            <span>(项目预期成果、</span><span>数量及形式,结题</span><span>时:须附项目研究</span><span>报告)</span>
           </div>
           <div class="chaptersTable">
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="ten">
                 <span>创客空间物理环境、制度建设及软件设施建设情况(环境优化/制度完善/设施改造)</span><br/>
                 <el-input
                   type="textarea"
@@ -288,7 +298,7 @@
                   v-model="wordData['development']">
                 </el-input>
               </div>
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="eleven">
                 <span>学生创客工作室建设情况(工作室数量及活动开展情况)</span><br/>
                 <el-input
                   type="textarea"
@@ -298,7 +308,7 @@
                   v-model="wordData['studio']">
                 </el-input>
               </div>
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="twelve">
                 <span>学生创客团队(人才)培养预期成果、数量</span><br/>
                 <el-input
                   type="textarea"
@@ -308,7 +318,7 @@
                   v-model="wordData['studentTeam']">
                 </el-input>
               </div>
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="thirteen">
                 <span>学生创客活动组织实施情况</span><br/>
                 <el-input
                   type="textarea"
@@ -318,7 +328,7 @@
                   v-model="wordData['studentActivities']">
                 </el-input>
               </div>
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="fourteen">
                 <span>学生创客团队孵化、转化创业项目情况</span><br/>
                 <el-input
                   type="textarea"
@@ -332,10 +342,10 @@
         </div>
         <div class="chapters">
           <div class="chaptersLabel">
-            <span>立项</span>
-            <span>基础</span>
-            <span>及</span>
-            <span>条件</span>
+            <span class="fontBold">立项</span>
+            <span class="fontBold">基础</span>
+            <span class="fontBold">及</span>
+            <span class="fontBold">条件</span>
             <span>(说明已开展的相</span>
             <span>关研究及基础准备</span>
             <span>工作,已具备的设</span>
@@ -345,7 +355,7 @@
             <span>径)</span>
           </div>
           <div class="chaptersTable">
-              <div class="chaptersValue">
+              <div class="chaptersValue" id="fifteen">
                 <span>基础条件(物理环境/设备设施/项目实施/活动开展/技术力量/社会资源)</span><br/>
                 <el-input
                   type="textarea"
@@ -534,43 +544,35 @@
         <span>1.表格可顺延或另附页。</span>
         <span>2.项目申报需附相关佐证材料。</span>
       </div>
-      <el-button @click="test">测试</el-button>
+      <el-button type="primary" @click="test">确认</el-button>
 </div>
 </template>
   
 <script>
+import {getNowDate} from '@/components/tool/Date.js'
   export default {
     data() {
       return {
         wordData:{
-          year:"",  //申请日期年
-          month:"",   //申请日期月
-          day:"",     //申请日期日
-          ing:false, //待建设
-          ed:false,  //已建设
-          state:"",
+          applicationDate:getNowDate(1),//申请日期
           projectName:"",//项目名称
           college:"",//所在学院
           begin_at:"",//项目开始时间
+          state:"",//项目状态
           plannedEnd_at:"",//计划完成时间
           pro_leader:"",//项目负责人
           lead_leader:"",//学院牵头领导
-          people:"",//项目组人数
-          teacherNum:"",//参与教师人数
-          studentNum:"",//参与学生人数
           teacher:[
               {name:"",speciality:"",title:"",education:"",section:"",work:""},
-              // {name:"",speciality:"",title:"",education:"",section:"",work:""},
-              // {name:"",speciality:"",title:"",education:"",section:"",work:""},
-              // {name:"",speciality:"",title:"",education:"",section:"",work:""},
-              // {name:"",speciality:"",title:"",education:"",section:"",work:""},
+              {name:"",speciality:"",title:"",education:"",section:"",work:""},
+              {name:"",speciality:"",title:"",education:"",section:"",work:""},
           ],   //教师组//name:姓名  speciality:专业  title:职称 education:学历    section:所在教研室    work:项目组角色分工
           student:[
               {name:"",class:"",age:"",work:""},
-              // {name:"",class:"",age:"",work:""},
-              // {name:"",class:"",age:"",work:""},
-              // {name:"",class:"",age:"",work:""},
-              // {name:"",class:"",age:"",work:""},
+              {name:"",class:"",age:"",work:""},
+              {name:"",class:"",age:"",work:""},
+              {name:"",class:"",age:"",work:""},
+              {name:"",class:"",age:"",work:""},
           ],   //学生组//name:姓名    class:班级 age:年龄   work:项目组任务分工
           brief:"",//项目简介
           Construction:"",//建设内容
@@ -615,7 +617,179 @@
         })
       },
       test(){
-        console.log(this.wordData)
+        //检查各个字段
+        // window.$().scrollTop(v0);
+        // scrollIntoView({ behavior: "smooth" });
+        const cEmpty = /^\s*$/g;
+        for(let i in this.wordData){
+          switch (i) {
+            case "projectName":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请输入项目名称");
+                document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "college":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请选择所在学院");
+                document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "state":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请选择项目状态");
+                document.querySelector('#two').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "begin_at":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请选择项目开始时间");
+                document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "plannedEnd_at":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请选择计划完成时间");
+                document.querySelector('#three').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "pro_leader":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请输入项目负责人");
+                document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "lead_leader":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请输入学院牵头领导");
+                document.querySelector('#four').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "teacher":
+              if(this.wordData[i].length<3){
+                this.$message.error('教师团队应3人以上')
+                document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }else{
+                let num = 0;
+                this.wordData[i].forEach(item=>{
+                  for(let j in item){
+                    if(cEmpty.test(item[j])){
+                      num++;
+                    }
+                  }
+
+                })
+                if(num>0){
+                  this.$message.error("请填完教师信息");
+                  document.querySelector('#five').scrollIntoView({ behavior: "smooth" });
+                  return false;
+                }
+
+              }
+              break;
+            case "student":
+              if(this.wordData[i].length<5){
+                this.$message.error('学生团队应5人以上')
+                document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }else{
+                let num = 0;
+                this.wordData[i].forEach(item=>{
+                  for(let j in item){
+                    if(cEmpty.test(item[j])){
+                      num++;
+                    }
+                  }
+                })
+                if(num>0){
+                  this.$message.error("请填完学生信息");
+                  document.querySelector('#six').scrollIntoView({ behavior: "smooth" });
+                  return false;
+                }
+              }
+              break;
+            case "brief":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写项目简介");
+                document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }else{
+                if(this.wordData[i].length<200||this.wordData>300){
+                  this.$message.error("项目简介需要200-300字")
+                  document.querySelector('#seven').scrollIntoView({ behavior: "smooth" });
+                  return false;
+                }
+              }
+              break;
+            case "Construction":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写建设内容");
+                document.querySelector('#eight').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "ProjectBasis":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写立项依据");
+                document.querySelector('#nine').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "development":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写创客空间物理环境、制度建设及软件设施建设情况");
+                document.querySelector('#ten').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "studio":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写学生创客工作室建设情况");
+                document.querySelector('#eleven').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "studentTeam":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写学生创客团队(人才)培养预期成果、数量");
+                document.querySelector('#twelve').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "studentActivities":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写学生创客活动组织实施情况");
+                document.querySelector('#thirteen').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "Transforming":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写学生创客团队孵化、转化创业项目情况");
+                document.querySelector('#fourteen').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break;
+            case "condition":
+              if(cEmpty.test(this.wordData[i])){
+                this.$message.error("请填写基础条件");
+                document.querySelector('#fifteen').scrollIntoView({ behavior: "smooth" });
+                return false;
+              }
+              break
+          }
+        }
+        this.$message.success("数据验证成功")
+        // console.log("哇偶")
+        // console.log(this.wordData)
       },
       addTeacher(){
         this.wordData['teacher'].push({name:"",speciality:"",title:"",education:"",section:"",work:""});
@@ -675,6 +849,7 @@
             bottom: 0;
             right: 100px;
             font-weight: bold;
+            margin-bottom:5px;
         }
     }
     #table{
@@ -697,6 +872,7 @@
         box-sizing: border-box;
         min-height: 50px;
         border-right: solid 1px black;
+        font-weight:bold;
       }
       .value{
         flex: 2;
@@ -730,6 +906,7 @@
         box-sizing: border-box;
         border-right: solid 1px black;
         border-bottom: solid 1px black;
+        font-weight:bold;
       }
       .ValueDescribe{
         flex: 5;
@@ -846,67 +1023,6 @@
         }
       }
     }
-    // .fund{
-    //   display: flex;
-    //   .fundTitle{
-    //     flex: 1;
-    //     display: flex;
-    //     justify-content: center;
-    //     align-items: center;
-    //     border-right:solid 1px black ;
-    //     border-bottom:solid 1px black ;
-    //   }
-    //   .fundTable{
-    //     flex: 5;
-    //     display: flex;
-    //     flex-direction: column;
-    //     .fundTotal{
-    //       min-height: 80px;
-    //       box-sizing: border-box;
-    //       border-bottom: solid 1px black;
-    //       font-weight: bold;
-    //       display: flex;
-    //       justify-content: center;
-    //       align-items: center;
-    //       .fundLabel{
-    //         flex: 1.5;
-    //         box-sizing: border-box;
-    //         border-right: solid 1px black;
-    //       }
-    //       .fundValue{
-    //         flex: 7;
-    //       }
-    //       div{
-    //         height: 100%;
-    //         display: flex;
-    //         justify-content: center;
-    //         align-items: center;
-    //       }
-    //     }
-    //     .fundHeader{
-    //       width: 100%;
-    //       display: flex;
-    //       min-height: 50px;
-    //       box-sizing: border-box;
-    //       border-bottom: solid 1px black;
-    //       .HeaderLabel{
-    //         flex: 2;
-    //         box-sizing: border-box;
-    //         border-right: solid 1px black;
-    //         display: flex;
-    //         justify-content: center;
-    //         align-items: center;
-    //         &:nth-of-type(1){
-    //           flex: 1.5;
-    //         }
-    //         &:nth-last-of-type(1){
-    //           flex: 3;
-    //           border:none;
-    //         }
-    //       }
-    //     }
-    //   }
-    // }
     .fund{
       display: flex;
       .fundTitle{
@@ -918,6 +1034,7 @@
         box-sizing: border-box;
         border-right: solid 1px black;
         border-bottom: solid 1px black;
+        font-weight:bold;
       }
       .fundTable{
         flex: 5;
@@ -949,6 +1066,7 @@
           box-sizing: border-box;
           border-bottom: solid 1px black;
           display: flex;
+          font-weight:bold;
           .HeaderLabel{
             flex: 1;
             display: flex;
@@ -972,6 +1090,7 @@
             display: flex;
             justify-content: center;
             align-items: center;
+            font-weight:bold;
           }
           .fundDataHan{
             flex: 4;
@@ -1027,6 +1146,7 @@
         // padding: 3.5px;
         border-right: solid 1px black;
         border-bottom: solid 1px black;
+        font-weight:bold;
       }
       .opinionValue{
         flex: 5;
@@ -1090,6 +1210,9 @@
     width: 100%;
     height: 100%;
   }
+  :deep(.el-input__suffix){
+    display:none;
+  }
   // .InputDiv{
   //   width: 100%;
   //   height: 100%;
@@ -1104,5 +1227,8 @@
   //     border:solid 1px #409eff ;
   //   }
   // }
+  .fontBold{
+    font-weight:bold;
+  }
 }
 </style>

+ 7 - 2
src/components/tool/Date.js

@@ -1,4 +1,4 @@
-function getNowDate() {
+function getNowDate(type=0) {
     let date = new Date();
     let year = date.getFullYear(); //年
     let month = date.getMonth() + 1; //月
@@ -11,7 +11,12 @@ function getNowDate() {
     if (hour > 0 && hour < 9) hour = "0" + hour;
     if (minutes > 0 && minutes <= 9) minutes = "0" + minutes;
     if (seconds > 0 && seconds < 9) seconds = "0" + seconds;
-    return `${year}-${month}-${day} ${hour}:${minutes}:${seconds}`;
+    if(type==0){
+      return `${year}-${month}-${day} ${hour}:${minutes}:${seconds}`;
+    }else if(type==1){
+      return `${year}年${month}月${day}日`;
+    }
+    
 }
 
 //比较两时间之差

+ 1 - 1
src/views/test.vue

@@ -51,7 +51,7 @@ export default {
 #test{
   width: 100vw;
   display: flex;
-  background:blue;
+  // background:blue;
   justify-content: center;
 }
 #word{