Sfoglia il codice sorgente

修改分类逻辑

Q-ABAB 2 anni fa
parent
commit
391ffeff0b

+ 44 - 44
src/views/projectApply/components/projectApplicationApply.vue

@@ -67,7 +67,7 @@
                           </div>
                           <div class="inpBlock">
                               <div class="label">选择分类</div>
-                              <el-cascader v-model="pageType" style="width: 100%;" disabled :options="sortOptions" clearable></el-cascader>
+                              <el-cascader v-model="pageType" style="width: 100%;" disabled :options="data.sortOptions" clearable></el-cascader>
                           </div>
                       </div>
 
@@ -458,30 +458,30 @@
                       label: '入驻学校孵化基地的初创企业法人'
                     }
           ],
-          sortOptions: [      //选择分类下拉框数据
-                    {
-                      value:"",
-                      label: '',
-                      children: [{
-                        value: 0,
-                        label: '创意组',
-                      },
-                       {
-                        value: 1,
-                        label: '初创组',
-                      }
-                    ]}, 
-                    {
-                    value:"",
-                    label: '',
-                    children: [{
-                      value: 0,
-                      label: '已建设',
-                    }, {
-                      value: 1,
-                      label: '待建设',
-                    }]
-                  }],
+          // sortOptions: [      //选择分类下拉框数据
+          //           {
+          //             value:"",
+          //             label: '',
+          //             children: [{
+          //               value: 0,
+          //               label: '创意组',
+          //             },
+          //              {
+          //               value: 1,
+          //               label: '初创组',
+          //             }
+          //           ]}, 
+          //           {
+          //           value:"",
+          //           label: '',
+          //           children: [{
+          //             value: 0,
+          //             label: '已建设',
+          //           }, {
+          //             value: 1,
+          //             label: '待建设',
+          //           }]
+          //         }],
         }
       },
       
@@ -649,24 +649,24 @@
             this.next();
         },
 
-        getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
-              let param={
-                uid:this.$store.state.userInfo.userid
-              }
-                this.ajax
-                      .get(this.$store.state.api+'/SelectAllType',param)
-                      .then(res=>{
-                        // console.log(res.data[0]);
-                        let p=res.data[0]
-                        this.sortOptions[0].value=p[0].id
-                        this.sortOptions[0].label=p[0].name
-                        this.sortOptions[1].value=p[1].id
-                        this.sortOptions[1].label=p[1].name
-                        // console.log(pageType);
-                      },err=>{
-                        console.log(err);
-                      })
-            },
+        // getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+        //       let param={
+        //         uid:this.$store.state.userInfo.userid
+        //       }
+        //         this.ajax
+        //               .get(this.$store.state.api+'/SelectAllType',param)
+        //               .then(res=>{
+        //                 // console.log(res.data[0]);
+        //                 let p=res.data[0]
+        //                 this.sortOptions[0].value=p[0].id
+        //                 this.sortOptions[0].label=p[0].name
+        //                 this.sortOptions[1].value=p[1].id
+        //                 this.sortOptions[1].label=p[1].name
+        //                 // console.log(pageType);
+        //               },err=>{
+        //                 console.log(err);
+        //               })
+        //     },
             //立项基础信息页面删除功能在它自己页面人员信息
         toPage(val){
             if (val==1) {
@@ -685,7 +685,7 @@
         }
       },
       mounted(){
-        this.getProjectTypeData()
+        // this.getProjectTypeData()
       }
     }
 </script>

+ 24 - 7
src/views/projectApply/components/projectApplicationDetails.vue

@@ -661,7 +661,7 @@
                     .get(this.$store.state.api+'/SelectProjectApplyDetailStudent',param)
                     .then(res=>{
                         let data=res.data[0][0]
-                        console.log(data);
+               
                         // console.log(data.multiSelectProject);
                         this.content.select.projectName=data.title
                         this.content.select.leader=data.leader
@@ -689,18 +689,35 @@
             },
 
             getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+              let TypeList = [];
               let param={
                 uid:this.$store.state.userInfo.userid
               }
                 this.ajax
                       .get(this.$store.state.api+'/SelectAllType',param)
                       .then(res=>{
-                        // console.log(res.data[0]);
-                        let data=res.data[0]
-                        this.sortOptions[0]['value']=data[0]['id']
-                        this.sortOptions[0]['label']=data[0]['name']
-                        this.sortOptions[1]['value']=data[1]['id']
-                        this.sortOptions[1]['label']=data[1]['name']
+                        //获取主分类
+                        let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.sortOptions = TypeList
                       },err=>{
                         console.log(err);
                       })

+ 25 - 28
src/views/projectApply/components/projectApplicationMakerSpaceDetails.vue

@@ -423,30 +423,7 @@
             tel:'',
             Date:'',
             Fund:'',
-            sortOptions: [
-                    {
-                      value:"",
-                      label:'',
-                      children: [{
-                        value: 0,
-                        label: '创意组',
-                      },
-                       {
-                        value: 1,
-                        label: '初创组',
-                      }
-                    ]}, 
-                    {
-                    value:"",
-                    label:'',
-                    children: [{
-                      value: 0,
-                      label: '已建设',
-                    }, {
-                      value: 1,
-                      label: '待建设',
-                    }]
-                  }],
+            sortOptions: [],//分类
             department:[],
           },
           textarea:'周四福利大放送',   //项目简介
