Procházet zdrojové kódy

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

zhouj1203@hotmail.com před 2 roky
rodič
revize
b7096dc3a9

+ 75 - 61
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -208,10 +208,10 @@
           <span class="dialog-footer">
             <el-button @click="adddialog = false">取消</el-button>
             <el-button type="primary" @click="addschoolfn()" v-if="checkboxArr.length !==0">
-              添加
+              确认
             </el-button>
             <el-button type="info" v-if="checkboxArr.length ===0" disabled>
-              添加
+              确认
             </el-button>
           </span>
         </template>
@@ -267,7 +267,7 @@
 </template>
 <script setup>
 import option_cn from '@/static/regions/region_cn.json'
-import { ref, getCurrentInstance, watch, h } from 'vue'
+import { ref, getCurrentInstance, watch, h, nextTick } from 'vue'
 import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox } from 'element-plus'
 import { Search, CirclePlus } from '@element-plus/icons-vue'
 import Details from './details.vue'
@@ -277,6 +277,7 @@ let direction = ref('ttb')
 let activeNames = ref(['1'])
 let showState = ref('default')
 let findValue = ref()
+let test = ref([])
 let columns = ref([
   // {
   //   key: "id",
@@ -358,13 +359,14 @@ let columns = ref([
 ])
 const searchColumns = [
   {
-    cellRenderer: (data) =>
-      h(
-        ElCheckbox,
-        // { onClick: () => handleDelete(data), type: "danger", icon: "Delete" },
-        { onChange: () => selectChange(data.rowData) },
-        { default: () => "" }
-      ),
+    // cellRenderer: (data) =>
+    //   h(
+    //     ElCheckbox,
+    //     // { onClick: () => handleDelete(data), type: "danger", icon: "Delete" },
+    //     { onChange: () => selectChange(data.rowData) },
+    //     { modelValue: () => modelValue = data.rowData },
+    //     { default: () => "" }
+    //   ),
     width: 50,//当前列的宽度,必须设置
     // fixed: true,//是否固定列
     align: 'center',
@@ -373,6 +375,11 @@ const searchColumns = [
     //   const onChange = (value: CheckboxValueType) => (rowData.checked = value)
     //   return <SelectionCell value={rowData.checked} onChange={onChange} />
     // },
+    cellRenderer: (data) => (
+      <>
+        <el-checkbox v-model={data.rowData.checkboxs} onChange={selectChange.bind(this, data.rowData)}></el-checkbox>
+      </>
+    )
   },
   {
     // key: "name",
@@ -602,6 +609,7 @@ function dataInit () {
       dataSource.value.school = res.scInfos
       res.scInfos.forEach((items) => {
         let areId = items.areaId
+        items.checkboxs = false
         dataList.forEach((itemA) => {
           areId === itemA.id ? itemA.children.push(items) : ''
         })
@@ -761,28 +769,15 @@ function remoteMethod (key) {
 }
 function beforefilter () {
   let keyvalue = addvalue.value
-  let data = { schoolIds: [keyvalue] }
-  proxy.$api.getfilterSchool(data).then((res) => {
-    console.log(res, 'scback')
-    if (res.state === 200 && res.data.length > 0) {
-      addschool.value.name = res.data[0].name
-      addschool.value.id = res.data[0].id
-      addschool.value.region = res.data[0].region
-      addschool.value.province = res.data[0].province
-      addschool.value.city = res.data[0].city
-      addschool.value.dist = res.data[0].dist
-      addschool.value.areaId = res.data[0].areaId
-      addschool.value.isvirtual = res.data[0].isvirtual
-    } else {
-      //searchInit()
-      ElMessage.info('未查询到相关学校信息,请确认学校简码')
-    }
-  }).catch((error) => {
-    ElMessage.error('API异常,未查询到信息')
+  let arr = dataSource.value.originalSchool
+  let newArr = arr.filter((item) => {
+    return item.name.includes(keyvalue) || item.id.includes(keyvalue)
   })
+  tableData.value = newArr
 }
 //搜索清空
 function searchInit () {
+  // checkboxArr.value = checkboxArr.value.length > 0 ? checkboxArr.value : []
   addschool.value.name = ''
   addschool.value.id = ''
   addschool.value.region = ''
@@ -790,43 +785,58 @@ function searchInit () {
   addschool.value.city = ''
   addschool.value.dist = ''
   addschool.value.isvirtual = false
+  tableData.value.forEach(item => item.checkboxs = false)
+  // console.log(checkboxArr.value)
 }
 //添加虚拟学校
 function addschoolfn () {
   let resultA = options.value.findIndex(item => item.id === 'notarea')
   console.log(resultA, '值')
-  resultA === -1 ? options.value.push({ id: 'notarea', name: '*已搜索学校*', province: '', city: '', children: [] }) : ''
-  let ids = addschool.value.id
-  let pushArr = [addschool.value.areaId, addschool.value.id]
+  resultA === -1 ? options.value.push({ id: 'notarea', name: '*手动添加学校*', province: '', city: '', children: [] }) : ''
+  console.log(checkboxArr.value, '选择的学校')
+  let checkList = checkboxArr.value
   let dataArr = options.value
-  if (!addschool.value.areaId) {
-    console.log('进入未归区学校或虚拟学校')
-    dataArr.forEach((item) => {
-      item.id === 'notarea' ? (item.children.push(addschool.value), optionsValue.value.push(['notarea', addschool.value.id])) : ''
-    })
-    options.value = JSON.parse(JSON.stringify(dataArr))
-    console.log(options.value)
-  } else {
-    console.log(pushArr, optionsValue.value, '进入有学区的学校')
-    console.log(options.value)
-    optionsValue.value = typeof (optionsValue.value) === 'object' ? optionsValue.value : []
-    console.log(optionsValue.value, '看值有没有发生变化')
-    optionsValue.value.forEach((itemV) => {
-      itemV[1] === addschool.value.id
-    })
-    for (let i in optionsValue.value) {
-      if (optionsValue.value[i][1] === addschool.value.id) {
-        ElMessage.info('添加学校已选中,请勿重复添加')
-        return
-      }
-    }
-    dataArr.forEach((item) => {
-      item.children.length > 0 ? item.children.forEach((itemc) => { itemc.id === ids ? (optionsValue.value.push(pushArr)) : '' }) : ''
-      // item.id === 'notarea' ? (item.children.push(addschool.value), optionsValue.value.push(pushArr)) : ''
-    })
-    options.value = JSON.parse(JSON.stringify(dataArr))
-  }
+  optionsValue.value = typeof (optionsValue.value) === 'object' ? optionsValue.value : []
+  checkList.forEach((item) => {
+    for (let i in optionsValue.value) { if (item.id === optionsValue.value[i][1]) { return } }
+    // if (item.areaId && item.id) {
+    //   optionsValue.value.push([item.areaId, item.id])
+    // }
+    item.areaId && item.id ? optionsValue.value.push([item.areaId, item.id]) : dataArr.forEach((itemc) => { itemc.id === 'notarea' ? itemc.children.push(item) : '' }), optionsValue.value.push(['notarea', item.id])
+  })
+  options.value = JSON.parse(JSON.stringify(dataArr))
   adddialog.value = false
+  // let ids = addschool.value.id
+  // let pushArr = [addschool.value.areaId, addschool.value.id]
+  // let dataArr = options.value
+  // if (!addschool.value.areaId) {
+  //   console.log('进入未归区学校或虚拟学校')
+  //   dataArr.forEach((item) => {
+  //     item.id === 'notarea' ? (item.children.push(addschool.value), optionsValue.value.push(['notarea', addschool.value.id])) : ''
+  //   })
+  //   options.value = JSON.parse(JSON.stringify(dataArr))
+  //   console.log(options.value)
+  // } else {
+  //   console.log(pushArr, optionsValue.value, '进入有学区的学校')
+  //   console.log(options.value)
+  //   optionsValue.value = typeof (optionsValue.value) === 'object' ? optionsValue.value : []
+  //   console.log(optionsValue.value, '看值有没有发生变化')
+  //   optionsValue.value.forEach((itemV) => {
+  //     itemV[1] === addschool.value.id
+  //   })
+  //   for (let i in optionsValue.value) {
+  //     if (optionsValue.value[i][1] === addschool.value.id) {
+  //       ElMessage.info('添加学校已选中,请勿重复添加')
+  //       return
+  //     }
+  //   }
+  //   dataArr.forEach((item) => {
+  //     item.children.length > 0 ? item.children.forEach((itemc) => { itemc.id === ids ? (optionsValue.value.push(pushArr)) : '' }) : ''
+  //     // item.id === 'notarea' ? (item.children.push(addschool.value), optionsValue.value.push(pushArr)) : ''
+  //   })
+  //   options.value = JSON.parse(JSON.stringify(dataArr))
+  // }
+  // adddialog.value = false
 }
 //获取所有学校列表 5.18日 调整搜索为 学校列表的形式 
 function selectChange (value) {
@@ -841,7 +851,6 @@ function selectChange (value) {
       checkboxArr.value.splice(indexNums, 1)
     }
   }
-  console.log(checkboxArr.value)
 }
 // init()
 dataInit()
@@ -855,9 +864,9 @@ watch(activeNames, (newdata) => {
 })
 watch(addvalue, (newvalue) => {
   if (newvalue.trim().length !== 0) {
-    debounce(beforefilter, 800)
+    debounce(beforefilter, 500)
   } else {
-
+    tableData.value = dataSource.value.originalSchool
   }
 })
 watch(clickNum, (newv) => {
@@ -1083,6 +1092,7 @@ watch(clickNum, (newv) => {
 .result-box .el-table-v2__row-cell {
   width: v-bind(searchWidth + "%") !important;
   /* width: 12% !important; */
+  line-height: 16px;
 }
 .result-box .cheboxclass {
   width: 7% !important;
@@ -1090,4 +1100,8 @@ watch(clickNum, (newv) => {
 .result-box .el-table-v2__row-cell:nth-child(1) {
   width: 7% !important;
 }
+.result-box .el-table-v2__row {
+  width: 100% !important;
+  height: 56px !important;
+}
 </style>

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -68,9 +68,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>1.2304.19</Version>
-		<AssemblyVersion>1.2304.19.1</AssemblyVersion>
-		<FileVersion>1.2304.19.1</FileVersion>
+		<Version>1.2305.22</Version>
+		<AssemblyVersion>1.2305.22.1</AssemblyVersion>
+		<FileVersion>1.2305.22.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 54 - 22
TEAMModelOS.SDK/Models/Cosmos/School/ScoreCalc.cs

@@ -62,8 +62,9 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
             itemRates = new List<double>();
             itemScores = new List<double>();
             itemScoresOrg = new List<double>();
-            stuScores = new List<List<double>>();
-            stuScoresOrg = new List<List<double>>();
+            stuScores = new List<double>();
+            stuActScores = new List<List<double>>();
+            stuActScoresOrg = new List<List<double>>();
         }
         /// <summary>
         /// 成績計算ID
@@ -102,13 +103,17 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
         /// </summary>
         public double rate { get; set; }
         /// <summary>
+        /// 各學生所有活動結算成績
+        /// </summary>
+        public List<double> stuScores { get; set; }
+        /// <summary>
         /// 各活動所屬學生成績
         /// </summary>
-        public List<List<double>> stuScores { get; set; }
+        public List<List<double>> stuActScores { get; set; }
         /// <summary>
         /// 各活動所屬學生成績最初系統計算結果
         /// </summary>
-        public List<List<double>> stuScoresOrg { get; set; }
+        public List<List<double>> stuActScoresOrg { get; set; }
     }
     /// <summary>
     /// 成績計算總覽分項-評量、作業
@@ -133,14 +138,17 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
         {
             items = new List<ScoreCalcActivityItems>();
             stuAttendFunction = new List<string>();
-            stuAttendVals = new List<List<string>>();
-            stuAttendScores = new List<List<double>>();
+            stuActAttendOrgVals = new List<List<string>>();
+            stuActAttendScores = new List<List<double>>();
+            stuAttendScores = new List<double>();
             stuPointFunction = new List<string>();
-            stuPointVals = new List<List<int>>();
-            stuPointScores = new List<List<double>>();
+            stuActPointOrgVals = new List<List<int>>();
+            stuActPointScores = new List<List<double>>();
+            stuPointScores = new List<double>();
             stuItactFunction = new List<string>();
-            stuItactVals = new List<List<int>>();
-            stuItactScores = new List<List<double>>();
+            stuActItactOrgVals = new List<List<int>>();
+            stuActItactScores = new List<List<double>>();
+            stuItactScores = new List<double>();
         }
         /// <summary>
         /// 被選取的課堂紀錄列表
@@ -151,37 +159,61 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
         /// </summary>
         public List<string> stuAttendFunction { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄出席 系統原值
+        /// 各學生各課堂紀錄出席 系統原值
+        /// </summary>
+        public List<List<string>> stuActAttendOrgVals { get; set; }
+        /// <summary>
+        /// 各學生各課堂紀錄出席 分數
         /// </summary>
-        public List<List<string>> stuAttendVals { get; set; }
+        public List<List<double>> stuActAttendScores { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄出席 分數
+        /// 各學生所有課堂紀錄出席 分數
         /// </summary>
-        public List<List<double>> stuAttendScores { get; set; }
+        public List<double> stuAttendScores { get; set; }
         /// <summary>
         /// 課堂紀錄記分板 採用的公式ID
         /// </summary>
         public List<string> stuPointFunction { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄記分板 系統原值
+        /// 各學生課堂紀錄記分板 系統原值
         /// </summary>
-        public List<List<int>> stuPointVals { get; set; }
+        public List<List<int>> stuActPointOrgVals { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄記分板 分數
+        /// 各學生課堂紀錄記分板 分數
         /// </summary>
-        public List<List<double>> stuPointScores { get; set; }
+        public List<List<double>> stuActPointScores { get; set; }
+        /// <summary>
+        /// 各學生所有課堂紀錄記分板 分數
+        /// </summary>
+        public List<double> stuPointScores { get; set; }
         /// <summary>
         /// 課堂紀錄互動 採用的公式ID
         /// </summary>
         public List<string> stuItactFunction { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄互動 系統原值
+        /// 各學生各課堂紀錄互動 系統原值
+        /// </summary>
+        public List<List<int>> stuActItactOrgVals { get; set; }
+        /// <summary>
+        /// 各學生各課堂紀錄互動 分數
+        /// </summary>
+        public List<List<double>> stuActItactScores { get; set; }
+        /// <summary>
+        /// 各學生所有課堂紀錄互動 分數
+        /// </summary>
+        public List<double> stuItactScores { get; set; }
+        /// <summary>
+        /// 出席加權數
+        /// </summary>
+        public double attendRate { get; set; }
+        /// <summary>
+        /// 記分板加權數
         /// </summary>
-        public List<List<int>> stuItactVals { get; set; }
+        public double pointRate { get; set; }
         /// <summary>
-        /// 各學生課堂紀錄互動 分數
+        /// 互動加權
         /// </summary>
-        public List<List<double>> stuItactScores { get; set; }
+        public double itactRate { get; set; }
     }
 
     public class ScoreCalcMember

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

@@ -2536,7 +2536,7 @@ const LANG_EN_US = {
             tab1: 'Assessment Data',
             tab2: 'Assessment Files',
             tab3: 'Answering Details',
-            tab4: 'clouDAS diagnostic analysis',
+            tab4: 'clouDAS Diagnostic Analysis',
             autoTips1: 'This function is only used to show the scenario and quickly simulate student response data. Student responses are randomly generated for reference only!',
             autoTips2: 'This function is only used to show the scenario and quickly simulate teacher grading data. Teacher grading are randomly generated for reference only!',
             autoScore: 'One Click Grading',
@@ -2745,7 +2745,7 @@ const LANG_EN_US = {
             gradeLabel: 'Grade:',
             classLabel: 'Class:',
             stuLabel: 'Student:',
-            autoCheck: 'Automatically detect whether scoring is completed',
+            autoCheck: 'Auto-detect if grading is completed',
             scoreView: 'Score Overview',
             scoring: 'Exam File Grading',
             classNoStu: 'No students in the class yet',
@@ -4373,7 +4373,7 @@ const LANG_EN_US = {
                 tips3: "Use your registered TEAM Model account to log in",
                 tips4: "Use the account/password assigned by the school to login",
             },
-            scale1: 'Today’s login limit has reached the school’s scale limit. This function is temporarily unavailable. Please contact the school administrator for confirmation.',
+            scale1: "The number of students logging in today has reached the school's limit, so the function is temporarily unavailable. Please contact the school administrator for confirmation.",
             scale2: 'Note: If there is a district scale test, it can still be answered normally.',
         },
         public: {

+ 6 - 4
TEAMModelOS/Controllers/Both/ScoreCalcController.cs

@@ -112,14 +112,16 @@ namespace TEAMModelOS.Controllers
                 scoreCalcActivity.score = 78.2;
                 scoreCalcActivity.scoreOrg = 77.5;
                 scoreCalcActivity.rate = 40; //評量的總加權 = 40%
+                List<double> stuScores = new List<double>() { 70.1, 73.5 }; //第一個學生的所有評量總成績,第二個同學...
+                scoreCalcActivity.stuScores = stuScores;
                 List<double> examScore1 = new List<double>() { 73.2, 69.7 }; //第一個評量,第一位同學73.2 第二位同學69.7
-                scoreCalcActivity.stuScores.Add(examScore1);
+                scoreCalcActivity.stuActScores.Add(examScore1);
                 List<double> examScore2 = new List<double>() { 81.6, 58.1 }; //第二個評量
-                scoreCalcActivity.stuScores.Add(examScore2);
+                scoreCalcActivity.stuActScores.Add(examScore2);
                 List<double> examScore1Org = new List<double>() { 73.2, 69.7 };
-                scoreCalcActivity.stuScoresOrg.Add(examScore1Org);
+                scoreCalcActivity.stuActScoresOrg.Add(examScore1Org);
                 List<double> examScore2Org = new List<double>() { 81.6, 58.1 };
-                scoreCalcActivity.stuScoresOrg.Add(examScore2Org);
+                scoreCalcActivity.stuActScoresOrg.Add(examScore2Org);
                 await client.GetContainer(Constant.TEAMModelOS, "Teacher").UpsertItemAsync(scoreCalcActivity, new PartitionKey($"ScoreCalcAct-{tmid}"));
 
                 //課堂紀錄