瀏覽代碼

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop5.0-tmd

XW 4 年之前
父節點
當前提交
23901ca461

+ 52 - 13
TEAMModelFunction/ActivityHttpTrigger.cs

@@ -6,7 +6,6 @@ using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs.Extensions.Http;
 using Microsoft.Azure.WebJobs.Extensions.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI;
 using Azure.Cosmos;
 using Azure.Cosmos;
 using System.Text.Json;
 using System.Text.Json;
@@ -117,7 +116,7 @@ namespace TEAMModelFunction
         {
         {
             log.LogInformation("fix-exam-activity...");
             log.LogInformation("fix-exam-activity...");
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
-            List<string> datas = JsonConvert.DeserializeObject<List<string>>(requestBody);
+            List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
             var client = _azureCosmos.GetCosmosClient();
             var client = _azureCosmos.GetCosmosClient();
            
            
             var query = $"select  *  from c ";
             var query = $"select  *  from c ";
@@ -214,7 +213,7 @@ namespace TEAMModelFunction
 
 
             log.LogInformation("fix-vote-activity...");
             log.LogInformation("fix-vote-activity...");
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
-            List<string> datas = JsonConvert.DeserializeObject<List<string>>(requestBody);
+            List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
             var client = _azureCosmos.GetCosmosClient();
             var client = _azureCosmos.GetCosmosClient();
 
 
             var query = $"select  *  from c ";
             var query = $"select  *  from c ";
@@ -308,7 +307,7 @@ namespace TEAMModelFunction
         {
         {
             log.LogInformation("fix-survey-activity...");
             log.LogInformation("fix-survey-activity...");
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
-            List<string> datas = JsonConvert.DeserializeObject<List<string>>(requestBody);
+            List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
             var client = _azureCosmos.GetCosmosClient();
             var client = _azureCosmos.GetCosmosClient();
 
 
             var query = $"select  *  from c ";
             var query = $"select  *  from c ";
@@ -399,7 +398,7 @@ namespace TEAMModelFunction
             ILogger log)
             ILogger log)
         {
         {
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
             string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
-            dynamic json = JsonConvert.DeserializeObject<dynamic>(requestBody);
+            dynamic json = JsonSerializer.Deserialize<dynamic>(requestBody);
             string id = json.id;
             string id = json.id;
             string code = json.code;
             string code = json.code;
             if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(code)) {
             if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(code)) {
@@ -474,7 +473,37 @@ namespace TEAMModelFunction
         /// <summary>
         /// <summary>
         ///获取单个目录的大小,用于获取评测,试题,试卷,问卷,投票等 文件层级超过两层的文件。
         ///获取单个目录的大小,用于获取评测,试题,试卷,问卷,投票等 文件层级超过两层的文件。
         ///例如 /exam/uuid/xxx  /item/uuid/xxx   /paper/uuid/xxx  /vote/uuid/xxx  /suervy/uuid/xxx
         ///例如 /exam/uuid/xxx  /item/uuid/xxx   /paper/uuid/xxx  /vote/uuid/xxx  /suervy/uuid/xxx
-        /// {""}
+        /// {"name":"hbcn","/item/uuid/xxx"}
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
+        [FunctionName("get-prefixsize")]
+        public async Task<IActionResult> GetPrefixsize(
+            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
+            ILogger log)
+        {
+            try {
+                string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
+                var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
+                if (data.TryGetProperty("name", out JsonElement name) && data.TryGetProperty("root", out JsonElement root))
+                {
+                    var size = await _azureStorage.GetBlobContainerClient($"{name}").GetBlobsSize($"{root}");
+                    return new OkObjectResult(new { size = size });
+                }
+                else
+                {
+                    return new BadRequestResult();
+                }
+            } catch (Exception ex) {
+                await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,get-prefixsize()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
+                return new BadRequestResult();
+            }
+
+        }
+        /// <summary>
+        ///获取多个blob路径的文件大小
+        /// {"name":"hbcn","blobs":["/paper/uuid/xxx.json","/paper/uuid/aaa.json"]}
         /// </summary>
         /// </summary>
         /// <param name="req"></param>
         /// <param name="req"></param>
         /// <param name="log"></param>
         /// <param name="log"></param>
@@ -484,15 +513,25 @@ namespace TEAMModelFunction
             [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
             [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
             ILogger log)
             ILogger log)
         {
         {
-            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
-            var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
-            if (data.TryGetProperty("name", out JsonElement name)) {
-                await _azureStorage.GetBlobContainerClient($"{name}").GetBlobsSize();
+            try { 
+                string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
+                var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
+                if (data.TryGetProperty("name", out JsonElement name) && data.TryGetProperty("blobs", out JsonElement blob))
+                {
+                    List<string> blobs = JsonSerializer.Deserialize<List<string>>(blob.ToJsonString());
+                   var size= await _azureStorage.GetBlobContainerClient($"{name}").GetBlobsSize(blobs);
+                    return new OkObjectResult(new { size = size });
+                }
+                else {
+                    return new BadRequestResult();
+                }
+              
+            } catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,get-blobsize()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
+                return new BadRequestResult();
             }
             }
-           
-            return new OkObjectResult(new { code = 200 });
         }
         }
-          
     }
     }
   
   
 }
 }

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

@@ -162,15 +162,15 @@ export default {
                             menuName: 'studentAccount'
                             menuName: 'studentAccount'
                         },
                         },
                         // // 教室管理
                         // // 教室管理