@@ -662,16 +639,36 @@
                       })
             },
         getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+          let TypeList = [];
           let param={
             uid:this.$store.state.userInfo.userid
           }
             this.ajax
                   .get(this.$store.state.api+'/SelectAllType',param)
                   .then(res=>{
-                    this.select.sortOptions[0].value=res.data[0][0].id
-                    this.select.sortOptions[0].label=res.data[0][0].name
-                    this.select.sortOptions[1].value=res.data[0][1].id
-                    this.select.sortOptions[1].label=res.data[0][1].name
+                        //获取主分类
+                        let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.select.sortOptions = TypeList;
+                        console.log(this.select)
                   },err=>{
                     console.log(err);
                   })

+ 0 - 8
src/views/projectApply/projectApplication.vue

@@ -117,14 +117,6 @@
           align="center"
           label="分类"
           min-width="10%">
-          <template #default="scope">
-            <div>
-              <!-- 特色创意空间建设 -->
-              <span v-if="scope.row.typeid=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'">{{ scope.row.sort==0?'已建设':'待建设' }}</span>
-              <!-- 学生创客项目 -->
-              <span v-if="scope.row.typeid=='5e21b204-c206-11ed-a4cd-509a4c5b67cf'">{{ scope.row.sort==0?'创意组':'初创组' }}</span>
-            </div>
-          </template>
         </el-table-column>
         <el-table-column
           prop="fund"

+ 25 - 112
src/views/projectApply/projectApplicationApplyMain.vue

@@ -163,30 +163,7 @@
                   projectApplyPerson:'',  //项目申请人
                 },
                 departmentOptions: [],  //部门下拉框
-                sortOptions: [      //选择分类下拉框数据
-                    {
-                      value:"",
-                      label: '',
-                      children: [{
-                        value: 0,
-                        label: '创意组',
-                      },
-                       {
-                        value: 1,
-                        label: '初创组',
-                      }
-                    ]}, 
-                    {
-                    value:"",
-                    label: '',
-                    children: [{
-                      value: 0,
-                      label: '已建设',
-                    }, {
-                      value: 1,
-                      label: '待建设',
-                    }]
-                  }],
+                sortOptions: []//分类下拉框,
 
             },
 
@@ -274,7 +251,7 @@
                 this.ajax
                       .get(this.$store.state.api+'/SelectAllDepartment',param)
                       .then(res=>{
-                        // console.log(res.data[0]);
+                        console.log(res.data[0]);
                         let p=res.data[0]
                         let a=this.projectApplicationApply1
                         a.options=p
@@ -285,19 +262,35 @@
                       })
             },
             getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+              let TypeList = [];
               let param={
                 uid:this.$store.state.userInfo.userid
               }
                 this.ajax
                       .get(this.$store.state.api+'/SelectAllType',param)
                       .then(res=>{
-                        // console.log(res.data[0]);
-                        let p=res.data[0]
-                        let a=this.projectApplicationApply1
-                        a.sortOptions[0].value=p[0].id
-                        a.sortOptions[0].label=p[0].name
-                        a.sortOptions[1].value=p[1].id
-                        a.sortOptions[1].label=p[1].name
+                        //获取主分类
+                        let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.projectApplicationApply1.sortOptions = TypeList;
                       },err=>{
                         console.log(err);
                       })
@@ -576,86 +569,6 @@
         }
   // 顶部导航区结束
 
