Browse Source

Merge branch 'master' of http://39.97.59.228:8013/hrx/goaf-monitoring-system

bobo04052021@163.com 6 months ago
parent
commit
89beaad713

+ 231 - 121
public/js/global.js

@@ -70,7 +70,7 @@ const __STATIC_ROUTES__ = [
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:home-outlined',
             componentName: 'index',
             title: '主页',
             hideMenu: true,
@@ -136,7 +136,7 @@ const __STATIC_ROUTES__ = [
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:bars-outlined',
             componentName: 'index',
             title: '矿山基础信息',
         },
@@ -165,7 +165,7 @@ const __STATIC_ROUTES__ = [
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:monitor-outlined',
             componentName: 'index',
             title: '密闭监测',
             generation: true,
@@ -174,32 +174,80 @@ const __STATIC_ROUTES__ = [
     },
     {
         redirect: undefined,
-        path: '/warningAnalysis',
+        path: '/warning-analysis',
         component: 'LAYOUT',
         children: [
             {
-                path: '/warningAnalysis/airLeak-status',
+                path: '/warning-analysis/air-leak-status',
                 component: '/analysis/warningAnalysis/airLeakStatus/index',
                 meta: {
                     keepAlive: true,
                     internalOrExternal: false,
                     icon: '',
                     componentName: 'index',
-                    title: '漏风分析',
+                    title: '密闭漏风状态判定',
                 },
-                name: 'warningAnalysis-airLeak-status',
+                name: 'airLeakStatus',
             },
             {
-                path: '/warningAnalysis/pressureDiff-analysis',
+                path: '/warning-analysis/pressure-diff-analysis',
                 component: '/analysis/warningAnalysis/pressureDiffAnalysis/index',
                 meta: {
                     keepAlive: true,
                     internalOrExternal: false,
                     icon: '',
                     componentName: 'index',
-                    title: '内外压差变化分析',
+                    title: '内外压差变化风险分析',
                 },
-                name: 'warningAnalysis-/pressureDiff-analysis',
+                name: 'pressureDiffAnalysis',
+            },
+            {
+                path: '/warning-analysis/fahuo',
+                component: '/demo/table/Basic',
+                meta: {
+                    keepAlive: true,
+                    internalOrExternal: false,
+                    icon: '',
+                    componentName: 'index',
+                    title: '自然发火隐患分级分析',
+                },
+                name: 'fahuo',
+            },
+            {
+                path: '/warning-analysis/qifeng',
+                component: '/demo/table/Basic',
+                meta: {
+                    keepAlive: true,
+                    internalOrExternal: false,
+                    icon: '',
+                    componentName: 'index',
+                    title: '火区密闭启封判定分析',
+                },
+                name: 'qifeng',
+            },
+            {
+                path: '/warning-analysis/weixianxing',
+                component: '/demo/table/Basic',
+                meta: {
+                    keepAlive: true,
+                    internalOrExternal: false,
+                    icon: '',
+                    componentName: 'index',
+                    title: '密闭爆炸危险性判定',
+                },
+                name: 'weixianxing',
+            },
+            {
+                path: '/warning-analysis/chaoxian',
+                component: '/demo/table/Basic',
+                meta: {
+                    keepAlive: true,
+                    internalOrExternal: false,
+                    icon: '',
+                    componentName: 'index',
+                    title: '超限报警分析',
+                },
+                name: 'chaoxian',
             },
             {
                 path: '/warningAnalysis/autoFire-analysis',
@@ -253,7 +301,7 @@ const __STATIC_ROUTES__ = [
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:fund-view-outlined',
             componentName: 'index',
             title: '预警分析',
         },
@@ -261,13 +309,26 @@ const __STATIC_ROUTES__ = [
     },
     {
         redirect: undefined,
-        path: '/smartAnalysis',
+        path: '/smart-analysis',
         component: 'LAYOUT',
-        children: [],
+        children: [
+            {
+                path: '/smart-analysis/association',
+                component: '/demo/table/Basic',
+                meta: {
+                    keepAlive: true,
+                    internalOrExternal: false,
+                    icon: '',
+                    componentName: 'index',
+                    title: '关联分析',
+                },
+                name: 'association',
+            },
+        ],
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:fund-projection-screen-outlined',
             componentName: 'index',
             title: '智能分析',
         },
@@ -275,59 +336,84 @@ const __STATIC_ROUTES__ = [
     },
     {
         redirect: undefined,
-        path: '/3dManage',
-        component: 'LAYOUT',
-        children: [],
-        meta: {
-            keepAlive: false,
-            internalOrExternal: false,
-            icon: '',
-            componentName: 'index',
-            title: '模型管理',
-        },
-        name: '3dManage',
-    },
-    {
-        redirect: undefined,
-        path: '/system',
+        path: '/manage',
         component: 'LAYOUT',
         children: [
             {
-                path: '/system/menu',
-                component: 'system/menu/index',
+                path: '/manage/map',
+                component: '/demo/table/Basic',
                 meta: {
-                    keepAlive: false,
+                    keepAlive: true,
                     internalOrExternal: false,
                     icon: '',
                     componentName: 'index',
-                    title: '系统菜单',
+                    title: '地图管理',
                 },
-                name: 'system-menu',
+                name: 'association',
             },
             {
-                path: '/system/user',
-                component: 'system/user/index',
+                path: '/manage/model',
+                component: '/system/algorithm/index',
                 meta: {
                     keepAlive: true,
                     internalOrExternal: false,
                     icon: '',
                     componentName: 'index',
-                    title: '系统用户',
+                    title: '模型管理',
                 },
-                name: 'system-user',
+                name: 'association',
             },
+        ],
+        meta: {
+            keepAlive: false,
+            internalOrExternal: false,
+            icon: 'ant-design:database-outlined',
+            componentName: 'index',
+            title: '模型与地图管理',
+        },
+        name: 'manage',
+    },
+    {
+        redirect: undefined,
+        path: '/system',
+        component: 'LAYOUT',
+        children: [
+            // {
+            //     path: '/system/menu',
+            //     component: 'system/menu/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '系统菜单',
+            //     },
+            //     name: 'system-menu',
+            // },
             {
-                path: '/system/homeConfig',
-                component: 'system/homeConfig/index',
+                path: '/system/user',
+                component: 'system/user/index',
                 meta: {
-                    keepAlive: false,
+                    keepAlive: true,
                     internalOrExternal: false,
                     icon: '',
                     componentName: 'index',
-                    title: '首页配置',
+                    title: '系统用户',
                 },
-                name: 'system-homeConfig',
+                name: 'system-user',
             },
+            // {
+            //     path: '/system/home-config',
+            //     component: 'system/homeConfig/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '首页配置',
+            //     },
+            //     name: 'system-home-config',
+            // },
             {
                 path: '/system/role',
                 component: 'system/role/index',
@@ -352,66 +438,66 @@ const __STATIC_ROUTES__ = [
                 },
                 name: 'system-dict',
             },
-            {
-                path: '/system/depart',
-                component: 'system/depart/index',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'index',
-                    title: '部门管理',
-                },
-                name: 'system-depart',
-            },
-            {
-                path: '/system/tenant',
-                component: 'system/tenant/index',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'index',
-                    title: '多租户管理',
-                },
-                name: 'system-tenant',
-            },
-            {
-                path: '/tenant/TenantDefaultPack',
-                component: 'system/tenant/pack/TenantDefaultPackList',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'TenantDefaultPackList',
-                    title: '租户默认套餐',
-                },
-                name: 'tenant-TenantDefaultPack',
-            },
-            {
-                path: '/system/position',
-                component: 'system/position/index',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'index',
-                    title: '职务级别',
-                },
-                name: 'system-position',
-            },
-            {
-                path: '/system/category',
-                component: 'system/category/index',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'index',
-                    title: '分类字典',
-                },
-                name: 'system-category',
-            },
+            // {
+            //     path: '/system/depart',
+            //     component: 'system/depart/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '部门管理',
+            //     },
+            //     name: 'system-depart',
+            // },
+            // {
+            //     path: '/system/tenant',
+            //     component: 'system/tenant/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '多租户管理',
+            //     },
+            //     name: 'system-tenant',
+            // },
+            // {
+            //     path: '/tenant/TenantDefaultPack',
+            //     component: 'system/tenant/pack/TenantDefaultPackList',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'TenantDefaultPackList',
+            //         title: '租户默认套餐',
+            //     },
+            //     name: 'tenant-TenantDefaultPack',
+            // },
+            // {
+            //     path: '/system/position',
+            //     component: 'system/position/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '职务级别',
+            //     },
+            //     name: 'system-position',
+            // },
+            // {
+            //     path: '/system/category',
+            //     component: 'system/category/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '分类字典',
+            //     },
+            //     name: 'system-category',
+            // },
             {
                 path: '/system/notice',
                 component: 'system/notice/index',
@@ -424,18 +510,18 @@ const __STATIC_ROUTES__ = [
                 },
                 name: 'system-notice',
             },
-            {
-                path: '/system/depart-user',
-                component: 'system/departUser/index',
-                meta: {
-                    keepAlive: false,
-                    internalOrExternal: false,
-                    icon: '',
-                    componentName: 'index',
-                    title: '我的部门',
-                },
-                name: 'system-depart-user',
-            },
+            // {
+            //     path: '/system/depart-user',
+            //     component: 'system/departUser/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '我的部门',
+            //     },
+            //     name: 'system-depart-user',
+            // },
             {
                 path: '/system/usersetting',
                 component: 'system/usersetting/UserSetting',
@@ -449,18 +535,42 @@ const __STATIC_ROUTES__ = [
                 },
                 name: 'system-usersetting',
             },
+            // {
+            //     path: '/monitor/datalog',
+            //     component: 'monitor/datalog/index',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'index',
+            //         title: '数据日志',
+            //     },
+            //     name: 'monitor-datalog',
+            // },
             {
-                path: '/third/app',
-                component: 'system/appconfig/ThirdAppConfigList',
+                path: '/monitor/log',
+                component: 'monitor/log/index',
                 meta: {
                     keepAlive: false,
                     internalOrExternal: false,
                     icon: '',
-                    componentName: 'ThirdAppConfigList',
-                    title: '第三方配置',
+                    componentName: 'index',
+                    title: '日志管理',
                 },
-                name: 'third-app',
+                name: 'monitor-log',
             },
+            // {
+            //     path: '/third/app',
+            //     component: 'system/appconfig/ThirdAppConfigList',
+            //     meta: {
+            //         keepAlive: false,
+            //         internalOrExternal: false,
+            //         icon: '',
+            //         componentName: 'ThirdAppConfigList',
+            //         title: '第三方配置',
+            //     },
+            //     name: 'third-app',
+            // },
             {
                 path: '/system/configurable',
                 component: 'system/configurable/index',
@@ -477,7 +587,7 @@ const __STATIC_ROUTES__ = [
         meta: {
             keepAlive: false,
             internalOrExternal: false,
-            icon: '',
+            icon: 'ant-design:setting-outlined',
             componentName: 'index',
             title: '系统管理',
         },

+ 2 - 1
src/layouts/default/feature/SystemSelect.vue

@@ -37,7 +37,8 @@
   });
 
   onMounted(() => {
-    text.value = OPTIONS.value[router.currentRoute.value.path];
+    // 由于BASE_HOME仅代表了一个页面,其他页面都隶属于SECONDARY_HOME,所以简单处理
+    text.value = OPTIONS.value[router.currentRoute.value.path] || t('routes.basic.secondaryHome');
   });
 
   defineExpose({ OPTIONS, prefixCls, handleMenuClick });

+ 0 - 0
src/views/system/algorithm/algorithm.api.ts


+ 81 - 0
src/views/system/algorithm/algorithm.data.ts

@@ -0,0 +1,81 @@
+import { FormSchema } from '/@/components/Form';
+import { BasicColumn } from '/@/components/Table';
+import { getDepartName } from '@/utils/common/compUtils';
+
+/** 煤层预警参数 表格配置 */
+export const columnsCoalAlarm: BasicColumn[] = [
+  {
+    title: 'N1',
+    dataIndex: 'name1',
+    width: 100,
+  },
+  {
+    title: '部门',
+    dataIndex: 'departName',
+    customRender: ({ text }) => {
+      return getDepartName(text);
+    },
+  },
+  /*  {
+    title: '职务',
+    dataIndex: 'post',
+    width: 150,
+    slots: { customRender: 'post' },
+  },*/
+  {
+    title: '手机',
+    width: 110,
+    dataIndex: 'phone',
+    customRender: ({ record, text }) => {
+      if (record.izHideContact && record.izHideContact === '1') {
+        return '/';
+      }
+      return text;
+    },
+  },
+];
+
+/** 采空区超限 表格配置 */
+export const columnsGoafLimit: BasicColumn[] = [
+  {
+    title: 'N2',
+    dataIndex: 'name2',
+    width: 100,
+  },
+  {
+    title: '部门',
+    dataIndex: 'departName',
+    customRender: ({ text }) => {
+      return getDepartName(text);
+    },
+  },
+  /*  {
+    title: '职务',
+    dataIndex: 'post',
+    width: 150,
+    slots: { customRender: 'post' },
+  },*/
+  {
+    title: '手机',
+    width: 110,
+    dataIndex: 'phone',
+    customRender: ({ record, text }) => {
+      if (record.izHideContact && record.izHideContact === '1') {
+        return '/';
+      }
+      return text;
+    },
+  },
+];
+
+export const searchFormSchema: FormSchema[] = [
+  {
+    label: '姓名',
+    field: 'realname',
+    component: 'Input',
+    colProps: { span: 6 },
+  },
+];
+
+export const schemasCoalAlarm: FormSchema[] = [];
+export const schemasGoafLimit: FormSchema[] = [];

+ 2 - 0
src/views/system/algorithm/index.less

@@ -0,0 +1,2 @@
+.algorithm-model {
+}

+ 153 - 0
src/views/system/algorithm/index.vue

@@ -0,0 +1,153 @@
+<!-- eslint-disable vue/multi-word-component-names -->
+<template>
+  <div class="algorithm-model">
+    <!--引用表格-->
+    <BasicTable :ellipsis="true" @register="registerTable">
+      <template #tableTitle>
+        <div class="table-title-bar">
+          <a-tabs v-model:activeKey="activeKey" @change="handleTabChange" size="small">
+            <a-tab-pane tab="预警参数" key="coal"></a-tab-pane>
+            <a-tab-pane tab="超限预警" key="goaf"></a-tab-pane>
+          </a-tabs>
+          <!-- <span class="export-btn" v-if="searchInfo.logType == 2">
+            <a-tooltip>
+              <template #title>导出</template>
+              <a-button type="text" preIcon="ant-design:download-outlined" shape="circle" @click="onExportXls" />
+            </a-tooltip>
+          </span> -->
+        </div>
+      </template>
+
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '编辑',
+              onClick: () => handleEdit(record),
+            },
+            {
+              label: '删除',
+              onClick: () => {},
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <BasicModal @register="registerModal" @ok="handleSubmit" title="预警参数设置">
+      <BasicForm @register="registerForm" />
+    </BasicModal>
+    <!-- <BasicModal @register="registerCoalModal" @ok="handleCoalEdit" title="预警参数设置">
+      <BasicForm @register="registerCoalForm" />
+    </BasicModal>
+    <BasicModal @register="registerGoafModal" @ok="handleGoafEdit" title="超限预警设置">
+      <BasicForm @register="registerGoafForm" />
+    </BasicModal> -->
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { nextTick, provide, ref, unref } from 'vue';
+  import { useDesign } from '/@/hooks/web/useDesign';
+  import DepartLeftTree from './components/DepartLeftTree.vue';
+  import { useModal, BasicModal, ModalProps } from '/@/components/Modal';
+  import { useForm, BasicForm, FormProps } from '/@/components/Form';
+  import { BasicTable, BasicTableProps, FormSchema, TableAction } from '/@/components/Table';
+  import { useListPage } from '/@/hooks/system/useListPage';
+  import { columnsCoalAlarm, columnsGoafLimit, schemasCoalAlarm, schemasGoafLimit, searchFormSchema } from './algorithm.data';
+  import { list, positionList } from './algorithm.api';
+  import { getCacheByDynKey } from '@/utils/auth';
+  import { JEECG_CHAT_UID } from '@/enums/cacheEnum';
+
+  const { prefixCls } = useDesign('algorithm-list');
+  provide('prefixCls', prefixCls);
+
+  const activeKey = ref('coal');
+  const tablePropsMap = new Map<string, Partial<BasicTableProps>>([
+    ['coal', { api: () => Promise.resolve([{ id: 1, name1: '测试TAB1' }]), columns: columnsCoalAlarm, rowKey: 'id' }],
+    ['goaf', { api: () => Promise.resolve([{ id: 2, name2: '测试TAB1' }]), columns: columnsGoafLimit, rowKey: 'id' }],
+  ]);
+  const modalPropsMap = new Map<string, Partial<ModalProps>>([
+    ['coal', { title: '预警参数设置', visible: true }],
+    ['goaf', { title: '超限预警设置', visible: true }],
+  ]);
+  const formPropsMap = new Map<string, Partial<FormProps>>([
+    ['coal', { schemas: schemasCoalAlarm }],
+    ['goaf', { schemas: schemasGoafLimit }],
+  ]);
+  // const rowEditMap;
+
+  // 给子组件定义一个ref变量
+  const leftTree = ref();
+
+  // 当前选中的部门code
+  const orgCode = ref('');
+  const positionInfo = ref({});
+
+  // 列表页面公共参数、方法
+  const { tableContext } = useListPage({
+    tableProps: {
+      ...tablePropsMap.get('coal'),
+      showIndexColumn: true,
+      formConfig: {
+        schemas: searchFormSchema,
+      },
+      // canResize: false,
+      // showTableSetting: false,
+      // 请求之前对参数做处理
+      beforeFetch(params) {
+        params.orgCode = orgCode.value;
+      },
+    },
+  });
+  //注册table数据
+  const [registerTable, { reload, setProps }] = tableContext;
+
+  // 左侧树选择后触发
+  function onTreeSelect(data) {
+    orgCode.value = data.orgCode;
+    reload();
+  }
+
+  function handleTabChange(key) {
+    activeKey.value = key;
+    if (!tablePropsMap.has(key)) return;
+    setProps(tablePropsMap.get(key) as BasicTableProps);
+    reload();
+  }
+
+  function handleEdit(record) {
+    if (!modalPropsMap.has(activeKey.value)) return;
+    if (!formPropsMap.has(activeKey.value)) return;
+    setModalProps(modalPropsMap.get(activeKey.value) as ModalProps);
+    nextTick(() => {
+      setFormProps({
+        model: record,
+        schemas: formPropsMap.get(activeKey.value) as FormSchema[],
+      });
+    });
+  }
+
+  const [registerModal, { setModalProps }] = useModal();
+  const [registerForm, { setProps: setFormProps }] = useForm({
+    schemas: schemasCoalAlarm,
+    showResetButton: false,
+    showSubmitButton: false,
+  });
+  // const [registerCoalModal, coalModalContext] = useModal();
+  // const [registerCoalForm, coalFormContext] = useForm({
+  //   schemas: schemasCoalAlarm,
+  // });
+
+  // function handleCoalEdit() {}
+
+  // const [registerGoafModal, goafModalContext] = useModal();
+  // const [registerGoafForm, goafFormContext] = useForm({
+  //   schemas: schemasGoafLimit,
+  // });
+
+  function handleGoafEdit() {}
+</script>
+
+<style lang="less">
+  @import './index.less';
+</style>