Ver código fonte

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

zhouj1203@hotmail.com 3 anos atrás
pai
commit
2d068b5532

+ 3 - 0
TEAMModelFunction/TEAMModelFunction.csproj

@@ -3,6 +3,9 @@
     <TargetFramework>netcoreapp3.1</TargetFramework>
     <AzureFunctionsVersion>v3</AzureFunctionsVersion>
     <_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
+    <Version>5.2107.29</Version>
+    <AssemblyVersion>5.2107.29.1</AssemblyVersion>
+    <FileVersion>5.2107.29.1</FileVersion>
   </PropertyGroup>
   <ItemGroup>
     <Compile Remove="AServiceBus.cs" />

+ 20 - 0
TEAMModelOS.SDK/Models/Cosmos/School/Area.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Models
+{
+    public class Area : CosmosEntity
+    {
+        public Area()
+        {
+            pk = "Area";
+        }
+        public string name { get; set; }
+
+        public string provCode { get; set; }
+        public string provName { get; set; }
+        public string cityCode { get; set; }
+        public string cityName { get; set; }
+    }
+}

+ 3 - 2
TEAMModelOS.SDK/Models/Cosmos/School/School.cs

@@ -46,8 +46,9 @@ namespace TEAMModelOS.SDK.Models
        /// 城市
        /// </summary>
         public string city { get; set; }
-        //郡县
-        public string county { get; set; }
+        //县,区,郡
+        public string dist { get; set; }
+        public string areaId { get; set; }
         /// <summary>
         ///授权给 学校的Blob 容器空间大小 单位为G
         ///1252748378/1024/1024/1024

+ 12 - 1
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css

