Переглянути джерело

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 рік тому
батько
коміт
1570bd75e2

+ 1 - 1
TEAMModelBI/ClientApp/public/index.html

@@ -12,7 +12,7 @@
     </title>
     </title>
 </head>
 </head>
 <script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
 <script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
-<script src="https://at.alicdn.com/t/c/font_2934132_fbh0djqz67s.js"></script>
+<script src="https://at.alicdn.com/t/c/font_2934132_zba0ifa4ele.js"></script>
 <script src="../src/access/iconfont.js"></script>
 <script src="../src/access/iconfont.js"></script>
 
 
 <body>
 <body>

+ 59 - 4
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -72,6 +72,14 @@
           创建学区
           创建学区
         </el-button>
         </el-button>
       </div>
       </div>
+      <div class="export-data">
+        <el-button :type="!loading ? 'primary':'info'" :disabled="loading ? true:false" @click="exportAreadata">
+          <svg class="created-icon" aria-hidden="true">
+            <use xlink:href="#icon-daochu2"></use>
+          </svg>
+          导出学区数据
+        </el-button>
+      </div>
     </div>
     </div>
     <div class="traitfrom">
     <div class="traitfrom">
       <el-table :data="optionData" style="width: 100%" :highlight-current-row="true" height="74vh" v-loading="loading" :empty-text="$t(`commonMsg.nodataTable`)" element-loading-text="数据加载中...">
       <el-table :data="optionData" style="width: 100%" :highlight-current-row="true" height="74vh" v-loading="loading" :empty-text="$t(`commonMsg.nodataTable`)" element-loading-text="数据加载中...">
@@ -558,7 +566,7 @@
             </svg>
             </svg>
           </div>
           </div>
           <div>{{currentlySelect.name}}</div>
           <div>{{currentlySelect.name}}</div>
-          <div class="area-namehint-code">xxxx</div>
+          <!-- <div class="area-namehint-code">xxxx</div> -->
         </div>
         </div>
         <div class="cut-ability">
         <div class="cut-ability">
           <div class="synchronization-title cut-ability-synchronization" v-show="currentlySelect.cutArea && activeName === 'adjust' && PowerShow"><span>已同步省平台</span></div>
           <div class="synchronization-title cut-ability-synchronization" v-show="currentlySelect.cutArea && activeName === 'adjust' && PowerShow"><span>已同步省平台</span></div>
@@ -825,6 +833,16 @@ export default {
     let schoolSeach = ref('')
     let schoolSeach = ref('')
     let dropdownValue = ref('显示所有学校')
     let dropdownValue = ref('显示所有学校')
     let multiplecheck=ref(false)
     let multiplecheck=ref(false)
+    let exportData=ref([
+        { name: '学区名称', key: 'name'},
+        { name: '学区ID', key: 'id',},
+        { name: '频道简码', key: 'shortCode'},
+        { name: '学校数量', key: 'schoolCount'},
+        { name: '学校位置', key: 'location'},
+        { name: '所属机构', key: 'institution'},
+        { name: '微能力方案', key: 'standard'},
+        { name: '微能力名称', key: 'standardName'},
+    ])
     onMounted(() => {
     onMounted(() => {
       provinceOptions.value.optionInfo = optionsData
       provinceOptions.value.optionInfo = optionsData
     })
     })
@@ -1472,6 +1490,33 @@ export default {
       })
       })
       position.value = ''
       position.value = ''
     }
     }
+    //学区数据导出
+    function exportAreadata(){
+      let arr=optionData.value
+      // arr.forEach(
+      //   item =>
+      //     item.location = item.provName + item.cityName ? item.cityName : ''
+      // )
+      let headerData = [], filterData = []
+        for (let items of exportData.value) {
+          headerData.push(items.name),filterData.push(items.key)
+        }
+      exportExcel(headerData, filterData, arr)
+    }
+    function exportExcel (header, filter, arr) {
+      require.ensure([], () => {
+        const { export_json_to_excel } = require('../../until/excel/Export2Excel')
+        const tHeader = header // excel文档第一行显示的标题
+        const filterVal = filter // id,version等都是上面标题所对应的数据
+        const list = arr
+        const data = formatJson(filterVal, list)
+        export_json_to_excel(tHeader, data, '学区列表清单') //标题,数据,文件名
+      })
+    }
+    function formatJson (filterVal, jsonData) {
+      return jsonData.map((v) => filterVal.map((j) => v[j]))
+    }
+
     watch(abilityModel, (newdata) => {
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       console.log(newdata)
       newdata
       newdata
@@ -1603,7 +1648,11 @@ export default {
       multipleChange,
       multipleChange,
       multipleAdd,
       multipleAdd,
       curTarget,
       curTarget,
-      updateShortcode
+      updateShortcode,
+      exportAreadata,
+      exportData,
+      exportExcel,
+      formatJson
     }
     }
   },
   },
 }
 }