-                        // {
-                        //     icon: 'iconfont icon-class-mgt',
-                        //     name: this.$t('system.menu.classMgt'),
-                        //     router: '/home/classroom',
-                        //     tag: '',
-                        //     role: 'admin',
-                        //     permission: 'classroom-upd|classroom-read',
-                        //     menuName: 'classroom'
-                        // },
+                        {
+                            icon: 'iconfont icon-class-mgt',
+                            name: this.$t('system.menu.classMgt'),
+                            router: '/home/classroom',
+                            tag: '',
+                            role: 'admin',
+                            permission: 'classroom-upd|classroom-read',
+                            menuName: 'classroom'
+                        },
                         // 课程管理
                         // 课程管理
                         {
                         {
                             icon: 'iconfont icon-kecheng',
                             icon: 'iconfont icon-kecheng',

+ 1 - 1
TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.vue

@@ -17,7 +17,7 @@
             <!-- 字串模糊搜尋 -->
             <!-- 字串模糊搜尋 -->
             <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px;margin-left:20px;" search @on-search="filterData" @on-clear="filterData"></Input>
             <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px;margin-left:20px;" search @on-search="filterData" @on-clear="filterData"></Input>
         </div>
         </div>
-        <div class="sc-content dark-iview-table" style="position:relative">
+        <div class="dark-iview-table" style="position:relative">
             <Scroll :on-reach-bottom="scrollLoad" height="600" :distance-to-edge="[15,15]">
             <Scroll :on-reach-bottom="scrollLoad" height="600" :distance-to-edge="[15,15]">
                 <Table ref="stuSelection" :columns="tableColumns" :data="tableShowData" @on-selection-change="getSelectInfo">
                 <Table ref="stuSelection" :columns="tableColumns" :data="tableShowData" @on-selection-change="getSelectInfo">
                     <template slot-scope="{ row,index }" slot="status">
                     <template slot-scope="{ row,index }" slot="status">

+ 1 - 1
TEAMModelOS/ClientApp/src/router/routes.js

@@ -345,7 +345,7 @@ export const routes = [
 			component: resolve => require(['@/view/newcourse/MyCourse.vue'], resolve),
 			component: resolve => require(['@/view/newcourse/MyCourse.vue'], resolve),
 			meta: {
 			meta: {
 				activeName: 'myCourse',
 				activeName: 'myCourse',
-				isKeep: true
+				// isKeep: true
 			}
 			}
 		},
 		},
 		{
 		{

+ 8 - 0
TEAMModelOS/ClientApp/src/store/module/answerSheet.js

@@ -27,6 +27,7 @@ export default {
 		count: 0,
 		count: 0,
 		pages: 1,
 		pages: 1,
 		isNewPage: false,
 		isNewPage: false,
+		isAutoCreate:false,
 		needFixArr: [26],
 		needFixArr: [26],
 		paperItem:{
 		paperItem:{
 			name:''
 			name:''
@@ -65,9 +66,16 @@ export default {
 	},
 	},
 
 
 	mutations: {
 	mutations: {
+		setCreateModal(state,val){
+			state.isAutoCreate = val === 'auto'
+		},
 		setPaper(state,val){
 		setPaper(state,val){
 			state.paperItem = val
 			state.paperItem = val
 		},
 		},
+		deleteItem(state,val){
+			let index = state.paperItem.item.map(i => i.id).indexOf(val)
+			state.paperItem.item.splice(index,1)
+		},
 		addPage(state) {
 		addPage(state) {
 			state.pages++
 			state.pages++
 		},
 		},

+ 22 - 6
TEAMModelOS/ClientApp/src/view/answersheet/BaseEditor.vue

@@ -3,7 +3,7 @@
 		<div :id="ids + 'btn'" class="base-editor-tools" v-show="isShowTools">
 		<div :id="ids + 'btn'" class="base-editor-tools" v-show="isShowTools">
 <!-- 		<div :id="ids + 'btn'" class="base-editor-tools" v-show="isShowTools" @mouseenter="isShowTools = true" @mouseleave="isShowTools = false"> -->
 <!-- 		<div :id="ids + 'btn'" class="base-editor-tools" v-show="isShowTools" @mouseenter="isShowTools = true" @mouseleave="isShowTools = false"> -->
 			<span class="select-model" @click="onSelectModal" v-if="type !== '0'">编辑</span>
 			<span class="select-model" @click="onSelectModal" v-if="type !== '0'">编辑</span>
-			<span class="select-model btn-delete" @click="onDeleteBlock">删除</span>
+			<span class="select-model btn-delete" @click="onDeleteBlock" v-if="!isAutoCreate">删除</span>
 		</div>
 		</div>
 		<p class="margin-block"></p>
 		<p class="margin-block"></p>
 		<!-- <div @mouseenter="isShowTools = true" @mouseleave="isShowTools = false"> -->
 		<!-- <div @mouseenter="isShowTools = true" @mouseleave="isShowTools = false"> -->
@@ -80,6 +80,7 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				preTop:0,
 				fixArr:[],
 				fixArr:[],
 				pArr:[],
 				pArr:[],
 				isShowTools:false,
 				isShowTools:false,
@@ -92,7 +93,8 @@
 				completeItems: [],
 				completeItems: [],
 				isNewPage: false,
 				isNewPage: false,
 				pageCount: 1,
 				pageCount: 1,
-				curEditorSetting: null
+				curEditorSetting: null,
+				curItemId:null
 			};
 			};
 		},
 		},
 		methods: {
 		methods: {
@@ -103,6 +105,9 @@
 
 
 			/* 删除当前富文本块 */
 			/* 删除当前富文本块 */
 			onDeleteBlock() {
 			onDeleteBlock() {
+				console.log(this.curItemId)
+				this.$store.commit('deleteItem',this.curItemId)
+				this.$parent.subjectiveItems.splice(this.$parent.subjectiveItems.map(i => i.id).indexOf(this.curItemId),1)
 				document.getElementById(this.ids).remove()
 				document.getElementById(this.ids).remove()
 				document.getElementById(this.ids + 'btn').remove()
 				document.getElementById(this.ids + 'btn').remove()
 				this.myEditor.destroy()
 				this.myEditor.destroy()
@@ -276,14 +281,17 @@
 					if (!scrollDom) return
 					if (!scrollDom) return
 					let editorDom = this.myEditor.$textElem.elems[0]
 					let editorDom = this.myEditor.$textElem.elems[0]
 					let scrollDis = scrollDom.getPosition().scrollTop
 					let scrollDis = scrollDom.getPosition().scrollTop
+					// let scrollDis = +localStorage.getItem('scrollDis') || scrollDom.getPosition().scrollTop
 					let allItemIds = this.$store.state.answerSheet.paperItem.item.map(i => i.id)
 					let allItemIds = this.$store.state.answerSheet.paperItem.item.map(i => i.id)
 					let subjectiveItem = items[0];
 					let subjectiveItem = items[0];
 					let itemOrder = allItemIds.indexOf(subjectiveItem.id) + 1;
 					let itemOrder = allItemIds.indexOf(subjectiveItem.id) + 1;
+					this.curItemId = subjectiveItem.id
 					let addStr = '<p>' +  itemOrder + "(" + (subjectiveItem.score + "分)") + '</p>'; // 渲染题号
 					let addStr = '<p>' +  itemOrder + "(" + (subjectiveItem.score + "分)") + '</p>'; // 渲染题号
 					let defaultBrCounts = 1; // 问答题默认回答区域空行数量
 					let defaultBrCounts = 1; // 问答题默认回答区域空行数量
 					let brHtml = new Array(defaultBrCounts).fill("<p><br></p>").join("");
 					let brHtml = new Array(defaultBrCounts).fill("<p><br></p>").join("");
 					this.myEditor.txt.html('<span></span>')
 					this.myEditor.txt.html('<span></span>')
 					let curSetting = this.hasEditorSetting(this.ids)
 					let curSetting = this.hasEditorSetting(this.ids)
+					// 如果vuex有保存 之前的文本内容 则渲染 否则按照默认只显示题号
 					if (curSetting && curSetting.content) {
 					if (curSetting && curSetting.content) {
 						this.myEditor.txt.append(curSetting.content);
 						this.myEditor.txt.append(curSetting.content);
 					}else{
 					}else{
@@ -295,19 +303,18 @@
 						let isNewPage = this.$store.state.answerSheet.isNewPage;
 						let isNewPage = this.$store.state.answerSheet.isNewPage;
 						let lastBottomGap = 20;
 						let lastBottomGap = 20;
 						let rectTop = editorDom.getBoundingClientRect().top
 						let rectTop = editorDom.getBoundingClientRect().top
-						let Y = scrollDis < 20 ? rectTop + scrollDis - 90 : rectTop + scrollDis;
+						let Y = rectTop + scrollDis - 90;
 						let paperH = PAPER_H;
 						let paperH = PAPER_H;
 						let curEditorY = Y > paperH ? +((Y % paperH).toFixed(4)) : Y;
 						let curEditorY = Y > paperH ? +((Y % paperH).toFixed(4)) : Y;
 						let curEditorH = editorDom.clientHeight; // 默认200px
 						let curEditorH = editorDom.clientHeight; // 默认200px
-						console.log(itemOrder, 'getBoundingClientRect', rectTop);
-						console.log(itemOrder, 'getBoundingClientRect222', editorDom.getBoundingClientRect());
+						console.log(itemOrder, 'rectTop', rectTop);
 						console.log(itemOrder, 'scrollDis', scrollDis);
 						console.log(itemOrder, 'scrollDis', scrollDis);
 						console.log(itemOrder, '当前Y', Y);
 						console.log(itemOrder, '当前Y', Y);
 						let leftHeight = paperH - curEditorY - lastBottomGap - SVG_BORDER_MB;
 						let leftHeight = paperH - curEditorY - lastBottomGap - SVG_BORDER_MB;
 						console.log(itemOrder, '高度', curEditorH)
 						console.log(itemOrder, '高度', curEditorH)
 						console.log(itemOrder, 'LEFT高度', leftHeight)
 						console.log(itemOrder, 'LEFT高度', leftHeight)
 						let fixHeight = curEditorH - leftHeight + 20
 						let fixHeight = curEditorH - leftHeight + 20
-						// console.log(itemOrder, '需要fix的高度', fixHeight)
+						console.log(itemOrder, '需要fix的高度', fixHeight)
 						// 如果 渲染当前富文本的时候 需要渲染的高度超过当前页的剩余高度 则需要进行加页处理
 						// 如果 渲染当前富文本的时候 需要渲染的高度超过当前页的剩余高度 则需要进行加页处理
 						if (curEditorY + curEditorH + lastBottomGap + SVG_BORDER_MB > PAPER_H) {
 						if (curEditorY + curEditorH + lastBottomGap + SVG_BORDER_MB > PAPER_H) {
 							// console.log(itemOrder, Y , curEditorY , curEditorH , '超出了')
 							// console.log(itemOrder, Y , curEditorY , curEditorH , '超出了')
@@ -457,6 +464,8 @@
 					function mouseup() {
 					function mouseup() {
 						document.removeEventListener("mousemove", mousemove);
 						document.removeEventListener("mousemove", mousemove);
 						document.removeEventListener("mouseup", mouseup);
 						document.removeEventListener("mouseup", mouseup);
+						let editorDom = that.myEditor.$textElem.elems[0]
+						that.preTop = editorDom.getBoundingClientRect().top
 						// 如果是补充区域 则需要把高度计算到主区域 进行重新渲染
 						// 如果是补充区域 则需要把高度计算到主区域 进行重新渲染
 						if(curId.includes('fix')){
 						if(curId.includes('fix')){
 							let mainEditorId = curId.split('fix')[0]
 							let mainEditorId = curId.split('fix')[0]
@@ -481,6 +490,9 @@
 								content:editor.txt.html()
 								content:editor.txt.html()
 							})
 							})
 						}
 						}
+						let scrollDom = that.$parent.$parent.$parent.$parent.$parent.$refs["evScroll"]
+						localStorage.setItem('scrollDis',scrollDom.getPosition().scrollTop)
+						
 						that.$EventBus.$emit('doRefresh')
 						that.$EventBus.$emit('doRefresh')
 					}
 					}
 					// 将鼠标事件绑定到 document 上
 					// 将鼠标事件绑定到 document 上
@@ -692,6 +704,10 @@
 					return this.$store.state.answerSheet.editorInfos[ids]
 					return this.$store.state.answerSheet.editorInfos[ids]
 				}
 				}
 			},
 			},
+			// 是否为根据试卷自动生成的答题卡
+			isAutoCreate(){
+				return this.$store.state.answerSheet.isAutoCreate
+			}
 		},
 		},
 		watch: {
 		watch: {
 			items: {
 			items: {

+ 2 - 2
TEAMModelOS/ClientApp/src/view/answersheet/BaseSvgBg.vue

@@ -61,8 +61,8 @@
 						)
 						)
 						.attr({
 						.attr({
 							fill: radixArr.split('')[index] === '1' ? '#000' : "none",
 							fill: radixArr.split('')[index] === '1' ? '#000' : "none",
-							stroke: "#000",
-							strokeWidth: 1
+							stroke: "#000000",
+							strokeWidth: radixArr.split('')[index] === '1' ? 0 : 1
 						})
 						})
 					);
 					);
 				}
 				}

+ 59 - 22
TEAMModelOS/ClientApp/src/view/answersheet/index.vue

@@ -7,15 +7,6 @@
 				<BaseSvgBg v-for="(page, pageIndex) in pages" :key="pageIndex" :ids="'svg' + pageIndex"
 				<BaseSvgBg v-for="(page, pageIndex) in pages" :key="pageIndex" :ids="'svg' + pageIndex"
 					:total="pages.length"></BaseSvgBg>
 					:total="pages.length"></BaseSvgBg>
 				<SheetBaseInfo></SheetBaseInfo>
 				<SheetBaseInfo></SheetBaseInfo>
