coys 2 سال پیش
والد
کامیت
3bf9f56079

+ 18 - 3
src/api/toConsult.js

@@ -48,13 +48,13 @@ export function registrationList(query) {
 }
 //根据字典类型查询字典值接口
 export function getDict(query) {
-  return request({
-    url: '/system/dict/data/type',
+  return request({  
+    url: `/system/dict/data/type/${query.dictType}`,
     headers: {
       isToken: false
     },
     method: 'get',
-    params:query
+    
   })
 }
 
@@ -65,3 +65,18 @@ export function deptTreeList() {
     method: 'get'
   })
 }
+// 通过机构ID获取主机列表
+export function getorgHost(query) {
+    return request({
+      url: `/system/device/getHostByOrgId/${query}`,
+      method: 'get'
+    })
+  }
+// 通过主机ID获取通道列表
+export function getSysDeviceByHostId(query) {
+    return request({
+      url: `/system/device/getSysDeviceByHostId/${query}`,
+      method: 'get'
+    })
+  }
+///system/device/getHostByOrgId/{orgId}

+ 1 - 1
src/router/router.config.js

@@ -22,7 +22,7 @@ export let routers = [
     meta: { title: '监控调阅', keepAlive: false }
   },
   {
-    path: '/addInfo',
+    path: '/addInfo/:id',
     name: 'addInfo',
     component: () => import('@/views/menu/monitoringCall/components/addInfo'),
     meta: { title: '添加监控调阅', keepAlive: false }

+ 1 - 0
src/store/getters.js

@@ -4,4 +4,5 @@ const getters = {
   orgId: state => state.user.orgId,
   orgName: state => state.user.orgName
 }
+
 export default getters

+ 9 - 4
src/store/modules/user.js

@@ -1,25 +1,30 @@
 const state = {
   //用户名
-  userName: null,
+  userName: JSON.parse(sessionStorage.getItem("SET_USER_NAME"))||null,
   //机构id
-  orgId:null,
+  orgId:JSON.parse(sessionStorage.getItem("SET_USER_ORGID"))||null,
   //用户id
-  id:null,
+  id:JSON.parse(sessionStorage.getItem("SET_USER_ID"))||null,
   //机构名称
-  orgName:null,
+  orgName:JSON.parse(sessionStorage.getItem("SET_USER_ORGNAME"))||null,
 }
 const mutations = {
   SET_USER_NAME(state, name) {
     state.userName = name;
+    sessionStorage.setItem("SET_USER_NAME", JSON.stringify(name))
   },
   SET_USER_ORGID(state, val) {
     state.orgId = val;
+    sessionStorage.setItem("SET_USER_ORGID", JSON.stringify(val))
+
   },
   SET_USER_ID(state, val) {
     state.id = val;
+    sessionStorage.setItem("SET_USER_ID", JSON.stringify(val))
   },
   SET_USER_ORGNAME(state, val) {
     state.orgName = val;
+    sessionStorage.setItem("SET_USER_ORGNAME", JSON.stringify(val))
   },
 }
 const actions = {

+ 65 - 17
src/views/menu/monitoringCall/components/addInfo.vue

@@ -5,34 +5,41 @@
       <van-row>
         <van-col span="24">
           <!-- <van-cell title="任务名称" value="每周监控调阅(0501~0507)" /> -->
-          <div class="textTitle">任务名称:每周监控调阅(0501~0507)</div>
+          <div class="textTitle">任务名称:{{ taskData?.taskName }}</div>
         </van-col>
         <van-col span="24">
           <!-- <van-cell title="调阅开始时间" value="2023-05-05 10:12" /> -->
-          <div class="text">调阅开始时间:2023-05-05 10:12</div>
+          <div class="text">调阅开始时间:{{ taskData?.taskStartTime }}</div>
         </van-col>
       </van-row>
 
       <!-- 主机选择 -->
       <van-row>
         <van-col span="24">
-          <van-field v-model="fieldValue" is-link readonly label="监控主机" placeholder="" @click="showStatus = true" />
-          <van-popup v-model="showStatus" round position="bottom">
+          <van-field v-model="host" is-link readonly label="监控主机" placeholder="" @click="showHost = true" />
+          <van-popup v-model="showHost" round position="bottom">
             <van-picker
               title="监控主机"
               show-toolbar
-              :columns="columns"
+              :columns="hostList"
               @confirm="onConfirm"
               @cancel="onCancel"
               @change="onChange"
-            /> </van-popup
+            >
+            <template #option="option">
+                <div style="display: flex; flex-direction: column; align-items: center">
+                  <!-- <div>{{ option.id }}</div> -->
+                  <div>{{ option.deviceName }}</div>
+                </div>
+              </template>
+          </van-picker> </van-popup
         ></van-col>
       </van-row>
       <!-- 视频通道 -->
       <van-row>
         <van-col span="24">
-          <van-field v-model="fieldValue" is-link readonly label="视频通道" placeholder="" @click="showStatus = true" />
-          <van-popup v-model="showStatus" round position="bottom">
+          <van-field v-model="fieldValue" :disabled="ishost" is-link readonly label="视频通道" placeholder="" @click="showStatus = true" />
+          <van-popup v-model="showStatus" :disabled="ishost" round position="bottom">
             <van-picker
               title="视频通道"
               show-toolbar
@@ -40,8 +47,16 @@
               @confirm="onConfirm"
               @cancel="onCancel"
               @change="onChange"
-            /> </van-popup
-        ></van-col>
+            >
+              <template #option="option">
+                <div style="display: flex; flex-direction: column; align-items: center">
+                  <div>{{ option.id }}</div>
+                  <div>{{ option.deviceName }}</div>
+                </div>
+              </template>
+            </van-picker>
+          </van-popup></van-col
+        >
       </van-row>
       <van-row>
         <van-col span="24">
@@ -99,7 +114,7 @@
             <van-row>
               <van-col span="24">
                 <van-field
-                    v-show="value1==0"
+                  v-show="value1 == 0"
                   v-model="message"
                   rows="2"
                   autosize
@@ -129,21 +144,29 @@ import NavBar from '@/components/NavBar'
 // 主机列表组件
 import MonitoingList from './monitoringList.vue'
 import { Col, Row, Dialog, Icon, Picker } from 'vant'
-
+import { registrationList, getorgHost } from '@/api/toConsult.js'
+import { mapGetters } from 'vuex'
 export default {
   data() {
     return {
       columns: ['全部', '已调阅', '调阅中', '待调阅'],
-      showStatus: false,
+      hostList: [], //主机列表
+      showStatus: false, //通道显示隐藏
+      showHost: false, //主机显示隐藏
       checked: false,
       checked1: false,
+      message: '',
+      ishost:true,
       fieldValue: '',
+      host:'',//主机名称
+      hostId:'',//主机ID
       value1: 0,
       option1: [
         { text: '异常', value: 0 },
         { text: '正常', value: 1 }
       ],
-      activeNames: ['']
+      activeNames: [''],
+      taskData: []
     }
   },
   components: {
@@ -158,14 +181,39 @@ export default {
   computed: {
     monitor() {
       return 'monitor'
-    }
+    },
+    ...mapGetters(['orgName', 'orgId'])
+  },
+  created() {
+    this.init()
   },
   methods: {
+    //项目初始化获取数据
+    init() {
+      //获取组织机构数据
+      registrationList({ taskId: this.$route.params.id }).then(res => {
+        let { code, data, msg } = res
+        if (code == 200) {
+          this.taskData = data
+        }
+      })
+      //获取当前登录人机构下主机列表
+
+      getorgHost(this.orgId).then(res => {
+        
+        let { code, data, msg } = res
+        if (code == 200) {
+          this.hostList = data
+        }
+      })
+    },
     onConfirm(value, index) {
-      Toast(`当前值:${value}, 当前索引:${index}`)
+      this.host=value
+      this.hostId=this.hostList[index].id
+      this.ishost=false
     },
     onChange(picker, value, index) {
-      Toast(`当前值:${value}, 当前索引:${index}`)
+      
     },
     onCancel() {
       Toast('取消')

+ 5 - 5
src/views/menu/monitoringCall/components/consultInfo.vue

@@ -14,6 +14,7 @@
         <!-- 调阅列表 -->
         <div class="topBox" v-for="item in taskData.coreMonitoringTaskRegistrationMonitorVOList" :key="item.id">
           <!-- //主机列表组件 -->
+          
           <MonitoingList :list="item"></MonitoingList>
         </div>
       </div>
@@ -58,12 +59,10 @@ export default {
   },
 
   created() {
-    // this.init()
+    this.init()
     console.log(this);
     
-    this.getDictHandler('core_check_type',res=>{
-      console.log(res);
-    })
+   
   },
   methods: {
     //项目初始化获取数据
@@ -77,7 +76,8 @@ export default {
       })
     },
     addInfoHandler() {
-      this.$router.push('/addInfo')
+      console.log(this.taskData);
+      this.$router.push('/addInfo/'+this.$route.params.id)
     }
   }
 }

+ 30 - 8
src/views/menu/monitoringCall/components/monitoringList.vue

@@ -13,7 +13,12 @@
       </van-row>
       <van-row class="List" v-for="item in list.coreMonitoringTaskMonitorInfoList" :key="item.id">
         <van-col class="vancol" span="6">{{ item.project }}</van-col>
-        <van-col class="vancol" span="6"><span :style="{'color':item.situation == 1 ? '#d97b7e':'#7de46f'}">{{ item.situation == 1 ? '异常' : '正常' }}</span></van-col>
+
+        <van-col class="vancol" span="6"
+          ><span :style="{ color: item.situation == 1 ? '#d97b7e' : '#7de46f' }">{{
+            item.situation | dictFilter(this_)
+          }}</span></van-col
+        >
         <van-col class="vancol" span="12">{{ item.abnormalIllustrate }}</van-col>
       </van-row>
     </div>
@@ -24,17 +29,34 @@ export default {
   name: 'SocAppMonitoringList',
   props: {
     list: {
-      type: Array,
-      default: () => {
-        return []
-      }
+      type: Object,
+      default: {}
     }
   },
   data() {
-    return {}
+    return {
+      this_:this,
+      dictList: [] //字典情况数组
+    }
+  },
+  filters: {
+    dictFilter: function (value,that) {
+      let label=''
+      if (that.dictList && that.dictList.length > 0) {
+        that.dictList.filter(item => {
+          if (value == item.dictValue) {
+            label= item.dictLabel
+          }
+        })
+      }
+      return label
+    }
   },
-  created(){
-    
+  created() {
+    //获取异常情况字典
+    this.getDictHandler('core_check_type', res => {
+      this.dictList = res
+    })
   },
   mounted() {},
 

+ 6 - 3
src/views/menu/monitoringCall/index.vue

@@ -49,8 +49,8 @@
         <p class="time">开始时间:{{ item.planStartTime }}</p>
         <p class="time">结束时间:{{ item.planEndTime }}</p>
       </div>
-      <div class="startMonitor" v-if="item.status <= 1" @click="startMonitorHandler(item.id)">开始调阅</div>
-      <div class="endMonitor" v-else @click="lookInfoHandler"><van-icon name="arrow" /></div>
+      <div class="startMonitor" v-if="item.status == 0" @click="startMonitorHandler(item.id)">开始调阅</div>
+      <div class="endMonitor" v-else @click="lookInfoHandler(item.id)"><van-icon name="arrow" /></div>
     </div>
 
     <!-- 扫描弹框 -->
@@ -208,7 +208,10 @@ export default {
       this.$router.push('/consultInfo/'+taskId)
     },
     //查看调阅详情
-    lookInfoHandler() {},
+    lookInfoHandler(taskId) {
+      this.taskId=taskId
+      this.$router.push('/consultInfo/'+taskId)
+    },
     //级联选择当前任意层级触发
     changeCascader(val) {
       console.log(val)