@@ -25,7 +25,18 @@
 }
 .vote .option-repeat .ivu-input-number {
   margin-right: 10px;
-  width: 60px;
+  width: 100px;
+}
+.vote .option-repeat{
+  display: flex;
+  margin-bottom: 15px;
+  border: 1px solid #ccc;
+  padding: 8px 10px;
+  border-radius: 4px;
+}
+.vote .action-rep{
+  background-color: #19BE6B;
+  color: #fff;
 }
 .vote .checkAnswer {
   display: block;

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

@@ -150,7 +150,7 @@ export default {
                     router: '',
                     subName: 'schoolMgt',
                     role: 'admin',
-                    permission: 'schoolSetting-read|teacher-read|student-read|classroom-read|auth-read|course-read|syllabus-read|content-read|exercise-read|knowledge-read',
+                    permission: 'schoolSetting-read|teacher-read|student-read|classroom-read|auth-read|course-read',
                     child: [
                         // 基础设置
                         {
@@ -221,7 +221,7 @@ export default {
                     router: '',
                     subName: 'schoolRes',
                     role: 'admin|teacher',
-                    permission: 'schoolSetting-read|teacher-read|student-read|classroom-read|auth-read|course-read|syllabus-read|content-read|exercise-read|knowledge-read',
+                    permission: '',
                     child: [
                         // 校本课纲
                         {

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

@@ -7,7 +7,7 @@
 			<span :class="['canvas-tools-item',curMode === 'move' ? 'tools-active' : '']" @click="doMove()" style="border-radius: 15px 0 0 0;">
 				<Icon custom="iconfont icon-left-arrow" size="20"/>
 				<!-- <span>{{ Object.keys(vm).length ? vm.$t('utils.clear') : $t('utils.clear')  }}</span> -->
-				<span>{{ vm.$t('utils.choose') }}</span>
+				<span>{{ Object.keys(vm).length ? vm.$t('utils.choose') : $t('utils.choose') }}</span>
 			</span>
 			<span :class="['canvas-tools-item',curMode === 'paint' ? 'tools-active' : '']" @click="doPaint()">
 				<Poptip trigger="click">

+ 113 - 29
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -11,13 +11,13 @@
         <div>
             <div>
                 <!--超时-->
-                <!-- <div v-if="getItemTitle.endTime < (new Date()).getTime() && !voteRes.records.length">
+                <div v-show="!isVote && !isVoteOK">
                     <br />
                     <div class="dec animate__animated animate__bounceInLeft">
                         <svg-icon icon-class="handonHint" class="warm-icon" />
                         <span class="warm-hint">{{ $t("studentWeb.vote.timeoutHint") }}</span>
                     </div>
-                </div> -->
+                </div>
                 <div v-if="!showResult">
                     <div class="load-box">
                         <Load :active.sync="isLoad"
@@ -32,7 +32,12 @@
                         <div class="title-rect-group">
                             <!-- <div class="title-rect" /> -->
                             <h2 class="title-rect-name">{{ $t("studentWeb.vote.bollotbox") }}</h2>
-                            <p v-if="voteInfo.repeat" style="margin-left:15px;margin-top:2px">{{ $t("studentWeb.vote.surplusTickets")}} <span style="font-size:16px">{{voteCount}}</span><span> {{ $t("studentWeb.vote.tickets")}} </span></p>
+                            <p v-if="voteInfo.voteNum > 1 && isVote" style="margin-left:15px;margin-top:2px">
+                                {{ $t("studentWeb.vote.surplusTickets")}}
+                                <span style="font-size:16px" v-show="voteInfo.repeat">{{voteCount}}</span>
+                                <span style="font-size:16px" v-show="!voteInfo.repeat">{{ votesNum }}</span>
+                                <span> {{ $t("studentWeb.vote.tickets")}} </span>
+                            </p>
                         </div>
                         <Button v-show="isResult"
                                 style="float:right;margin-top:-30px"
@@ -47,30 +52,47 @@
                         <span v-html="voteInfo.description"></span>
                     </div> -->
                     <div class="vote-option">
-                        <!-- 1票
-                        <RadioGroup v-model="voteChecked" v-if="voteInfo.voteNum == 1" class="option-group">
-                            <Radio :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
+                        <!-- 1票 -->
+                        <RadioGroup v-model="radioCheck" v-if="voteInfo.voteNum == 1" class="option-group">
+                            <Radio border
+                                :label="item.code"
+                                v-for="(item, index) in voteInfo.options"
+                                :key="index"
+                                class="option-wrapper"
+                                :disabled="!isVote"
+                            >
                                 <span v-html="item.value"></span>
                             </Radio>
                         </RadioGroup>
-                        多票  不重复
-                        <CheckboxGroup v-model="voteChecked" v-if="voteInfo.voteNum > 1 && !voteInfo.repeat" class="option-group">
-                            <Checkbox :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
+                        <!-- 多票 -->
+                        <CheckboxGroup v-model="voteChecked" v-if="voteInfo.voteNum > 1 && !voteInfo.repeat" class="option-group" @on-change="controlNum">
+                            <Checkbox border
+                                :label="item.code"
+                                v-for="(item, index) in voteInfo.options"
+                                :key="index"
+                                class="option-wrapper"
+                                :disabled="!isVote"
+                            >
                                 <span v-html="item.value"></span>
                             </Checkbox>
                         </CheckboxGroup>
-                        多票  重复
-                        <CheckboxGroup v-model="voteChecked" v-if="voteInfo.voteNum > 1 && voteInfo.repeat" class="option-group option-repeat">
-                            <Checkbox :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
+                        <!-- 重复 -->
+                        <div v-if="voteInfo.voteNum > 1 && voteInfo.repeat">
+                            <div v-for="(item, index) in voteInfo.options"
+                                :key="index"
+                                :class="['option-repeat', {'action-rep': item.count}]"
+                            >
                                 <InputNumber v-model="item.count"
+                                            controls-outside
                                             :min="0"
                                             size="small"
                                             :formatter="value => `${value}` +$t('studentWeb.vote.tickets')"
+                                            :disabled="!isVote"
                                 ></InputNumber>
                                 <span v-html="item.value"></span>
-                            </Checkbox>
-                        </CheckboxGroup> -->
-                        <div class="checkAnswer" v-for="(item, index) in voteInfo.options" :key="index">  
+                            </div>
+                        </div>
+                        <!-- <div class="checkAnswer" v-for="(item, index) in voteInfo.options" :key="index">  
                             <label class="testBtn">
                                 <input type="checkbox" :value="item" v-model="voteChecked" @click="getVote(item)" />
                                 <div class="testbg">
@@ -87,12 +109,16 @@
                                     </InputNumber>
                                 </div>
                             </label>
-                        </div>
+                        </div> -->
                     </div>
-                    <Button :disabled="!isVote" size="large" type="success" @click="submitMessage()">
+                    <Button v-if="isVote || !isVoteOK" :disabled="!isVote" size="large" type="success" @click="submitMessage()">
                         <svg-icon icon-class="vote" class="uploadBtn-icon" />
                         <span style="margin-left:5px">{{ $t("studentWeb.vote.submitBVote") }}</span>
                     </Button>
+                    <Button v-if="isVoteOK" :disabled="true" size="large" type="success" @click="submitMessage()">
+                        <svg-icon icon-class="vote" class="uploadBtn-icon" />
+                        <span style="margin-left:5px">{{ $t("studentWeb.vote.submitOKVote") }}</span>
+                    </Button>
                     <span class="clickbutnoChoosehint"
                         v-if="clickbutnoChoose == true && voteChecked == ''">{{ $t("studentWeb.vote.note") }}</span>
                     <span v-if="isOverCount" style="margin-top:5px;margin-left:15px;color:red">{{$t("studentWeb.vote.warning2")}}</span>
@@ -146,15 +172,18 @@
         data() {
             return {
                 isHintNextItem: false,
-                voteChecked: [],
+                radioCheck: "", //单选
+                voteChecked: [], //多选——不重复
+                numChecked: 0, //多选——重复
                 WarmMessageisOpen: false,
-                clickbutnoChoose: false,
+                clickbutnoChoose: false, //没有选中选项
                 voteInfo: {}, //投票信息
                 // voteRes: {},
                 voteResData: [], //投票结果的数据
                 isVote: false, //不可以投票
+                isVoteOK: false, //已经投票
                 voteStatus:false,
-                voteNum: 0, //剩余投票数
+                votesNum: 0, //剩余投票数
                 showResult: false, //显示投票结果
                 chooseVoteRes: {},
                 isLoad: false,
@@ -179,16 +208,23 @@
                         if (res) {
                             // this.voteRes = res
                             this.timeStatus(this.voteInfo, res)
-                            this.voteResData = res.records.sort((a, b) => {
-                                return b > a
-                            })
-                            this.isLoad = false
+                            if(res.records.length) {
+                                this.voteResData = res.records.sort((a, b) => {
+                                    return b > a
+                                })
+                                this.isVoteOK = true
+                            }
                         }
+                    }).finally(() => {
+                        this.isLoad = false
                     })
                 }
             },
             //获取活动投票结果数据
             getVoteInfo() {
+                this.isOverCount = false
+                this.clickbutnoChoose = false
+                this.isVoteOK = false
                 if (this.getItemTitle.id) {
                     let params = {
                         "id": this.getItemTitle.id,
@@ -213,6 +249,7 @@
                                 for (let item of res.vote.options) {
                                     item.count = 0
                                 }
+                                this.votesNum = res.vote.voteNum
                                 this.voteInfo = res.vote
                                 if (res.vote.progress == "finish") {
                                     this.getVoteRecord()
@@ -406,9 +443,54 @@
                     data.count = 0
                 }
             },
+            // 多选框改变时
+            controlNum(arr) {
+                if(arr.length > this.voteInfo.voteNum) {
+                    this.isOverCount = true
+                    this.votesNum = 0
+                } else {
+                    this.isOverCount = false
+                    this.votesNum = this.voteInfo.voteNum - arr.length
+                }
+            },
             submitMessage() {
-                this.clickbutnoChoose = false;
-                if (this.voteChecked.length && this.voteChecked.length <= this.voteInfo.voteNum) {
+                // this.clickbutnoChoose = false;
+                if((!this.voteChecked.length && this.voteInfo.voteNum > 1) || (this.radioCheck === '' && this.voteInfo.voteNum === 1)) {
+                    this.clickbutnoChoose = true;
+                } else if ((this.voteChecked.length > this.voteInfo.voteNum || this.numChecked > this.voteInfo.voteNum) && this.voteInfo.voteNum > 1) {
+                    this.$Message.warning(this.$t("studentWeb.vote.warning2"))
+                } else {
+                    let params = {
+                        "id": this.getItemTitle.id,
+                        "code": this.getItemTitle.scode,
+                        "option": {}
+                    }
+                    if(this.voteInfo.voteNum > 1) {
+                        for (let item of this.voteChecked) {
+                            if (this.voteInfo.repeat) {
+                                params.option[item.code] = item.count
+                            } else {
+                                params.option[item] = 1
+                            }
+                        }
+                    } else {
+                        params.option[this.radioCheck] = 1
+                    }
+                    this.$api.studentWeb.sendVoteResult(params).then(res => {
+                        if (res.msgid == 1) {
+                            this.WarmMessageisOpen = true;
+                            this.getVoteInfo()
+                            setTimeout(() => {
+                                this.WarmMessageisOpen = false;
+                            }, 1000);
+                        } else {
+                            this.$Message.warning(this.$t('studentWeb.vote.warning'))
+                        }
+                    })
+                    this.voteChecked = []
+                    this.radioCheck = ""
+                }
+                /* if (this.voteChecked.length && this.voteChecked.length <= this.voteInfo.voteNum) {
                     let params = {
                         "id": this.getItemTitle.id,
                         "code": this.getItemTitle.scode,
@@ -421,6 +503,7 @@
                             params.option[item.code] = 1
                         }
                     }
+                    console.log(params);
                     this.$api.studentWeb.sendVoteResult(params).then(res => {
                         if (res.msgid == 1) {
                             this.WarmMessageisOpen = true;
@@ -437,7 +520,7 @@
                     this.clickbutnoChoose = true;
                 } else if (this.voteChecked.length > this.voteInfo.voteNum) {
                     this.$Message.warning(this.$t("studentWeb.vote.warning2"))
-                }
+                } */
             },
             cancelPreview() {
                 this.isHintNextItem = false;
@@ -456,16 +539,17 @@
             voteCount() {
                 if (this.voteInfo.voteNum !== undefined) {
                     let num = 0
-                    this.isVote = true
+                    // this.isVote = true
                     this.isOverCount = false
                     for (let item of this.voteInfo.options) {
                         if (item.count !== null) {
                             num += item.count
                         }
                     }
+                    this.numChecked = num
                     if (num > this.voteInfo.voteNum) {
                         this.isOverCount = true
-                        this.isVote = false
+                        // this.isVote = false
                         return 0
                     }
                     return this.voteInfo.voteNum - num

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js

@@ -239,6 +239,7 @@ export default {
         tickets: 'vote(s)',
         surplusTickets: 'Remaining votes',
         submitBVote: 'Submit to vote',
+        submitOKVote: '已投票',
         note: 'Please select at least one option before voting! ',
         warning: 'Voting failed, please check the polling information! ',
         warning2: 'The maximum number of votes has been exceeded! ',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js

@@ -240,6 +240,7 @@ export default {
         tickets: '票',
         surplusTickets: '剩余票数',
         submitBVote: '提交投票',
+        submitOKVote: '已投票',
         note: '请至少选择一个选项,再进行投票!',
         warning: '投票失败,请检查投票信息!',
         warning2: '已超出最大投票数!',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js

@@ -239,6 +239,7 @@ export default {
         tickets: '票',
         surplusTickets: '剩餘票數',
         submitBVote: '提交投票',
+        submitOKVote: '已投票',
         note: '請至少選擇一個選項,再進行投票! ',
         warning: '投票失敗,請檢查投票信息! ',
         warning2: '已超出最大投票數! ',

+ 1 - 1
TEAMModelOS/ClientApp/src/store/module/config.js

@@ -32,7 +32,7 @@ export default {
                 },
                 {
                     station: 'test',
-                    url: 'https://ies5-test.azurewebsites.net'
+                    url: 'https://test.teammodel.net'
                 },
             ]
         }

+ 25 - 17
TEAMModelOS/ClientApp/src/view/evaluation/components/BasePointPie.vue

@@ -81,28 +81,36 @@
 		},
 		mounted() {
 			let arr = []
-			let tempArr = []
+			let pointList = []
 			this.echartsData.item.forEach(i => {
 				if (i.type === 'compose' && i.children.length) {
-					tempArr.push(...i.children)
+					i.children.forEach(j => {
+						pointList.push(...j.knowledge)
+					})
 				} else {
-					tempArr.push(i)
+					pointList.push(...i.knowledge)
 				}
 			})
-			let typeList = this._.groupBy(tempArr, 'knowledge')
-			for (let key in typeList) {
-				let newKey = key === 'undefined' || !key ? this.$t('evaluation.noPoints') : key
-				let isExistIndex = arr.map(i => i.name).indexOf(newKey)
-				if (arr.length && isExistIndex > -1) {
-					arr[isExistIndex].value = arr[isExistIndex].value + typeList[key].length
-				} else {
-					arr.push({
-						value: typeList[key].length,
-						name: newKey
-					})
-				}
-
-			}
+			let pointArr = [...new Set(pointList)]
+			pointArr.forEach((i,index) => {
+				arr.push({
+					value: 0,
+					name: i
+				})
+				this.echartsData.item.forEach(k => {
+					if (k.type === 'compose' && k.children.length) {
+						k.children.forEach(j => {
+							if(j.knowledge && Array.isArray(j.knowledge) && j.knowledge.includes(i)){
+								arr[index].value++
+							}
+						})
+					} else {
+						if(k.knowledge && Array.isArray(k.knowledge) && k.knowledge.includes(i)){
+							arr[index].value++
+						}
+					}
+				})
+			})
 			this.drawLine(arr)
 		},
 		computed: {

+ 20 - 13
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -34,7 +34,6 @@
                         <div v-for="(item,index) in courseListShow" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
                             <p class="course-name">
                                 {{item.name}}
-                                <!-- <Icon type="ios-information-circle-outline" @click="toggleCusInfo" :title="$t('cusMgt.cusInfo')" /> -->
                             </p>
                             <p class="course-code">
                                 <Icon type="md-pricetags" />
@@ -516,10 +515,10 @@ export default {
     methods: {
         copyUrl() {
             this.$copyText(this.inviteUrl).then(
-                ok=>{
+                ok => {
                     this.$Message.success(this.$t("settings.copyModal1"))
                 },
-                fail=>{
+                fail => {
                     this.$Message.error(this.$t("settings.copyModal2"))
                 }
             )
@@ -558,7 +557,7 @@ export default {
                 return item.scope == this.listType
             })
             this.selectCourse(0)
-            
+
         },
         //显示课表模式
         showSchedule() {
@@ -655,15 +654,19 @@ export default {
                         res.stus.forEach(item => {
                             //TODO 设置班级名称
                             item.type = 'school'
-                            let curClass = this.classList.find(classItem => {
-                                return classItem.id == item.classId
-                            })
-                            item.className = curClass ? curClass.name : '- -'
+                            //老师还在学校,被移除学校后这里就拿不到学校的数据了
+                            if (this.classList) {
+                                let curClass = this.classList.find(classItem => {
+                                    return classItem.id == item.classId
+                                })
+                                item.className = curClass ? curClass.name : '—'
+                            }
                         })
                         res.tmdinfos = res.tmdinfos || []
                         res.tmdinfos.forEach(item => {
                             item.type = 'TMID'
                         })
+                        console.log('学生信息', JSON.stringify(res))
                         this.$set(this.courseListShow[this.curCusIndex].schedule[this.curClassIndex], 'allStu', res.stus.concat(res.tmdinfos))
                         this.$set(this.courseListShow[this.curCusIndex].schedule[this.curClassIndex], 'fullStu', true)
                     }
@@ -828,12 +831,15 @@ export default {
                         this.$api.courseMgmt.upsertStulist(params).then(
                             res => {
                                 this.$Message.success(this.$t('cusMgt.delOk'))
-                                for (let i = 0; i < schedule.students.length; i++) {
-                                    if (delIds.indexOf(schedule.students[i].id) > -1) {
-                                        schedule.students.splice(i, 1)
-                                        i--
+                                if (schedule) {
+                                    for (let i = 0; i < schedule.students.length; i++) {
+                                        if (delIds.indexOf(schedule.students[i].id) > -1) {
+                                            schedule.students.splice(i, 1)
+                                            i--
+                                        }
                                     }
                                 }
+                                // this.getCusInfo()
                             },
                             err => {
                                 this.$Message.error(this.$t('cusMgt.delErr'))
@@ -1011,7 +1017,7 @@ export default {
                 }
                 clientId = this.$store.state.config.China.clientID
                 accUrl = this.$store.state.config.China.accAPIUrl
-            } 
+            }
             // accUrl = 'https://account-rc.teammodel.cn' //暂时使用,待总部部署最新代码,已部署
             let state = this.$jsFn.getBtwRandom(1000, 9999)
             let idToken = localStorage.getItem('id_token')
@@ -1238,6 +1244,7 @@ export default {
             }).then(
                 res => {
                     this.$Message.success(this.$t('cusMgt.updateOk'))
+                    this.getCusInfo()
                 }
             ).catch(() => {
                 this.$Message.error(this.$t('cusMgt.updateErr'))

+ 45 - 5
TEAMModelOS/ClientApp/src/view/teachermgmt/components/userList/Index.vue

@@ -421,10 +421,10 @@ export default {
                     show: true,
                     width: 260,
                     render: (h, params) => {
-                        let p = ['content-read','exercise-read','knowledge-read','syllabus-read']
+                        let p = ['content-read', 'exercise-read', 'knowledge-read', 'syllabus-read']
                         let flag = false
-                        params.row.permissions.forEach(item=>{
-                            if(!p.includes(item)){
+                        params.row.permissions.forEach(item => {
+                            if (!p.includes(item)) {
                                 flag = true
                             }
                         })
@@ -666,7 +666,14 @@ export default {
                         sortable: true,
                         show: true,
                         render: (h, params) => {
-                            if (params.row.permissionCount > 0) {
+                            let p = ['content-read', 'exercise-read', 'knowledge-read', 'syllabus-read']
+                            let flag = false
+                            params.row.permissions.forEach(item => {
+                                if (!p.includes(item)) {
+                                    flag = true
+                                }
+                            })
+                            if (flag) {
                                 return h(
                                     'span',
                                     {
@@ -679,6 +686,19 @@ export default {
                             } else {
                                 return h('span', this.$t('teachermgmt.table.text1'))
                             }
+                            // if (params.row.permissionCount > 0) {
+                            //     return h(
+                            //         'span',
+                            //         {
+                            //             style: {
+                            //                 color: '#1CC0F3'
+                            //             }
+                            //         },
+                            //         this.$t('teachermgmt.table.text2')
+                            //     )
+                            // } else {
+                            //     return h('span', this.$t('teachermgmt.table.text1'))
+                            // }
                         }
                     },
                     {
@@ -747,7 +767,14 @@ export default {
                         show: true,
                         width: 260,
                         render: (h, params) => {
-                            if (params.row.permissionCount > 0) {
+                            let p = ['content-read', 'exercise-read', 'knowledge-read', 'syllabus-read']
+                            let flag = false
+                            params.row.permissions.forEach(item => {
+                                if (!p.includes(item)) {
+                                    flag = true
+                                }
+                            })
+                            if (flag) {
                                 return h(
                                     'span',
                                     {
@@ -760,6 +787,19 @@ export default {
                             } else {
                                 return h('span', this.$t('teachermgmt.table.text1'))
                             }
+                            // if (params.row.permissionCount > 0) {
+                            //     return h(
+                            //         'span',
+                            //         {
+                            //             style: {
+                            //                 color: '#1CC0F3'
+                            //             }
+                            //         },
+                            //         this.$t('teachermgmt.table.text2')
+                            //     )
+                            // } else {
+                            //     return h('span', this.$t('teachermgmt.table.text1'))
+                            // }
                         }
                     },
                     {

+ 3 - 2
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -558,10 +558,11 @@ namespace TEAMModelOS.Controllers.Client
 
                 //取得School Blob 容器位置及SAS
                 string school_code_blob = school_code.GetString().ToLower();
-                var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List); //讀
+                var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List); //讀列
+                var (blob_uri_read, blob_sas_read) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Read); //讀
                 var (blob_uri_write, blob_sas_write) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Write); //寫
 
-                return Ok(new { blob_uri, blob_sas, blob_sas_write,  periods, grades, subjects, courses, examTypes, exams });
+                return Ok(new { blob_uri, blob_sas, blob_sas_read, blob_sas_write,  periods, grades, subjects, courses, examTypes, exams });
             }
             catch (Exception ex)
             {

+ 22 - 8
TEAMModelOS/Controllers/School/CourseController.cs

@@ -452,17 +452,17 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                string originCode = stuList.code.Replace("StuList-","");
+                
                 //todo 需要校验是否重复
                 if (string.IsNullOrEmpty(stuList.no))
                 {
                     stuList.no = $"{Utils.CreatSaltString(6, "0123456789")}";
-                    string table = $"{scope}" != "school" ? "Teacher" : "School";
+                    //string table = $"{scope}" != "school" ? "Teacher" : "School";
                     for (int i = 0; i < 10; i++)
                     {
                         var queryNo = $"SELECT  c.no  FROM c where  c.no ='{stuList.no}'";
                         List<string> noStus = new();
-                        await foreach (var item in client.GetContainer("TEAMModelOS", $"{table}").GetItemQueryStreamIterator(queryText: queryNo,
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: queryNo,
                                 requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{stuList.code}") }))
                         {
                             using var jsonNo = await JsonDocument.ParseAsync(item.ContentStream);
@@ -476,6 +476,20 @@ namespace TEAMModelOS.Controllers
                                 }
                             }
                         }
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: queryNo,
+                                requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey("StuList") }))
+                        {
+                            using var jsonNo = await JsonDocument.ParseAsync(item.ContentStream);
+                            if (jsonNo.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                            {
+                                var accounts = jsonNo.RootElement.GetProperty("Documents").EnumerateArray();
+                                while (accounts.MoveNext())
+                                {
+                                    JsonElement account = accounts.Current;
+                                    noStus.Add(account.GetProperty("no").GetString());
+                                }
+                            }
+                        }
                         if (noStus.Count == 0)
                         {
                             break;
@@ -504,14 +518,14 @@ namespace TEAMModelOS.Controllers
                     {
                         listid= stuList.id,
                         scope = $"{scope}",
-                        originCode = originCode,
+                        originCode = stuList.school,
                         school=stuList.school,
                         creatorId=stuList.creatorId
                     };
                     var query = $"SELECT distinct value(c)  FROM c where  c.id='{stuList.id}'";
                     List<StuList> odlStus = new List<StuList>();
                     await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<StuList>(queryText: query,
-                            requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{originCode}") }))
+                            requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{stuList.school}") }))
                     {
                         odlStus.Add(item);
                     }
@@ -572,7 +586,7 @@ namespace TEAMModelOS.Controllers
                             await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
                         }
                     }
-                    stuList = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(stuList, new PartitionKey($"StuList-{originCode}"));
+                    stuList = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(stuList, new PartitionKey($"StuList-{stuList.school}"));
                 }
                 else
                 {
@@ -581,7 +595,7 @@ namespace TEAMModelOS.Controllers
                     {
                         listid= stuList.id,
                         scope = $"{scope}",
-                        originCode = originCode,
+                        originCode = stuList.creatorId,
                         school = stuList.school,
                         creatorId = stuList.creatorId
                     };
@@ -741,7 +755,7 @@ namespace TEAMModelOS.Controllers
                 List<string> ids = new();
                 ids = classId.ToObject<List<string>>();
                 //List<Students> stu = new();
-                var query = $"select c.id,c.name,c.students,c.tmids,c.no from c where c.id in ({string.Join(",", ids.Select(o => $"'{o}'"))})";
+                var query = $"select c.id,c.name,c.students,c.tmids,c.no,c.code,c.scope,c.school,c.creatorId from c where c.id in ({string.Join(",", ids.Select(o => $"'{o}'"))})";
                 if (scope.ToString().Equals("school", StringComparison.OrdinalIgnoreCase))
                 {
                     await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{code}") }))

+ 1 - 1
TEAMModelOS/Controllers/School/SchoolTeacherController.cs

@@ -308,7 +308,7 @@ namespace TEAMModelOS.Controllers
                         writer.WriteString("groupName", "默认组别");
                         writer.WriteString("picture", picture.ToString());
                         writer.WriteNull("job");
-                        writer.WriteNumber("size", 1);
+                        writer.WriteNumber("size", 0);
                         writer.WriteStartArray("roles");
                         writer.WriteStringValue("teacher");
                         writer.WriteEndArray();

+ 6 - 1
TEAMModelOS/Startup.cs

@@ -7,6 +7,7 @@ using System.Text;
 using System.Text.Json;
 using System.Threading;
 using System.Threading.Tasks;
+using Azure.Storage.Blobs.Models;
 using HTEXLib.Builders;
 using HTEXLib.Translator;
 using Lib.AspNetCore.ServerSentEvents;
@@ -145,12 +146,16 @@ namespace TEAMModelOS
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AzureStorageFactory _azureStorage)
         {
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();
             }
+            //解决blob播放视频无法支持Accept-Ranges:  bytes 的问题
+            BlobServiceProperties prop = _azureStorage.GetBlobServiceClient().GetProperties();
+            prop.DefaultServiceVersion = "2018-03-28";
+            _azureStorage.GetBlobServiceClient().SetProperties(prop);
             //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回BadRequert 400,並選擇需要返回釘釘群組回報的API
             //app.UseMiddleware<HttpGlobalExceptionInvoke>();
 

+ 3 - 3
TEAMModelOS/TEAMModelOS.csproj

@@ -37,9 +37,9 @@
     <SpaRoot>ClientApp\</SpaRoot>
     <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
     <UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-    <Version>5.2107.29</Version>
-    <AssemblyVersion>5.2107.29.1</AssemblyVersion>
-    <FileVersion>5.2107.29.1</FileVersion>
+    <Version>5.2108.02</Version>
+    <AssemblyVersion>5.2108.02.2</AssemblyVersion>
+    <FileVersion>5.2108.02.2</FileVersion>
     <Description>修复学生端扫码加入课程名单,联动触发相关课程和活动。</Description>
     <PackageReleaseNotes>版本说明</PackageReleaseNotes>
   </PropertyGroup>