-				
-				
-<!-- 				<SheetObjective :items="items" v-show="groupItems.objectiveItems.length" @onRendered="onRendered">
-				</SheetObjective>
-				<div class="sheet-subjective-wrap" :style="'top:' + subjectiveTop + 'px'">
-					<SheetComplete :items="items" v-if="groupItems.completeItems.length"></SheetComplete>
-					<SheetSubjective :items="groupItems.subjectiveItems" v-show="groupItems.subjectiveItems.length"></SheetSubjective>
-				</div> -->
-				
 				<!-- 绘制主区域 -->
 				<!-- 绘制主区域 -->
 				<div class="sheet-groups">
 				<div class="sheet-groups">
 					<div v-for="(group,groupIndex) in groups" :key="groupIndex" class="sheet-group-item">
 					<div v-for="(group,groupIndex) in groups" :key="groupIndex" class="sheet-group-item">
@@ -47,16 +38,29 @@
 					<Checkbox v-model="isColumn">添加二维码</Checkbox>
 					<Checkbox v-model="isColumn">添加二维码</Checkbox>
 					<Checkbox v-model="isColumn">密封线</Checkbox>
 					<Checkbox v-model="isColumn">密封线</Checkbox>
 				</div>
 				</div>
-				<p class="sheet-right-title">添加题型</p>
-				<div style="display: flex;flex-wrap: wrap;">
-					<span class="add-block-item"> + 客观题</span>
-					<span class="add-block-item"> + 填空题</span>
-					<span class="add-block-item"> + 简答题</span>
-					<span class="add-block-item"> + 作文(语)</span>
-					<span class="add-block-item"> + 作文(英)</span>
+				<p class="sheet-right-title" v-if="!isAutoCreate">添加题型</p>
+				<div style="display: flex;flex-wrap: wrap;" v-if="!isAutoCreate">
+					<span class="add-block-item" @click="onAddType('0')"> + 客观题</span>
+					<span class="add-block-item" @click="onAddType('1')"> + 填空题</span>
+					<span class="add-block-item" @click="onAddType('2')"> + 简答题</span>
+					<span class="add-block-item" @click="onAddType('3')"> + 作文(语)</span>
+					<span class="add-block-item" @click="onAddType('4')"> + 作文(英)</span>
 				</div>
 				</div>
 			</div>
 			</div>
 		</div>
 		</div>
+		
+		<Modal
+			v-model="isShowAdd"
+			@on-ok="doAddType"
+			title="添加题型">
+			<Tabs :value="activeTab">
+				<TabPane label="客观题" name="0">标签一的内容</TabPane>
+				<TabPane label="填空题" name="1">标签二的内容</TabPane>
+				<TabPane label="简答题" name="2">标签三的内容</TabPane>
+				<TabPane label="作文(语)" name="3">标签三的内容</TabPane>
+				<TabPane label="作文(英)" name="4">标签三的内容</TabPane>
+			</Tabs>
+		</Modal>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -81,11 +85,6 @@
 				default: "",
 				default: "",
 			},
 			},
 		},
 		},
