Browse Source

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

CrazyIter_Bin 2 years ago
parent
commit
3ea8f848c6

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

@@ -125,7 +125,8 @@
                 <ul>
                   <li class="details-list-school" v-for="(item, index) in notjoinSchool" :key="item.id" :class="{ active: position === index }">
                     <div class="list-school-logo">
-                      <el-image :src="item.picture" fit="fill"> </el-image>
+                      <el-image :src="item.picture" fit="fill" v-if="item.picture"> </el-image>
+                      <div class="notimages" v-else>暂无图片</div>
                     </div>
                     <div class="list-school-name">
                       <div>
@@ -189,11 +190,12 @@
                   {{ $t(`areaManages.operational.areaAddSchool.tabletitle`) }}
                 </div>
                 <div :class="[!PowerShow ? 'subjoin':'','schoolRight-table']">
-                  <el-table :data="tableDatas" style="width: 100%" height="535">
+                  <el-table :data="tableDatas" style="width: 100%" height="535" empty-text="暂无数据">
                     <el-table-column prop="index" :label="$t(`areaManages.operational.areaAddSchool.tables.serialnum`)" type="index" />
                     <el-table-column :label="$t(`areaManages.operational.areaAddSchool.tables.badge`)" align="center">
                       <template #default="scope">
-                        <el-image :src="scope.row.picture" fit="fill"></el-image>
+                        <el-image :src="scope.row.picture" fit="fill" v-if="scope.row.picture"></el-image>
+                        <div class="notimages nottables" v-else>暂无图片</div>
                       </template>
                     </el-table-column>
                     <el-table-column prop="name" :label="$t(`areaManages.operational.areaAddSchool.tables.name`)" align="center" />
@@ -2201,6 +2203,23 @@ export default {
   background-color: rgba(223, 230, 233, 0.7);
   color: rgba(178, 190, 195, 1);
 }
