Bladeren bron

瓦斯日报修改-提交

lxh 4 maanden geleden
bovenliggende
commit
1998638e2a

+ 203 - 0
src/views/system/menuModalApp/index.vue

@@ -0,0 +1,203 @@
+<template>
+    <div class="p-4 device-manager-box">
+      <BasicTable @register="registerTable" :rowSelection="rowSelection">
+        <template #tableTitle>
+          <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增菜单</a-button>
+          <a-button type="primary" preIcon="ic:round-expand" @click="expandAll">展开全部</a-button>
+          <a-button type="primary" preIcon="ic:round-compress" @click="collapseAll">折叠全部</a-button>
+  
+          <a-dropdown v-if="checkedKeys.length > 0">
+            <template #overlay>
+              <a-menu>
+                <a-menu-item key="1" @click="batchHandleDelete">
+                  <Icon icon="ant-design:delete-outlined" />
+                  删除
+                </a-menu-item>
+              </a-menu>
+            </template>
+            <a-button
+              >批量操作
+              <Icon icon="ant-design:down-outlined" />
+            </a-button>
+          </a-dropdown>
+        </template>
+        <template #action="{ record }">
+          <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
+        </template>
+      </BasicTable>
+      <MenuDrawer @register="registerDrawer" @success="handleSuccess" :showFooter="showFooter" />
+      <DataRuleList @register="registerDrawer1" />
+    </div>
+  </template>
+  <script lang="ts" name="system-menu" setup>
+    import { nextTick, ref } from 'vue';
+    import { BasicTable, useTable, TableAction } from '/@/components/Table';
+    import { useListPage } from '/@/hooks/system/useListPage';
+    import { useDrawer } from '/@/components/Drawer';
+    import MenuDrawer from '../menuModal/MenuDrawer.vue';
+    import DataRuleList from '../menuModal/DataRuleModal.vue';
+    import { columns, searchFormSchema } from '../menuModal/menu.data';
+    import { list, deleteMenu, batchDeleteMenu } from '../menuModal/menu.api';
+  
+    const checkedKeys = ref<Array<string | number>>([]);
+    const showFooter = ref(true);
+    const [registerDrawer, { openDrawer }] = useDrawer();
+    const [registerDrawer1, { openDrawer: openDataRule }] = useDrawer();
+    // 列表页面公共参数、方法
+    const { prefixCls, tableContext } = useListPage({
+      tableProps: {
+        title: '菜单列表',
+        api: list.bind(null, {kind: 3}),
+        columns: columns,
+        size: 'small',
+        pagination: false,
+        isTreeTable: true,
+        striped: true,
+        useSearchForm: true,
+        showTableSetting: true,
+        bordered: true,
+        showIndexColumn: false,
+        tableSetting: { fullScreen: true },
+        formConfig: {
+          schemas: searchFormSchema,
+          autoAdvancedCol: 4,
+          baseColProps: { xs: 24, sm: 12, md: 6, lg: 6, xl: 6, xxl: 6 },
+          actionColOptions: { xs: 24, sm: 12, md: 6, lg: 6, xl: 6, xxl: 6 },
+        },
+        actionColumn: {
+          width: 120,
+        },
+      },
+    });
+    //注册table数据
+    const [registerTable, { reload, expandAll, collapseAll }] = tableContext;
+  
+    /**
+     * 选择列配置
+     */
+    const rowSelection = {
+      type: 'checkbox',
+      columnWidth: 30,
+      selectedRowKeys: checkedKeys,
+      onChange: onSelectChange,
+    };
+  
+    /**
+     * 选择事件
+     */
+    function onSelectChange(selectedRowKeys: (string | number)[]) {
+      checkedKeys.value = selectedRowKeys;
+    }
+  
+    /**
+     * 新增
+     */
+    function handleCreate() {
+      showFooter.value = true;
+      openDrawer(true, {
+        isUpdate: false,
+      });
+    }
+  
+    /**
+     * 编辑
+     */
+    function handleEdit(record) {
+      showFooter.value = true;
+      openDrawer(true, {
+        record,
+        isUpdate: true,
+      });
+    }
+    /**
+     * 详情
+     */
+    function handleDetail(record) {
+      showFooter.value = false;
+      openDrawer(true, {
+        record,
+        isUpdate: true,
+      });
+    }
+    /**
+     * 添加下级
+     */
+    function handleAddSub(record) {
+      openDrawer(true, {
+        record: { parentId: record.id, menuType: 1, kind: 3 },
+        isUpdate: false,
+  
+      });
+    }
+    /**
+     * 数据权限弹窗
+     */
+    function handleDataRule(record) {
+      openDataRule(true, { id: record.id, kind: 3 });
+    }
+  
+    /**
+     * 删除
+     */
+    async function handleDelete(record) {
+      await deleteMenu({ id: record.id }, reload);
+    }
+    /**
+     * 批量删除事件
+     */
+    async function batchHandleDelete() {
+      await batchDeleteMenu({ ids: checkedKeys.value }, reload);
+    }
+    /**
+     * 成功回调
+     */
+    function handleSuccess() {
+      reload();
+    }
+  
+    function onFetchSuccess() {
+      // 演示默认展开所有表项
+      nextTick(expandAll);
+    }
+  
+    /**
+     * 操作栏
+     */
+    function getTableAction(record) {
+      return [
+        {
+          label: '编辑',
+          onClick: handleEdit.bind(null, record),
+        },
+      ];
+    }
+  
+    /**
+     * 下拉操作栏
+     */
+    function getDropDownAction(record) {
+      return [
+        // {
+        //   label: '详情',
+        //   onClick: handleDetail.bind(null, record),
+        // },
+        {
+          label: '添加下级',
+          onClick: handleAddSub.bind(null, record),
+        },
+        {
+          label: '数据规则',
+          onClick: handleDataRule.bind(null, record),
+        },
+        {
+          label: '删除',
+          color: 'error',
+          popConfirm: {
+            title: '是否确认删除',
+            confirm: handleDelete.bind(null, record),
+          },
+        },
+      ];
+    }
+  </script>
+  

