Browse Source

[BI]修正學校規模版本顯示邏輯

jeff 1 year ago
parent
commit
eaf0adf124

+ 20 - 17
TEAMModelBI/ClientApp/src/view/index/index.vue

@@ -3045,19 +3045,22 @@ export default {
       //    && item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && item.service.includes('YPXSJ6NJ') 
       //    ? marjorArr.push(item) : '' }) : ''
       //  11.14日修正  关于学校版本问题   根据edition   current /1基础   /2标准   /3专业
-      // schoolList ? schoolList.forEach((item) => {
-      //    item.edition   && item.edition.current === 3 && item.code ==='BIRel' ? marjorArr.push(item):''
-      //   //  item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') &&  item.service.includes('YPXSJ6NJ') && item.code ==='BIRel'  ?  marjorArr.push(item):''
-      //  }) : ''
+      schoolList ? schoolList.forEach((item) => {
+         item.edition   && item.edition.current === 3 && item.code ==='BIRel' ? marjorArr.push(item):''
+        //  item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') &&  item.service.includes('YPXSJ6NJ') && item.code ==='BIRel'  ?  marjorArr.push(item):''
+       }) : ''
        // 標準版
       //  schoolList ? schoolList.forEach((item) => { 
       //   (item.edition == null || item.edition.scaleVersion == null) && item.code ==='BIRel'
       //   && item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) ? standardArr.push(item) : '' }) : ''
-      // schoolList ? schoolList.forEach((item) => { 
-      //   item.edition  && item.edition.current === 2 && item.code ==='BIRel' ? standardArr.push(item):''
-      //   // item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && item.code ==='BIRel' ? standardArr.push(item):''
-      // }) : ''
+      schoolList ? schoolList.forEach((item) => { 
+        item.edition  && item.edition.current === 2 && item.code ==='BIRel' ? standardArr.push(item):''
+        // item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && item.code ==='BIRel' ? standardArr.push(item):''
+      }) : ''
        // 基礎版
+      schoolList ? schoolList.forEach((item) => { 
+        item.code === 'BIRel' && (item.edition == null || (item.edition && item.edition.current == null) || (item.edition && item.edition.current === 1 && (item.edition.scaleVersion == null || item.edition.scaleVersion == ''))) ? basicsArr.push(item):''
+      }) : ''
       //  schoolList ? schoolList.forEach((item) => { 
       //   (item.edition == null || item.edition.scaleVersion == null) && item.code ==='BIRel'
       //   && !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') ? basicsArr.push(item) : '' }) : ''
@@ -3067,16 +3070,16 @@ export default {
       //   // !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.code ==='BIRel' ? basicsArr.push(item):''
       // }) : ''
        // 评测版
-      //  schoolList ? schoolList.forEach((item) => { 
-      //   item.edition !== null && item.edition.current === 1 && item.code ==='BIRel' && item.service.includes('B6V5J6NP') ? 
-      //   customArr.push(item) : '' }) : ''    
+      schoolList ? schoolList.forEach((item) => { 
+        item.edition !== null && item.code === 'BIRel' && item.edition.scaleVersion == '评测版' ? customArr.push(item) : ''
+      }) : ''    
 
-        schoolList ? schoolList.forEach((item) => {
-          item.service.includes('YPXSJ6NJ') && item.service.includes('B6V5J6NP') && item.service.includes('YMPCVCIM') && item.code ==='BIRel' ? marjorArr.push(item):
-          item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) && item.code ==='BIRel' ? standardArr.push(item):
-          !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.service.includes('B6V5J6NP') && item.code ==='BIRel'   ? customArr.push(item):
-          !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.code ==='BIRel'  ? basicsArr.push(item):''
-        }):''
+        // schoolList ? schoolList.forEach((item) => {
+        //   item.service.includes('YPXSJ6NJ') && item.service.includes('B6V5J6NP') && item.service.includes('YMPCVCIM') && item.code ==='BIRel' ? marjorArr.push(item):
+        //   item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) && item.code ==='BIRel' ? standardArr.push(item):
+        //   !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.service.includes('B6V5J6NP') && item.code ==='BIRel'   ? customArr.push(item):
+        //   !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.code ==='BIRel'  ? basicsArr.push(item):''
+        // }):''
         //计算版本占比
         console.log(basicsArr,standardArr,marjorArr,customArr,'数组')
         versionsData.value.basics.num = basicsArr.length >0 ?basicsArr.length :0

+ 23 - 29
TEAMModelBI/ClientApp/src/view/schoolServe/school.vue

@@ -808,18 +808,20 @@ export default {
                 item.versions = item.service.includes('YPXSJ6NJ') && item.service.includes('B6V5J6NP') ? '专业版' : item.service.includes('YMPCVCIM') ? '标准版' : '基础版';
           } */
           //11.14日修正  关于学校版本问题   根据edition   current /1基础   /2标准   /3专业
-           /* if(item.edition !== null){
-            item.edition.current === 1 && item.service.includes('B6V5J6NP') ? item.versions='评测版':
-            item.edition.current === 3 ?  item.versions='专业版':
-            item.edition.current === 2 ? item.versions='标准版':
-            item.edition.current === 1 ? item.versions='基础版':''
+          if (item.code === 'BIRel'){
+            item.edition && item.edition.scaleVersion == '评测版' ? item.versions = '评测版' :
+            item.edition && item.edition.current === 3 ? item.versions = '专业版' :
+            item.edition && item.edition.current === 2 ? item.versions = '标准版' :
+            item.edition == null || (item.edition && item.edition.current == null) || (item.edition && item.edition.current === 1 && (item.edition.scaleVersion == null || item.edition.scaleVersion == '')) ? item.versions = '基础版' : ''
           }else{
-            item.versions='基础版'
-          } */
+            item.versions=''
+          }
+          /*
           item.versions =item.service.includes('YPXSJ6NJ') && item.service.includes('B6V5J6NP') && item.service.includes('YMPCVCIM') ? '专业版':
           item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) ? '标准版':
           !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.service.includes('B6V5J6NP')   ?'评测版':
           !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM')  ? '基础版':'基础版' 
+                    */
         }),
         tableData.value.push(...res.scInfos),originalNum.value = res.scInfos.length,
         originalData.value = res.scInfos,tablesccnt.value = res.allCnt) 
