Browse Source

Merge branch 'cmy/develop-bi' into develop

chenmy 2 years ago
parent
commit
13caea97b5

BIN
TEAMModelBI/ClientApp/src/assets/img/notsearch.png


+ 0 - 10
TEAMModelBI/ClientApp/src/view/login.vue

@@ -98,16 +98,6 @@ export default {
     })
     let loadings = ref(true)
     let msgText = ref('钉钉扫码登录')
-    const openFullScreen2 = () => {
-      const loading = ElLoading.service({
-        lock: true,
-        text: 'Loading',
-        background: 'rgba(0, 0, 0, 0.7)',
-      })
-      setTimeout(() => {
-        loading.close()
-      }, 2000)
-    }
     onMounted(() => {
       if (window.location.href.indexOf('?code') != -1) {
         userCode = window.location.href.substring(window.location.href.indexOf('?') + 6, window.location.href.indexOf('&state'))

+ 34 - 29
TEAMModelBI/ClientApp/src/view/product/details.vue

@@ -78,10 +78,14 @@
                     <use :xlink:href="items.icon"></use>
                   </svg>
                 </div>
-                <div class="lesson-title">{{items.title}}</div>
+                <!-- <div class="lesson-title">{{items.title}}</div> -->
               </div>
               <div class="inquirybox"><span>{{items.content}}</span></div>
-              <div class="less-value">{{indexs+1 === lessonsList.length ? items.value:items.value+'/堂课'}}</div>
+              <div class="less-value">
+                <span class="lessvalue-num">{{items.value}}</span>
+                <!-- {{indexs+1 === lessonsList.length ? items.value:items.value}} -->
+                <span v-if="indexs+1 !== lessonsList.length">/堂课</span>
+              </div>
               <div class="result-box">
                 <svg class="lessRicon" aria-hidden="true">
                   <use :xlink:href="items.value !==0 ? '#icon-zhengque2':'#icon-cuowu'"></use>
@@ -90,23 +94,21 @@
             </div>
           </div>
           <div class="inuse-right">
-            <!-- <div class="inuse-total">
-              <p>{{echartData.total}}<span>/堂课</span></p>
-              <div class="class-title">多形态课堂总量</div>
-            </div> -->
+            <div class="inuse-total">
+              <div class="class-title">多形态课堂</div>
+            </div>
             <div class="echartsX">
               <Xlines :lineData="echartData.xlines"></Xlines>
             </div>
-            <div class="inuse-below">
+            <!-- <div class="inuse-below">
               <div class="below-item" v-for="(itemA,index) in classType" :key="index">
                 <p>{{itemA.name}}</p>
                 <div class="valuebox">
                   <span>{{itemA.value}}</span>
-                  <!-- <span :class="itemA.textClass">{{itemA.percent}}%</span> -->
                 </div>
                 <div :class="itemA.class"></div>
               </div>
-            </div>
+            </div> -->
           </div>
         </div>
       </div>
@@ -217,16 +219,15 @@
                   <div class="echartsX">
                     <Xlines :lineData="echartData.xlines"></Xlines>
                   </div>
-                  <div class="inuse-below">
+                  <!-- <div class="inuse-below">
                     <div class="below-item" v-for="(itemA,index) in classType" :key="index">
                       <p>{{itemA.name}}</p>
                       <div class="valuebox">
                         <span>{{itemA.value}}</span>
-                        <!-- <span :class="itemA.textClass">{{itemA.percent}}</span> -->
                       </div>
                       <div :class="itemA.class"></div>
                     </div>
-                  </div>
+                  </div> -->
                 </div>
               </div>
             </div>
@@ -664,13 +665,13 @@ onMounted(() => {
 })
 console.log(basicaList.value, '@@@@')
 let lessonsList = ref([
-  { icon: '#icon--caozuorizhi', title: 'IES课程', content: '是否使用IES课程', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'webIrs', content: '是否使用webIrs', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'IRS', content: '是否使用IRS', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'HiTA', content: '是否使用HiTA', state: false, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'HaBoard', content: '是否使用HaBoard', state: false, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'IES5资源', content: '是否使用IES5资源', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'T指数', content: '课程T数', state: true, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'IES课程', content: '使用IES课程', state: true, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'webIrs', content: '使用webIrs', state: true, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'IRS', content: '使用IRS', state: true, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'HiTA', content: '使用HiTA', state: false, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'HaBoard', content: '使用HaBoard', state: false, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'IES5资源', content: '使用IES5资源', state: true, value: 0 },
+  { icon: '#icon--caozuorizhi', title: 'T指数', content: '课程T绿灯数', state: true, value: 0 },
 ])
 let inuseList = ref([
   { title: '任务数', value: 15, icon: '#icon-renwu', percent: '41.2%', class: 'task', textClass: 'task-text' },
@@ -702,7 +703,7 @@ let echartData = ref({
       }
     },
     grid: {
-      bottom: '10%',
+      bottom: '5%',
       left: '5%',
       right: '5%',
       top: '8%',
@@ -1057,11 +1058,11 @@ init()
   /* margin: 0 auto; */
   line-height: 60px;
   box-shadow: 0 2px 5px #e9e9e9;
-  margin-top: 0.5%;
+  margin-top: 0.8%;
   background: #dfe6e9;
 }
 .lessons-img-title {
-  width: 30%;
+  width: 20%;
   display: flex;
   align-items: center;
 }
@@ -1095,8 +1096,8 @@ init()
   font-weight: bold;
 }
 .less-value {
-  width: 10%;
-  color: #74b9ff;
+  width: 15%;
+  color: #79bbff;
 }
 .result-box {
   width: 15%;
@@ -1108,6 +1109,10 @@ init()
   vertical-align: -0.5em;
   fill: currentColor;
 }
+.lessvalue-num {
+  font-size: 18px;
+  color: #409eff;
+}
 .inuse-left {
   width: 35%;
   box-shadow: 0 2px 5px #e9e9e9;
@@ -1178,8 +1183,8 @@ init()
 }
 .echartsX {
   width: 100%;
-  height: 75%;
-  margin-top: 6%;
+  height: 90%;
+  margin-top: 5%;
   overflow: hidden;
 }
 .inuse-below {
@@ -1223,9 +1228,9 @@ init()
   position: relative;
 }
 .class-title {
-  margin-top: 2%;
-  font-size: 14px;
-  color: #b2b2b9;
+  margin-top: 0%;
+  font-size: 16px;
+  color: #303a5d;
 }
 .lastbtn {
   width: 80px;

+ 215 - 5
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -53,10 +53,16 @@
                   <span class="filtratebox-phase-title subclass">精准选择:</span>
                   <div class="filtratebox-phase-content precise">
                     <div v-if="clickNum.subject === 0 || clickNum.subject === 2" class="schoolclass">
-                      <el-cascader v-model="optionsValue" :options="options" :props="props2" clearable />
+                      <el-cascader v-model="optionsValue" :options="options" :props="props2" :before-filter="beforefilter" :collapse-tags=true :collapse-tags-tooltip=true filterable :filter-method="keywords">
+                      </el-cascader>
+                      <div class="addschoolbtn" @click="(adddialog=true,searchInit(),addvalue='')">
+                        <el-icon color="#606266">
+                          <CirclePlus />
+                        </el-icon>
+                      </div>
                     </div>
                     <div v-else-if="clickNum.subject === 1" class="aresclass">
-                      <el-select v-model="optionsValue" multiple placeholder="选择相应的学区进行统计" clearable>
+                      <el-select v-model="optionsValue" multiple filterable :filter-method="remoteMethod" collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="选择相应的学区进行统计" clearable>
                         <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </div>
@@ -167,6 +173,45 @@
         </template>
       </el-auto-resizer>
     </div>
+    <div class="addschool-dialog">
+      <el-dialog v-model="adddialog" title="学校搜索" width="30%">
+        <div class="addschool-box">
+          <div>
+            <el-input v-model="addvalue" placeholder="搜索学校简码" class="input-with-select">
+              <template #append>
+                <el-button :icon="Search" />
+              </template>
+            </el-input>
+          </div>
+          <div class="school-list">
+            <div class="notsearch-box" v-if="!addschool.id"><img src="@/assets/img/notsearch.png" /></div>
+            <div class="search-result" v-else-if="addschool.id">
+              <p>搜索结果:</p>
+              <div class="result-box">
+                <p><span>学校名称:</span><span class="result-text">{{addschool.name}}</span></p>
+                <p><span>学校简码:</span><span class="result-text">{{addschool.id}}</span></p>
+                <p><span>学校地址:</span><span class="result-text">{{addschool.region}}{{addschool.province}}{{addschool.city}}{{addschool.dist}}</span></p>
+                <div class="school-type">
+                  <div>学校类型:</div>
+                  <div><el-tag v-if="addschool.isvirtual">虚拟学校</el-tag><el-tag v-else-if="!addschool.isvirtual" type="success">实体学校</el-tag></div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <template #footer>
+          <span class="dialog-footer">
+            <el-button @click="adddialog = false">取消</el-button>
+            <el-button type="primary" @click="addschoolfn()" v-if="addschool.id">
+              添加
+            </el-button>
+            <el-button type="info" v-if="!addschool.id" disabled>
+              添加
+            </el-button>
+          </span>
+        </template>
+      </el-dialog>
+    </div>
   </div>
   <div v-else-if="showState==='details'">
     <Details @myback="changStateshow" :detailsData="detailsData"></Details>
@@ -219,7 +264,7 @@
 import option_cn from '@/static/regions/region_cn.json'
 import { ref, getCurrentInstance, watch } from 'vue'
 import { ElMessage, TableV2SortOrder, ElLoading } from 'element-plus'
-import { Search } from '@element-plus/icons-vue'
+import { Search, CirclePlus } from '@element-plus/icons-vue'
 import Details from './details.vue'
 let { proxy } = getCurrentInstance()
 let drawer = ref(false)
@@ -364,6 +409,7 @@ let optionsValue = ref()
 const props2 = {
   multiple: true,
   checkStrictly: false,
+  collapse: true,
   label: "name",
   value: "id",
 }
@@ -424,6 +470,20 @@ let dataSource = ref({
   area: [],
   composite: [],
 })
+let timer = ref()
+let oldKeyword = ref('')
+let adddialog = ref(false)
+let addvalue = ref('')
+let addschool = ref({
+  name: '',
+  id: '',
+  region: '',
+  province: '',
+  city: '',
+  dist: '',
+  areaId: '',
+  isvirtual: false,
+})
 function changeState (value) {
   console.log(value)
   showState.value = 'details'
@@ -552,6 +612,107 @@ async function filterDistrict (state, valueArr) {
   })
   return schoolList
 }
+function debounce (fn, wait) {
+  if (timer.value !== null) {
+    clearTimeout(timer.value)
+  }
+  timer.value = setTimeout(fn, wait)
+}
+function keywords (node, keyword) {
+  // let back = ''
+  // if (oldKeyword.value === '' || oldKeyword.value === undefined) {
+  //   oldKeyword.value = keyword
+  //   debounce(back = filterSchool(keyword), 500)
+  // } else if (oldKeyword.value === keyword) {
+  //   return
+  // } else if (oldKeyword.value !== keyword) {
+  //   oldKeyword.value = keyword
+  //   debounce(back = filterSchool(keyword), 500)
+  // }
+  // console.log(back, 'backsssssss')
+  // return true
+  console.log(node, keyword)
+  if (node.data.name.indexOf(keyword) !== -1 || node.data.id === keyword) {
+    return true
+  } else {
+    return false
+  }
+}
+function filterSchool (keyword) {
+  console.log(keyword, '接收到的值')
+  let dataArr = dataSource.value.composite
+  let filterArr = []
+  dataArr.forEach((item) => {
+    item.children.length > 0 ? item.children.forEach((itema) => { itema.name.indexOf(keyword) !== -1 || itema.id == keyword ? filterArr.push({ "id": itema.id, "name": itema.name, "children": [] }) : '' }) : ''
+  })
+  console.log(filterArr, 'filter结果')
+  return filterArr
+  // options.value = filterArr
+  console.log(options.value, '最终')
+}
+function remoteMethod (key) {
+  console.log(key, '???')
+  if (!key) {
+    options.value = dataSource.value.composite
+    return false
+  }
+  let dataArr = dataSource.value.composite
+  let fArr = []
+  dataArr.forEach((item) => {
+    item.name.indexOf(key) !== -1 ? fArr.push(item) : ''
+  })
+  options.value = fArr
+}
+function beforefilter () {
+  let keyvalue = addvalue.value
+  let data = { schoolIds: [keyvalue] }
+  proxy.$api.getfilterSchool(data).then((res) => {
+    console.log(res, 'scback')
+    if (res.state === 200 && res.data.length > 0) {
+      addschool.value.name = res.data[0].name
+      addschool.value.id = res.data[0].id
+      addschool.value.region = res.data[0].region
+      addschool.value.province = res.data[0].province
+      addschool.value.city = res.data[0].city
+      addschool.value.dist = res.data[0].dist
+      addschool.value.areaId = res.data[0].areaId
+      addschool.value.isvirtual = res.data[0].isvirtual
+    } else {
+      searchInit()
+      ElMessage.info('未查询到相关学校信息,请确认学校简码')
+    }
+  }).catch((error) => {
+    ElMessage.error('API异常,未查询到信息')
+  })
+}
+//搜索清空
+function searchInit () {
+  addschool.value.name = ''
+  addschool.value.id = ''
+  addschool.value.region = ''
+  addschool.value.province = ''
+  addschool.value.city = ''
+  addschool.value.dist = ''
+  addschool.value.isvirtual = false
+}
+//添加虚拟学校
+function addschoolfn () {
+  let resultA = options.value.findIndex(item => item.id === 'notarea')
+  resultA === -1 ? options.value.push({ id: 'notarea', name: '*已搜索学校*', province: '', city: '', children: [] }) : ''
+  let ids = addschool.value.id
+  let pushArr = [addschool.value.areaId, addschool.value.id]
+  if (!addschool.value.areaId) {
+    options.value.forEach((item) => {
+      item.id === 'notarea' ? (item.children.push(addschool.value), optionsValue.value.push(['notarea', addschool.value.id])) : ''
+    })
+  } else {
+    options.value.forEach((item) => {
+      item.children.length > 0 ? item.children.forEach((itemc) => { itemc.id === ids ? (optionsValue.value = [], optionsValue.value.push(pushArr)) : '' }) : ''
+    })
+  }
+  adddialog.value = false
+  searchInit()
+}
 // init()
 dataInit()
 filterDistrict()
@@ -562,8 +723,12 @@ watch(activeNames, (newdata) => {
     changeHight.value = 56
   }
 })
-watch(checkList, (newvalue) => {
-  console.log(newvalue)
+watch(addvalue, (newvalue) => {
+  if (newvalue.trim().length !== 0) {
+    debounce(beforefilter, 800)
+  } else {
+
+  }
 })
 watch(clickNum, (newv) => {
   console.log(newv, '新值')
@@ -673,6 +838,16 @@ watch(clickNum, (newv) => {
   padding-left: 1%;
   text-align: left;
 }
+.schoolclass {
+  position: relative;
+}
+.addschoolbtn {
+  position: absolute;
+  top: 6px;
+  right: 10%;
+  display: block;
+  cursor: pointer;
+}
 .exportbtn {
   margin-right: 2%;
 }
@@ -704,6 +879,41 @@ watch(clickNum, (newv) => {
   bottom: 0%;
   display: block;
 }
+.addschool-box {
+  width: 100%;
+  padding: 0% 1% 1% 1%;
+}
+.school-list {
+  width: 100%;
+  height: 40vh;
+  margin-top: 1%;
+}
+.notsearch-box img {
+  width: 75%;
+  /* height: 100%; */
+}
+.search-result {
+  width: 100%;
+  text-align: left;
+}
+.result-box {
+  padding: 1% 1% 0% 2%;
+  border-radius: 5px;
+  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
+}
+.result-box p,
+.result-box div {
+  margin-bottom: 10px;
+  font-size: 14px;
+  color: #9ba1b4;
+}
+.result-box p .result-text {
+  font-size: 16px;
+  color: #303a5d;
+}
+.school-type {
+  display: flex;
+}
 </style>
 <style>
 .data-tables .header-class,

+ 1 - 1
TEAMModelBI/ClientApp/src/view/schoolServe/school.vue

@@ -632,7 +632,7 @@ export default {
         (
           <>
             <el-button type="primary" onClick={deleteRow.bind(this, data.rowData)} v-show={userVerify.roles.includes('admin') ? true : false}>编辑</el-button>
-            <el-button type="primary" onClick={deleteRow.bind(data.rowData)} v-show={userVerify.roles.includes('leader') ? true : false}>查看</el-button>
+            <el-button type="primary" onClick={deleteRow.bind(this, data.rowData)} v-show={userVerify.roles.includes('leader') ? true : false}>查看</el-button>
             <el-button type="danger" onClick={removeSchool.bind(this, data.rowData)} v-show={userVerify.roles.includes('admin') ? true : false}>删除</el-button>
           </>
         ),