+ 39 - 39
src/views/vent/gas/gasReport/gas-report.data.ts

@@ -10,9 +10,9 @@ export const columns: BasicColumn[] = [
             title: '第一次',
             children: [
               {
-                title: '区队',
-                dataIndex: 'districtTeam',
-                key: 'districtTeam',
+                title: '煤层',
+                dataIndex: 'coalseam_dictText',
+                key: 'coalseam_dictText',
                 width: 100,
                 align: 'center',
               },
@@ -38,14 +38,14 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Night1',
                 key: 'ch4Night1',
                 width: 100,
                 align: 'center',
               },
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Night1',
                 key: 'co2Night1',
                 width: 100,
@@ -59,7 +59,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Night1',
                 key: 'o2Night1',
                 width: 100,
@@ -67,8 +67,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tNight1',
-                key: 'tNight1',
+                dataIndex: 'tnight1',
+                key: 'tnight1',
                 width: 100,
                 align: 'center',
               },
@@ -112,7 +112,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Night2',
                 key: 'ch4Night2',
                 width: 100,
@@ -120,7 +120,7 @@ export const columns: BasicColumn[] = [
               },
 
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Night2',
                 key: 'co2Night2',
                 width: 100,
@@ -134,7 +134,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Night2',
                 key: 'o2Night2',
                 width: 100,
@@ -142,8 +142,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tNight2',
-                key: 'tNight2',
+                dataIndex: 'tnight2',
+                key: 'tnight2',
                 width: 100,
                 align: 'center',
               },
@@ -184,9 +184,9 @@ export const columns: BasicColumn[] = [
             title: '第一次',
             children: [
               {
-                title: '区队',
-                dataIndex: 'districtTeam_dictText',
-                key: 'districtTeam_dictText',
+                title: '煤层',
+                dataIndex: 'coalseam_dictText',
+                key: 'coalseam_dictText',
                 width: 100,
                 align: 'center',
               },
@@ -212,7 +212,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Early1',
                 key: 'ch4Early1',
                 width: 100,
@@ -220,7 +220,7 @@ export const columns: BasicColumn[] = [
               },
 
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Early1',
                 key: 'co2Early1',
                 width: 100,
@@ -234,7 +234,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Early1',
                 key: 'o2Early1',
                 width: 100,
@@ -242,8 +242,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tEarly1',
-                key: 'tEarly1',
+                dataIndex: 'tearly1',
+                key: 'tearly1',
                 width: 100,
                 align: 'center',
               },
@@ -286,7 +286,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Early2',
                 key: 'ch4Early2',
                 width: 100,
@@ -294,7 +294,7 @@ export const columns: BasicColumn[] = [
               },
 
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Early2',
                 key: 'co2Early2',
                 width: 100,
@@ -308,7 +308,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Early2',
                 key: 'o2Early2',
                 width: 100,
@@ -316,8 +316,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tEarly2',
-                key: 'tEarly2',
+                dataIndex: 'tearly2',
+                key: 'tearly2',
                 width: 100,
                 align: 'center',
               },
