Parcourir la source

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

CrazyIter_Bin il y a 2 ans
Parent
commit
0f4915c844

+ 49 - 15
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -111,6 +111,15 @@
               <div class="schoolLeft" v-loading="loadingSchoolList" element-loading-text="数据加载中..." v-if="PowerShow">
                 <div class="haveSchool-title">
                   <div>{{ $t(`areaManages.operational.areaAddSchool.schooltitle`) }}</div>
+                  <div class="search-school">
+                    <el-input v-model="schoolSeach" placeholder="输入学校名称搜索" size="small" clearable>
+                      <!-- <template #prepend>
+                        <svg class="addrelevancy-icon" aria-hidden="true">
+                          <use xlink:href="#icon-sousuo3-copy"></use>
+                        </svg>
+                      </template> -->
+                    </el-input>
+                  </div>
                   <div class="synchronization-title" v-show="currentlySelect.cutArea"><span>已同步省平台</span></div>
                 </div>
                 <ul>
@@ -122,9 +131,9 @@
                       <div>
                         {{$t(`areaManages.operational.areaAddSchool.schoolList.name`)}}:<span>{{ item.name }}</span>
                       </div>
-                      <div>
+                      <!-- <div>
                         {{$t(`areaManages.operational.areaAddSchool.schoolList.grading`)}}:<span>{{ item.period[0] }}</span>
-                      </div>
+                      </div> -->
                       <div>
                         {{$t(`areaManages.operational.areaAddSchool.schoolList.code`)}}:<span>{{ item.id }}</span>
                       </div>
@@ -330,11 +339,6 @@
                       <div class="table-not-title">未管理学校列表</div>
                       <div class="searchSc-box">
                         <el-input v-model="manaNotValue" placeholder="搜索 学校名称/简码" class="input-with-select" size="small" clearable>
-                          <template #prepend>
-                            <svg class="addrelevancy-icon" aria-hidden="true">
-                              <use xlink:href="#icon-sousuo3-copy"></use>
-                            </svg>
-                          </template>
                         </el-input>
                       </div>
                       <el-table :data="adminSchoold.not" style="width: 100%" max-height="55vh" height="55vh" v-loading="adminSchoold.loading" element-loading-text="数据加载中..." empty-text="暂无数据" size="small" @selection-change="addSelectSchool">
@@ -593,7 +597,7 @@ import { useRouter } from 'vue-router'
 import Ability from '@/components/Ability.vue'
 import option from '@/static/region.json'
 import loadingsz from '@/components/loading/partial.vue'
-import { CopyDocument, ArrowRight, ArrowLeft } from '@element-plus/icons-vue'
+import { CopyDocument, ArrowRight, ArrowLeft, Search } from '@element-plus/icons-vue'
 import useClipboard from 'vue-clipboard3'
 import jwt_decode from 'jwt-decode'
 const optionsData = option
@@ -603,7 +607,8 @@ export default {
     loadingsz,
     CopyDocument,
     ArrowRight,
-    ArrowLeft
+    ArrowLeft,
+    Search
   },
   setup () {
     let { proxy } = getCurrentInstance()
@@ -630,6 +635,7 @@ export default {
     let adjustmentbox = ref(false)
     let activeName = ref('add')
     let notjoinSchool = ref([])
+    let notjoinPrimitive = ref([])
     let position = ref()
     let cutbtnTitle = ref({
       name: '切换微能力方案',
@@ -706,6 +712,8 @@ export default {
     //学校搜索(左右框内)
     let manaNotValue = ref('')
     let manaJoinValue = ref('')
+    //未加入学区学校搜索
+    let schoolSeach = ref('')
     onMounted(() => {
       provinceOptions.value.optionInfo = optionsData
     })
@@ -770,13 +778,13 @@ export default {
       loadingSchoolList.value = true
       console.log(currentlySelect.value.id)
       proxy.$api
-        .getNotjoinSchool({})
+        .getNotjoinSchool({ areaId: '' })
         .then((res) => {
           console.log(res, '获取未加入区域的学校')
           res.state === 200
             ? ((notjoinSchool.value = []),
-              notjoinSchool.value.push(...res.notAreaSchools),
-              (loadingSchoolList.value = false))
+              notjoinSchool.value.push(...res.notAreaSchools), notjoinPrimitive.value.push(...res.notAreaSchools)
+                (loadingSchoolList.value = false))
             : ''
         })
     }
@@ -1252,6 +1260,12 @@ export default {
       })
       adminSchoold.value.data = newArr
     }
+    //学校列表 未加入学区
+    function notjoinSchoolarea () {
+      let values = schoolSeach.value
+      let newdata = notjoinPrimitive.value.filter((item) => { return item.name.includes(values) })
+      notjoinSchool.value = newdata
+    }
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       newdata
@@ -1276,6 +1290,14 @@ export default {
         optionData.value = originalDatas.value
       }
     })