@@ -1622,8 +1671,6 @@ export default {
 .boxselect {
 .boxselect {
   width: 10%;
   width: 10%;
   display: inline-block;
   display: inline-block;
-  margin-top: 1.5%;
-  padding-right: 1%;
 }
 }
 
 
 .created-areaicon {
 .created-areaicon {
@@ -2498,6 +2545,10 @@ export default {
 .codeboxs:hover .el-icon-edit-outline{
 .codeboxs:hover .el-icon-edit-outline{
   opacity: 1;
   opacity: 1;
 }
 }
+.export-data{
+  width: 9%;
+  display: inline-block;
+}
 </style>
 </style>
 <style>
 <style>
 .stagebox-table-not .el-image {
 .stagebox-table-not .el-image {
@@ -2537,6 +2588,10 @@ export default {
   font-weight: bold;
   font-weight: bold;
   line-height: 20px;
   line-height: 20px;
   text-align: right;
   text-align: right;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0% 1%;
 }
 }
 
 
 .cuttable {
 .cuttable {

+ 22 - 16
TEAMModelBI/ClientApp/src/view/schoolServe/school.vue

@@ -46,29 +46,29 @@
         </div>
         </div>
       </div>
       </div>
       <div class="boxselect">
       <div class="boxselect">
-        <div class="batchDelete" v-show="PowerShow && deleteSchoolArr.length !==0">
-          <el-button type="danger" @click="batchRemoveSchool">
+        <div class="createschools" v-if="PowerShow">
+          <el-button @click="createdSchoolbtn" type="primary">
             <svg class="created-icon" aria-hidden="true">
             <svg class="created-icon" aria-hidden="true">
-              <use xlink:href="#icon-piliangshanchu"></use>
+              <use xlink:href="#icon-chuangjianx"></use>
             </svg>
             </svg>
-            删除勾选学校
+            创建学校
           </el-button>
           </el-button>
         </div>
         </div>
-        <div class="batchDelete" v-show="PowerShow && deleteSchoolArr.length !==0">
-          <el-button type="success" @click="exportState=true">
+        <div class="schoolNums"><span>学校数量:</span><span>{{tablesccnt}}</span></div>
+        <div class="batchDelete">
+          <el-button :type="PowerShow && deleteSchoolArr.length !==0 ? 'danger':'info'" @click="batchRemoveSchool">
             <svg class="created-icon" aria-hidden="true">
             <svg class="created-icon" aria-hidden="true">
-              <use xlink:href="#icon-jurassic_import-form-copy"></use>
+              <use xlink:href="#icon-piliangshanchu"></use>
             </svg>
             </svg>
-            导出勾选学校到Excel
+            删除勾选学校
           </el-button>
           </el-button>
         </div>
         </div>
-        <div class="schoolNums"><span>学校数量:</span><span>{{tablesccnt}}</span></div>
-        <div class="createschools" v-if="PowerShow">
-          <el-button @click="createdSchoolbtn" type="primary">
+        <div class="batchDelete mgl">
+          <el-button :type="PowerShow && deleteSchoolArr.length !==0 ?'success':'info'" @click="exportState=true">
             <svg class="created-icon" aria-hidden="true">
             <svg class="created-icon" aria-hidden="true">
-              <use xlink:href="#icon-chuangjianx"></use>
+              <use xlink:href="#icon-jurassic_import-form-copy"></use>
             </svg>
             </svg>
-            创建学校
+            导出勾选学校到Excel
           </el-button>
           </el-button>
         </div>
         </div>
       </div>
       </div>
@@ -1527,7 +1527,6 @@ export default {
        // 自訂版
        // 自訂版
        arrState.custom ? originalData.value.forEach((item) => { 
        arrState.custom ? originalData.value.forEach((item) => { 
         item.edition !== null && item.edition.scaleVersion !== null && item.edition.scaleVersion !== "" ? customArr.push(item) : '' }) : ''           
         item.edition !== null && item.edition.scaleVersion !== null && item.edition.scaleVersion !== "" ? customArr.push(item) : '' }) : ''           
-
       let versionArr = [...marjorArr, ...standardArr, ...basicsArr, ...customArr]
       let versionArr = [...marjorArr, ...standardArr, ...basicsArr, ...customArr]
       console.log(versionArr, '合并结果')
       console.log(versionArr, '合并结果')
       tableData.value = versionArr
       tableData.value = versionArr
@@ -1791,6 +1790,9 @@ export default {
   margin-top: 1%;
   margin-top: 1%;
   text-align: right;
   text-align: right;
   padding-right: 2%;
   padding-right: 2%;
+  display: flex;
+  flex-direction: row-reverse;
+  flex-wrap: wrap;
 }
 }
 
 
 .created-areaicon {
 .created-areaicon {
@@ -1903,13 +1905,17 @@ export default {
   display: inline-block;
   display: inline-block;
   vertical-align: top;
   vertical-align: top;
 }
 }
-.batchDelete {
+.createschools{
+  width:20%;
+}
+.mgl{
   margin-right: 1%;
   margin-right: 1%;
 }
 }
 .schoolNums {
 .schoolNums {
-  margin-right: 30px;
   font-size: 14px;
   font-size: 14px;
   color: #636e72;
   color: #636e72;
+  width:80%;
+  text-align:right;
 }
 }
 .scalebox {
 .scalebox {
   width: 60%;
   width: 60%;

+ 11 - 4
TEAMModelBI/ClientApp/src/view/schoolmanage/schoolAnalyse.vue

@@ -898,8 +898,8 @@ export default {
         backgroundColor: "#fff",
         backgroundColor: "#fff",
         barWidth: 15,
         barWidth: 15,
         grid: {
         grid: {
-          top: '5%',
-          bottom: '12%',
+          top: '15%',
+          bottom: '5%',
           left: '5%',
           left: '5%',
           right: '8%',
           right: '8%',
           containLabel: true,
           containLabel: true,
@@ -2545,10 +2545,13 @@ export default {
 .school-analyse-bottom-left,
 .school-analyse-bottom-left,
 .school-analyse-bottom-right {
 .school-analyse-bottom-right {
   width: 48%;
   width: 48%;
-  height: 28vh;
+  height: 32vh;
   background-color: #fff;
   background-color: #fff;
   border-radius: 5px;
   border-radius: 5px;
 }
 }
+.school-analyse-bottom-left{
+  position:relative;
+}
 .school-list {
 .school-list {
   width: 100%;
   width: 100%;
   height: 300px;
   height: 300px;
@@ -2565,6 +2568,7 @@ export default {
   height: 65vh;
   height: 65vh;
   padding: 1%;
   padding: 1%;
   background-color: #fff;
   background-color: #fff;
+  margin-top:1%;
 }
 }
 .school-list-title {
 .school-list-title {
   font-size: 14px;
   font-size: 14px;
@@ -2760,7 +2764,10 @@ export default {
 }
 }
 .modularization {
 .modularization {
   color: #7fecd5;
   color: #7fecd5;
-  margin-top: 1.5%;
+  position: absolute;
+  left:42%;
+  top:1%;
+  z-index:999;
 }
 }
 .modularization span:last-child {
 .modularization span:last-child {
   margin-left: 25px;
   margin-left: 25px;

+ 24 - 1
TEAMModelBI/ClientApp/src/view/systemConfig/pushmsg/createdpush.vue

@@ -451,6 +451,17 @@
                   </el-radio-group>
                   </el-radio-group>
                   <el-date-picker v-model="constructorData.time" :locale="locale" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择预约发布的时间" v-if="constructorData.timeType =='preordered'" />
                   <el-date-picker v-model="constructorData.time" :locale="locale" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择预约发布的时间" v-if="constructorData.timeType =='preordered'" />
                 </div>
                 </div>
+                <div class="addition-system" v-show="constructorData.source ==='system'">
+                  <span>类型区别:</span>
+                  <el-radio-group v-model="constructorData.systemType" class="radio-time">
+                    <el-radio label="interior">
+                      端内通知
+                    </el-radio>
+                    <el-radio label="external">
+                      端外通知
+                    </el-radio>
+                  </el-radio-group>
+                </div>
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
@@ -538,6 +549,7 @@ let constructorData = ref({
   },
   },
   receiveType: 'hita5',
   receiveType: 'hita5',
   source: '',
   source: '',
+  systemType:'',
   timeType: 'immediately',      // immediately or preordered
   timeType: 'immediately',      // immediately or preordered
   time: 0,
   time: 0,
 })
 })
@@ -874,7 +886,13 @@ function pushSystem(){
   console.log(constructorData.value.receiveType)
   console.log(constructorData.value.receiveType)
   let tagsData=[]; let receives=constructorData.value.receiveType =='hita5' ? 'HiTA':constructorData.value.receiveType
   let tagsData=[]; let receives=constructorData.value.receiveType =='hita5' ? 'HiTA':constructorData.value.receiveType
   receivedatas.value.forEach((item)=>{tagsData.push(item.id+'_'+receives)})
   receivedatas.value.forEach((item)=>{tagsData.push(item.id+'_'+receives)})
-  let data={hubName:constructorData.value.receiveType,tags:tagsData,title:constructorData.value.basic.title,body:constructorData.value.basic.content}
+  let data=''
+  if(constructorData.value.systemType ==='interior'){
+    data={tags:tagsData,title:constructorData.value.basic.title,body:constructorData.value.basic.content,sender:'HiTeach'}
+  }else{
+    data={hubName:constructorData.value.receiveType,tags:tagsData,title:constructorData.value.basic.title,body:constructorData.value.basic.content,sender:'HiTeach'}
+  }
+  console.log(data,'通知的参数')
    proxy.$api.sendPushnotify(data).then((res)=>{
    proxy.$api.sendPushnotify(data).then((res)=>{
      ElMessage.success('消息发送成功')
      ElMessage.success('消息发送成功')
    }).catch((error)=>{
    }).catch((error)=>{
@@ -1358,6 +1376,7 @@ watch(store.state.msgData, (newvalue) => {
   color: #409eff;
   color: #409eff;
   display: flex;
   display: flex;
   justify-content: space-between;
   justify-content: space-between;
+  flex-wrap: wrap;
 }
 }
 .skip-functions {
 .skip-functions {
   width: 50%;
   width: 50%;
@@ -1429,6 +1448,10 @@ watch(store.state.msgData, (newvalue) => {
   top: 0.5%;
   top: 0.5%;
   right: 0.5%;
   right: 0.5%;
 }
 }
+.pushtime-box{
+  width:55%;
+}
+
 </style>
 </style>
 <style>
 <style>
 .skip-switch .el-form-item__content {
 .skip-switch .el-form-item__content {

+ 19 - 0
TEAMModelBI/Controllers/BINormal/BatchAreaController.cs

@@ -34,6 +34,7 @@ using Microsoft.AspNetCore.Hosting;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelBI.Models;
 using TEAMModelBI.Models;
+using System.Text.RegularExpressions;
 
 
 namespace TEAMModelBI.Controllers.BINormal
 namespace TEAMModelBI.Controllers.BINormal
 {
 {
@@ -681,6 +682,24 @@ namespace TEAMModelBI.Controllers.BINormal
                     if (item.shortCode.Equals($"{shortCode}"))
                     if (item.shortCode.Equals($"{shortCode}"))
                         return Ok(new { state = 1, message = "此学区简码已存在请检查" });
                         return Ok(new { state = 1, message = "此学区简码已存在请检查" });
                 }
                 }
+
+                // 檢查是否有大寫或是中文字
+                if ( Regex.IsMatch(shortCode, @"[^a-z0-9]") )
+                {
+                    return Ok(new { state = 1, message = "此區級簡碼必須為小寫字母!" });
+                }             
+
+                string sqlCheckRep =  $"SELECT c.id FROM c WHERE c.shortCode = '{shortCode}'";
+                var _azureCosmosClientCsv2Read = _azureCosmos.GetCosmosClient(name: "CoreServiceV2CnRead");
+                await foreach (var item in _azureCosmosClientCsv2Read.GetContainer("Core", "School").GetItemQueryStreamIterator(queryText: sqlCheckRep, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("district") })) 
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
+                    {
+                        return Ok(new { state = 1, message = "区级名称相同,请检测区级名称!" });
+                    }                    
+                }
+                
                 //DB值更新
                 //DB值更新
                 if (!string.IsNullOrWhiteSpace(name)) area.name = name;
                 if (!string.IsNullOrWhiteSpace(name)) area.name = name;
                 if (!string.IsNullOrWhiteSpace(shortCode)) area.shortCode = shortCode;
                 if (!string.IsNullOrWhiteSpace(shortCode)) area.shortCode = shortCode;

+ 1 - 1
TEAMModelOS.SDK/Models/Service/Common/TeacherService.cs

@@ -460,7 +460,7 @@ namespace TEAMModelOS.Services
             }
             }
             //私人課程
             //私人課程
             List<object> courses = new List<object>();
             List<object> courses = new List<object>();
-            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIterator(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{id}") }))
+            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIterator(queryText: $"select value(c) from c WHERE c.creatorId = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"CourseBase") }))
             {
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)

+ 10 - 10
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -1851,7 +1851,7 @@ const LANG_EN_US = {
             average: 'Evenly distributed',
             average: 'Evenly distributed',
             noItemTip: 'The number of question cannot be empty!',
             noItemTip: 'The number of question cannot be empty!',
             noResultTip: 'No questions found that meets the requirements!',
             noResultTip: 'No questions found that meets the requirements!',
-            total: 'total',
+            total: 'Total',
             nums: 'question(s)',
             nums: 'question(s)',
             spc: '',
             spc: '',
             goDetails: 'View Details',
             goDetails: 'View Details',
@@ -2673,8 +2673,8 @@ const LANG_EN_US = {
         mgtScEv: {
         mgtScEv: {
             delArtExamTip: 'Deleting activities associated with art assessment is not supported at the moment',
             delArtExamTip: 'Deleting activities associated with art assessment is not supported at the moment',
             listLabel: 'Assessment List',
             listLabel: 'Assessment List',
-            listLabel1: 'School Assessment',
-            listLabel2: 'Personal Assessment',
+            listLabel1: 'Assessment',
+            listLabel2: 'Assessment',
             period: 'School System:',
             period: 'School System:',
             create: 'Create',
             create: 'Create',
             delete: 'Delete',
             delete: 'Delete',
@@ -2987,7 +2987,7 @@ const LANG_EN_US = {
             calcing: 'Result data are being processed now.,',
             calcing: 'Result data are being processed now.,',
             clickFresh: 'Click here to refresh',
             clickFresh: 'Click here to refresh',
             inCalc: 'The data is being processed, please check later',
             inCalc: 'The data is being processed, please check later',
-            total: 'Total',
+            total: 'Total Score ',
             avgScore1: 'Total Average Score',
             avgScore1: 'Total Average Score',
             totalLabel: 'Total Quantity',
             totalLabel: 'Total Quantity',
             scoreMat: 'Score Segment',
             scoreMat: 'Score Segment',
@@ -3691,7 +3691,7 @@ const LANG_EN_US = {
         dashboard: {
         dashboard: {
             title: 'Smart Campus Big Data',
             title: 'Smart Campus Big Data',
             title3: 'All-round Quality Big Data',
             title3: 'All-round Quality Big Data',
-            block1: 'Teaching & Research',
+            block1: 'Resource & Application',
             block2: 'Classroom IoT',
             block2: 'Classroom IoT',
             block3: 'Multivariate Assessment',
             block3: 'Multivariate Assessment',
             block4: 'Learning Status Analysis',
             block4: 'Learning Status Analysis',
@@ -3702,7 +3702,7 @@ const LANG_EN_US = {
             comingSoon: 'Coming Soon',
             comingSoon: 'Coming Soon',
             loading: 'Loading',
             loading: 'Loading',
             quit: 'Exit',
             quit: 'Exit',
-            title2: 'Teaching Big Data',
+            title2: 'Resource & Application',
             typeCount: 'Lesson Categories',
             typeCount: 'Lesson Categories',
             gradeCount: 'No. of Grades',
             gradeCount: 'No. of Grades',
             subjectCount: 'No. of Subjects',
             subjectCount: 'No. of Subjects',
@@ -5896,8 +5896,8 @@ const LANG_EN_US = {
             trainSystem: 'Research Platform',
             trainSystem: 'Research Platform',
             artExam: 'Assessment Activity',
             artExam: 'Assessment Activity',
             artExam1: 'Assessment Evaluation',
             artExam1: 'Assessment Evaluation',
-            iotBoard: 'IoT Smart Classroom Dashboard',
-            areaIotboard: 'IoT Smart Classroom Dashboard'
+            iotBoard: 'Smart Classroom IoT Dashboard',
+            areaIotboard: 'Smart Classroom IoT Dashboard'
         },
         },
         compt: {
         compt: {
             cusWare: 'Teaching Material',
             cusWare: 'Teaching Material',
@@ -7574,7 +7574,7 @@ const LANG_EN_US = {
         subjectTitle: 'Subject Distribution',
         subjectTitle: 'Subject Distribution',
     },
     },
     schoolIot: {
     schoolIot: {
-        title: 'Automated (IoT) School Smart Classroom Dashboard',
+        title: 'HiTeach Smarter Classroom IoT Dashboard',
         basics: {
         basics: {
             classnums: 'Used Classrooms',
             classnums: 'Used Classrooms',
             classTotals: 'Activated Licenses',
             classTotals: 'Activated Licenses',
@@ -7616,7 +7616,7 @@ const LANG_EN_US = {
         }
         }
     },
     },
     areaIot: {
     areaIot: {
-        title: 'Automated (IoT) Distrcit Smart Classroom Dashboard',
+        title: 'HiTeach Smarter Classroom IoT Dashboard',
         classrank: {
         classrank: {
             title: 'Lesson Record Statistics',
             title: 'Lesson Record Statistics',
             rank: 'Rank',
             rank: 'Rank',

+ 1 - 1
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -724,7 +724,7 @@
 									permission: "dashboard-read",
 									permission: "dashboard-read",
 									menuName: "TeacherDashboard",
 									menuName: "TeacherDashboard",
 									child: [],
 									child: [],
-                                    isShow: this.isGlobalSite && this.isAdmin
+                                    isShow: this.isGlobalSite
 									//isShow:true,
 									//isShow:true,
 								},
 								},
 								// 教学看板(国际站单独)
 								// 教学看板(国际站单独)

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue

@@ -45,8 +45,8 @@
 			</div>
 			</div>
 		</div>
 		</div>
 
 
-		<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo" :isEditM="isEdit"></BaseSingle>
-		<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo" :isEditM="isEdit"></BaseMultiple>
+		<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo"></BaseSingle>
+		<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo"></BaseMultiple>
 		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo" ></BaseJudge>
 		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo" ></BaseJudge>
 		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo" ></BaseCompletion>
 		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo" ></BaseCompletion>
 		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo" ></BaseConnector>
 		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo" ></BaseConnector>

+ 1 - 8
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -35,10 +35,6 @@
 				type:Boolean,
 				type:Boolean,
 				default:false
 				default:false
 			},
 			},
-			isEditM:{
-				type:Boolean,
-				default:false
-			}
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
@@ -301,15 +297,12 @@
 			this.$editorTools.initMyEditor(stemEditor,this)
 			this.$editorTools.initMyEditor(stemEditor,this)
 			stemEditor.create()
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			this.stemEditor = stemEditor
+			this.initEditors()
 
 
 			if (this.editInfo && this.isEdit) { 
 			if (this.editInfo && this.isEdit) { 
 				console.log('进入多选题Mounted编辑')
 				console.log('进入多选题Mounted编辑')
 				this.doRender(this.editInfo)
 				this.doRender(this.editInfo)
 			}
 			}
-			
-			if(!this.isEditM){
-				this.initEditors()
-			}
 		},
 		},
 		computed: {
 		computed: {
 		    // 选项顺序转化成字母
 		    // 选项顺序转化成字母

+ 2 - 9
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -37,10 +37,6 @@
 				type:Boolean,
 				type:Boolean,
 				default:false
 				default:false
 			},
 			},
-			isEditM:{
-				type:Boolean,
-				default:false
-			},
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
@@ -252,6 +248,7 @@
 
 
 			stemEditor.create()
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			this.stemEditor = stemEditor
+			this.initEditors();
 			
 			
 			if (this.editInfo && this.isEdit) {
 			if (this.editInfo && this.isEdit) {
 				console.log('进入单选题Mounted编辑',this.editInfo)
 				console.log('进入单选题Mounted编辑',this.editInfo)
@@ -263,14 +260,10 @@
 				this.options = this.editSingleInfo.option.map((item, index) => index)
 				this.options = this.editSingleInfo.option.map((item, index) => index)
 				this.existOptions = this.editSingleInfo.option.map((item, index) => index)
 				this.existOptions = this.editSingleInfo.option.map((item, index) => index)
 				this.$nextTick(() => {
 				this.$nextTick(() => {
-					//this.initEditors()
+					this.initEditors()
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 				})
 				})
 			}
 			}
-			console.log("1單選this.isEditM="+this.isEditM);
-			if(!this.isEditM){
-				this.initEditors()
-			}
 		},
 		},
 		watch: {
 		watch: {
 			editInfo: {
 			editInfo: {

+ 3 - 8
TEAMModelOS/ClientApp/src/view/mycourse/score/AddProject.vue

@@ -85,11 +85,8 @@
               <div v-if="!isSave" class="save-info-erro">
               <div v-if="!isSave" class="save-info-erro">
                 <Icon type="md-alert" />{{ $t("scoreCalc.notSave") }}
                 <Icon type="md-alert" />{{ $t("scoreCalc.notSave") }}
               </div>
               </div>
-              <Button type="primary" style="z-index: 500" @click="ProjectGoback('save')">{{ $t("scoreCalc.save")
-              }}</Button>
-              <Button type="primary" ghost class="right-button" @click="ProjectGoback('back')">{{
-                $t("scoreCalc.back")
-              }}</Button>
+              <Button type="primary" style="z-index: 500" @click="ProjectGoback('save')">{{ $t("scoreCalc.save")}}</Button>
+              <Button type="primary" ghost class="right-button" @click="ProjectGoback('back')">{{ $t("scoreCalc.back")}}</Button>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -131,8 +128,7 @@
                       </Col>
                       </Col>
                       <Col flex="2" class="felx1" v-if="!classData.islessonrecord">
                       <Col flex="2" class="felx1" v-if="!classData.islessonrecord">
                         <div class="average-div center">
                         <div class="average-div center">
-                          <span class="average">{{ $t("scoreCalc.average") }}{{ classData.score }}{{ $t("scoreCalc.marks")
-                      }}</span>
+                          <span class="average">{{ $t("scoreCalc.average") }}{{ classData.score }}{{ $t("scoreCalc.marks")}}</span>
                         </div>
                         </div>
                         <div class="average-div center">
                         <div class="average-div center">
                           <span class="type">{{ showTag(classData.type,classData.type2,classData.custom) }}</span>
                           <span class="type">{{ showTag(classData.type,classData.type2,classData.custom) }}</span>
@@ -472,7 +468,6 @@ export default {
         //#region 更新子項目順序
         //#region 更新子項目順序
         let sortItems = [];
         let sortItems = [];
         for (let i = 0; i < this.classDatas.length; i++) {
         for (let i = 0; i < this.classDatas.length; i++) {
-          let id = this.classDatas[i].id;
           sortItems.push({
           sortItems.push({
             id: this.classDatas[i].id,
             id: this.classDatas[i].id,
             //sort: i + 1,
             //sort: i + 1,

+ 4 - 2
TEAMModelOS/ClientApp/src/view/student-web/AppNew.vue

@@ -82,8 +82,10 @@
                         <svg-icon icon-class="selflearning" class="tabIcon4" />
                         <svg-icon icon-class="selflearning" class="tabIcon4" />
                         <span class="no-show" v-show="MyNo != 3">{{ $t('studentWeb.type.activity') }}</span>
                         <span class="no-show" v-show="MyNo != 3">{{ $t('studentWeb.type.activity') }}</span>
                     </MenuItem>
                     </MenuItem>
-                    <!-- 错题本 -->
-                    <MenuItem v-if="userInfo.scope === 'student'" name="8" to="/studentWeb/practice/wrongQues" :title="$t('studentWeb.type.wrongTopic')"
+                    <!-- 错题本(搭配学校卖出,限制学生才能使用) -->
+                    <!-- 先放开醍摩豆登录限制,方便老师体验试用 -->
+                    <!-- <MenuItem v-if="userInfo.scope === 'student'" name="8" to="/studentWeb/practice/wrongQues" :title="$t('studentWeb.type.wrongTopic')" -->
+                    <MenuItem name="8" to="/studentWeb/practice/wrongQues" :title="$t('studentWeb.type.wrongTopic')"
                             v-show="getNowCourse && getNowCourse.id && selectClass && !onlySystem && getNowCourse.subject && !isScale">
                             v-show="getNowCourse && getNowCourse.id && selectClass && !onlySystem && getNowCourse.subject && !isScale">
                         <Icon custom="iconfont icon-cuotiji" size="17" class="tabIcon1" />
                         <Icon custom="iconfont icon-cuotiji" size="17" class="tabIcon1" />
                         <span class="no-show" v-show="MyNo != 8">{{ $t('studentWeb.type.wrongTopic') }}</span>
                         <span class="no-show" v-show="MyNo != 8">{{ $t('studentWeb.type.wrongTopic') }}</span>

+ 81 - 35
TEAMModelOS/Controllers/Both/ScoreCalcController.cs

@@ -59,6 +59,7 @@ using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
 using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
 using TEAMModelOS.SDK.Models.Cosmos.School;
 using TEAMModelOS.SDK.Models.Cosmos.School;
+using TEAMModelOS.SDK.Models.Cosmos.Student;
 using TEAMModelOS.SDK.Models.Service;
 using TEAMModelOS.SDK.Models.Service;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelOS.SDK.Services;
 using TEAMModelOS.SDK.Services;
@@ -2321,7 +2322,7 @@ namespace TEAMModelOS.Controllers
                 sb_examIds.Append($"'{examItem[i].examId}',");
                 sb_examIds.Append($"'{examItem[i].examId}',");
             }
             }
             // 取評量名稱
             // 取評量名稱
-            string sql_examName = $"SELECT c.name, c.startTime FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
+            string sql_examName = $"SELECT c.id as examId, c.name, c.startTime FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
             //string sql_examName = $"SELECT c.id as examId, c.name FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
             //string sql_examName = $"SELECT c.id as examId, c.name FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
             await foreach (var item in clientCommon.GetItemQueryIterator<ExamItem>(queryText: sql_examName))
             await foreach (var item in clientCommon.GetItemQueryIterator<ExamItem>(queryText: sql_examName))
             {
             {
@@ -2583,18 +2584,90 @@ namespace TEAMModelOS.Controllers
                 // 取項目表資料
                 // 取項目表資料
                 ScoreCalcActivityBase scoreCalcActivityBase = await clientTeacher.ReadItemAsync<ScoreCalcActivityBase>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
                 ScoreCalcActivityBase scoreCalcActivityBase = await clientTeacher.ReadItemAsync<ScoreCalcActivityBase>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
 
 
+                // 先排序傳進來的參數 aesc
+                List<sortItem> sortItemsrq = (from e in updateActItemSortRq.sortItems
+                                              orderby e.sort
+                                              select e).ToList();
+
                 // 先判斷是否為課堂紀錄 根據項目的類別需要調整
                 // 先判斷是否為課堂紀錄 根據項目的類別需要調整
                 if (scoreCalcActivityBase.type == "lessonrecord")
                 if (scoreCalcActivityBase.type == "lessonrecord")
                 {
                 {
-                    ScoreCalcLsRecord scoreCalcLsRecord = await clientTeacher.ReadItemAsync<ScoreCalcLsRecord>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
-                    scoreCalcLsRecord.items = setSort(scoreCalcLsRecord.items, updateActItemSortRq.sortItems);
-                    scoreCalcLsRecord = await clientTeacher.ReplaceItemAsync(scoreCalcLsRecord, $"{scoreCalcLsRecord.id}", new PartitionKey(scoreCalcLsRecord.code));
+                    ScoreCalcLsRecord scoreCalcLsRecordDB = await clientTeacher.ReadItemAsync<ScoreCalcLsRecord>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
+
+                    //存放排序後的參數
+                    List<List<double>> up_stuActAttendOrgVals = new();
+                    List<List<double>> up_stuActAttendScores = new();
+                    List<List<double>> up_stuActPointOrgVals = new();
+                    List<List<double>> up_stuActPointScores = new();
+                    List<List<double>> up_stuActItactOrgVals = new();
+                    List<List<double>> up_stuActItactScores = new();
+                    List<double> up_itemRates = new();
+
+                    //依照傳進來的id 順序修改 分數 比重 項目等順序
+                    for (int i = 0; i < sortItemsrq.Count; i++)
+                    {
+                        for (int j = 0; j < scoreCalcLsRecordDB.items.Count; j++)
+                        {
+                            if (sortItemsrq[i].id == scoreCalcLsRecordDB.items[j].id)
+                            {
+                                up_stuActAttendOrgVals.Add(scoreCalcLsRecordDB.stuActAttendOrgVals[j]);
+                                up_stuActAttendScores.Add(scoreCalcLsRecordDB.stuActAttendScores[j]);
+                                up_stuActPointOrgVals.Add(scoreCalcLsRecordDB.stuActPointOrgVals[j]);
+                                up_stuActPointScores.Add(scoreCalcLsRecordDB.stuActPointScores[j]);
+                                up_stuActItactOrgVals.Add(scoreCalcLsRecordDB.stuActItactOrgVals[j]);
+                                up_stuActItactScores.Add(scoreCalcLsRecordDB.stuActItactScores[j]);
+                                up_itemRates.Add(scoreCalcLsRecordDB.itemRates[j]);
+                                scoreCalcLsRecordDB.items[j].sort = sortItemsrq[i].sort;
+                            }
+                        }
+
+                    }
+                    scoreCalcLsRecordDB.stuActAttendOrgVals = up_stuActAttendOrgVals;
+                    scoreCalcLsRecordDB.stuActAttendScores = up_stuActAttendScores;
+                    scoreCalcLsRecordDB.stuActPointOrgVals = up_stuActPointOrgVals;
+                    scoreCalcLsRecordDB.stuActPointScores = up_stuActPointScores;
+                    scoreCalcLsRecordDB.stuActItactOrgVals = up_stuActItactOrgVals;
+                    scoreCalcLsRecordDB.stuActItactScores = up_stuActItactScores;
+                    scoreCalcLsRecordDB.itemRates = up_itemRates;
+                    // 按照更新後的sort排序
+                    scoreCalcLsRecordDB.items = (from e in scoreCalcLsRecordDB.items
+                                                 orderby e.sort
+                                                 select e).ToList();
+
+                    scoreCalcLsRecordDB = await clientTeacher.ReplaceItemAsync(scoreCalcLsRecordDB, $"{scoreCalcLsRecordDB.id}", new PartitionKey(scoreCalcLsRecordDB.code));
                 }
                 }
                 else
                 else
                 {
                 {
-                    ScoreCalcActivity scoreCalcActivity = await clientTeacher.ReadItemAsync<ScoreCalcActivity>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
-                    scoreCalcActivity.items = setSort(scoreCalcActivity.items, updateActItemSortRq.sortItems);
-                    scoreCalcActivity = await clientTeacher.ReplaceItemAsync(scoreCalcActivity, $"{scoreCalcActivity.id}", new PartitionKey(scoreCalcActivity.code));
+                    ScoreCalcActivity scoreCalcActivityDB = await clientTeacher.ReadItemAsync<ScoreCalcActivity>(updateActItemSortRq.scoreCalcActId.ToString(), new PartitionKey($"ScoreCalcAct-{teammodelId}"));
+
+                    //存放排序後的參數
+                    List<List<double>> up_stuActScores = new();
+                    List<List<double>> up_stuActScoresOrg = new();
+                    List<double> up_itemRates = new();
+
+                    //依照傳進來的id 順序修改 分數 比重 項目等順序
+                    for (int i = 0; i < sortItemsrq.Count; i++)
+                    {
+                        for (int j = 0; j < scoreCalcActivityDB.items.Count; j++)
+                        {
+                            if (sortItemsrq[i].id == scoreCalcActivityDB.items[j].id)
+                            {
+                                up_stuActScores.Add(scoreCalcActivityDB.stuActScores[j]);
+                                up_stuActScoresOrg.Add(scoreCalcActivityDB.stuActScoresOrg[j]);
+                                up_itemRates.Add(scoreCalcActivityDB.itemRates[j]);
+                                scoreCalcActivityDB.items[j].sort = sortItemsrq[i].sort;
+                            }
+                        }
+                    }
+                    scoreCalcActivityDB.stuActScores = up_stuActScores;
+                    scoreCalcActivityDB.stuActScoresOrg = up_stuActScoresOrg;
+                    scoreCalcActivityDB.itemRates = up_itemRates;
+                    // 按照更新後的sort排序
+                    scoreCalcActivityDB.items = (from e in scoreCalcActivityDB.items
+                                                 orderby e.sort
+                                                 select e).ToList();
+
+                    scoreCalcActivityDB = await clientTeacher.ReplaceItemAsync(scoreCalcActivityDB, $"{scoreCalcActivityDB.id}", new PartitionKey(scoreCalcActivityDB.code));
                 }
                 }
 
 
                 var result = new
                 var result = new
@@ -2611,34 +2684,7 @@ namespace TEAMModelOS.Controllers
                 return BadRequest();
                 return BadRequest();
             }
             }
         }
         }
-        /// <summary>
-        /// 重新排序資料
-        /// </summary>
-        /// <param name="dbitems"></param>
-        /// <param name="sortItems"></param>
-        /// <returns></returns>
-        private List<ScoreCalcActivityItems> setSort(List<ScoreCalcActivityItems> dbitems, List<sortItem> sortItems)
-        {
-            for (int i = 0; i < dbitems.Count; i++)
-            {
-                for (int j = 0; j < sortItems.Count; j++)
-                {
-                    if (dbitems[i].id == sortItems[j].id)
-                    {
-                        dbitems[i].sort = sortItems[j].sort;
-                    }
-                }
-            }
-            var newdbitems = from e in dbitems
-                             orderby e.sort
-                             select e;
-            List<ScoreCalcActivityItems> scoreCalcActivityItems = new List<ScoreCalcActivityItems>();
-            foreach (var dbitem in newdbitems)
-            {
-                scoreCalcActivityItems.Add(dbitem);
-            }
-            return scoreCalcActivityItems;
-        }
+
 
 
         /// <summary>
         /// <summary>
         /// (十七)查詢項目屬性資料
         /// (十七)查詢項目屬性資料

+ 2 - 2
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -2196,7 +2196,7 @@ namespace TEAMModelOS.Controllers
                         stuShow += data.stuShow;
                         stuShow += data.stuShow;
                         stuLessonLengMin += data.stuLessonLengMin;
                         stuLessonLengMin += data.stuLessonLengMin;
                         lessonRecord += data.lessonRecord;
                         lessonRecord += data.lessonRecord;
-                        lessonLengMin += data.stuLessonLengMin;
+                        lessonLengMin += data.lessonLengMin;
                         mission += data.mission;
                         mission += data.mission;
                         missionFin += data.missionFin;
                         missionFin += data.missionFin;
                         item += data.item;
                         item += data.item;
@@ -2391,7 +2391,7 @@ namespace TEAMModelOS.Controllers
                             schIot[school.id].stuShow += data.stuShow;
                             schIot[school.id].stuShow += data.stuShow;
                             schIot[school.id].stuLessonLengMin += data.stuLessonLengMin;
                             schIot[school.id].stuLessonLengMin += data.stuLessonLengMin;
                             schIot[school.id].lessonRecord += data.lessonRecord;
                             schIot[school.id].lessonRecord += data.lessonRecord;
-                            schIot[school.id].lessonLengMin += data.stuLessonLengMin;
+                            schIot[school.id].lessonLengMin += data.lessonLengMin;
                             schIot[school.id].mission += data.mission;
                             schIot[school.id].mission += data.mission;
                             schIot[school.id].missionFin += data.missionFin;
                             schIot[school.id].missionFin += data.missionFin;
                             schIot[school.id].item += data.item;
                             schIot[school.id].item += data.item;