+.notimages {
+  /* width: 65%;
+  margin: 3% 0 0 3%; */
+  width: 70px;
+  height: 70px;
+  line-height: 70px;
+  text-align: center;
+  background-color: #bdc3c7;
+  font-size: 10px;
+  color: #ecf0f1;
+  margin: 0 auto;
+}
+.nottables {
+  width: 60px !important;
+  height: 60px !important;
+  line-height: 60px !important;
+}
 </style>
 <style>
 .stagebox-table-not .el-image {
@@ -2321,7 +2340,7 @@ export default {
 }
 
 .schoolRight-table .el-image__inner {
-  width: 75%;
+  width: 80%;
 }
 .addschoolHints .el-dialog__title {
   padding-left: 15px;

+ 1 - 1
TEAMModelBI/ClientApp/src/view/areaServe/thirdparty.vue

@@ -250,7 +250,7 @@ export default {
       timer.value = setTimeout(fn, wait)
     }
     function personnelSearch () {
-      let arr = thirdpartyArr.value
+      let arr = original.value
       let newArr = arr.filter((item) => {
         // return (item.name && item.name.includes(filterText.value)) || (item.mobile && item.mobile.includes(filterText.value)) || (item.mobile && item.mobile.tmdId.includes(filterText.value))
         return item.name.includes(serachkeys.value)

+ 1 - 1
TEAMModelBI/ClientApp/src/view/areamanage/statistics.vue

@@ -1857,7 +1857,7 @@ export default {
       timer.value = setTimeout(fn, wait)
     }
     function personnelSearch () {
-      let arr = showPattern.value === 'all' ? notClassifydata.value : schooltableData.value
+      let arr = showPattern.value === 'all' ? notClassifyoriginal.value : originalSchool.value
       let newArr = arr.filter((item) => {
         // return (item.name && item.name.includes(filterText.value)) || (item.mobile && item.mobile.includes(filterText.value)) || (item.mobile && item.mobile.tmdId.includes(filterText.value))
         return item.name.includes(areaSearchValue.value) || item.id.includes(areaSearchValue.value)

+ 69 - 2
TEAMModelBI/ClientApp/src/view/participation/setPhase.vue

@@ -411,6 +411,18 @@
     <!--编辑弹窗-->
     <div class="conductbox">
       <el-dialog v-model="editDialog" :title="editDialogName" width="30%">
+        <!--学段编辑-->
+        <el-form :model="stageData" v-if="dialogModels === 'stage'">
+          <el-form-item label="学段名称" prop="name" class="form-semester-name">
+            <el-input v-model="stageData.name" autocomplete="off"></el-input>
+          </el-form-item>
+          <el-form-item label="所属阶段" class="stage-checkbox">
+            <div class="checkbox-stage">
+              <el-checkbox v-for="(item,index) in stageData.checkeds" :key="index" v-model="item.state" :label="item.name" size="small" />
+            </div>
+          </el-form-item>
+        </el-form>
+        <!--学段编辑end-->
         <!--学期弹窗-->
         <el-form :model="form" :rules="rules" ref="ruleFormbox" v-if="dialogModels === 'semester'">
           <el-form-item :label="$t(`schoolManages.gradSet.popup.tables.name`) + ':'" prop="name" class="form-semester-name">
@@ -708,6 +720,43 @@ export default {
     let timeZoneList = ref([])
     let ruleFormbox = ref()
     let dialogModels = ref()
+    const stageTage = ref([
+      { name: '学前', value: 'pre', color: '#fd79a8' },
+      { name: '小学', value: 'primary', color: '#74b9ff' },
+      { name: '初中', value: 'junior', color: '#0984e3' },
+      { name: '高中', value: 'senior', color: '#00cec9' },
+      { name: '中职(中专,技校,职高)', value: 'secondary', color: '#2ed573' },
+      { name: '高职(专科)', value: 'college', color: '#eccc68' },
+      { name: '大学本科', value: 'university', color: '#e17055' },
+      { name: '特殊教育', value: 'special', color: '#a29bfe' },
+      { name: '教育局', value: 'edu-bureau', color: '#e84393' },
+      { name: '电教部门', value: 'elecedu-dept', color: '#5758BB' },
+      { name: '成人中专', value: 'adult-secondary', color: '#fab1a0' },
+      { name: '成人高教', value: 'adult-higher', color: '#e17055' },
+      { name: '硕士研究生', value: 'master', color: '#12CBC4' },
+      { name: '博士研究生', value: 'doctor', color: '#1289A7' },
+      { name: '企业', value: 'enterprise', color: '#778beb' },
+    ])
+    let stageData = ref({
+      name: '',
+      checkeds: [
+        { name: '学前', value: 'pre', state: false, },
+        { name: '小学', value: 'primary', state: false, },
+        { name: '初中', value: 'junior', state: false, },
+        { name: '高中', value: 'senior', state: false, },
+        { name: '中职(中专,技校,职高)', value: 'secondary', state: false, },
+        { name: '高职(专科)', value: 'college', state: false, },
+        { name: '大学本科', value: 'university', state: false, },
+        { name: '特殊教育', value: 'special', state: false, },
+        { name: '教育局', value: 'edu-bureau', state: false, },
+        { name: '电教部门', value: 'elecedu-dept', state: false, },
+        { name: '成人中专', value: 'adult-secondary', state: false, },
+        { name: '成人高教', value: 'adult-higher', state: false, },
+        { name: '硕士研究生', value: 'master', state: false, },
+        { name: '博士研究生', value: 'doctor', state: false, },
+        { name: '企业', value: 'enterprise', state: false, },
+      ],
+    })
     //获取当前学校的信息(API)
     function getnowSchool (data) {
       console.log(data, '进入调用API方法')
@@ -785,8 +834,9 @@ export default {
     //修改学段名称
     function amendPhasename () {
       let num = pathNowphase.value
-      nowschoolData.value.period[num].changed = true
+      // nowschoolData.value.period[num].changed = true
       console.log(nowschoolData.value)
+      semesterCompile(nowschoolData.value.period[num], 'stage')
     }
     //学段名称修改完成 调整状态值
     function nameChanges (index) {
@@ -941,6 +991,18 @@ export default {
           (editDialogName.value = proxy.$t(`schoolManages.gradSet.popup.addTime`)),
           (dialogModels.value = 'timebucket'))
         : ''
+      state === 'stage'
+        ? (
+          (editDialogName.value = '编辑学段属性'),
+          (stageData.value.checkeds.forEach((a) => { a.state = false })),
+          (stageData.value.name = value.name),
+          (value.type.forEach((item) => {
+            stageData.value.checkeds.forEach((items) => {
+              item == items.value ? items.state = true : ''
+            })
+          })),
+          dialogModels.value = 'stage')
+        : ''
       console.log(form.value)
       editDialog.value = true
     }
@@ -1327,7 +1389,9 @@ export default {
       timeZoneList,
       semesterSort,
       gradeClassdata,
-      userPower
+      userPower,
+      stageTage,
+      stageData
     }
   },
 }
@@ -2199,6 +2263,9 @@ export default {
 .settimg-notdata {
   padding-top: 5%;
 }
+.checkbox-stage {
+  text-align: left;
+}
 </style>
 <style>
 .pitch .el-card__body {

+ 32 - 13
TEAMModelBI/ClientApp/src/view/schoolServe/school.vue

@@ -330,7 +330,8 @@ import Impower from './impower.vue'
 import Classpower from './classpower.vue'
 import setSchooladmin from './setSchooladmin.vue'
 const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
-const optionsData = siteValue === 'cn' ? option_cn : option_gl
+//const optionsData = siteValue === 'cn' ? option_cn : option_gl
+const optionsData = siteValue === 'cn' ? option_gl : option_gl
 export default {
   components: {
     SetSchool,
@@ -586,7 +587,8 @@ export default {
         let cityData = regionsData.filter((item) => {
           return value.includes(item.name)
         })
-        cityOptions.value.cityInfo = cityData[0].children
+        console.log(cityData, '筛选记过')
+        cityOptions.value.cityInfo = cityData[0].hasOwnProperty('children') ? cityData[0].children : []
         //遍历list
         // let schoolData = originalData.value.filter((items) => {
         //   // let provinceState = items.province.includes('自治区') || items.province.includes('市') ? true : false
@@ -594,15 +596,21 @@ export default {
         //   return value.includes(items.province)
         //   // return items.province === value
         // })
-        let textNums = value.indexOf('省') !== -1 ? value.indexOf('省') : value.indexOf('自治区') !== -1 ? value.indexOf('自治区') : value.indexOf('市') !== -1 ? value.indexOf('市') : value.indexOf('特别行政区') !== -1 ? value.indexOf('特别行政区') : ''
-        let disposeText = value.substr(0, textNums)
-        console.log(textNums, disposeText, '位置')
+        let disposeText = ''
+        if (siteValue.value === 'cn') {
+          let textNums = value.indexOf('省') !== -1 ? value.indexOf('省') : value.indexOf('自治区') !== -1 ? value.indexOf('自治区') : value.indexOf('市') !== -1 ? value.indexOf('市') :
+            value.indexOf('特别行政区') !== -1 ? value.indexOf('特别行政区') : value.indexOf('地區') !== -1 ? value.indexOf('地區') : value
+          console.log(textNums, '数字')
+          disposeText = typeof textNums == 'number' ? value.substr(0, textNums) : value
+          console.log(textNums, disposeText, '位置')
+        } else {
+          disposeText = value
+        }
         let data = { province: disposeText }
         await proxy.$api.getSchooldata(data).then((res) => {
           console.log(res, '筛选结果')
           // res.state === 200 ? tableData.value=res.schoolAssists:''
           res.state === 200 ? (schoolListDatas = res.schoolAssists, selectValue.value.province = disposeText, nextPageToken = res.continuationToken, tablesccnt.value = res.scCnt) : ''
-
         }).catch((error) => {
           ElMessage.error('API异常,数据 省 筛选失败')
         })
@@ -612,16 +620,22 @@ export default {
         let distData = cityOptions.value.cityInfo.filter((item) => {
           return value.includes(item.name)
         })
-        distOptions.value.distInfo = distData[0].children
+        distOptions.value.distInfo = distData[0].hasOwnProperty('children') ? distData[0].children : []
         // let provinceData = provinceOptions.value.provinceValue
         // let schoolData = originalData.value.filter((items) => {
         //   return value.includes(items.city) && provinceData.includes(items.province)
         //   // return items.city === value && items.province === provinceData
         // })
         // tableData.value = schoolData
-        let cityNums = value.indexOf('市') !== -1 && value !== '直辖市' ? value.indexOf('市') : value.indexOf('县') !== -1 ? value.indexOf('县') : value.indexOf('自治州') !== -1 ? value.indexOf('自治州') : value.indexOf('直辖市') !== -1 ? value.length : ''
-        let disposeText = value.substr(0, cityNums)
-        console.log(cityNums, disposeText, '位置')
+        let disposeText = ''
+        if (siteValue.value === 'cn') {
+          let cityNums = value.indexOf('市') !== -1 && value !== '直辖市' ? value.indexOf('市') : value.indexOf('县') !== -1 ? value.indexOf('县') :
+            value.indexOf('自治州') !== -1 ? value.indexOf('自治州') : value.indexOf('縣') !== -1 ? value.indexOf('縣') : value.indexOf('直辖市') !== -1 ? value.length : ''
+          disposeText = value.substr(0, cityNums)
+          console.log(cityNums, disposeText, '位置')
+        } else {
+          disposeText = value
+        }
         let data = { province: selectValue.value.province ? selectValue.value.province : '', city: disposeText }
         await proxy.$api.getSchooldata(data).then((res) => {
           res.state === 200 ? (schoolListDatas = res.schoolAssists, selectValue.value.city = disposeText, nextPageToken = res.continuationToken, tablesccnt.value = res.scCnt) : ''
@@ -637,9 +651,14 @@ export default {
         //   // return items.city === cityData && items.province === provinceData && items.dist === value
         // })
         // tableData.value = schoolData
-        let distNums = value.indexOf('区') !== -1 && value.length > 2 ? value.indexOf('区') : value.indexOf('县') !== -1 ? value.indexOf('县') : value.indexOf('市') !== -1 ? value.indexOf('市') : value.indexOf('直辖市') !== -1 || value.indexOf('天府新区') !== -1 ? value.length : ''
-        let disposeText = value.substr(0, distNums)
-        console.log(distNums, disposeText, '位置')
+        let disposeText = ''
+        if (siteValue.value === 'cn') {
+          let distNums = value.indexOf('区') !== -1 && value.length > 2 ? value.indexOf('区') : value.indexOf('县') !== -1 ? value.indexOf('县') : value.indexOf('市') !== -1 ? value.indexOf('市') : value.indexOf('直辖市') !== -1 || value.indexOf('天府新区') !== -1 ? value.length : ''
+          disposeText = value.substr(0, distNums)
+          console.log(distNums, disposeText, '位置')
+        } else {
+          disposeText = value
+        }
         let data = { province: selectValue.value.province ? selectValue.value.province : '', city: selectValue.value.city ? selectValue.value.city : '', dist: disposeText }
         await proxy.$api.getSchooldata(data).then((res) => {
           res.state === 200 ? (schoolListDatas = res.schoolAssists, nextPageToken = res.continuationToken, tablesccnt.value = res.scCnt) : ''

+ 12 - 2
TEAMModelBI/ClientApp/src/view/schoolServe/setschool.vue

@@ -669,12 +669,17 @@ export default {
       { name: '小学', value: 'primary', color: '#74b9ff' },
       { name: '初中', value: 'junior', color: '#0984e3' },
       { name: '高中', value: 'senior', color: '#00cec9' },
-      { name: '中职', value: 'secondary', color: '#2ed573' },
-      { name: '高职', value: 'college', color: '#eccc68' },
+      { name: '中职(中专,技校,职高)', value: 'secondary', color: '#2ed573' },
+      { name: '高职(专科)', value: 'college', color: '#eccc68' },
       { name: '大学本科', value: 'university', color: '#e17055' },
       { name: '特殊教育', value: 'special', color: '#a29bfe' },
       { name: '教育局', value: 'edu-bureau', color: '#e84393' },
       { name: '电教部门', value: 'elecedu-dept', color: '#5758BB' },
+      { name: '成人中专', value: 'adult-secondary', color: '#fab1a0' },
+      { name: '成人高教', value: 'adult-higher', color: '#e17055' },
+      { name: '硕士研究生', value: 'master', color: '#12CBC4' },
+      { name: '博士研究生', value: 'doctor', color: '#1289A7' },
+      { name: '企业', value: 'enterprise', color: '#778beb' },
     ])
     //学段编辑弹窗需要数据
     let stageData = ref({
@@ -690,6 +695,11 @@ export default {
         { name: '特殊教育', value: 'special', state: false, },
         { name: '教育局', value: 'edu-bureau', state: false, },
         { name: '电教部门', value: 'elecedu-dept', state: false, },
+        { name: '成人中专', value: 'adult-secondary', state: false, },
+        { name: '成人高教', value: 'adult-higher', state: false, },
+        { name: '硕士研究生', value: 'master', state: false, },
+        { name: '博士研究生', value: 'doctor', state: false, },
+        { name: '企业', value: 'enterprise', state: false, },
       ],
     })
     //学期弹窗需要数据

+ 33 - 14
TEAMModelBI/ClientApp/src/view/schoolmanage/schoolAnalyse.vue

@@ -377,7 +377,7 @@ export default {
     })
     let rankMsg = ref('正在加载...')
     let headerbasics = ref([
-      { id: 1, title: '参与管理的学校', num: 0, subheading: '总数据量', subnum: 0, class: 'schoolnum-statistics' },
+      { id: 1, title: '当前关联学校', num: 0, subheading: '总数据量', subnum: 0, class: 'schoolnum-statistics' },
       { id: 2, title: '学校教师总数', num: 0, subheading: '本月新增', subnum: 0, class: 'teachnum-statistics' },
       { id: 3, title: '学校学生总数', num: 0, subheading: '本月新增', subnum: 0, class: 'studentnum-statistics' },
       { id: 4, title: '课例总数', num: 0, subheading: '本月新增', subnum: 0, class: 'classnum-statistics' },
@@ -1542,12 +1542,14 @@ export default {
       }
       console.log(roleA, '身份')
       console.log(store.state.areaClickCounselor, '特殊跳过来的')
-
       // let data = store.state.areaClickCounselor && urlState ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } : { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA }
       let ids = store.state.areaClickCounselor && urlState ? store.state.areaClickCounselor : JSON.parse(localStorage.getItem('userData')).tmdId
       let data = (roleA === 'admin' || roleA === 'leader') && !store.state.areaClickCounselor ? {} :
-        store.state.areaClickCounselor && urlState ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
-          (roleA !== 'admin' || roleA !== 'leader') && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } : ''
+        store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'sales' ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
+          store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'assist' ? { tmdId: store.state.areaClickCounselor } :
+            store.state.areaClickCounselor && urlState && (store.state.areaClickRoles === 'admin' || store.state.areaClickRoles === 'leader') ? {} :
+              roleA === 'sales' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } :
+                roleA === 'assist' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId } : ''
       allAspects(ids)
       serviceAndversions(ids)
       proxy.$api.getBasicsData(data).then((res) => {
@@ -1587,7 +1589,7 @@ export default {
           allLoding.value.headerData = false
           allLoding.value.rank = false
           searchText.loading = false
-          store.commit('clickCounselor', '')
+          // store.commit('clickCounselor', '')
         }
       }).catch((error) => {
         ElMessage.error('数据获取API异常')
@@ -1609,12 +1611,18 @@ export default {
         roleA = user.roles[0]
       }
       let urlState = window.location.href.indexOf('pattern=area') != -1 ? true : false
-      console.log(store.state.areaClickCounselor, '身份')
+      console.log(store.state.areaClickCounselor, '身份123456')
       let beData = behinddata
       let nowstate = state
+      console.log(state, '是否有state')
       let data = state === 'details' ? { schoolId: val } :
-        !store.state.areaClickCounselor && urlState === false ? { tmdId: user.sub, role: roleA } :
-          (roleA === 'admin' || roleA === 'leader') && store.state.areaClickCounselor && (state !== 'details' && state) ? {} : { tmdId: user.sub }
+        store.state.areaClickCounselor && urlState && store.state.areaClickRoles === 'sales' ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
+          store.state.areaClickCounselor && urlState && store.state.areaClickRoles === 'assist' ? { tmdId: store.state.areaClickCounselor } :
+            store.state.areaClickCounselor && urlState && (store.state.areaClickRoles === 'admin' || store.state.areaClickRoles === 'leader') ? {} :
+              (roleA === 'admin' || roleA === 'leader') && !store.state.areaClickCounselor && state === undefined ? {} :
+                roleA === 'assist' && !store.state.areaClickCounselor && state === undefined ? { tmdId: user.sub } :
+                  roleA === 'sales' && !store.state.areaClickCounselor && state === undefined ? { tmdId: user.sub, role: roleA } :
+                    { tmdId: user.sub, role: roleA }
       console.log(data, '提交的数据')
       proxy.$api.getAllaspects(data).then((res) => {
         console.log(res, '课例等的返回')
@@ -1678,9 +1686,14 @@ export default {
       } else {
         roleA = user.roles[0]
       }
+      let urlState = window.location.href.indexOf('pattern=area') != -1 ? true : false
+      console.log(store.state.areaClickCounselor, urlState, store.state.areaClickRoles, '最后一个API')
       let data = (roleA === 'admin' || roleA === 'leader') && !store.state.areaClickCounselor ? {} :
-        store.state.areaClickCounselor && urlState ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
-          (roleA !== 'admin' || roleA !== 'leader') && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } : ''
+        store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'sales' ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
+          store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'assist' ? { tmdId: store.state.areaClickCounselor } :
+            store.state.areaClickCounselor && urlState && (store.state.areaClickRoles == 'admin' || store.state.areaClickRoles == 'leader') ? {} :
+              roleA === 'sales' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } :
+                roleA === 'assist' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId } : ''
       proxy.$api.getaspects(data).then((res) => {
         console.log(res, '历史全部返回')
         if (res.state == 200) {
@@ -1761,9 +1774,15 @@ export default {
       } else {
         roleA = user.roles[0]
       }
+      let urlState = window.location.href.indexOf('pattern=area') != -1 ? true : false
+      console.log(store.state.areaClickCounselor, '--', urlState, '--', store.state.areaClickRoles, '查看传值')
+      console.log(store.state.areaClickRoles, '身份')
       let data = (roleA === 'admin' || roleA === 'leader') && !store.state.areaClickCounselor ? {} :
-        store.state.areaClickCounselor && urlState ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
-          (roleA !== 'admin' || roleA !== 'leader') && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } : ''
+        store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'sales' ? { tmdId: store.state.areaClickCounselor, role: store.state.areaClickRoles } :
+          store.state.areaClickCounselor && urlState && store.state.areaClickRoles == 'assist' ? { tmdId: store.state.areaClickCounselor } :
+            store.state.areaClickCounselor && urlState && (store.state.areaClickRoles == 'admin' || store.state.areaClickRoles == 'leader') ? {} :
+              roleA === 'sales' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId, role: roleA } :
+                roleA === 'assist' && !store.state.areaClickCounselor ? { tmdId: JSON.parse(localStorage.getItem('userData')).tmdId } : ''
       proxy.$api.getServiceandVersions(data).then((res) => {
         console.log(res, '服务和版本占比')
         let xData = []; let datas = []
@@ -2005,7 +2024,7 @@ export default {
       timer.value = setTimeout(fn, wait)
     }
     function personnelSearch () {
-      let arr = schoolDefault.value
+      let arr = searchText.original
       let newArr = arr.filter((item) => {
         return item.name.includes(searchText.values) || item.id.includes(searchText.values)
       })
@@ -2420,7 +2439,7 @@ export default {
   background-color: rgba(116, 185, 255, 1);
   border-radius: 5px;
   position: absolute;
-  top: -1%;
+  top: -15px;
   right: 0%;
   cursor: pointer;
 }

+ 17 - 13
TEAMModelBI/ClientApp/src/view/systemConfig/correlation.vue

@@ -13,8 +13,8 @@
     <div class="school-list-header">
       <div class="correlationbox-titles">目前用户所关联学校:<span>关联数量:<span class="correlationbox-num">{{nowUsers.handleSchools.length}}</span></span></div>
       <div class="correlationbox-btn">
-        <el-button type="primary" size="small" v-if="removeBatchschool.length >0 && PowerShow" @click="multipeRemove"> 移除选中学校</el-button>
-        <el-button type="primary" size="small" v-else-if="removeBatchschool.length ===0 && PowerShow" disabled>移除选中学校</el-button>
+        <el-button type="primary" size="small" v-if="removeBatchschool.length >0 && PowerShow && adminOrleader===false" @click="multipeRemove"> 移除选中学校</el-button>
+        <el-button type="primary" size="small" v-else-if="removeBatchschool.length ===0 && PowerShow && adminOrleader===true" disabled>移除选中学校</el-button>
       </div>
     </div>
     <!-- <p class="correlationbox-title">目前用户所关联学校:</p>
@@ -22,8 +22,8 @@
       <el-button type="primary" size="small" v-if="multipleSchool.length >0 && PowerShow" @click="multipleCorrelation">关联选中学校</el-button>
       <el-button type="primary" size="small" v-else-if="multipleSchool.length ===0 && PowerShow" disabled>关联选中学校</el-button>
     </div> -->
-    <div class="possessbox" v-if="nowUsers.handleSchools.length >0">
-      <el-table :data="nowUsers.handleSchools" style="width: 100%" height="20vh" size="small" @selection-change="removeBatch" v-loading="loadingData.possess" element-loading-text="数据加载中...">
+    <div class="possessbox">
+      <el-table :data="nowUsers.handleSchools" style="width: 100%" height="20vh" size="small" @selection-change="removeBatch" v-loading="loadingData.possess" element-loading-text="数据加载中..." empty-text='暂无相关数据'>
         <el-table-column type="selection" v-if="PowerShow" />
         <el-table-column label="校徽" align="center">
           <template #default="scope">
@@ -48,16 +48,16 @@
             <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">
+        <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow && adminOrleader===false">
           <template #default="scope">
             <el-button type="text" size="small" @click="removeSchool(scope.row,scope.$index)">取消关联</el-button>
           </template>
         </el-table-column>
       </el-table>
     </div>
-    <div class="nodata" v-else-if="nowUsers.handleSchools.length ===0">
+    <!-- <div class="nodata" v-else-if="nowUsers.handleSchools.length ===0">
       <div>暂无关联学校</div>
-    </div>
+    </div> -->
     <div class="school-list">
       <div class="school-list-header">
         <div class="correlationbox-titles">学校列表:</div>
@@ -65,8 +65,8 @@
           <el-input v-model="schoolSearch" placeholder="输入学校名称/简码 搜索" :prefix-icon="Search" size="small" clearable />
         </div>
         <div class="correlationbox-btn">
-          <el-button type="primary" size="small" v-if="multipleSchool.length >0 && PowerShow" @click="multipleCorrelation">关联选中学校</el-button>
-          <el-button type="primary" size="small" v-else-if="multipleSchool.length ===0 && PowerShow" disabled>关联选中学校</el-button>
+          <el-button type="primary" size="small" v-if="multipleSchool.length >0 && PowerShow && adminOrleader===false" @click="multipleCorrelation">关联选中学校</el-button>
+          <el-button type="primary" size="small" v-else-if="multipleSchool.length ===0 && PowerShow && adminOrleader===true" disabled>关联选中学校</el-button>
         </div>
       </div>
       <div class="listbox">
@@ -94,7 +94,7 @@
               <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">
+          <el-table-column fixed="right" label="操作" width='80' align="center" v-if="PowerShow && adminOrleader===false">
             <template #default="scope">
               <el-button type="text" size="small" @click="correlation(scope.row,tableData)">关联学校</el-button>
             </template>
@@ -150,6 +150,7 @@ export default {
     })
     //关联筛选原始data
     let correlaData = ref([])
+    let adminOrleader = ref(false)
     onMounted(() => {
       //监听表格滚动事件
       // let table = mutipleTable.value._value.layout.table.refs.bodyWrapper;
@@ -300,9 +301,9 @@ export default {
           .then((res) => {
             console.log(res, '成功的返回')
             res.state === 200
-              ? ((nowUsers.value.handleSchools = nowUsers.value.handleSchools.concat(schoolData)), getSchoolList('', 'restart'), processingSchool(), context.emit('changerestart', true))
+              ? ((nowUsers.value.handleSchools = nowUsers.value.handleSchools.concat(schoolData)), getSchoolList('', 'restart'), processingSchool(), context.emit('changerestart', true), ElMessage.success('操作成功'))
               : res.state === 201
-                ? (ElMessage.success('已关联,请勿重复操作'), getSchoolList())
+                ? (ElMessage.success('已关联,请勿重复操作'), getSchoolList('', 'restart'))
                 : ''
           })
           .catch((error) => {
@@ -459,6 +460,7 @@ export default {
     }
     //处理显示目前关联的
     function nowRelevance (value) {
+      console.log(value, '这个人的身份')
       nowUsers.value = JSON.parse(JSON.stringify(value))
       let nowUserdata = nowUsers.value
       nowUserdata.handleSchools.forEach((item) => {
@@ -470,6 +472,7 @@ export default {
       })
       nowUsers.value.handleSchools = nowUserdata.handleSchools
       correlaData.value = nowUserdata.handleSchools
+      value.handleRoles.includes('admin') || value.handleRoles.includes('leader') ? adminOrleader.value = true : adminOrleader.value = false
       loadingData.value.possess = false
     }
     watch(scrollHeight, (newdata, olddata) => {
@@ -520,7 +523,8 @@ export default {
       removeBatch,
       nowRelevance,
       correlaData,
-      correlaSchool
+      correlaSchool,
+      adminOrleader
     }
   },
 }

+ 3 - 2
TEAMModelBI/ClientApp/src/view/teachermanage/manage.vue

@@ -445,7 +445,7 @@ export default {
     }
     //人员搜索
     function personnelSearch () {
-      let arr = tableData.value
+      let arr = original.value
       let newArr = arr.filter((item) => {
         // return (item.name && item.name.includes(filterText.value)) || (item.mobile && item.mobile.includes(filterText.value)) || (item.mobile && item.mobile.tmdId.includes(filterText.value))
         return item.name.includes(filterText.value)
@@ -491,6 +491,7 @@ export default {
       })
     }
     watch(filterText, (newdata) => {
+      console.log(newdata, '搜索监听')
       if (newdata.trim().length !== 0) {
         debounce(personnelSearch, 500)
       } else {
@@ -499,7 +500,7 @@ export default {
     })
     watch(drawer, (news) => {
       console.log(news, '监听开关')
-      news === false && restartState.value === true ? (getEvery(), restartState.value = false) : ''
+      news === false && restartState.value === true ? (getEvery(), valueinfo.value = 'all', restartState.value = false) : ''
     })
     areaData()
     return {

+ 11 - 1
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -1502,6 +1502,9 @@ namespace TEAMModelBI.Controllers.BISchool
                     case "admin":
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "admin");
                         break;
+                    case "sales":
+                        schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "sales");
+                        break;
                     default:
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
                         break;
@@ -1595,7 +1598,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             scSql = BICommonWay.ManyScSql("c.school", schoolIds);
                             break;
                         case "sales":
-                            schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", isMany: true);
+                            schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "sales");
                             scSql = BICommonWay.ManyScSql("c.school", schoolIds);
                             break;
                         default:
@@ -1689,6 +1692,10 @@ namespace TEAMModelBI.Controllers.BISchool
                     case "admin":
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "admin");
                         break;
+                    case "sales":
+                        schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "sales");
+                        //scSql = BICommonWay.ManyScSql("c.school", schoolIds);
+                        break;
                     default:
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
                         break;
@@ -1841,6 +1848,9 @@ namespace TEAMModelBI.Controllers.BISchool
                     case "admin":
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "admin");
                         break;
+                    case "sales":
+                        schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}", "sales");
+                        break;
                     default:
                         schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
                         break;

+ 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.28</Version>
-		<AssemblyVersion>1.2210.28.2</AssemblyVersion>
-		<FileVersion>1.2210.28.2</FileVersion>
+		<Version>1.2210.31</Version>
+		<AssemblyVersion>1.2210.31.1</AssemblyVersion>
+		<FileVersion>1.2210.31.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 40 - 27
TEAMModelBI/Tool/CosmosBank/ActivityWay.cs

@@ -19,45 +19,49 @@ namespace TEAMModelBI.Tool.CosmosBank
         public async static Task<int> GetAll(CosmosClient cosmosClient, List<string> scIds = null, List<string> tecIds = null)
         {
             int totals = 0;
-            string sqlTxt = "select count(c.id) as totals from c";
-            foreach (string type in types)
+            try
             {
-                if (scIds.Count > 0)
+                string sqlTxt = "select count(c.id) as totals from c";
+                foreach (string type in types)
                 {
-                    foreach (string sc in scIds)
+                    if (scIds.Count > 0)
                     {
-                        await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
+                        foreach (string sc in scIds)
                         {
-                            using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
-                            if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
+                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
                             {
-                                foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                                using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
+                                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                                 {
-                                    totals += obj.GetProperty("totals").GetInt32();
+                                    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                                    {
+                                        totals += obj.GetProperty("totals").GetInt32();
+                                    }
                                 }
                             }
                         }
                     }
-                }
 
-                if (tecIds.Count > 0)
-                {
-                    foreach (string sc in scIds)
+                    if (tecIds.Count > 0)
                     {
-                        await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
+                        foreach (string sc in scIds)
                         {
-                            using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
-                            if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
+                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
                             {
-                                foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                                using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
+                                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                                 {
-                                    totals += obj.GetProperty("totals").GetInt32();
+                                    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                                    {
+                                        totals += obj.GetProperty("totals").GetInt32();
+                                    }
                                 }
                             }
                         }
                     }
                 }
             }
+            catch { }
             return totals;
         }
 
@@ -72,14 +76,19 @@ namespace TEAMModelBI.Tool.CosmosBank
         public static async Task<int> GetCnt(CosmosClient cosmosClient, string container = "Common", string condSql = null, string code = null) 
         {
             int total = 0;
-            foreach (string type in types)
+            try
             {
-                string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
-                await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") })) 
+                foreach (string type in types)
                 {
-                    total += cnt;
+                    string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
+                    await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                    {
+                        total += cnt;
+                    }
                 }
             }
+            catch { }
+
             return total;
         }
 
@@ -94,17 +103,21 @@ namespace TEAMModelBI.Tool.CosmosBank
         public static async Task<int> GetCnt(CosmosClient cosmosClient, List<string> containers, string condSql = null, string code = null)
         {
             int total = 0;
-            foreach (var container in containers)
+            try
             {
-                foreach (string type in types)
+                foreach (var container in containers)
                 {
-                    string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
-                    await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                    foreach (string type in types)
                     {
-                        total += cnt;
+                        string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
+                        await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                        {
+                            total += cnt;
+                        }
                     }
                 }
             }
+            catch { }
             return total;
         }
 

+ 162 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/StatsInfo.cs

@@ -8,9 +8,170 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI
 {
     public class StatsInfo : CosmosEntity
     {
+        //id  学校id
         //pk   Stats
-        //code   Stats-hbcn  Stats-学校id   Stats-学区id
+        //code Stats
+        //code   Stats-hbcn  Stats-学校id   Stats-学区id 暂未启动
+        public StatsInfo()
+        {
+            pk = "Stats";
+        }
 
+        /// <summary>
+        /// 学校头像
+        /// </summary>
+        public string picture { get; set; }
 
+        /// <summary>
+        /// 学校名称
+        /// </summary>
+        public string name { get; set; }
+
+        /// <summary>
+        /// 教师总数
+        /// </summary>
+        public int tch { get; set; }
+
+        /// <summary>
+        /// 当天新增教师
+        /// </summary>
+        public int dayTch { get; set; }
+
+        /// <summary>
+        /// 本周新增教师
+        /// </summary>
+        public int weekTch { get; set; }
+
+        /// <summary>
+        /// 本月新增教师
+        /// </summary>
+        public int monthTch { get; set; }
+
+        /// <summary>
+        /// 学生总数
+        /// </summary>
+        public int stu { get; set; }
+
+        /// <summary>
+        /// 当天新增学生
+        /// </summary>
+        public int dayStu { get; set; }
+
+        /// <summary>
+        /// 本周新增学生
+        /// </summary>
+        public int weekStu { get; set; }
+
+        /// <summary>
+        /// 本月新增学生
+        /// </summary>
+        public int monthStu { get; set; }
+
+        /// <summary>
+        /// 教室数
+        /// </summary>
+        public int room { get; set; }
+
+        /// <summary>
+        /// 智慧教室
+        /// </summary>
+        public int witRoom { get; set; }
+
+        /// <summary>
+        /// 空间
+        /// </summary>
+        public int size { get; set; }
+
+        /// <summary>
+        /// 学校创建时间
+        /// </summary>
+        public long scCreateDte { get; set; }
+
+        /// <summary>
+        /// 学校统计数据更新时间
+        /// </summary>
+        public long upDate { get; set; }
+
+        public LessonStats lesson { get; set; }
     }
+
+    /// <summary>
+    /// 课例
+    /// </summary>
+    public class LessonStats 
+    {
+        /// <summary>
+        /// 开课数
+        /// </summary>
+        public int open { get; set; }
+
+        /// <summary>
+        /// 课例
+        /// </summary>
+        public int less { get; set; }
+
+        /// <summary>
+        /// 昨天的课例数
+        /// </summary>
+        public int lastDay { get; set; }
+
+        /// <summary>
+        /// 今天课例
+        /// </summary>
+        public int day { get; set; }
+
+        /// <summary>
+        /// 上周课例
+        /// </summary>
+        public int lastWeek { get; set; }
+
+        /// <summary>
+        /// 本周课例
+        /// </summary>
+        public int week { get; set; }
+
+        /// <summary>
+        /// 上学期
+        /// </summary>
+        public int lastTerm { get; set; }
+
+        /// <summary>
+        /// 本学期
+        /// </summary>
+        public int term { get; set; }
+
+        /// <summary>
+        /// 昨天互动次数
+        /// </summary>
+        public int lastDayInter { get; set; }
+
+        /// <summary>
+        /// 今天的互动次数
+        /// </summary>
+        public int dayInter { get; set; }
+
+        /// <summary>
+        /// 上个月互动
+        /// </summary>
+        public int lastMonthInter { get; set; }
+
+        /// <summary>
+        /// 本月互动
+        /// </summary>
+        public int monthInter { get; set; }
+
+        /// <summary>
+        /// 去年每天的数据  366天
+        /// </summary>
+        public List<double> LastYear { get; set; }
+
+        /// <summary>
+        /// 今年每天的数据 366天
+        /// </summary>
+        public List<double> year { get; set; }
+    } 
+
+
+
+
 }