-		provide: function() {
-			return {
-				reload: this.reload
-			}
-		},
 		components: {
 		components: {
 			SheetObjective,
 			SheetObjective,
 			SheetBaseInfo,
 			SheetBaseInfo,
@@ -96,6 +95,8 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+				isShowAdd:false,
+				activeTab:'0',
 				groups:[],
 				groups:[],
 				isLoading:false,
 				isLoading:false,
 				isColumn:false,
 				isColumn:false,
@@ -124,13 +125,44 @@
 				this.$store.commit('clearPage')
 				this.$store.commit('clearPage')
 				this.$store.commit('clearIsNewPage')
 				this.$store.commit('clearIsNewPage')
 				this.$store.commit('setPaper',routerPaper)
 				this.$store.commit('setPaper',routerPaper)
-				this.items = routerPaper.item
+				if(routerPaper.item === null){
+					this.$store.commit('setCreateModal','diy')
+				}else{
+					this.items = routerPaper.item
+					this.$store.commit('setCreateModal','auto')
+				}
+				localStorage.setItem('scrollDis',0) 
 			}else{
 			}else{
 				this.goBack()
 				this.goBack()
 			}
 			}
 			
 			
 		},
 		},
 		methods: {
 		methods: {
+			onAddType(type){
+				this.isShowAdd = true
+				this.activeTab = type
+			},
+			
+			doAddType(){
+				// let newItems =  [{
+				// 	id:'1111',
+				// 	score:4,
+				// 	option:[{
+				// 		code:'A',
+				// 		value:'111'
+				// 	},{
+				// 		code:'B',
+				// 		value:'222'
+				// 	}],
+				// 	opts:2,
+				// 	type:'single'
+				// }] 
+				// this.items.push(newItems)
+				// this.groups.push({
+				// 	items:newItems,
+				// 	type:'objective'
+				// })
+			},
 			doDownload(){
 			doDownload(){
 				this.isLoading = true
 				this.isLoading = true
 				this.getPdf().then(res => {
 				this.getPdf().then(res => {
@@ -228,6 +260,11 @@
 				return this.$store.state.answerSheet.pages;
 				return this.$store.state.answerSheet.pages;
 			},
 			},
 			
 			
+			// 是否为根据试卷自动生成的答题卡
+			isAutoCreate(){
+				return this.$store.state.answerSheet.isAutoCreate
+			},
+			
 			titleContent(){
 			titleContent(){
 				return (groupIndex,group) => {
 				return (groupIndex,group) => {
 					let totalScore = group.items.length ? group.items.map(i => i.score).reduce((a,b) => a + b) : 0
 					let totalScore = group.items.length ? group.items.map(i => i.score).reduce((a,b) => a + b) : 0

+ 7 - 7
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -63,7 +63,7 @@
 					</div>
 					</div>
 					<div class="item-btn-toggle" @click.stop v-show="isShowTools && !isPreview">
 					<div class="item-btn-toggle" @click.stop v-show="isShowTools && !isPreview">
 						<template v-if="!isExamPaper">
 						<template v-if="!isExamPaper">
-							<InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 50px;margin-right: 10px;height: 30px;"
+							<InputNumber :max="item.score + surPlusScore" :min="0" :step="0.5" v-model="item.score" style="display: inline-block ;width: 50px;margin-right: 10px;height: 30px;"
 							 @click.stop></InputNumber>
 							 @click.stop></InputNumber>
 							<span style="margin-right: 10px;">{{$t('evaluation.paperList.score')}}</span>
 							<span style="margin-right: 10px;">{{$t('evaluation.paperList.score')}}</span>
 							<!-- <span class="item-score" title="设置题目分数" @click.stop="onSetSingleItem(item,index)" v-else>{{ item.score }} 分</span> -->
 							<!-- <span class="item-score" title="设置题目分数" @click.stop="onSetSingleItem(item,index)" v-else>{{ item.score }} 分</span> -->
@@ -501,12 +501,12 @@
 			 * 配分变化时的剩余分数处理
 			 * 配分变化时的剩余分数处理
 			 * @param val
 			 * @param val
 			 */
 			 */
-			onScoreChange(val) {
-				this.surPlusScore = this.surPlusScore + this.lastScore - val
-				this.lastScore = val
-				this.$emit('scoreUpdate', this.surPlusScore)
+			// onScoreChange(val) {
+			// 	this.surPlusScore = this.surPlusScore + this.lastScore - val
+			// 	this.lastScore = val
+			// 	this.$emit('scoreUpdate', this.surPlusScore)
 
 
-			},
+			// },
 
 
 			/** 确认单个试题配分 */
 			/** 确认单个试题配分 */
 			onConfirmScore() {
 			onConfirmScore() {
@@ -714,7 +714,7 @@
 						this.totalNum = newPaper.item.length
 						this.totalNum = newPaper.item.length
 						
 						
 						// 剩余可分配分数 更新
 						// 剩余可分配分数 更新
-						this.surPlusScore = newPaper.score - newPaper.item.reduce((p, e) => parseInt(p) + parseInt(e.score), 0);
+						this.surPlusScore = newPaper.score - newPaper.item.reduce((p, e) => Number(p) + Number(e.score), 0);
 						this.$emit('scoreUpdate', this.surPlusScore)
 						this.$emit('scoreUpdate', this.surPlusScore)
 						
 						
 						this.pageScrollTo(0)
 						this.pageScrollTo(0)

+ 9 - 4
TEAMModelOS/ClientApp/src/view/homepage/HomePage.vue

@@ -1,13 +1,13 @@
 <template>
 <template>
     <div v-if="!isComplete">
     <div v-if="!isComplete">
         <!-- 如果是大陆站需要验证是否完成手机号认证 -->
         <!-- 如果是大陆站需要验证是否完成手机号认证 -->
-        <div v-if="!$store.state.userInfo.hasVerify && $store.state.config.srvAdr == 'China'">
+        <!-- <div v-if="!$store.state.userInfo.hasVerify && $store.state.config.srvAdr == 'China'">
             <Icon custom="iconfont icon-phone-unverify" class="tips-icon" />
             <Icon custom="iconfont icon-phone-unverify" class="tips-icon" />
             <p class="phone-tips">
             <p class="phone-tips">
                 <span>温馨提示:为了方便使用更加完整的系统功能,请先完成<b>手机号认证</b>!</span>
                 <span>温馨提示:为了方便使用更加完整的系统功能,请先完成<b>手机号认证</b>!</span>
                 <router-link to="/regist" class="to-verify">前往认证>>></router-link>
                 <router-link to="/regist" class="to-verify">前往认证>>></router-link>
             </p>
             </p>
-        </div>
+        </div> -->
         <!-- <div v-else>
         <!-- <div v-else>
             <Icon custom="iconfont icon-phone-verify" class="tips-icon" />
             <Icon custom="iconfont icon-phone-verify" class="tips-icon" />
             <p class="phone-tips">
             <p class="phone-tips">
@@ -16,7 +16,7 @@
         </div> -->
         </div> -->
 
 
         <!-- 大陆和国际站都需要验证是否加入学校 -->
         <!-- 大陆和国际站都需要验证是否加入学校 -->
-        <div v-else-if="$store.state.userInfo.hasSchool">
+        <div v-if="!$store.state.userInfo.hasSchool">
             <Icon custom="iconfont icon-school" class="tips-icon" />
             <Icon custom="iconfont icon-school" class="tips-icon" />
             <p class="phone-tips">
             <p class="phone-tips">
                 <span>温馨提示:为了方便使用更加完整的系统功能,请先申请<b>加入学校</b>!</span>
                 <span>温馨提示:为了方便使用更加完整的系统功能,请先申请<b>加入学校</b>!</span>
@@ -300,7 +300,6 @@ export default {
     },
     },
     data() {
     data() {
         return {
         return {
-            isComplete: false,
             split1: 0.5,
             split1: 0.5,
             split2: 0.5,
             split2: 0.5,
             split3: 0.5,
             split3: 0.5,
@@ -357,6 +356,12 @@ export default {
     },
     },
     created() {
     created() {
         console.log(this.$store)
         console.log(this.$store)
+    },
+    computed:{
+        //暂时只验证加入学校, 手机号需要对接API
+        isComplete(){
+            return this.$store.state.userInfo.hasSchool
+        }
     }
     }
 }
 }
 </script>
 </script>

+ 60 - 23
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -220,7 +220,7 @@
                                 </h2>
                                 </h2>
                             </vuescroll>
                             </vuescroll>
                         </div>-->
                         </div>-->
-                    </div> 
+                    </div>
                 </Split>
                 </Split>
             </div>
             </div>
         </Split>
         </Split>
@@ -411,17 +411,17 @@ export default {
                     align: 'center',
                     align: 'center',
                     sortable: true
                     sortable: true
                 },
                 },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC5'),
-                    slot: 'groupId',
-                    align: 'center',
-                    sortable: true
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC6'),
-                    slot: 'groupName',
-                    align: 'center'
-                }
+                // {
+                //     title: this.$t('courseManage.classroom.studentTableC5'),
+                //     slot: 'groupId',
+                //     align: 'center',
+                //     sortable: true
+                // },
+                // {
+                //     title: this.$t('courseManage.classroom.studentTableC6'),
+                //     slot: 'groupName',
+                //     align: 'center'
+                // }
             ],
             ],
             listColumn: [
             listColumn: [
                 {
                 {
@@ -487,14 +487,14 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
-        initData(){
+        initData() {
             this.cusType = [
             this.cusType = [
                 {
                 {
                     label: this.$t('cusMgt.privCus'),
                     label: this.$t('cusMgt.privCus'),
                     value: 'private'
                     value: 'private'
                 }
                 }
             ]
             ]
-            if(this.$store.state.userInfo.hasSchool){
+            if (this.$store.state.userInfo.hasSchool) {
                 this.cusType.unshift({
                 this.cusType.unshift({
                     label: this.$t('cusMgt.scCus'),
                     label: this.$t('cusMgt.scCus'),
                     value: 'school'
                     value: 'school'
@@ -608,7 +608,7 @@ export default {
                         res.stus = res.stus || []
                         res.stus = res.stus || []
                         res.stus.forEach(item => {
                         res.stus.forEach(item => {
                             //TODO 设置班级名称
                             //TODO 设置班级名称
-                            item.source = '校内账号'
+                            // item.source = '校内账号'
                             let curClass = this.classList.find(classItem => {
                             let curClass = this.classList.find(classItem => {
                                 return classItem.id == item.classId
                                 return classItem.id == item.classId
                             })
                             })
@@ -625,10 +625,10 @@ export default {
                 return
                 return
             }
             }
             //教室默认名单
             //教室默认名单
-            if (schedule && schedule.classId && !schedule.students) {
-                //TODO 根据班级id查询学生信息
-                this.findClassStu()
-            }
+            // if (schedule && schedule.classId && !schedule.students) {
+            //     //TODO 根据班级id查询学生信息 (处理课程就获取了)
+            //     // this.findClassStu()
+            // }
         },
         },
         //查询班级学生名单
         //查询班级学生名单
         findClassStu() {
         findClassStu() {
@@ -658,6 +658,16 @@ export default {
                 }, 500)
                 }, 500)
             })
             })
         },
         },
+        //初始化课程课程信息时,根据班级ids查询名单信息
+        getStuByClassIds(classIds) {
+            let params = {
+                'school_code': this.listType == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+                'ids': classIds,
+                //school:校本班级 teacher:私人课程校本名单 private:私人课程动态名单
+                'scope': this.listType
+            }
+            return this.$api.schoolSetting.getClassroomStudent(params)
+        },
         /**获取type对应的label */
         /**获取type对应的label */
         getTypeLabel(code) {
         getTypeLabel(code) {
             for (let item of this.$GLOBAL.EV_TYPE()) {
             for (let item of this.$GLOBAL.EV_TYPE()) {
@@ -1005,7 +1015,7 @@ export default {
                     tmids: [],
                     tmids: [],
                     course: null
                     course: null
                 }
                 }
-                
+
                 this.saveStuList(stuList, true)
                 this.saveStuList(stuList, true)
             }
             }
         },
         },
@@ -1204,7 +1214,6 @@ export default {
                 this.listName = ''
                 this.listName = ''
             })
             })
         },
         },
-        //获取标准课程列表(调整)
         //获取个人和校本课程列表,API调整后没有进行分开处理
         //获取个人和校本课程列表,API调整后没有进行分开处理
         getCourseList() {
         getCourseList() {
             this.listLoading = true
             this.listLoading = true
@@ -1218,7 +1227,6 @@ export default {
                     if (res.error == null) {
                     if (res.error == null) {
                         this.courseList = res.courses
                         this.courseList = res.courses
                         //设置当前课程列表 
                         //设置当前课程列表 
-                        // this.listType = sessionStorage.getItem('myCusType') || this.listType //是否有记录当前页面状态
                         this.courseListShow = this.courseList.filter(item => {
                         this.courseListShow = this.courseList.filter(item => {
                             return item.scope == this.listType
                             return item.scope == this.listType
                         })
                         })
@@ -1256,7 +1264,7 @@ export default {
                     if (!res.error) {
                     if (!res.error) {
                         if (res.courses && res.courses.length > 0) {
                         if (res.courses && res.courses.length > 0) {
                             res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
                             res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
-                            //过滤当前教师的schedule
+                            //过滤当前教师的schedule 因为一个名单被安排到不同教室上课会出现重复数据,这里需要去重
                             res.courses[0].schedule = res.courses[0].schedule.filter(item => {
                             res.courses[0].schedule = res.courses[0].schedule.filter(item => {
                                 return item.teacherId == this.$store.state.userInfo.TEAMModelId
                                 return item.teacherId == this.$store.state.userInfo.TEAMModelId
                             })
                             })
@@ -1279,6 +1287,25 @@ export default {
                                 }
                                 }
                             }
                             }
 
 
+                            //获取班级名单信息(为了列表显示学生人数)
+                            let classIds = res.courses[0].schedule.map(item => {
+                                return item.classId
+                            })
+                            for (let i = 0; i < classIds.length; i++) {
+                                if (!classIds[i]) {
+                                    classIds.splice(i, 1)
+                                    i--
+                                }
+                            }
+                            let classStus = null
+                            if (classIds.length) {
+                                try {
+                                    classStus = await this.getStuByClassIds(classIds)
+                                } catch (e) {
+                                    this.$Message.error('API ERROR')
+                                }
+                            }
+
                             res.courses[0].schedule.forEach(item => {
                             res.courses[0].schedule.forEach(item => {
                                 //补充教室信息
                                 //补充教室信息
                                 if (item.classId) {
                                 if (item.classId) {
@@ -1289,6 +1316,15 @@ export default {
                                         id: item.classId,
                                         id: item.classId,
                                         name: classInfo ? classInfo.name : '--'
                                         name: classInfo ? classInfo.name : '--'
                                     }
                                     }
+                                    //根据上面查看班级学生的返回结果补充学生名单
+                                    if (classStus && classStus.stus) {
+                                        classStus.stus.forEach(stuItem => {
+                                            if (stuItem.length > 0 && stuItem[0].classId == item.classId) {
+                                                item.students = stuItem
+                                                item.fullStu = true
+                                            }
+                                        })
+                                    }
                                 }
                                 }
                                 //补充名单信息
                                 //补充名单信息
                                 if (ids.length && item.stulist) {
                                 if (ids.length && item.stulist) {
@@ -1302,6 +1338,7 @@ export default {
                             })
                             })
                         }
                         }
                         this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
                         this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
+                        console.log(this.courseListShow[this.curCusIndex])
                         this.changeClassroom(0)
                         this.changeClassroom(0)
                         // if (sessionStorage.getItem('myCusTabName') && sessionStorage.getItem('myCusTabName') != 'record') {
                         // if (sessionStorage.getItem('myCusTabName') && sessionStorage.getItem('myCusTabName') != 'record') {
                         //     this.selectTab(sessionStorage.getItem('myCusTabName'))
                         //     this.selectTab(sessionStorage.getItem('myCusTabName'))

+ 130 - 255
TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue

@@ -75,24 +75,17 @@
                         </div>
                         </div>
                     </div>
                     </div>
                     <!-- 上课名单、上课时段设置 -->
                     <!-- 上课名单、上课时段设置 -->
-                    <div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
+                    <div slot="right" class="class-setting" v-show="!addListStatus && !addTeaStatus">
                         <div class="teacher-list-header">
                         <div class="teacher-list-header">
                             <span class="tab-label" style="padding-left:10px">
                             <span class="tab-label" style="padding-left:10px">
                                 {{$t('cusMgt.cusNameList')}}
                                 {{$t('cusMgt.cusNameList')}}
                             </span>
                             </span>
-                            <!-- <span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
-                                {{$t('cusMgt.cusNameList')}}
-                            </span> -->
-                            <!-- 取消根据老师设置课程时段的功能 -->
-                            <!-- <span @click="selectTab(1)" :class="curTab == 1 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
-                                {{$t('cusMgt.cusTime')}}
-                            </span> -->
                             <div class="action-btn-wrap">
                             <div class="action-btn-wrap">
                                 <span class="action-btn" style="margin-right:30px" @click="updCusInfo()" v-if="isUpd">
                                 <span class="action-btn" style="margin-right:30px" @click="updCusInfo()" v-if="isUpd">
                                     <Icon type="ios-albums-outline" size="16" />
                                     <Icon type="ios-albums-outline" size="16" />
                                     <span>{{$t('cusMgt.saveLabel')}}</span>
                                     <span>{{$t('cusMgt.saveLabel')}}</span>
                                 </span>
                                 </span>
-                                <span class="action-btn" v-show="curTab == 0" :style="{marginRight:isUpd ? '20px':'30px'}" @click="setDefaultTea">
+                                <span class="action-btn" v-show="curTab == 0" :style="{marginRight:isUpd ? '20px':'30px'}" @click="addNameList">
                                     <Icon type="md-add" size="16" />
                                     <Icon type="md-add" size="16" />
                                     <span>{{$t('cusMgt.addStuList')}}</span>
                                     <span>{{$t('cusMgt.addStuList')}}</span>
                                 </span>
                                 </span>
@@ -116,23 +109,12 @@
                                             </p>
                                             </p>
                                             <p class="class-attr-item">
                                             <p class="class-attr-item">
                                                 <span class="attr-label">学生人数:</span>
                                                 <span class="attr-label">学生人数:</span>
-                                                <span class="class-name">--人</span>
+                                                <span class="class-name">{{item.students ? item.students.length : 0}}{{$t('unit.text7')}}</span>
                                             </p>
                                             </p>
-                                            <!-- 上课地点 取消设置上课教室-->
-                                            <!-- <p class="class-attr-item">
-                                                <span class="attr-label">{{$t('cusMgt.addrLabel')}} </span>
-                                                <span :class="item.room ? 'class-name':'def-class-name'">{{item.room && item.roomInfo ? item.roomInfo.name : $t('cusMgt.noSet')}}</span>
-                                            </p> -->
                                         </div>
                                         </div>
                                     </div>
                                     </div>
-                                    <!-- 设置教室名单 -->
+                                    <!-- 设置班级名单 -->
                                     <div slot="right" class="set-stu-list dark-iview-table dark-el-cascader" v-if="schdList[curClassIndex]">
                                     <div slot="right" class="set-stu-list dark-iview-table dark-el-cascader" v-if="schdList[curClassIndex]">
-                                        <!-- <div class="stu-list-header dark-iview-select">
-                                            <span class="attr-label">{{$t('cusMgt.addrLabel')}}</span>
-                                            <Select v-model="schdList[curClassIndex].room" style="width:200px" size="small" filterable clearable @on-clear="updCusInfo">
-                                                <Option v-for="item in roomList" :value="item.id" :key="item.id" @click.native="setCusRoom(item)">{{ item.name }}</Option>
-                                            </Select>
-                                        </div> -->
                                         <vuescroll>
                                         <vuescroll>
                                             <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
                                             <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
                                                 <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                                                 <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
@@ -173,8 +155,8 @@
                             </vuescroll>
                             </vuescroll>
                         </div>
                         </div>
                     </div>
                     </div>
-                    <!-- 添加名单UI 批量添加-->
-                    <div slot="right" class="class-setting dark-iview-input dark-iview-select dark-iview-table" v-show="isAddStuList">
+                    <!-- 添加班级名单UI 批量添加-->
+                    <div slot="right" class="class-setting dark-iview-input dark-iview-select dark-iview-table" v-show="addListStatus">
                         <vuescroll>
                         <vuescroll>
                             <div class="add-tea-header">
                             <div class="add-tea-header">
                                 <RadioGroup v-model="addType" type="button" button-style="solid" size="small">
                                 <RadioGroup v-model="addType" type="button" button-style="solid" size="small">
@@ -208,7 +190,7 @@
                     <div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
                     <div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
                         <vuescroll>
                         <vuescroll>
                             <div class="add-tea-header">
                             <div class="add-tea-header">
-                                <Input search :placeholder="$t('cusMgt.searchHolder')" style="width:240px;margin-top:4px" size="small" />
+                                <!-- <Input search :placeholder="$t('cusMgt.searchHolder')" style="width:240px;margin-top:4px" size="small" /> -->
                                 <div class="action-btn-wrap">
                                 <div class="action-btn-wrap">
                                     <span class="action-btn" style="margin-right:40px" @click="confirmAddTea">
                                     <span class="action-btn" style="margin-right:40px" @click="confirmAddTea">
                                         <Icon type="md-add" size="16" />
                                         <Icon type="md-add" size="16" />
@@ -309,13 +291,11 @@ export default {
             setCurClass: '',
             setCurClass: '',
             addTeaStatus: false,
             addTeaStatus: false,
             preDefault: true,
             preDefault: true,
-            isAddStuList: false,
+            addListStatus: false,
             isSearch: false,
             isSearch: false,
             stuLoading: false,
             stuLoading: false,
-            students: [],
             preStus: [],
             preStus: [],
             stuList: [],
             stuList: [],
-            isDefault: true,
             teacherList: [],
             teacherList: [],
             sltTeachers: [],
             sltTeachers: [],
             sltClass: [],
             sltClass: [],
@@ -406,17 +386,17 @@ export default {
                     align: 'center',
                     align: 'center',
                     sortable: true
                     sortable: true
                 },
                 },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC5'),
-                    slot: 'groupId',
-                    align: 'center',
-                    sortable: true
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC6'),
-                    slot: 'groupName',
-                    align: 'center'
-                }
+                // {
+                //     title: this.$t('courseManage.classroom.studentTableC5'),
+                //     slot: 'groupId',
+                //     align: 'center',
+                //     sortable: true
+                // },
+                // {
+                //     title: this.$t('courseManage.classroom.studentTableC6'),
+                //     slot: 'groupName',
+                //     align: 'center'
+                // }
             ],
             ],
             listColumn: [
             listColumn: [
                 {
                 {
@@ -507,20 +487,6 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
-        //设置上课教室
-        setCusRoom(room) {
-            console.log(room)
-            this.$set(this.schdList[this.curClassIndex], 'roomInfo', {
-                id: room.id,
-                name: room.name
-            })
-            // this.schdList[this.curClassIndex].roomInfo = {
-            //     id:room.id,
-            //     name:room.name
-            // }
-            console.log(this.schdList[this.curClassIndex])
-            this.updCusInfo()
-        },
         //根据班级学年计算年级
         //根据班级学年计算年级
         getGradeByYear(year) {
         getGradeByYear(year) {
             if (year && this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
             if (year && this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
@@ -642,7 +608,7 @@ export default {
             this.addTeaStatus = true
             this.addTeaStatus = true
         },
         },
         initStatus() {
         initStatus() {
-            this.isAddStuList = false
+            this.addListStatus = false
             this.addTeaStatus = false
             this.addTeaStatus = false
         },
         },
         confirmAddStuList() {
         confirmAddStuList() {
@@ -705,23 +671,11 @@ export default {
         },
         },
         selectTab(index) {
         selectTab(index) {
             this.curTab = index
             this.curTab = index
-            // this.setDefClass()
             let teaId = this.teaList[this.curTeaIndex].id
             let teaId = this.teaList[this.curTeaIndex].id
             if (index == 1 && teaId && !this.teaSchds[teaId]) {
             if (index == 1 && teaId && !this.teaSchds[teaId]) {
                 this.getTeaSchd()
                 this.getTeaSchd()
             }
             }
         },
         },
-        //设置默认授课教室
-        // setDefClass() {
-        //     if (this.schdList[this.curClassIndex]) {
-        //         this.setCurClass = this.schdList[this.curClassIndex].classId || ''
-        //         if (!this.setCurClass && this.schdRoomList[0]) {
-        //             this.setCurClass = this.schdRoomList[0].classId
-        //         }
-        //     } else {
-        //         this.setCurClass = ''
-        //     }
-        // },
         //设置课程时段
         //设置课程时段
         selectCell(data) {
         selectCell(data) {
             let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
             let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
@@ -797,20 +751,16 @@ export default {
                 }
                 }
             }
             }
         },
         },
-        //修改上课名单
-        updateStuList(listName) {
-            this.isUpd = true
-            this.schdList[this.curClassIndex].listName = listName
-        },
+
         //关闭搜索状态
         //关闭搜索状态
         closeSearch() {
         closeSearch() {
             this.isSearch = false
             this.isSearch = false
             this.keyWord = ''
             this.keyWord = ''
             this.filterByPeriod()
             this.filterByPeriod()
         },
         },
-        //设置默认授课老师
-        setDefaultTea() {
-            this.isAddStuList = true
+        //添加课程名单
+        addNameList() {
+            this.addListStatus = true
             this.schedule.teacherId = this.teaList[this.curTeaIndex].id
             this.schedule.teacherId = this.teaList[this.curTeaIndex].id
             this.schedule.teacherName = this.teaList[this.curTeaIndex].name
             this.schedule.teacherName = this.teaList[this.curTeaIndex].name
         },
         },
@@ -829,18 +779,16 @@ export default {
                 }
                 }
             )
             )
         },
         },
-        //选择教室列表
+        //选择课程名单列表
         selectClass(index) {
         selectClass(index) {
             this.curClassIndex = index
             this.curClassIndex = index
-            this.setIsDefault()
+            this.findCurStuList()
             this.initStatus()
             this.initStatus()
         },
         },
         //教师列表选择事件
         //教师列表选择事件
         selectTea(index) {
         selectTea(index) {
             this.curClassIndex = 0
             this.curClassIndex = 0
             this.curTeaIndex = index
             this.curTeaIndex = index
-            this.setIsDefault()
-            // this.setDefClass()
             this.initStatus()
             this.initStatus()
             //获取老师所有授课数据渲染课程表
             //获取老师所有授课数据渲染课程表
             if (this.teaList.length) {
             if (this.teaList.length) {
@@ -882,63 +830,7 @@ export default {
                 }
                 }
             }
             }
         },
         },
-        //默认名单切换判断
-        handleSwitch() {
-            return new Promise((resolve, reject) => {
-                if (!this.isDefault) {
-                    this.$Modal.confirm({
-                        title: this.$t('cusMgt.defaultTitle'),
-                        content: this.$t('cusMgt.defaultContent'),
-                        onOk: () => {
-                            this.schdList[this.curClassIndex].stulist = ''
-                            resolve()
-                        },
-                        onCancel: () => {
-                            reject()
-                        }
-                    })
-                } else {
-                    resolve()
-                }
-            })
-        },
-        //设置教室名称
-        setClassName(data, option) {
-            let curClass = this.roomList.find(item => {
-                return item.id == data
-            })
-            if (option == 'insert') { //添加名单的逻辑
-                if (curClass) {
-                    this.schedule.classInfo.name = curClass.name
-                    this.schedule.classInfo.id = curClass.id
-                    if (curClass.students) {
-                        this.preStus = curClass.students
-                    } else {
-                        let params = {
-                            'school_code': this.$store.state.userInfo.schoolCode,
-                            'ids': [curClass.id],
-                            'scope': 'school'
-                        }
-                        this.$api.schoolSetting.getClassroomStudent(params).then(
-                            (res) => {
-                                if (!res.error) {
-                                    this.preStus = res.stus.length ? res.stus[0] : []
-                                    curClass.students = res.stus.length ? res.stus[0] : []
-                                } else {
-                                    this.$Message.error('API error!')
-                                }
-                            },
-                            (err) => {
-                                this.$Message.error('API error!')
-                            }
-                        )
-                    }
-                }
-            } else { //修改教室的逻辑
-                this.isUpd = true
-                if (curClass) this.schdList[this.curClassIndex].classInfo.name = curClass.name
-            }
-        },
+
         //确认添加名单
         //确认添加名单
         confirmAddSchd() {
         confirmAddSchd() {
             if (!this.schedule.teacherId) {
             if (!this.schedule.teacherId) {
@@ -1003,14 +895,14 @@ export default {
                 return
                 return
             }
             }
             console.log('课程信息:', this.courseListShow[this.curCusIndex])
             console.log('课程信息:', this.courseListShow[this.curCusIndex])
-            this.isAddStuList = false
+            this.addListStatus = false
             this.updCusInfo()
             this.updCusInfo()
             this.initSchedule()
             this.initSchedule()
             this.clearTable()
             this.clearTable()
         },
         },
         //取消添加Schd
         //取消添加Schd
         cancelAddSchd() {
         cancelAddSchd() {
-            this.isAddStuList = false
+            this.addListStatus = false
             this.initSchedule()
             this.initSchedule()
             this.clearTable()
             this.clearTable()
         },
         },
@@ -1126,20 +1018,11 @@ export default {
                 onCancel: () => { }
                 onCancel: () => { }
             })
             })
         },
         },
-        goMgtStuList() {
-            //不用跳转页面进行操作
-            this.$router.push({
-                name: 'MgtStuList'
-            })
-            // 在当前页面添加stulist
-            // this.addStuListStatus = true
-        },
         // 切换课表模式和课程模式
         // 切换课表模式和课程模式
         toggleView() {
         toggleView() {
             this.$router.push({
             this.$router.push({
                 name: 'CoursePlan'
                 name: 'CoursePlan'
             })
             })
-            // this.$Message.warning('课表模式开发中...')
         },
         },
         dropdownStates(flag) {
         dropdownStates(flag) {
             if (!flag) this.filterByPeriod()
             if (!flag) this.filterByPeriod()
@@ -1209,58 +1092,81 @@ export default {
                     'id': this.courseListShow[this.curCusIndex].id
                     'id': this.courseListShow[this.curCusIndex].id
                 }
                 }
                 this.$api.courseMgmt.findCusInfo(requestData).then(
                 this.$api.courseMgmt.findCusInfo(requestData).then(
-                    (res) => {
-                        if (!res.error) {
-                            if (res.courses && res.courses.length > 0) {
-                                res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
-                                res.courses[0].schedule.forEach(item => {
-                                    //补充班级信息
-                                    if (item.classId) {
-                                        let classInfo = this.classList.find(classItem => {
-                                            return classItem.id == item.classId
-                                        })
-                                        if (classInfo) {
-                                            item.classInfo = {
-                                                id: item.classId,
-                                                name: classInfo.name
-                                            }
-                                        } else {
-                                            item.classInfo = {
-                                                id: item.classId,
-                                                name: '--'
-                                            }
+                    async (res) => {
+                        if (!res.error && res.courses && res.courses.length > 0) {
+                            res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
+                            //获取班级名单信息(方便列表显示学生人数)
+                            let classIds = res.courses[0].schedule.map(item => {
+                                return item.classId
+                            })
+                            for (let i = 0; i < classIds.length; i++) {
+                                if (!classIds[i]) {
+                                    classIds.splice(i, 1)
+                                    i--
+                                }
+                            }
+                            let classStus = null
+                            if (classIds.length) {
+                                try {
+                                    classStus = await this.getStuByClassIds(classIds)
+                                } catch (e) {
+                                    this.$Message.error('API ERROR')
+                                }
+                            }
+
+                            res.courses[0].schedule.forEach(item => {
+                                //补充班级信息
+                                if (item.classId) {
+                                    let classInfo = this.classList.find(classItem => {
+                                        return classItem.id == item.classId
+                                    })
+                                    if (classInfo) {
+                                        item.classInfo = {
+                                            id: item.classId,
+                                            name: classInfo.name
                                         }
                                         }
-                                    }
-                                    // 补充动态名单信息
-                                    if (item.stulist) {
-                                        let listInfo = this.stuList.find(listItem => {
-                                            return listItem.id == item.stulist
-                                        })
-                                        if (listInfo) {
-                                            item.listName = listInfo.name
-                                        } else {
-                                            item.listName = '--'
+                                    } else {
+                                        item.classInfo = {
+                                            id: item.classId,
+                                            name: '--'
                                         }
                                         }
                                     }
                                     }
-                                    // 补充教室信息
-                                    if (item.room) {
-                                        let roomInfo = this.roomList.find(roomItem => {
-                                            return roomItem.id == item.room
-                                        })
-                                        if (roomInfo) {
-                                            item.roomInfo = {
-                                                id: item.room,
-                                                name: roomInfo.name
-                                            }
-                                        } else {
-                                            item.roomInfo = {
-                                                id: item.room,
-                                                name: '--'
+                                    //根据上面查看班级学生的返回结果补充学生名单
+                                    if (classStus && classStus.stus) {
+                                        classStus.stus.forEach(stuItem => {
+                                            if (stuItem.length > 0 && stuItem[0].classId == item.classId) {
+                                                item.students = stuItem
+                                                item.fullStu = true
                                             }
                                             }
+                                        })
+                                    }
+                                }
+                                // 补充动态名单信息
+                                if (item.stulist) {
+                                    let listInfo = this.stuList.find(listItem => {
+                                        return listItem.id == item.stulist
+                                    })
+                                    item.listName = listInfo ? listInfo.name : '--'
+                                    item.students = listInfo ? listInfo.students : []
+                                }
+                                // 补充教室信息
+                                if (item.room) {
+                                    let roomInfo = this.roomList.find(roomItem => {
+                                        return roomItem.id == item.room
+                                    })
+                                    if (roomInfo) {
+                                        item.roomInfo = {
+                                            id: item.room,
+                                            name: roomInfo.name
+                                        }
+                                    } else {
+                                        item.roomInfo = {
+                                            id: item.room,
+                                            name: '--'
                                         }
                                         }
                                     }
                                     }
-                                })
-                            }
+                                }
+                            })
                             this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
                             this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
                             this.selectTea(0)
                             this.selectTea(0)
                         }
                         }
@@ -1272,6 +1178,16 @@ export default {
                 })
                 })
             }
             }
         },
         },
+        //初始化课程课程信息时,根据班级ids查询名单信息
+        getStuByClassIds(classIds) {
+            let params = {
+                'school_code': this.$store.state.userInfo.schoolCode,
+                'ids': classIds,
+                //school:校本班级 teacher:私人课程校本名单 private:私人课程动态名单
+                'scope': 'school'
+            }
+            return this.$api.schoolSetting.getClassroomStudent(params)
+        },
         //显示新增/编辑课程对话框
         //显示新增/编辑课程对话框
         showAddCourse(type) {
         showAddCourse(type) {
             this.addCourseStatus = true
             this.addCourseStatus = true
@@ -1413,30 +1329,17 @@ export default {
                 }
                 }
             })
             })
         },
         },
-        setIsDefault() {
-            if (this.schdList.length) {
-                this.isDefault = !this.schdList[this.curClassIndex].stulist
-                this.findCurStuList()
-            }
-        },
-        //获取当前学生名单
+        //获取当前动态学生名单
         findCurStuList() {
         findCurStuList() {
-            if (this.isAddStuList) {
-                this.students = []
-                return
-            }
-            if (!this.schdList || !this.schdList[this.curClassIndex]) {
-                this.students = []
-                return
-            }
-            if (this.schdList[this.curClassIndex].stulist) {            //自定义名单学生
+            if (this.schdList[this.curClassIndex] && this.schdList[this.curClassIndex].stulist) {            //自定义名单学生
                 let stulist = this.stuList.find(item => {
                 let stulist = this.stuList.find(item => {
                     return item.id == this.schdList[this.curClassIndex].stulist
                     return item.id == this.schdList[this.curClassIndex].stulist
                 })
                 })
                 if (stulist) { //有对应的自定义名单
                 if (stulist) { //有对应的自定义名单
                     if (stulist.full) {
                     if (stulist.full) {
-                        this.students = stulist.students
+                        // this.students = stulist.students
                     } else {
                     } else {
+                        this.stuLoading = true
                         this.$api.courseMgmt.findStuSummary({
                         this.$api.courseMgmt.findStuSummary({
                             students: stulist.students
                             students: stulist.students
                         }).then(
                         }).then(
@@ -1451,20 +1354,18 @@ export default {
                                 })
                                 })
                                 stulist.students = res.stus
                                 stulist.students = res.stus
                                 stulist.full = true
                                 stulist.full = true
-                                this.students = res.stus
+                                // this.students = res.stus
+                                this.schdList[this.curClassIndex].students = res.stus 
                             }
                             }
-                        )
+                        ).finally(()=>{
+                            this.stuLoading = false
+                        })
                     }
                     }
-                } else { //没有对应的自定义名单
-                    this.students = []
-                }
-            } else {              //教室默认学生
-                if (this.schdList[this.curClassIndex].students) {
-                    this.students = this.schdList[this.curClassIndex].students
-                } else {
-                    this.findClassStu(this.schdList[this.curClassIndex].classId)
                 }
                 }
             }
             }