@@ -1525,32 +1527,24 @@ export default {
       // debugger;
        // 專業版
         arrState.major ? originalData.value.forEach((item) => {
-          item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && item.service.includes('YPXSJ6NJ') ? 
-          marjorArr.push(item) : '' }) : '' 
-
-         {/* arrState.major ? originalData.value.forEach((item) => {
-          item.edition  && !item.edition.scaleVersion && item.edition.current === 3 ? marjorArr.push(item):''
-         }) : '' */}
-
+         // item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && item.service.includes('YPXSJ6NJ') ? marjorArr.push(item) : '' }) : '' 
+         item.edition && item.edition.current === 3 && item.code === 'BIRel' ? marjorArr.push(item) : ''
+        }) : ''
        // 標準版
         arrState.standard ? originalData.value.forEach((item) => { 
-        item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) ? 
-        standardArr.push(item) : '' }) : '' 
-        /* arrState.standard ? originalData.value.forEach((item) => { 
-          item.edition  && !item.edition.scaleVersion && item.edition.current === 2  ? standardArr.push(item):''
-        }) : '' */
+         // item.service.includes('IPDYZYLC') && item.service.includes('YMPCVCIM') && (!item.service.includes('YPXSJ6NJ')) ? standardArr.push(item) : ''
+         item.edition && item.edition.current === 2 && item.code === 'BIRel' ? standardArr.push(item) : ''
+        }) : ''
        // 基礎版
-       arrState.basics ? originalData.value.forEach((item) => { 
-        !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && !item.service.includes('B6V5J6NP') ? 
-        basicsArr.push(item) : '' }) : '' 
-
-        /* arrState.basics ? originalData.value.forEach((item) => { 
-          item.edition  && !item.edition.scaleVersion && item.edition.current === 1 ? basicsArr.push(item):
-          item.edition ==null ? basicsArr.push(item):''
-        }) : '' */
+        arrState.basics ? originalData.value.forEach((item) => { 
+         // !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && !item.service.includes('B6V5J6NP') ? basicsArr.push(item) : ''
+         item.code === 'BIRel' && (item.edition == null || (item.edition && item.edition.current == null) || (item.edition && item.edition.current === 1 && (item.edition.scaleVersion == null || item.edition.scaleVersion == ''))) ? basicsArr.push(item) : ''
+        }) : '' 
        // 自訂版
-       arrState.custom ? originalData.value.forEach((item) => { 
-        !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.service.includes('B6V5J6NP') ? customArr.push(item) : '' }) : ''   
+        arrState.custom ? originalData.value.forEach((item) => { 
+         // !item.service.includes('IPDYZYLC') && !item.service.includes('YMPCVCIM') && item.service.includes('B6V5J6NP') ? customArr.push(item) : ''
+         item.edition && item.code === 'BIRel' && item.edition.scaleVersion == '评测版' ? customArr.push(item) : ''
+        }) : ''   
         console.log(marjorArr,standardArr,basicsArr,customArr,'重组')        
       let versionArr = [...marjorArr, ...standardArr, ...basicsArr, ...customArr]
       console.log(versionArr, '合并结果')

+ 1 - 1
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -900,7 +900,7 @@ namespace TEAMModelBI.Controllers.Census
                 areaScStats.size = statsInfo.size;
                 areaScStats.scCreateTime = statsInfo.scCreateTime;
                 areaScStats.upTime = statsInfo.upTime;
-                areaScStats.lessStats.open = statsInfo.lesson.all;
+                areaScStats.lessStats.all = statsInfo.lesson.all;
                 areaScStats.lessStats.open = statsInfo.lesson.open;
                 areaScStats.lessStats.less = statsInfo.lesson.less;
                 areaScStats.lessStats.lastDay = statsInfo.lesson.lastDay;