+    watch(schoolSeach, (newdata) => {
+      // console.log(newdata, '触发搜索内容')
+      if (newdata.trim().length !== 0) {
+        debounce(notjoinSchoolarea, 500)
+      } else {
+        notjoinSchool.value = notjoinPrimitive.value
+      }
+    })
     watch(manaNotValue, (newvalue) => {
       if (newvalue.trim().length !== 0) {
         debounce(searchSchools, 500)
@@ -1365,7 +1387,10 @@ export default {
       manaJoinValue,
       userRoles,
       removeList,
-      removeSelect
+      removeSelect,
+      schoolSeach,
+      notjoinSchoolarea,
+      notjoinPrimitive
     }
   },
 }
@@ -1447,6 +1472,7 @@ export default {
 .list-school-name {
   width: 65%;
   padding-left: 1%;
+  margin-top: 1.5%;
 }
 
 .list-school-name div {
@@ -1736,11 +1762,19 @@ export default {
 }
 .haveSchool-title {
   width: 100%;
-  line-height: 20px;
+  line-height: 40px;
 }
 .haveSchool-title div {
   display: inline-block;
-  vertical-align: top;
+  /* vertical-align: top; */
+  width: 20%;
+}
+.search-school {
+  width: 50% !important;
+  vertical-align: center;
+}
+.search-school div {
+  width: 100%;
 }
 .synchronization-title {
   float: right;

+ 22 - 16
TEAMModelBI/ClientApp/src/view/index/index.vue

@@ -2255,21 +2255,27 @@ export default {
             })
           }
           console.log(replaceTime, '345345')
-          if (siteValue.value === 'china') {
-            replaceTime.forEach((q) => {
-              nowTimeQuantum.value.classTime.push(q.time)
-              nowTimeQuantum.value.classinToday.push(q.schoolClass)
-              nowTimeQuantum.value.todayUpload.push(q.teachClass)
-              nowTimeQuantum.value.totalattendClass.push(parseInt(q.schoolClass))
-            })
-          } else if (siteValue.value === 'international') {
-            replaceTime.forEach((q) => {
-              worldnowTimeQuantum.value.classTime.push(q.time)
-              worldnowTimeQuantum.value.classinToday.push(q.schoolClass)
-              worldnowTimeQuantum.value.todayUpload.push(q.teachClass)
-              worldnowTimeQuantum.value.totalattendClass.push(parseInt(q.schoolClass))
-            })
-          }
+          replaceTime.forEach((q) => {
+            nowTimeQuantum.value.classTime.push(q.time)
+            nowTimeQuantum.value.classinToday.push(q.schoolClass)
+            nowTimeQuantum.value.todayUpload.push(q.teachClass)
+            nowTimeQuantum.value.totalattendClass.push(parseInt(q.schoolClass))
+          })
+          // if (siteValue.value === 'china') {
+          //   replaceTime.forEach((q) => {
+          //     nowTimeQuantum.value.classTime.push(q.time)
+          //     nowTimeQuantum.value.classinToday.push(q.schoolClass)
+          //     nowTimeQuantum.value.todayUpload.push(q.teachClass)
+          //     nowTimeQuantum.value.totalattendClass.push(parseInt(q.schoolClass))
+          //   })
+          // } else if (siteValue.value === 'international') {
+          //   replaceTime.forEach((q) => {
+          //     worldnowTimeQuantum.value.classTime.push(q.time)
+          //     worldnowTimeQuantum.value.classinToday.push(q.schoolClass)
+          //     worldnowTimeQuantum.value.todayUpload.push(q.teachClass)
+          //     worldnowTimeQuantum.value.totalattendClass.push(parseInt(q.schoolClass))
+          //   })
+          // }
 
           console.log(nowTimeQuantum.value.todayUpload, '999999999999999999')
           //处理课例活跃数据(今日)
@@ -3122,7 +3128,7 @@ export default {
         totalArea.value.dynamic.series[1].data = nowTimeQuantum.value.classinToday
         totalArea.value.dynamic.series[2].data = nowTimeQuantum.value.yesterdayUpload
         totalArea.value.dynamic.series[3].data = nowTimeQuantum.value.classinYesterday
-        getClassLivelys()
+        // getClassLivelys()
       } else if (val === 'allmonth') {
         let month = date.getMonth() + 1
         console.log(month)

+ 1 - 1
TEAMModelBI/ClientApp/src/view/participation/setPhase.vue

@@ -718,7 +718,7 @@ export default {
       //   .getNowscholl({ schoolId: data })
       //   .then((res) => {
       //     console.log(res, '返回的res内容')
-      //     res.state === 200 ? ((schoolData = res.schoolAssists), conductData(res.schoolAssists),store.commit('getSchoolPeriod',res.schoolAssists.period)) : ''
+      //     res.state === 200 ? ((schoolData = res.schoolAssists), conductData(res.schoolAssists)) : ''
       //   })
       //   .catch((res) => {
       //     ElMessage.error('获取学校数据异常')

+ 37 - 18
TEAMModelBI/ClientApp/src/view/systemConfig/correlation.vue

@@ -37,7 +37,7 @@
                 <el-table-column prop="name" label="目前顾问" /> -->
         <el-table-column align="center">
           <template #header>
-            <el-select v-model="areaList.value" placeholder="Select" size="small" @change="getAreaschool">
+            <el-select v-model="areaList.existValue" placeholder="Select" size="small" @change="correlaSchool">
               <el-option v-for="item in areaList.data" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </template>
@@ -86,7 +86,9 @@
               </el-select>
             </template>
             <template #default="scope">
-              <span class="areaitem-name">{{scope.row.areaName}}</span><span class="areaitem-insti">({{scope.row.institution}})</span>
+              <span class="areaitem-name">{{scope.row.areaName}}</span>
+              <span class="areaitem-insti" v-if="scope.row.institution">({{scope.row.institution}})</span>
+              <span class="areaitem-insti" v-else>{{scope.row.institution}}</span>
             </template>
           </el-table-column>
           <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow">
@@ -103,18 +105,24 @@
 import { ref, getCurrentInstance, watch, onMounted } from 'vue'
 import { ElMessage, ElLoading, ElMessageBox } from 'element-plus'
 import { Search } from '@element-plus/icons'
+import { useStore } from 'vuex'
 export default {
   props: {
     userdata: {
       type: Object,
       default: () => { },
     },
+    areadata: {
+      type: Object,
+      default: () => [],
+    }
   },
   components: {
     Search
   },
   setup (props) {
     let { proxy } = getCurrentInstance()
+    const store = useStore()
     let PowerShow = proxy.$access.identifyPosition(JSON.parse(localStorage.getItem('id_token')))
     const tableDatas = ref([])
     let tableData = ref([])
@@ -131,11 +139,14 @@ export default {
       list: false,
     })
     let areaList = ref({
+      existValue: 'all',
       value: 'all',
       data: [
         { value: 'all', label: '全部', situate: 'all' },
       ]
     })
+    //关联筛选原始data
+    let correlaData = ref([])
     onMounted(() => {
       //监听表格滚动事件
       // let table = mutipleTable.value._value.layout.table.refs.bodyWrapper;
@@ -150,16 +161,13 @@ export default {
         console.log(scrollHeight.value, '值')
       }
     }
-    async function getSchoolList (value, state) {
+    function getSchoolList (value, state) {
       console.log(value, nextpageToken.value, '触发下一页')
       if ((nextpageToken.value === null) && state !== 'restart') {
         ElMessage.success('已经到最底了')
         return
       }
       loadingData.value.list = true
-      if (areaList.value.data.length === 1) {
-        await areaData()
-      }
       let data = value ? { contToken: value } : {}
       proxy.$api
         .getSchooldata(data)
@@ -185,7 +193,6 @@ export default {
               res.schoolAssists[y].areaName = ''
               res.schoolAssists[y].institution = ''
               for (let i in areaList.value.data) {
-                console.log(areaList.value.data[i], '循环的值')
                 areaValue === areaList.value.data[i].value ? (res.schoolAssists[y].areaName = areaList.value.data[i].label, res.schoolAssists[y].institution = areaList.value.data[i].situate) : ''
               }
             }
@@ -310,10 +317,10 @@ export default {
         }
         schoolName = schoolName + '等...'
       }
-      ElMessageBox.confirm(`请问您确定将 ${schoolName} 移除学校管理,取消数据关联吗 ?`, '取消关联学校', {
+      ElMessageBox.confirm(`请问您确定将 ${schoolName} 移除学校关联,取消数据关联吗 ?`, '取消关联学校', {
         confirmButtonText: proxy.$t(`commonMsg.confirm`),
         cancelButtonText: proxy.$t(`commonMsg.closes`),
-        type: 'success',
+        type: 'warning',
         center: true,
       }).then(() => {
         let schoolArr = []
@@ -390,7 +397,7 @@ export default {
     async function areaData () {
       await proxy.$api.getCapacity({}).then((res) => {
         console.log(res, '学区信息')
-        res.state === 200 ? res.areas.forEach((item) => { areaList.value.data.push({ value: item.id, label: item.name, situate: item.institution }) }) : ''
+        res.state === 200 ? (res.areas.forEach((item) => { areaList.value.data.push({ value: item.id, label: item.name, situate: item.institution }) }), store.commit('getPoint', areaList.value.data)) : ''
       }).catch((error) => {
         ElMessage.error('API异常,获取学区失败')
       })
@@ -428,23 +435,32 @@ export default {
         })
       }
     }
+    //关联的筛选
+    function correlaSchool (value) {
+      console.log(value, '筛选')
+      let targetId = value
+      if (targetId === 'all') {
+        nowUsers.value.handleSchools = correlaData.value
+      } else {
+        let filterData = nowUsers.value.handleSchools.filter((item) => {
+          return item.areaId === targetId
+        })
+        nowUsers.value.handleSchools = filterData
+      }
+    }
     //处理显示目前关联的
-    async function nowRelevance (value) {
+    function nowRelevance (value) {
       nowUsers.value = JSON.parse(JSON.stringify(value))
-      if (areaList.value.data.length === 1) {
-        await areaData()
-      }
-      getSchoolList()
       let nowUserdata = nowUsers.value
       nowUserdata.handleSchools.forEach((item) => {
         let areaIds = item.areaId
         item.areaName = ''; item.institution = ''
         for (let i of areaList.value.data) {
-          console.log(i, '值123')
           i.value === areaIds ? (item.areaName = i.label, item.institution = i.situate) : ''
         }
       })
       nowUsers.value.handleSchools = nowUserdata.handleSchools
+      correlaData.value = nowUserdata.handleSchools
       loadingData.value.possess = false
     }
     watch(scrollHeight, (newdata, olddata) => {
@@ -456,7 +472,7 @@ export default {
     watch(
       props,
       (newuser) => {
-        newuser ? (nowRelevance(newuser.userdata), processingSchool(true)) : ''
+        newuser ? (areaList.value.data.push(...newuser.areadata), nowRelevance(newuser.userdata), processingSchool(true)) : ''
         console.log(nowUsers.value, '触发监听')
       },
       { immediate: true, deep: true }
@@ -468,6 +484,7 @@ export default {
         tableData.value = original.value
       }
     })
+    getSchoolList()
     // areaData()
     return {
       tableData,
@@ -492,7 +509,9 @@ export default {
       removeBatchschool,
       multipeRemove,
       removeBatch,
-      nowRelevance
+      nowRelevance,
+      correlaData,
+      correlaSchool
     }
   },
 }

Fichier diff supprimé car celui-ci est trop grand
+ 568 - 377
TEAMModelBI/ClientApp/src/view/systemConfig/manageschool.vue


+ 15 - 4
TEAMModelBI/ClientApp/src/view/teachermanage/manage.vue

@@ -95,10 +95,10 @@
           <Operates ref="roaming" :userdata="nowUser" @changeShow="changeState"></Operates>
         </el-tab-pane>
         <el-tab-pane label="关联学校" name="second" v-if="(nowUser.handleRoles.includes('assist') || nowUser.handleRoles.includes('admin') || nowUser.handleRoles.includes('sales')) && nowUser.tmdId !==''">
-          <Correlation :userdata="nowUser"></Correlation>
+          <Correlation :userdata="nowUser" :areadata="areaDatas"></Correlation>
         </el-tab-pane>
         <el-tab-pane label="管理学校" name="manegeschool" v-if="nowUser.tmdId !==''">
-          <Manageschool :userdata="nowUser"></Manageschool>
+          <Manageschool :userdata="nowUser" :areadata="areaDatas"></Manageschool>
         </el-tab-pane>
       </el-tabs>
       <div class="changeBtn" v-show="activeName === 'first'">
@@ -220,6 +220,7 @@ export default {
     let activeName = ref('first')
     let drawerChange = ref(false)
     let roaming = ref()
+    let areaDatas = ref([])
     const identityArr = [
       {
         value: 'rdc',
@@ -310,7 +311,6 @@ export default {
     function handleClick (index, data) {
       console.log(index, data, 'click')
       nowUser.value = data[index]
-      console.log(nowUser.value)
       drawer.value = true
       console.log(nowUser.value)
       // let userData = data.value[index]
@@ -474,6 +474,14 @@ export default {
         return val2.handleSchools.length - val1.handleSchools.length
       })
     }
+    function areaData () {
+      proxy.$api.getCapacity({}).then((res) => {
+        console.log(res, '学区信息')
+        res.state === 200 ? (res.areas.forEach((item) => { areaDatas.value.push({ value: item.id, label: item.name, situate: item.institution }) }), store.commit('getPoint', areaDatas.value)) : ''
+      }).catch((error) => {
+        ElMessage.error('API异常,获取学区失败')
+      })
+    }
     watch(filterText, (newdata) => {
       if (newdata.trim().length !== 0) {
         debounce(personnelSearch, 500)
@@ -481,6 +489,7 @@ export default {
         tableData.value = original.value
       }
     })
+    areaData()
     return {
       proxy,
       store,
@@ -516,7 +525,9 @@ export default {
       changeSubmit,
       roaming,
       schoolSort,
-      identityArr
+      identityArr,
+      areaData,
+      areaDatas
     }
   },
 }

+ 5 - 6
TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs

@@ -69,16 +69,13 @@ namespace TEAMModelBI.Controllers.BINormal
                 //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 var isManyArea = false;
                 if (!string.IsNullOrEmpty($"{_isDefalue}"))
-                {
                     isManyArea = true;
-                }
-
                 List<JoinAreaSchool> joinAreaSchools = new();
                 string sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c WHERE c.areaId='{_areaId}'";
 
                 if (isManyArea)
                 {
-                    sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE c.areaId ='{_areaId}' or m.areaId='{_areaId}'";
+                    sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE (c.areaId ='{_areaId}' or m.areaId='{_areaId}')";
                 }
 
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")})) 
@@ -88,7 +85,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     {
                         foreach(var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
-                            JoinAreaSchool joinAreaSchool = new JoinAreaSchool
+                            JoinAreaSchool joinAreaSchool = new()
                             {
                                 id = obj.GetProperty("id").GetString(),
                                 name = obj.GetProperty("name").GetString(),
@@ -108,9 +105,10 @@ namespace TEAMModelBI.Controllers.BINormal
                             }
                             catch { }
 
-                            if (!string.IsNullOrEmpty($"{joinAreaSchool.id}")) 
+                            if (!string.IsNullOrEmpty($"{joinAreaSchool.id}"))
                             {
                                 joinAreaSchool.assists = await CommonFind.FindSchoolRoles(cosmosClient, joinAreaSchool.id, "assist");
+                                joinAreaSchool.scAdmin = await CommonFind.FindSchoolRoles(cosmosClient, joinAreaSchool.id, "admin");
                             }
 
                             joinAreaSchools.Add(joinAreaSchool);
@@ -612,6 +610,7 @@ namespace TEAMModelBI.Controllers.BINormal
             public string dist { get; set; }
             public List<SchoolArea> areas { get; set; } = new List<SchoolArea>();
             public List<SchoolTeacherRoles> assists { get; set; } = new List<SchoolTeacherRoles>();
+            public List<SchoolTeacherRoles> scAdmin { get; set; } = new List<SchoolTeacherRoles>();
         }
 
     }

+ 26 - 24
TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

@@ -169,7 +169,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         CreateSchoolInfo createSchoolInfo = new CreateSchoolInfo()
                         {
                             province = bischool.province,
-                            id = "",
+                            id = bischool.id,
                             name = bischool.name,
                             city = bischool.city,
                             aname = "",
@@ -233,8 +233,15 @@ namespace TEAMModelBI.Controllers.BISchool
                                 {
                                     using var tchJson = await JsonDocument.ParseAsync(resTeache.ContentStream);
                                     teacher = tchJson.ToObject<Teacher>();
-                                    //教师存在,在该教师信息中添加要管理的学校信息
-                                    teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                                    Teacher.TeacherSchool tchSc = null;
+                                    //var tempTch = teacher.schools.Select(x => x.schoolId.Equals(upSchool.id)).ToString();
+                                    tchSc = teacher.schools.Find(x => x.schoolId.Equals(upSchool.id));                                
+                                    if (tchSc == null)
+                                    {
+                                        //教师存在,在该教师信息中添加要管理的学校信息
+                                        teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                                    }
+
                                     //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, coreUser.id, new PartitionKey("Base"));
                                     SchoolTeacher schoolTeacher = new()
                                     {
@@ -533,18 +540,13 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize))
                 {
                     if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize))
-                    {
                         pageSize = tempPageSize;
-                    }
                 }
                 if (pageSize != null && pageSize.Value > 0)
-                {
                     iscontinuation = true;
-                }
+
                 if (jsonElement.TryGetProperty("contToken", out JsonElement ContToken))
-                {
                     pageToken = ContToken.GetString();
-                }
 
                 if (!string.IsNullOrEmpty($"{tmdId}"))
                 {
@@ -561,9 +563,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         StringBuilder sqlTxt = new($"select c.id,c.code,c.schoolCode,c.name,c.region,c.province,c.city,c.dist,c.size,c.address,c.picture,c.type,c.scale,c.areaId,c.standard from c where c.id='{id}'");
 
                         if ($"{order}".Equals("desc"))
-                        {
                             sqlTxt.Append(" order by c.createTime desc");
-                        }
 
                         await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         {
@@ -600,9 +600,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     }
 
                     if ($"{order}".Equals("desc"))
-                    {
                         stringBuilder.Append(" order by c.createTime desc");
-                    }
 
                     scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
 
@@ -631,17 +629,11 @@ namespace TEAMModelBI.Controllers.BISchool
                     {
                         using var json = await JsonDocument.ParseAsync(response.ContentStream);
                         if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
-                        {
                             item.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
-                        }
                         if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
-                        {
                             item.service = service.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
-                        }
                         if (json.RootElement.TryGetProperty("hard", out JsonElement hard) && !hard.ValueKind.Equals(JsonValueKind.Null))
-                        {
                             item.hard = hard.ToObject<List<SchoolProductSumDataHard>>().Select(x => x.prodCode).ToList();
-                        }
                     }
 
                     item.assists = await CommonFind.FindSchoolRoles(cosmosClient, item.id, "assist");
@@ -1323,7 +1315,6 @@ namespace TEAMModelBI.Controllers.BISchool
                 return Ok(new { state = RespondCode.Ok, createScInfo });
         }
 
-
         /// <summary>
         /// 添加多个学校添加多个管理员
         /// </summary>
@@ -1572,7 +1563,7 @@ namespace TEAMModelBI.Controllers.BISchool
         /// <param name="Language"></param>
         /// <param name="campusId"></param>
         /// <returns></returns>
-        public List<Period> PresetSchoolPeriod(List<string> period, string Language, string campusId)
+        public List<Period> PresetSchoolPeriod(List<PeriodType> period, string Language, string campusId)
         {
             var builder = $"{_environment.ContentRootPath}/JsonFile/Preset/LangSchoolConfig.json";
             StreamReader streamReader = new(new FileStream(builder, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
@@ -1603,7 +1594,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     periods.Add(new Period
                     {
                         id = Guid.NewGuid().ToString(),
-                        name = x,
+                        name = x.pidName,
                         campusId = campusId,
                         semesters = new List<Semester>() { new Semester { name = schoolConfig.semester[0].term, start = schoolConfig.semester[0].start, month = schoolConfig.semester[0].month, day = schoolConfig.semester[0].day, id = Guid.NewGuid().ToString() },
                         new Semester { name = schoolConfig.semester[1].term, start = schoolConfig.semester[1].start, month = schoolConfig.semester[1].month, day = schoolConfig.semester[1].day, id = Guid.NewGuid().ToString() } },
@@ -1622,7 +1613,9 @@ namespace TEAMModelBI.Controllers.BISchool
                             income = schoolConfig.PresetExam[0].income,
                             eugenics = schoolConfig.PresetExam[0].eugenics,
                             touch = schoolConfig.PresetExam[0].touch
-                        }
+                        },
+                        type = x.pidType
+                        
                     });
                 });
             }
@@ -1723,7 +1716,7 @@ namespace TEAMModelBI.Controllers.BISchool
             /// <summary>
             /// 学校的学段
             /// </summary>
-            public List<string> period { get; set; }
+            public List<PeriodType> period { get; set; }
             /// <summary>
             /// 学校空间大小
             /// </summary>
@@ -1762,6 +1755,15 @@ namespace TEAMModelBI.Controllers.BISchool
             public string standard { get; set; }
         }
 
+        /// <summary>
+        /// 学段类型和学段名称
+        /// </summary>
+        public record PeriodType
+        {
+            public List<string> pidType { get; set; }
+            public string pidName { get; set; }
+        }
+
         /// <summary>
         /// 存在的学校
         /// </summary>

+ 13 - 17
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -91,27 +91,22 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize))
                 {
                     if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize))
-                    {
                         pageSize = tempPageSize;
-                    }
                 }
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
                 if (pageSize != null && pageSize.Value > 0)
-                {
                     iscontinuation = true;
-                }
+
                 if (jsonElement.TryGetProperty("contToken", out JsonElement ContToken))
-                {
                     pageToken = ContToken.GetString();
-                }
 
 
                 StringBuilder sqltxt = new($"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c");
                 if (!string.IsNullOrEmpty($"{areaId}"))
-                    sqltxt.Append($" WHERE c.areaId !='{areaId}'");
+                    sqltxt.Append($" WHERE c.pk='School' and c.areaId !='{areaId}'");
                 else
-                    sqltxt.Append($" WHERE (c.areaId ='' or c.areaId = null or IS_DEFINED(c.areaId) = false)");
+                    sqltxt.Append($" WHERE c.pk='School' and (c.areaId = '' or c.areaId = null or IS_DEFINED(c.areaId) = false)");
 
                 List<NotAreaSchool> tempNotAreaSchools = new();
                 await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
@@ -196,9 +191,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //jsonElement.TryGetProperty("site", out JsonElement site); //分开部署,就不需要,一站多用时,取消注释
                 var isManyArea = false;
                 if (!string.IsNullOrEmpty($"{isDefault}"))
-                {
                     isManyArea = true;
-                }
 
                 var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
                 List<string> schoolCodes = _schoolCode.ToObject<List<string>>();
@@ -793,17 +786,20 @@ namespace TEAMModelBI.Controllers.BISchool
         [HttpPost("del-manage")]
         public async Task<IActionResult> DelSchoolManage(JsonElement jsonElement)
         {
+            var (_tmdId, _tmdName, _, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
             if (!jsonElement.TryGetProperty("scIds", out JsonElement _scIds)) return BadRequest();
             //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
 
             List<string> scIds = _scIds.ToObject<List<string>>();
             var cosmosClient = _azureCosmos.GetCosmosClient();
+            var tableClient = _azureStorage.GetCloudTableClient();
+            var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
             ////分开部署,就不需要,一站多用时,取消注释
             //if ($"{site}".Equals(BIConst.Global))
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<string> existScId = new();
-
+            StringBuilder strMsg = new($"{_tmdName}【{_tmdId}】管理员账户将{tmdId}的账户移除学校:");
             SchoolTeacher scTeacher = null;
             foreach (var scId in scIds)
             {
@@ -815,6 +811,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     if (scTeacher.roles.Contains("admin"))
                     {
                         scTeacher.roles.Remove("admin");
+                        strMsg.Append($"{scId},");
                         scTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(scTeacher, scTeacher.id, new PartitionKey($"Teacher-{scId}"));
                     }
                     else
@@ -824,6 +821,9 @@ namespace TEAMModelBI.Controllers.BISchool
                     existScId.Add(scId);
             }
 
+            //保存操作记录
+            await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "schoolTeacher-updatee", strMsg.ToString(), _dingDing, httpContext: HttpContext);
+
             return Ok(new { state = RespondCode.Ok, existScId });
         }
 
@@ -1128,17 +1128,13 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     using var json = await JsonDocument.ParseAsync(response.ContentStream);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
-                    {
                         schoolInfo.serial = serial.ToObject<List<ProductSumInfos>>();
-                    }
+
                     if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
-                    {
                         schoolInfo.service = service.ToObject<List<ProductSumInfos>>();
-                    }
+
                     if (json.RootElement.TryGetProperty("hard", out JsonElement hard) && !hard.ValueKind.Equals(JsonValueKind.Null))
-                    {
                         schoolInfo.hard = hard.ToObject<List<SchoolProductSumDataHard>>();
-                    }
                 }
 
                 schoolInfo.assists = await CommonFind.FindSchoolRoles(cosmosClient, schoolInfo.id, "assist");

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

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

+ 6 - 2
TEAMModelBI/Tool/CommonFind.cs

@@ -189,10 +189,14 @@ namespace TEAMModelBI.Tool
         public static async Task<int> GetSqlValueCount(CosmosClient cosmosClient, string container, string SqlTxt,string code = null) 
         {
             int totals = 0;
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            try
             {
-                totals = item;
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                {
+                    totals = item;
+                }
             }
+            catch{ }
 
             return totals;
         }

+ 1 - 1
TEAMModelOS/ClientApp/src/view/areaArtExam/Mgt.vue

@@ -122,7 +122,7 @@ export default {
             return this.artInfo?.subjects || []
         },
         schoolListShow() {
-            if (this.artList[this.curIndex].sc && this.schoolList.length) {
+            if (this.artList[this.curIndex] && this.artList[this.curIndex].sc && this.schoolList.length) {
                 let data = this.schoolList.filter(item => {
                     let has = this.artList[this.curIndex].sc?.find(s => item.id === s.code)
                     return !!has

Fichier diff supprimé car celui-ci est trop grand
+ 469 - 479
TEAMModelOS/ClientApp/src/view/art/AreaArt.vue


+ 15 - 11
TEAMModelOS/ClientApp/src/view/artexam/Create.vue

@@ -125,8 +125,8 @@ export default {
         };
         let _this = this
         return {
-            schoolList:[],
-            examInfoList:[],
+            schoolList: [],
+            examInfoList: [],
             isArea: false,
             defaultQuos: ['quota_2'],
             subjectList: [
@@ -158,7 +158,7 @@ export default {
                 targets: [],
                 subjects: [],
                 setting: [],
-                schools:[]
+                schools: []
             },
             settingDetail: {},
             baseRule: {
@@ -297,7 +297,7 @@ export default {
             })
         },
         handleCheckChange(data) {
-            if (!this.settingDetail[data.quoid])this.settingDetail[data.quoid] = {}
+            if (!this.settingDetail[data.quoid]) this.settingDetail[data.quoid] = {}
             this.settingDetail[data.quoid]["checked"] = data.data
         },
         handleTypeChange(data) {
@@ -454,10 +454,14 @@ export default {
                     promise = this.$api.areaArt.saveAreaArt({
                         id: sessionStorage.getItem("areaId"),
                         art: params,
-                        artExam:this.examInfoList,
+                        artExam: this.examInfoList,
                         schoolId: this.artInfo.schools.length ? this.artInfo.schools : undefined
                     })
                 } else {
+                    params.period = {
+                        id: this.curPeriod.id,
+                        name: this.curPeriod.name
+                    }
                     promise = this.$api.areaArt.saveArt({
                         art: params
                     })
@@ -491,7 +495,7 @@ export default {
                         id: this.$jsFn.uuid(),
                         code: this.$store.state.userInfo.schoolCode,
                         school: this.$store.state.userInfo.schoolCode,
-                        name: `${this.artInfo.name}-${setting.subject}`,
+                        name: `${this.artInfo.name}-${setting.subject === 'subject_music' ? '音乐' : '美术'}`,
                         creatorId: this.$store.state.userInfo.TEAMModelId,
                         // type: this.evaluationInfo.type,
                         period: {
@@ -735,14 +739,14 @@ export default {
             console.log(data)
             this.artInfo.targets = data.map((item) => item[1])
         },
-        getAreaSchoolList(){
+        getAreaSchoolList() {
             this.$api.areaArt.findAreaSchoolList({
-                id:sessionStorage.getItem('areaId')
+                id: sessionStorage.getItem('areaId')
             }).then(
-                res=>{
+                res => {
                     this.schoolList = res.sc
                 },
-                err=>{
+                err => {
                     this.$Message.error("获取学校列表失败")
                 }
             )
@@ -753,7 +757,7 @@ export default {
         console.log(this.$route)
         // 判断是否为区级发布
         this.isArea = this.$route.name === 'areaCreateArtMgt'
-        if(this.isArea){
+        if (this.isArea) {
             this.getAreaSchoolList()
         }
     }

+ 3 - 2
TEAMModelOS/ClientApp/src/view/artexam/Mgt.vue

@@ -220,7 +220,7 @@ export default {
                                 id: this.$jsFn.uuid(),
                                 code: this.$store.state.userInfo.schoolCode,
                                 school: this.$store.state.userInfo.schoolCode,
-                                name: `${this.artInfo.name}-${task.subject}`,
+                                name: `${this.artInfo.name}-${task.subject === 'subject_music' ? '音乐' : '美术'}`,
                                 creatorId: this.$store.state.userInfo.TEAMModelId,
                                 period: {
                                     id: this.curPeriod.id,
@@ -485,7 +485,8 @@ export default {
         toDetailPage(index) { },
         findArtList() {
             let params = {
-                code: this.$store.state.userInfo.schoolCode
+                code: this.$store.state.userInfo.schoolCode,
+                periodId: this.curPeriod.id
             }
             this.$api.areaArt.findArtList(params).then(
                 (res) => {

+ 5 - 0
TEAMModelOS/ClientApp/src/view/dashboard/Art.vue

@@ -192,6 +192,11 @@ export default {
           this.acList = res.arts.filter(i => i.progress === 'finish')
           if (this.acList.length) {
             this.onAcChange(0)
+          } else {
+            this.$Message.warning('未查询到已结束的艺术评测活动!')
+            setTimeout(() => {
+              this.$router.go(-1)
+            }, 1000)
           }
         },
         (err) => { }

+ 8 - 2
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -18,6 +18,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Net;
 using System.Reflection;
+using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelOS.Filter;
@@ -497,9 +498,14 @@ namespace TEAMModelOS.Controllers.Common
             {
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                var query = $"select c.id,c.img,c.name,c.classes,c.code,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress from c where (c.status<>404 or IS_DEFINED(c.status) = false ) order by c.createTime desc";
+                StringBuilder stringBuilder = new($"select c.id,c.img,c.name,c.classes,c.code,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress from c where (c.status<>404 or IS_DEFINED(c.status) = false )");
                 string continuationToken = string.Empty;
                 string token = default;
+                if (request.TryGetProperty("periodId", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
+                {
+                    stringBuilder.Append($" and c.period.id = '{period}' ");
+                }
+                stringBuilder.Append("order by c.createTime desc");
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
                 if (request.TryGetProperty("token", out JsonElement token_1))
@@ -518,7 +524,7 @@ namespace TEAMModelOS.Controllers.Common
                 }
 
                 List<object> arts = new();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Art-{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Art-{code}") }))
                 {
 
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);