+            //系统班级学生(初始化课程的时候就获取了这里就不用获取了)
+            else {
+            }
         },
         },
         //查询班级学生
         //查询班级学生
         findClassStu(classId) {
         findClassStu(classId) {
@@ -1476,7 +1377,7 @@ export default {
             this.$api.schoolSetting.getClassroomStudent(params).then(
             this.$api.schoolSetting.getClassroomStudent(params).then(
                 (res) => {
                 (res) => {
                     if (!res.error) {
                     if (!res.error) {
-                        this.students = res.stus.length ? res.stus[0] : []
+                        // this.students = res.stus.length ? res.stus[0] : []
                         this.schdList[this.curClassIndex].students = res.stus.length ? res.stus[0] : []
                         this.schdList[this.curClassIndex].students = res.stus.length ? res.stus[0] : []
                     } else {
                     } else {
                         this.$Message.error('API error!')
                         this.$Message.error('API error!')
@@ -1567,38 +1468,6 @@ export default {
             }
             }
             return []
             return []
         },
         },
-        //选择教室名单列表
-        roomTable() {
-            let tbData = []
-            tbData = this.roomList.filter(item => {
-                return item.periodId == this.filterPeriod
-            })
-            return tbData
-        },
-        //级联选择年级班级
-        csOptions() {
-            let data = []
-            if (this.filterPeriod && this.schoolBase.period.length && this.roomList.length) {
-                let curPd = this.schoolBase.period.filter((item) => {
-                    return item.id == this.filterPeriod
-                })
-                if (curPd && curPd.length) {
-                    curPd[0].grades.forEach((item, index) => {
-                        let dataItem = {
-                            id: item.id,
-                            name: item.name,
-                            children: []
-                        }
-                        let child = this.roomList.filter(classItem => {
-                            return classItem.gradeId == item.id
-                        })
-                        dataItem.children = child
-                        data.push(dataItem)
-                    })
-                }
-            }
-            return data
-        },
         filterPeriodName() {
         filterPeriodName() {
             let data = this.schoolBase.period
             let data = this.schoolBase.period
             let pId = this.filterPeriod
             let pId = this.filterPeriod
@@ -1624,7 +1493,7 @@ export default {
                 const ids = new Map()
                 const ids = new Map()
                 return schds.filter(item => {
                 return schds.filter(item => {
                     // return (item.classId || item.stulist) && (!ids.has(item.room) && ids.set(item.room, 1))
                     // return (item.classId || item.stulist) && (!ids.has(item.room) && ids.set(item.room, 1))
-                    return (item.classId && !ids.has(item.classId) && ids.set(item.classId, 1)) || (item.stulist  && !ids.has(item.stulist) && ids.set(item.stulist, 1))
+                    return (item.classId && !ids.has(item.classId) && ids.set(item.classId, 1)) || (item.stulist && !ids.has(item.stulist) && ids.set(item.stulist, 1))
                 })
                 })
             } else {
             } else {
                 return []
                 return []
@@ -1640,7 +1509,6 @@ export default {
         teaList() {
         teaList() {
             if (this.courseListShow && this.courseListShow[this.curCusIndex] && this.courseListShow[this.curCusIndex].schedule) {
             if (this.courseListShow && this.courseListShow[this.curCusIndex] && this.courseListShow[this.curCusIndex].schedule) {
                 let all = this.courseListShow[this.curCusIndex].schedule.map(item => {
                 let all = this.courseListShow[this.curCusIndex].schedule.map(item => {
-                    // return item.teacher
                     return {
                     return {
                         id: item.teacherId,
                         id: item.teacherId,
                         name: item.teacherName
                         name: item.teacherName
@@ -1652,7 +1520,14 @@ export default {
             } else {
             } else {
                 return []
                 return []
             }
             }
-        }
+        },
+        students() {
+            if (this.schdList && this.schdList[this.curClassIndex]) {
+                return this.schdList[this.curClassIndex].students
+            } else {
+                return []
+            }
+        },
     },
     },
     watch: {
     watch: {
         curCusIndex() {
         curCusIndex() {

+ 4 - 4
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -77,10 +77,10 @@
             <div class="class-info-wrap" slot="right">
             <div class="class-info-wrap" slot="right">
                 <!-- tab菜单 -->
                 <!-- tab菜单 -->
                 <div class="class-info-header common-save-btn">
                 <div class="class-info-header common-save-btn">
-                    <!-- 位置设定 -->
-                    <span :class="currentTabIndex == 1 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(1)">
+                    <!-- 位置设定 暂时去掉-->
+                    <!-- <span :class="currentTabIndex == 1 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(1)">
                         {{$t('schoolBaseInfo.tab3')}}
                         {{$t('schoolBaseInfo.tab3')}}
-                    </span>
+                    </span> -->
                     <!-- hiteach关联 -->
                     <!-- hiteach关联 -->
                     <span :class="currentTabIndex == 3 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(3)">
                     <span :class="currentTabIndex == 3 ? 'main-header-tab line-bottom line-bottom-active':'main-header-tab line-bottom'" @click="selectTab(3)">
                         {{$t('schoolBaseInfo.tab4')}}
                         {{$t('schoolBaseInfo.tab4')}}
@@ -287,7 +287,7 @@ export default {
             editStatus: true,//可切换编辑状态
             editStatus: true,//可切换编辑状态
             noStatus: false,
             noStatus: false,
             isSearch: false,
             isSearch: false,
-            currentTabIndex: 1,
+            currentTabIndex: 3,
             isListLoading: false,
             isListLoading: false,
             isSaveLoading: false,
             isSaveLoading: false,
             hiteachListLoading: true,
             hiteachListLoading: true,

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/AddStudent.vue

@@ -102,7 +102,7 @@
                     </Select>
                     </Select>
                 </FormItem>
                 </FormItem>
             </div>
             </div>
-            <!-- 教室資訊 -->
+            <!-- 教室資訊 -- 班级 -->
             <FormItem :label="$t('stuAccount.classroomInfo')" prop="classId">
             <FormItem :label="$t('stuAccount.classroomInfo')" prop="classId">
                 <Select filterable style="width:100%" :placeholder="$t('stuAccount.classroomInfoHolder')" v-model="studentInfo.classId" clearable>
                 <Select filterable style="width:100%" :placeholder="$t('stuAccount.classroomInfoHolder')" v-model="studentInfo.classId" clearable>
                     <Option v-for="(item,index) in filterClasses" :value="item.id" :key="index" @click.native="setCurrentClassDetail(item)">{{ item.name }}</Option>
                     <Option v-for="(item,index) in filterClasses" :value="item.id" :key="index" @click.native="setCurrentClassDetail(item)">{{ item.name }}</Option>

+ 23 - 60
TEAMModelOS/ClientApp/src/view/student-account/ImportStudent.vue

@@ -138,7 +138,7 @@
                 tableLoading: false,
                 tableLoading: false,
                 systemColumn: [
                 systemColumn: [
                     'id',
                     'id',
-                    'pw',
+                    // 'pw',//密码默认同账号
                     'name',
                     'name',
                     'className',
                     'className',
                     'classId',
                     'classId',
@@ -254,6 +254,7 @@
                     const columnStr = columns.join('')
                     const columnStr = columns.join('')
                     let flag = true
                     let flag = true
                     let column = ''
                     let column = ''
+                    console.log('汇入表头:',columns)
                     for (let item of this.systemColumn) {
                     for (let item of this.systemColumn) {
                         let f = 0
                         let f = 0
                         for (let i of columns) {
                         for (let i of columns) {
@@ -271,21 +272,23 @@
                     if (flag) {
                     if (flag) {
                         // 处理表格导入数据类型
                         // 处理表格导入数据类型
                         this.tableData = results.filter(item => {
                         this.tableData = results.filter(item => {
-                            let arr = item.id.split('#')
-                            if (arr.length == 2) {
+                            // let arr = item.id.split('#') //账号id不用#
+                            // if (arr.length == 2) {
                                 for (let i of this.systemColumn) {
                                 for (let i of this.systemColumn) {
                                     if (i != 'no') {
                                     if (i != 'no') {
                                         if (typeof item[i] === 'number') {
                                         if (typeof item[i] === 'number') {
                                             item[i] = item[i] + ''
                                             item[i] = item[i] + ''
                                         }
                                         }
-                                        if (item.pw == undefined) {
-                                            item.pw = arr[1]
-                                        }
+                                        //表格去掉pw栏位,密码默认同账号id
+                                        // if (item.pw == undefined) {
+                                        //     item.pw = arr[1]
+                                        // }
+                                        item.pw = item.id
                                     }
                                     }
                                 }
                                 }
-                            } else {
-                                item._disabled = true
-                            }
+                            // } else {
+                            //     item._disabled = true
+                            // }
                             return item
                             return item
                         })
                         })
 
 
@@ -361,47 +364,6 @@
                     this.showRemoveFile = true
                     this.showRemoveFile = true
                 }
                 }
             },
             },
-            groupBy(array, key) {
-                const groups = {}
-                array.forEach(function (item) {
-                    const group = JSON.stringify(item[key])
-                    groups[group] = groups[group] || []
-                    groups[group].push(item)
-                })
-                return Object.keys(groups).map(function (group) {
-                    return groups[group]
-                })
-            },
-            /*
-            *获取对象在对象数组的中index
-            */
-            getIndex(_arr, _obj) {
-                var len = _arr.length
-                for (let i = 0; i < len; i++) {
-                    if (this.isObjEqual(_arr[i], _obj)) {
-                        return parseInt(i)
-                    }
-                }
-                return -1
-            },
-
-            /*
-            * 判断两个json对象是否相同
-            */
-            isObjEqual(o1, o2) {
-                var props1 = Object.keys(o1)
-                var props2 = Object.keys(o2)
-                if (props1.length != props2.length) {
-                    return false
-                }
-                for (var i = 0, max = props1.length; i < max; i++) {
-                    var propName = props1[i]
-                    if (o1[propName] !== o2[propName]) {
-                        return false
-                    }
-                }
-                return true
-            },
             saveFileData() {
             saveFileData() {
                 if (this.isError == 0) {
                 if (this.isError == 0) {
                     this.uploadLoading = true
                     this.uploadLoading = true
@@ -476,10 +438,10 @@
                         title: this.$t('stuAccount.stuName'),
                         title: this.$t('stuAccount.stuName'),
                         key: 'name'
                         key: 'name'
                     },
                     },
-                    {
-                        title: '年級',
-                        slot: 'gradeIndex'
-                    },
+                    // {
+                    //     title: '年級',
+                    //     slot: 'gradeIndex'
+                    // },
                     {
                     {
                         title: this.$t('stuAccount.classroomName'),
                         title: this.$t('stuAccount.classroomName'),
                         key: 'className'
                         key: 'className'
@@ -502,7 +464,8 @@
                 this.errNumReset()
                 this.errNumReset()
                 excelData.forEach( (item, index, array) => {
                 excelData.forEach( (item, index, array) => {
                     // 座號、ID、教室ID、教室名稱必填
                     // 座號、ID、教室ID、教室名稱必填
-                    if(item.no == '' || item.no == null || item.id == '' || item.id == null || item.classId == '' || item.classId == null || item.className == '' || item.className == null || item.gradeIndex == '' || item.gradeIndex == null) {
+                    // if(item.no == '' || item.no == null || item.id == '' || item.id == null || item.classId == '' || item.classId == null || item.className == '' || item.className == null || item.gradeIndex == '' || item.gradeIndex == null) {
+                    if(!item.no || !item.id || !item.classId || !item.className) {
                         _this.excelValid.fieldIds.push(item.id)
                         _this.excelValid.fieldIds.push(item.id)
                         _this.excelFiledNum++
                         _this.excelFiledNum++
                     } else {
                     } else {
@@ -540,11 +503,11 @@
                             if(data.length > 0 && data[item.gradeIndex-1]) {
                             if(data.length > 0 && data[item.gradeIndex-1]) {
                                 gradeID = data[item.gradeIndex-1].id
                                 gradeID = data[item.gradeIndex-1].id
                             }
                             }
-
-                            if(gradeID != classInfo[0].gradeId){
-                                _this.excelValid.gradeIds.push(item.id)
-                                _this.gradeNum++
-                            }
+                            // //不用设置年级,通过学级自动计算年级
+                            // if(gradeID != classInfo[0].gradeId){
+                            //     _this.excelValid.gradeIds.push(item.id)
+                            //     _this.gradeNum++
+                            // }
                         } else {
                         } else {
                             let data = array.filter( (i) => {
                             let data = array.filter( (i) => {
                                 return i.classId == item.classId && i.gradeIndex != item.gradeIndex
                                 return i.classId == item.classId && i.gradeIndex != item.gradeIndex

+ 22 - 8
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -49,12 +49,11 @@
                 </div>
                 </div>
                 <div class="sc-menu-right sc-text-no-select" v-if="authorizationStatus == false">
                 <div class="sc-menu-right sc-text-no-select" v-if="authorizationStatus == false">
                     <ul v-if="$access.can('admin.*|student-upd')">
                     <ul v-if="$access.can('admin.*|student-upd')">
-                        <!--授權管理開關-->
-                        <li @click="showAuthorization()">
+                        <!--授權管理開關 0531无法完成,暂时隐藏-->
+                        <!-- <li @click="showAuthorization()">
                             <Icon custom="iconfont icon-auth-key" color="white" size="18" />
                             <Icon custom="iconfont icon-auth-key" color="white" size="18" />
                             <span>{{ $t('stuAccount.menuAuth') }}</span>
                             <span>{{ $t('stuAccount.menuAuth') }}</span>
-                        </li>
-                        <!--授權管理開關-->
+                        </li> -->
                         <li @click="importStudent()">
                         <li @click="importStudent()">
                             <Icon type="md-arrow-round-up" color="white" size="18" />
                             <Icon type="md-arrow-round-up" color="white" size="18" />
                             <span>{{ $t('stuAccount.importStu') }}</span>
                             <span>{{ $t('stuAccount.importStu') }}</span>
@@ -199,7 +198,7 @@ export default {
             tableColumns: [],
             tableColumns: [],
             basicCount: 99,
             basicCount: 99,
             pointNum: 0,
             pointNum: 0,
-            academicYear: new Date().getFullYear(),
+            academicYear: new Date().getFullYear(), //这里需要根据学期计算当前学级
             isloading: true
             isloading: true
         }
         }
     },
     },
@@ -665,8 +664,6 @@ export default {
                 this.pointNum += this.basicCount
                 this.pointNum += this.basicCount
                 if (temp.length == 0) {
                 if (temp.length == 0) {
                     this.$Message.info(this.$t('stuAccount.isBottom'))
                     this.$Message.info(this.$t('stuAccount.isBottom'))
-                    //多语系后面统一处理
-                    //this.$Message.info(this.$t('已經到底了'))
                 } else {
                 } else {
                     this.tableShowData.push(...temp)
                     this.tableShowData.push(...temp)
                 }
                 }
@@ -675,7 +672,6 @@ export default {
         /**根据学段、年级、班级搜索 */
         /**根据学段、年级、班级搜索 */
         filterData: function () {
         filterData: function () {
             let data = this.students
             let data = this.students
-
             // 筛选没有关联班级的学生
             // 筛选没有关联班级的学生
             if (this.searchClassroom == 'noclass') {
             if (this.searchClassroom == 'noclass') {
                 if (this.searchClassroom) {
                 if (this.searchClassroom) {
@@ -735,6 +731,24 @@ export default {
         this.$store.dispatch('user/getSchoolProfile').then(
         this.$store.dispatch('user/getSchoolProfile').then(
             res => {
             res => {
                 this.schoolBase = res.school_base
                 this.schoolBase = res.school_base
+                //根据入学期计算当前学级
+                let pData = this.schoolBase.period.find(item => {
+                    return item.id == this.searchPeriod
+                })
+                if (pData) {
+                    let date = new Date()
+                    let curYear = date.getFullYear()
+                    let month = date.getMonth() + 1
+                    let start = pData.semesters.find(item => {
+                        return item.start == 1
+                    })
+                    // 根据入学月份确定当前年级和学级的关系
+                    if (start && month < start.month) {
+                        curYear--
+                    }
+                    this.academicYear = curYear
+                }
+                
             }
             }
         )
         )
         this.initData()
         this.initData()

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/MgtStuList.vue

@@ -49,7 +49,7 @@
                 </div>
                 </div>
                 <div class="stu-list-table dark-iview-table">
                 <div class="stu-list-table dark-iview-table">
                     <vuescroll>
                     <vuescroll>
-                        <Table :columns="listColumn" v-if="stuList[curIndex]" :data="students" @on-select="(selction)=>{rmSelctions = selction}" :loading="tableLoading" :no-data-text="$t('cusMgt.noStu')">
+                        <Table :columns="listColumn" v-if="stuList[curIndex]" :data="students" @on-selection-change="(selction)=>{rmSelctions = selction}" :loading="tableLoading" :no-data-text="$t('cusMgt.noStu')">
                             <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                             <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                             <template slot-scope="{ row }" slot="picture">
                             <template slot-scope="{ row }" slot="picture">
                                 <PersonalPhoto :name="row.name ? row.name : ''" :picture="row.picture" />
                                 <PersonalPhoto :name="row.name ? row.name : ''" :picture="row.picture" />