-   //提交对话框开始     选择分类
-  // .projectApplicationfundAddDialog{  
- 
-  //   .el-dialog__header{
-  //       display: flex;
-  //       justify-content: center;
-  //   }
-  //   .el-dialog{
-  //     border-radius: 5px;
-  //     overflow: hidden;
-
-  //     top: 10%;
-  //   }
-    
-  //   .deleteContent{
-  //     width: 100%;
-  //     text-align: center;
-  //     font-size: 22px;
-  //     color: #000;
-  //   }
-  //   .addDialogLogo{
-  //     width: 60px;
-  //       height: 30px;
-  //       border-radius: 5px;
-  //       display: flex;
-  //       justify-content: center;
-  //       line-height: 30px;
-  //       background: #f2f2f2;
-  //       position: absolute;
-  //       left: 20px; top: 15px; 
-  //   }
-  //   .el-dialog__header{
-  //   background: #32455b;
-  //   }
-  //   .el-dialog__title{
-  //     color:#fff;
-  //       display: flex;
-  //       justify-content: center;
-  //       font-size: 18px;
-  //       position: relative;
-  //       top: -2px;
-  //   }
-  //   .addDialogMid{
-  //     box-sizing: border-box;
-  //     padding:0 60px 0 10px;
-  //     .addDialogTit{
-  //       display: flex;
-  //       span{
-  //         width: 80px;
-  //         line-height: 40px;
-  //         text-align: left;
-  //       }
-  //     }
-  //   .addDialogTit1{
-  //     display: flex;
-  //     justify-content: space-between;
-  //     margin-bottom: 15px;
-  //   }
-  //   .addDialogTit2{
-  //     margin-top: 10px;
-  //     font-size: 18px;
-  //     color: #000;
-  //     text-indent: 2em;
-  //   }
-  //   .addDialogCon{
-  //     margin-top: 20px;
-  //   }
-  // }
-  // .dialog-footer{
-  //   display: flex;
-  //   justify-content: center;
-  //   // .btn5{
-  //   //   height: 40px;
-  //   //   font-size: 16px;
-  //   //   background: #0e72e6;
-  //   //   width: 200px;
-  //   // }
-  // }
-  // }
-   //提交对话框结束
 
 
    .right{

+ 23 - 6
src/views/projectManage/components/ProjectManagement1.vue

@@ -694,18 +694,35 @@
             },
 
             getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+              let TypeList = [];
               let param={
                 uid:this.$store.state.userInfo.userid
               }
                 this.ajax
                       .get(this.$store.state.api+'/SelectAllType',param)
                       .then(res=>{
-                        // console.log(res.data[0]);
-                        let data=res.data[0]
-                        this.sortOptions[0]['value']=data[0]['id']
-                        this.sortOptions[0]['label']=data[0]['name']
-                        this.sortOptions[1]['value']=data[1]['id']
-                        this.sortOptions[1]['label']=data[1]['name']
+                       //获取主分类
+                    let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.sortOptions = TypeList;
                       },err=>{
                         console.log(err);
                       })

+ 24 - 28
src/views/projectManage/components/ProjectManagement1_MakerSpace.vue

@@ -420,30 +420,7 @@
             tel:'',
             Date:'',
             Fund:'',
-            sortOptions: [
-                    {
-                      value:"",
-                      label:'',
-                      children: [{
-                        value: 0,
-                        label: '创意组',
-                      },
-                       {
-                        value: 1,
-                        label: '初创组',
-                      }
-                    ]}, 
-                    {
-                    value:"",
-                    label:'',
-                    children: [{
-                      value: 0,
-                      label: '已建设',
-                    }, {
-                      value: 1,
-                      label: '待建设',
-                    }]
-                  }],
+            sortOptions: [],
             department:[],
           },
           textarea:'周四福利大放送',   //项目简介
@@ -654,16 +631,35 @@
                       })
             },
         getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+          let TypeList = [];
           let param={
             uid:this.$store.state.userInfo.userid
           }
             this.ajax
                   .get(this.$store.state.api+'/SelectAllType',param)
                   .then(res=>{
-                    this.select.sortOptions[0].value=res.data[0][0].id
-                    this.select.sortOptions[0].label=res.data[0][0].name
-                    this.select.sortOptions[1].value=res.data[0][1].id
-                    this.select.sortOptions[1].label=res.data[0][1].name
+                    //获取主分类
+                    let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.select.sortOptions = TypeList;
                   },err=>{
                     console.log(err);
                   })

+ 23 - 28
src/views/projectSettlement/components/projectSettlementDetailBase_MakerSpace.vue

@@ -425,30 +425,7 @@
             tel:'',
             Date:'',
             Fund:'',
-            sortOptions: [
-                    {
-                      value:"",
-                      label:'',
-                      children: [{
-                        value: 0,
-                        label: '创意组',
-                      },
-                       {
-                        value: 1,
-                        label: '初创组',
-                      }
-                    ]}, 
-                    {
-                    value:"",
-                    label:'',
-                    children: [{
-                      value: 0,
-                      label: '已建设',
-                    }, {
-                      value: 1,
-                      label: '待建设',
-                    }]
-                  }],
+            sortOptions: [],
             department:[],
           },
           textarea:'',   //项目简介
