ソースを参照

设备预警历史接口对接-提交

lxh 5 ヶ月 前
コミット
bd4991d3e6

+ 35 - 12
src/views/vent/monitorManager/warningMonitor/index.vue

@@ -34,7 +34,8 @@ import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 import { defHttp } from '/@/utils/http/axios';
 import dayjs from 'dayjs';
 import { getAutoScrollContainer } from '/@/utils/common/compUtils';
-import { list } from './warning.api';
+import { list ,getEachMineWarnCountInfo} from './warning.api';
+import { useGlobSetting } from '/@/hooks/setting';
 
 const props = defineProps({
   deviceListApi: {
@@ -48,16 +49,16 @@ const props = defineProps({
   },
   list: {
     type: Function,
-    default: (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params }),
+    default: (params) => defHttp.post({ url: '/ventanaly-company/company/index/getEachMineWarnLogList', params }),
   },
 });
 
 let statisticsList = reactive<any[]>([
-  { title: '通风', valueT: '4854', valueB: '低风险' },
-  { title: '粉尘', valueT: '4854', valueB: '低风险' },
-  { title: '瓦斯', valueT: '4854', valueB: '低风险' },
-  { title: '火灾', valueT: '4854', valueB: '低风险' },
-  { title: '安全监测', valueT: '4854', valueB: '低风险' },
+  { title: '通风', valueT: 0, valueB: '' },
+  { title: '粉尘', valueT: 0, valueB: '' },
+  { title: '瓦斯', valueT: 0, valueB: '' },
+  { title: '火灾', valueT: 0, valueB: '' },
+  { title: '安全监测', valueT: 0, valueB: '' },
 ])
 const alarmHistory = ref();
 const columns = getTableHeaderColumns('alarm_history');
@@ -79,7 +80,8 @@ const { tableContext, onExportXls } = useListPage({
       schemas: [
         {
           label: '是否解决',
-          field: 'isok',
+          // field: 'isok',
+          field: 'isOk',
           component: 'Select',
           componentProps: {
             options: [
@@ -97,7 +99,8 @@ const { tableContext, onExportXls } = useListPage({
         },
         {
           label: '所属系统',
-          field: 'kindtype',
+          // field: 'kindtype',systemType
+          field: 'systemType',
           component: 'Select',
           componentProps: {
             options: [
@@ -123,7 +126,7 @@ const { tableContext, onExportXls } = useListPage({
         },
 
         {
-          field: 'startTime',
+          field: 'starttime',
           label: '开始时间',
           component: 'DatePicker',
           defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
@@ -138,7 +141,7 @@ const { tableContext, onExportXls } = useListPage({
           },
         },
         {
-          field: 'endTime',
+          field: 'endtime',
           label: '结束时间',
           component: 'DatePicker',
           defaultValue: dayjs(),
@@ -163,6 +166,9 @@ const { tableContext, onExportXls } = useListPage({
       pageSizeOptions: ['10', '30', '50', '100'],
     },
     beforeFetch(params) {
+      const { sysOrgCode } = useGlobSetting();
+      params.orgcode=sysOrgCode
+      params.type='alarmLog'
       // params.devicetype = params.devicetype ? params.devicetype + '*' : '';
       if (props.sysId) {
         params.sysId = props.sysId;
@@ -177,7 +183,24 @@ const { tableContext, onExportXls } = useListPage({
 //注册table数据
 const [registerTable, { reload, setLoading, getForm }] = tableContext;
 
-onMounted(async () => { });
+//获取预警统计信息
+async function getEachMineWarnCountInfoList(){
+  const { sysOrgCode } = useGlobSetting();
+  let res=await getEachMineWarnCountInfo({orgcode:sysOrgCode})
+  statisticsList[0].valueT=res.ventSWarnInfo.totalNum || 0
+  statisticsList[0].valueB=res.ventSWarnInfo.maxWarnLevel || ''
+  statisticsList[1].valueT=res.dustSWarnInfo.totalNum || 0
+  statisticsList[1].valueB=res.dustSWarnInfo.maxWarnLevel || ''
+  statisticsList[2].valueT=res.gasSWarnInfo.totalNum || 0
+  statisticsList[2].valueB=res.gasSWarnInfo.maxWarnLevel || ''
+  statisticsList[3].valueT=res.fireSWarnInfo.totalNum || 0
+  statisticsList[3].valueB=res.fireSWarnInfo.maxWarnLevel || ''
+  statisticsList[4].valueT=res.synthesizeSWarnInfo.totalNum || 0
+  statisticsList[4].valueB=res.synthesizeSWarnInfo.maxWarnLevel || ''
+}
+onMounted(async () => {
+  getEachMineWarnCountInfoList()
+ });
 
 defineExpose({ setLoading });
 </script>

+ 10 - 2
src/views/vent/monitorManager/warningMonitor/warning.api.ts

@@ -1,10 +1,18 @@
 import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
-  list = '/safety/ventanalyAlarmLog/list',
+  // list = '/safety/ventanalyAlarmLog/list',
+  list = '/ventanaly-company/company/index/getEachMineWarnLogList',
+  getEachMineWarnCountInfo= '/ventanaly-company/company/index/getEachMineWarnCountInfo'
+
 }
 /**
  * 列表接口
  * @param params
  */
-export const list = (params) => defHttp.get({ url: Api.list, params });
+export const list = (params) => defHttp.post({ url: Api.list, params });
+/**
+ * 获取预警统计信息
+ * @param params
+ */
+export const getEachMineWarnCountInfo = (params) => defHttp.post({ url: Api.getEachMineWarnCountInfo, params });