@@ -358,9 +358,9 @@ export const columns: BasicColumn[] = [
             title: '第一次',
             children: [
               {
-                title: '区队',
-                dataIndex: 'districtTeam',
-                key: 'districtTeam',
+                title: '煤层',
+                dataIndex: 'coalseam_dictText',
+                key: 'coalseam_dictText',
                 width: 100,
                 align: 'center',
               },
@@ -386,7 +386,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Noon1',
                 key: 'ch4Noon1',
                 width: 100,
@@ -394,7 +394,7 @@ export const columns: BasicColumn[] = [
               },
 
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Noon1',
                 key: 'co2Noon1',
                 width: 100,
@@ -408,7 +408,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Noon1',
                 key: 'o2Noon1',
                 width: 100,
@@ -416,8 +416,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tNoon1',
-                key: 'tNoon1',
+                dataIndex: 'tnoon1',
+                key: 'tnoon1',
                 width: 100,
                 align: 'center',
               },
@@ -460,7 +460,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'CH4(%)',
+                title: 'CH₄‌(%)',
                 dataIndex: 'ch4Noon2',
                 key: 'ch4Noon2',
                 width: 100,
@@ -468,7 +468,7 @@ export const columns: BasicColumn[] = [
               },
 
               {
-                title: 'CO2(%)',
+                title: 'CO₂‌(%)',
                 dataIndex: 'co2Noon2',
                 key: 'co2Noon2',
                 width: 100,
@@ -482,7 +482,7 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: 'O2(%)',
+                title: 'O₂‌(%)',
                 dataIndex: 'o2Noon2',
                 key: 'o2Noon2',
                 width: 100,
@@ -490,8 +490,8 @@ export const columns: BasicColumn[] = [
               },
               {
                 title: 'T(℃)',
-                dataIndex: 'tNoon2',
-                key: 'tNoon2',
+                dataIndex: 'tnoon2',
+                key: 'tnoon2',
                 width: 100,
                 align: 'center',
               },

+ 42 - 5
src/views/vent/gas/gasReport/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="gasReport">
-    <customHeader>瓦斯日报监测</customHeader>
+    <customHeader>通风瓦斯日报管理</customHeader>
     <div class="report-container">
       <div class="search-area">
         <a-row>
@@ -11,7 +11,7 @@
                 v-model:value="searchData.reportTime" placeholder="请选择填报日期" @change="onChange" />
             </div>
           </a-col>
-          <a-col :span="4">
+          <!-- <a-col :span="4">
             <div class="area-item">
               <div class="item-text">区队:</div>
               <a-select v-model:value="searchData.districtTeam" style="width: 220px" placeholder="请选择区队">
@@ -19,7 +19,7 @@
                   }}</a-select-option>
               </a-select>
             </div>
-          </a-col>
+          </a-col> -->
           <a-col :span="4">
             <div class="area-item">
               <div class="item-text">上报人:</div>
@@ -38,8 +38,33 @@
 
           <a-button type="primary" preIcon="ant-design:search-outlined" @click="getSearch">查询</a-button>
           <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 15px" @click="onReset">重置</a-button>
-          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport">导出报表</a-button>
-          <a-button type="primary" preIcon="ant-design:download-outlined"  @click="getExport1" style="margin: 0px 15px">导出瓦斯三对照报表</a-button>
+          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport">导出日报表</a-button>
+          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport1"
+            style="margin: 0px 15px">导出瓦斯三对照报表</a-button>
+          <a-dropdown>
+            <template #overlay>
+              <a-menu @click="handleMenuClick">
+                <a-menu-item key="1">
+                  <UserOutlined />
+                  夜班
+                </a-menu-item>
+                <a-menu-divider />
+                <a-menu-item key="2">
+                  <UserOutlined />
+                  早班
+                </a-menu-item>
+                <a-menu-divider />
+                <a-menu-item key="3">
+                  <UserOutlined />
+                  中班
+                </a-menu-item>
+              </a-menu>
+            </template>
+            <a-button type="primary">
+              导出班报表
+              <DownOutlined />
+            </a-button>
+          </a-dropdown>
         </a-row>
       </div>
       <a-table :columns="columns" :data-source="tableData" :scroll="{ y: 500 }" class="tableW" :pagination="pagination"
@@ -172,6 +197,18 @@ function downFilePublic(content, fileName) {
     navigator.msSaveBlob(blob, fileName);
   }
 }
+//下拉选项切换
+function handleMenuClick(val) {
+  console.log(val, 'val--------')
+  switch (val.key) {
+    case '1':
+      break;
+    case '2':
+      break;
+    case '3':
+      break;
+  }
+}
 
 onMounted(() => {
   getSelectList();