@@ -659,16 +636,34 @@
                       })
             },
         getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+          let TypeList = [];
           let param={
             uid:this.$store.state.userInfo.userid
           }
             this.ajax
                   .get(this.$store.state.api+'/SelectAllType',param)
                   .then(res=>{
-                    this.select.sortOptions[0].value=res.data[0][0].id
-                    this.select.sortOptions[0].label=res.data[0][0].name
-                    this.select.sortOptions[1].value=res.data[0][1].id
-                    this.select.sortOptions[1].label=res.data[0][1].name
+                    let master = res.data[0].filter(item=>item['pid']=='');
+                        //获取子分类
+                        let minion = res.data[0].filter(item=>item['pid']!='');
+                        master.forEach(item=>{
+                          let type = {
+                            value:item['id'],
+                            label:item['name'],
+                            children:[],
+                          }
+                          minion.forEach(min=>{
+                            if(min['pid']==item['id']){
+                              let minType = {
+                                value:min['id'],
+                                label:min['name']
+                              }
+                              type['children'].push(minType);
+                            }
+                          })
+                          TypeList.push(type);
+                        })
+                        this.select.sortOptions = TypeList;
                   },err=>{
                     console.log(err);
                   })

+ 22 - 6
src/views/projectSettlement/components/projectSettlementDetailBase_Student.vue

@@ -695,18 +695,34 @@
               },
   
               getProjectTypeData(){  //获取项目立项申请基础信息页面分类数据
+                let TypeList = [];
                 let param={
                   uid:this.$store.state.userInfo.userid
                 }
                   this.ajax
                         .get(this.$store.state.api+'/SelectAllType',param)
                         .then(res=>{
-                          // console.log(res.data[0]);
-                          let data=res.data[0]
-                          this.sortOptions[0]['value']=data[0]['id']
-                          this.sortOptions[0]['label']=data[0]['name']
-                          this.sortOptions[1]['value']=data[1]['id']
-                          this.sortOptions[1]['label']=data[1]['name']
+                          let master = res.data[0].filter(item=>item['pid']=='');
+                              //获取子分类
+                              let minion = res.data[0].filter(item=>item['pid']!='');
+                              master.forEach(item=>{
+                                let type = {
+                                  value:item['id'],
+                                  label:item['name'],
+                                  children:[],
+                                }
+                                minion.forEach(min=>{
+                                  if(min['pid']==item['id']){
+                                    let minType = {
+                                      value:min['id'],
+                                      label:min['name']
+                                    }
+                                    type['children'].push(minType);
+                                  }
+                                })
+                                TypeList.push(type);
+                              })
+                              this.sortOptions = TypeList;
                         },err=>{
                           console.log(err);
                         })

+ 1 - 1
src/views/resultShow/components/resultDetail_MakerSpace.vue

@@ -14,7 +14,7 @@
                 </div>
                 <div class="rsHead3Tit rsHead2Tit">
                     <div>学院:<span class="titleMessage">{{ TitleMessage.ClassName }}</span></div>
-                    <div>分类:<span class="titleMessage">{{ TitleMessage.TypeName }} - {{ TitleMessage.TypeName=="学生创客项目"?TitleMessage.tn2==0?"创意组":"初创组":TitleMessage.tn2==0?"已建设":"待建设"}}</span></div>
+                    <div>分类:<span class="titleMessage">{{ TitleMessage.TypeName }} - {{ TitleMessage.tn2}}</span></div>
                 </div>
       
                 <div class="rsHead2Tit personListUL">

+ 1 - 1
src/views/resultShow/components/resultDetail_student.vue

@@ -14,7 +14,7 @@
                 </div>
                 <div class="rsHead3Tit rsHead2Tit">
                     <div>学院:<span class="titleMessage">{{ TitleMessage.ClassName }}</span></div>
-                    <div>分类:<span class="titleMessage">{{ TitleMessage.TypeName }} - {{ TitleMessage.TypeName=="学生创客项目"?TitleMessage.tn2==0?"创意组":"初创组":TitleMessage.tn2==0?"已建设":"待建设"}}</span></div>
+                    <div>分类:<span class="titleMessage">{{ TitleMessage.TypeName }} - {{ TitleMessage.tn2}}</span></div>
                 </div>
       
                 <div class="rsHead2Tit personListUL">