浏览代码

处理产品使用分析跳转 ID查询相关内容

chenmy 1 年之前
父节点
当前提交
e74bc2bdb4

+ 6 - 1
TEAMModelBI/ClientApp/src/store/index.js

@@ -22,7 +22,8 @@ export default createStore({
         areaClickschool: {},
         areaClickCounselor: '',
         areaClickRoles: '',
-        msgData: {}
+        msgData: {},
+        transmitvalue:[]
     },
     mutations: {
         //修改组织架构
@@ -99,6 +100,10 @@ export default createStore({
         //复用消息
         copyMsgs(state, value) {
             state.msgData = value
+        },
+        //保存产品使用->ID查询用户列表
+        transmitUsers(state,value){
+            state.transmitvalue=value
         }
     },
     actions: {},

+ 96 - 1
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -264,6 +264,41 @@
       </template>
     </el-dialog>
   </div>
+  <div class="dialog-teachlist" v-if="teachtableShow">
+      <el-dialog v-model="teachtableShow" title="教师详细列表" width="55%">
+      <div class="header-title">
+        <div class="header-title-schoolname">{{touchNowteach.name}}</div>
+        <div class="header-title-content">
+          <div class="header-title-num">共 <span style="color:#409EFF">{{teachData.length}}</span> 名用户</div>
+          <div class="header-title-btn">
+            <el-button size="small" type="primary" v-if="deleteSchoolArr.length >0" @click="seachAllteach"  :icon="Search">个人数据查询</el-button>
+            <el-button size="small" type="info" disabled :icon="Search" v-else>个人数据查询</el-button>
+          </div>
+          <div class="header-title-hint" v-show="deleteSchoolArr.length >0">
+            <span>目前支持同时最多5名用户查询</span>
+          </div>
+        </div>
+      </div>
+      <div class="teachlist-table">
+        <el-table ref="multipleTableRef" :data="teachData" style="width: 100%"  height="50vh" @selection-change="selectTeach">
+          <el-table-column type="selection" />
+          <el-table-column label="头像" align="center">
+            <template #default="scope">
+              <el-image style="width: 50px; height: 50px" :src="scope.row.picture" fit="fill" v-if="scope.row.picture"></el-image>
+              <PersonalPhoto style="cursor: pointer;" :name="scope.row.name" width="50px" height="50px" v-else></PersonalPhoto>
+            </template>
+          </el-table-column>  
+          <el-table-column property="name" label="姓名" align="center"/>
+          <el-table-column property="id" label="ID" align="center"/>
+        </el-table>  
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="teachtableShow = false">关闭</el-button>
+        </span>
+      </template>  
+    </el-dialog>
+  </div>
 </template>
 <script setup>
 import option_cn from '@/static/regions/region_cn.json'
@@ -273,8 +308,12 @@ import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox,HeaderCellSlotProps,
 import { Filter } from '@element-plus/icons'
 import { multipleSheetExport } from '@/until/multipleSheetExport'
 import { Search, CirclePlus } from '@element-plus/icons-vue'
+import { useRouter } from 'vue-router'
+import { useStore } from 'vuex'
 import Details from './details.vue'
 let { proxy } = getCurrentInstance()
+let router=useRouter()
+const store = useStore()
 let drawer = ref(false)
 let direction = ref('ttb')
 let activeNames = ref(['1'])
@@ -371,7 +410,7 @@ let columns = ref([
     cellRenderer: (data) =>
     (
       <>
-        <el-button type="primary"  round>查看所有教师</el-button>
+        <el-button type="primary"  onClick={examineAllteach.bind(this,data)}>查看所有教师</el-button>
       </>
     )
   },
@@ -688,6 +727,10 @@ let filterType=ref({
    unregistered:true,
 })
 let initLoading=ref(false)
+let teachtableShow=ref(false)
+let teachData=ref([])
+let deleteSchoolArr=ref([])
+let touchNowteach=ref()
 const pickerOptions=function disabledDate(time) {
           return time.getTime() > Date.now();
 }
@@ -709,6 +752,7 @@ const monthOptions=function disabledDate(time){
                 const elTimeData = timeyear.toString() + timemonth.toString();
                 return elTimeData >= nowDate; 
 }
+
 function changeState (value) {
   console.log(value)
   showState.value = 'details'
@@ -1423,6 +1467,31 @@ function filterSchooltype(){
   console.log(result,'赋值')
   filterdata.value=result
 }
+//获取查看所有老师BTN
+function examineAllteach(value){
+  let teachList=value.rowData.tmidList
+  touchNowteach.value=value.rowData
+  store.commit('transmitUsers', [])
+  let data={tmids:teachList,mode:'simple'}
+  proxy.$api.getUserdatas(data).then((res)=>{
+    console.log(res,'查询老师')
+    res.length >0 ? teachData.value=res:(teachData.value=[],ElMessage.info('暂无查询到相应用户数据'))
+    teachtableShow.value=true
+  })
+}
+function selectTeach (value) {
+    deleteSchoolArr.value=value
+    console.log(deleteSchoolArr.value,'6666')
+}
+function seachAllteach(){
+  if(deleteSchoolArr.value.length >4){
+      ElMessage.info('当前查询人数仅支持小于或等于5名用户')
+      return
+  }
+  console.log(deleteSchoolArr.value,'传递出去的参数')
+  store.commit('transmitUsers', deleteSchoolArr.value)
+  router.push({name:'userinquire'})  
+}
 // init()
 dataInit()
 filterDistrict()
@@ -1626,6 +1695,28 @@ watch(clickNum, (newv) => {
 .school-type {
   display: flex;
 }
+.dialog-teachlist{
+  line-height: 40px;
+}
+.header-title-content{
+  display: flex;
+  flex-direction: row-reverse;
+  position: relative;
+}
+.header-title-schoolname{
+  font-size:20px;
+  text-align: center;
+}
+.header-title-num{
+  margin-left:2%;
+}
+.header-title-hint{
+  position:absolute;
+  top:0%;
+  left:1%;
+  font-size:12px;
+  color:#909399;
+}
 </style>
 <style>
 .data-tables .header-class,
@@ -1687,4 +1778,8 @@ watch(clickNum, (newv) => {
 .data-tables .el-table-v2__header-cell:hover .el-icon{
   display: flex;
 }
+.dialog-teachlist .el-dialog__header{
+  padding: 5px;
+
+}
 </style>

+ 19 - 5
TEAMModelBI/ClientApp/src/view/userInquire/details.vue

@@ -49,11 +49,11 @@
                   <use :xlink:href="item.icon"></use>
                 </svg>
                 <span class="information-text">{{item.value}}</span>
-                <div :title="[item.correlation ? '已关联':'弱关联,可进行手动修改']" v-show="item.key ==='school' && item.value !=='无'">
+                <!-- <div :title="[item.correlation ? '已关联':'弱关联,可进行手动修改']" v-show="item.key ==='school' && item.value !=='无'">
                     <svg class="hint-icon" aria-hidden="true"  >
                         <use :xlink:href="[item.correlation ? '#icon-zhengque3':'#icon-tishi2']"></use>
                     </svg>
-                </div>
+                </div> -->
                 <!-- <el-button type="" size="small" v-show="item.key ==='school'&& !item.correlation" class="changebtn">更改</el-button> -->
                 <!-- <el-button type="" size="small" v-show="item.key ==='local'">更改</el-button> -->
             </div>
@@ -369,7 +369,7 @@
     </div>
 </template>
 <script setup>
-import { ref, getCurrentInstance, watch, h, nextTick,onMounted,defineProps,defineEmits,computed } from 'vue'
+import { ref, getCurrentInstance, watch, h, nextTick,onMounted,defineProps,defineEmits,computed,inject} from 'vue'
 import { Iphone,More,MoreFilled,ArrowLeft,Right } from '@element-plus/icons'
 import commonHeatmapVue from '../../components/echarts/commonHeatmap.vue'
 import commonGaugeVue from '../../components/echarts/commonGauge.vue'
@@ -381,9 +381,11 @@ import Score from './score.vue'
 import Ticket from './ticket.vue'
 import Userdetail from './userdetail.vue'
 import replaceHiTeach from './iot.vue'
+import { useRouter } from 'vue-router'
 let props = defineProps({
     searchdata: Object,
 })
+let router=useRouter()
 let {ctx:that,proxy } = getCurrentInstance()
 let activeName = ref('basics')
 let userdetailState=ref(false)
@@ -733,6 +735,7 @@ let headerData=ref([
     require('@/assets/img/default4.png'),
     ])
 let userPortrait=ref()     //用户头像
+let backtoShow=inject("transmitShow")
 const randomImage = computed(()=>{
     const randomIndex = Math.floor(Math.random() * headerData.value.length);
     console.log(randomIndex,'随机头像')
@@ -744,7 +747,11 @@ const handleChildEvent = (payload) => {
 const emits = defineEmits(['parentClick']) 
 const backClick = () => {
     console.log('back init')
-        emits('parentClick','default') // 使用方式和 vue2 this.$emit 一样
+    if(backtoShow){
+        router.push({name:'analysis'})
+    }else{
+        emits('parentClick','default')
+    }
 }
 // initdata()
 function initdata() {
@@ -758,9 +765,16 @@ function initdata() {
     userdata.value[0].value = id ? id:'暂无'
     userdata.value[1].value = mobile ?mobile:'暂无'
     userdata.value[2].value = schoolCodeW ? schoolCodeW : schoolCode ? schoolCode:'无'
+    let schoolname= schoolCode ?schoolCode:'无'; let schoolnameW=schoolCodeW ? schoolCodeW:'无'
+    userdata.value[2].value = schoolCodeW || schoolCode ?  schoolname   + ' | '  +schoolnameW:'暂无'
     schoolCodeW ? userdata.value[2].correlation=true:false
     userdata.value[3].value = mail ? mail:'暂无'
-    userdata.value[4].value = country && province && city ? country+'-'+province+city:country && province ? country+'-'+province:'暂无'
+    //userdata.value[4].value = country && province && city ? country+'-'+province+city:country && province ? country+'-'+province:'暂无'
+    let locationName= country && province && city && dist ? country+'-'+province+city+dist:
+                      country && province && city ? country +'-'+province+city:
+                      country && city && dist  ? country+'-'+city+dist:
+                      country && province ? country+'-'+province:'暂无'
+    userdata.value[4].value = locationName
     //产品使用及安装情况 登入时间
     let {login}=transmitData
     let logintimes = login.length >0 ? login.sort(function(a,b){return b.time-a.time}):'无'

+ 27 - 1
TEAMModelBI/ClientApp/src/view/userInquire/index.vue

@@ -39,11 +39,18 @@
     </div>
 </template>
 <script setup>
-import { ref, getCurrentInstance, watch, h, nextTick } from 'vue'
+import { ref, getCurrentInstance, watch, h, nextTick,provide } from 'vue'
 import { ElMessage, ElLoading } from 'element-plus'
 import { Search } from '@element-plus/icons'
 import Detailsbox from './details.vue'
+import {useRoute} from "vue-router"
+import { useStore } from 'vuex'
 let { proxy } = getCurrentInstance()
+let route=useRoute()
+const store = useStore()
+let transmitUser=store.state.transmitvalue
+let transmitModel=ref(transmitUser.length >0 ? true:false)
+console.log(store,'用户传递')
 let tags = ref([
   { name: 'Tag 1', type: '' },
   { name: 'Tag 2', type: 'success' },
@@ -59,6 +66,9 @@ let searchLoading=ref(false)
 const searchRecordsArr = ref(localStorage.getItem('searchRecords') ?  JSON.parse(localStorage.getItem('searchRecords')):[]);
 const backClicks=()=>{pageShow.value='default'}
 console.log(searchRecordsArr.value,'搜索记录')
+//逻辑判断  是否是从 产品使用分析跳转过来
+transmitModel.value ? transmitinit():''
+provide('transmitShow',transmitModel.value)
 function seachSole(datavalue) {
     if(!searchvalue.value){
         ElMessage.info('请输入手机号码/ 醍魔豆账号 进行搜索!')
@@ -90,6 +100,8 @@ function seachSole(datavalue) {
         time:Date.now()
     }
     proxy.$api.getUserdatas(data).then((res) => { 
+        //重置vuex内的值,预防下次Menu进入 自动获取vuex值进行查询
+        store.commit('transmitUsers', [])
         console.log(res, 'user back')
         res.length >0 ? 
         (searchResult.value=res,searchLoading.value=false,pageShow.value='details'):
@@ -122,6 +134,20 @@ function deleteLog(value){
     resultNum !== -1 ? (searchRecordsArr.value.splice(resultNum,1)):''
     localStorage.setItem('searchRecords', JSON.stringify(searchRecordsArr.value));
 }
+function transmitinit(){
+    console.log('被调用')
+    let users=store.state.transmitvalue
+    let searchvs=''
+    users.forEach(element => {
+        if(searchvs.length ===0){
+            searchvs=element.id
+        }else{
+            searchvs=searchvs+','+element.id
+        }
+    });
+    searchvalue.value=searchvs
+    seachSole()
+}
 </script>
 <style scoped>
 .inquirebox{