|
@@ -32,12 +32,15 @@
|
|
|
<!-- 历史数据表格 -->
|
|
<!-- 历史数据表格 -->
|
|
|
<BasicTable @register="registerHistoryTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
|
|
<BasicTable @register="registerHistoryTable" :scroll="{ x: 'max-content' }" :style="{ padding: 0 }">
|
|
|
<!-- <template #action="{ record }">
|
|
<!-- <template #action="{ record }">
|
|
|
- <div class="action-buttons">
|
|
|
|
|
- <button @click="openModal(record, 'history')" class="action-btn">
|
|
|
|
|
- <SvgIcon name="details" />
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template> -->
|
|
|
|
|
|
|
+ <div class="action-buttons">
|
|
|
|
|
+ <button @click="openModal(record, 'history')" class="action-btn">
|
|
|
|
|
+ <SvgIcon name="details" />
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template> -->
|
|
|
|
|
+ <template #resetBefore>
|
|
|
|
|
+ <a-button type="default" class="ml-8px" preIcon="mdi:download" @click="onExportXls"> 导出 </a-button>
|
|
|
|
|
+ </template>
|
|
|
<template #form-goaf-select>
|
|
<template #form-goaf-select>
|
|
|
<a-select v-model:value="goafId" :options="goafOptions" placeholder="请选择" />
|
|
<a-select v-model:value="goafId" :options="goafOptions" placeholder="请选择" />
|
|
|
</template>
|
|
</template>
|
|
@@ -64,6 +67,7 @@
|
|
|
import { BasicModal } from '/@/components/Modal/index';
|
|
import { BasicModal } from '/@/components/Modal/index';
|
|
|
import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
|
|
import { historicalFormSchema } from '/@/views/monitor/sealedMonitor/monitor.data';
|
|
|
import { useIntervalFn } from '@vueuse/core';
|
|
import { useIntervalFn } from '@vueuse/core';
|
|
|
|
|
+ import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
|
|
|
|
|
// 激活的Tab页签
|
|
// 激活的Tab页签
|
|
|
const activeTab = ref('realtime');
|
|
const activeTab = ref('realtime');
|
|
@@ -126,76 +130,83 @@
|
|
|
const { goafOptions, goafId, hiscode, resolveValue, registerModal, openModal, initGoafOptions, handleResolve } = useInitForm(tableCtx);
|
|
const { goafOptions, goafId, hiscode, resolveValue, registerModal, openModal, initGoafOptions, handleResolve } = useInitForm(tableCtx);
|
|
|
|
|
|
|
|
// 注册历史数据表格
|
|
// 注册历史数据表格
|
|
|
- const [registerHistoryTable, historyTable] = useTable({
|
|
|
|
|
- columns,
|
|
|
|
|
- api: getProvinceAlarmHistory,
|
|
|
|
|
- formConfig: {
|
|
|
|
|
- model: { mineCode: hiscode },
|
|
|
|
|
- labelWidth: 120,
|
|
|
|
|
- schemas: [
|
|
|
|
|
- // {
|
|
|
|
|
- // label: '开始时间',
|
|
|
|
|
- // field: 'startTime',
|
|
|
|
|
- // component: 'DatePicker',
|
|
|
|
|
- // defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
- // componentProps: {
|
|
|
|
|
- // showTime: true,
|
|
|
|
|
- // placeholder: '请选择开始时间',
|
|
|
|
|
- // valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
|
- // },
|
|
|
|
|
- // colProps: { span: 6 },
|
|
|
|
|
- // rules: [{ required: true, message: '请选择开始时间' }],
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // label: '结束时间',
|
|
|
|
|
- // field: 'endTime',
|
|
|
|
|
- // component: 'DatePicker',
|
|
|
|
|
- // defaultValue: dayjs(),
|
|
|
|
|
- // componentProps: {
|
|
|
|
|
- // showTime: true,
|
|
|
|
|
- // placeholder: '请选择结束时间',
|
|
|
|
|
- // valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
|
- // },
|
|
|
|
|
- // colProps: { span: 6 },
|
|
|
|
|
- // rules: [{ required: true, message: '请选择结束时间' }],
|
|
|
|
|
- // },
|
|
|
|
|
- {
|
|
|
|
|
- label: '煤矿名称',
|
|
|
|
|
- field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
|
|
|
|
|
- component: 'MineCascader', // 自定义组件名
|
|
|
|
|
- componentProps: {
|
|
|
|
|
- initFromStore: false,
|
|
|
|
|
- syncToStore: false,
|
|
|
|
|
- changeOnSelect: false,
|
|
|
|
|
- onChange: (e) => {
|
|
|
|
|
- historyTable.setLoading(true);
|
|
|
|
|
- initGoafOptions(e).finally(() => {
|
|
|
|
|
- historyTable.setLoading(false);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const { tableContext, onExportXls } = useListPage({
|
|
|
|
|
+ tableProps: {
|
|
|
|
|
+ columns,
|
|
|
|
|
+ // columns: historyColumns,
|
|
|
|
|
+ api: getProvinceAlarmHistory,
|
|
|
|
|
+ formConfig: {
|
|
|
|
|
+ model: { mineCode: hiscode },
|
|
|
|
|
+ labelWidth: 120,
|
|
|
|
|
+ schemas: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: '开始时间',
|
|
|
|
|
+ // field: 'startTime',
|
|
|
|
|
+ // component: 'DatePicker',
|
|
|
|
|
+ // defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
+ // componentProps: {
|
|
|
|
|
+ // showTime: true,
|
|
|
|
|
+ // placeholder: '请选择开始时间',
|
|
|
|
|
+ // valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
|
+ // },
|
|
|
|
|
+ // colProps: { span: 6 },
|
|
|
|
|
+ // rules: [{ required: true, message: '请选择开始时间' }],
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // label: '结束时间',
|
|
|
|
|
+ // field: 'endTime',
|
|
|
|
|
+ // component: 'DatePicker',
|
|
|
|
|
+ // defaultValue: dayjs(),
|
|
|
|
|
+ // componentProps: {
|
|
|
|
|
+ // showTime: true,
|
|
|
|
|
+ // placeholder: '请选择结束时间',
|
|
|
|
|
+ // valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
|
+ // },
|
|
|
|
|
+ // colProps: { span: 6 },
|
|
|
|
|
+ // rules: [{ required: true, message: '请选择结束时间' }],
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '煤矿名称',
|
|
|
|
|
+ field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
|
|
|
|
|
+ component: 'MineCascader', // 自定义组件名
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ initFromStore: false,
|
|
|
|
|
+ syncToStore: false,
|
|
|
|
|
+ changeOnSelect: false,
|
|
|
|
|
+ onChange: (e) => {
|
|
|
|
|
+ historyTable.setLoading(true);
|
|
|
|
|
+ initGoafOptions(e).finally(() => {
|
|
|
|
|
+ historyTable.setLoading(false);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
|
|
+ colProps: { span: 6 },
|
|
|
|
|
+ rules: [],
|
|
|
},
|
|
},
|
|
|
- colProps: { span: 6 },
|
|
|
|
|
- rules: [],
|
|
|
|
|
- },
|
|
|
|
|
- ...historicalFormSchema,
|
|
|
|
|
- ],
|
|
|
|
|
- showAdvancedButton: false,
|
|
|
|
|
- schemaGroupNames: ['常规查询'],
|
|
|
|
|
|
|
+ ...historicalFormSchema,
|
|
|
|
|
+ ],
|
|
|
|
|
+ showAdvancedButton: false,
|
|
|
|
|
+ schemaGroupNames: ['常规查询'],
|
|
|
|
|
+ },
|
|
|
|
|
+ pagination: true,
|
|
|
|
|
+ striped: true,
|
|
|
|
|
+ useSearchForm: true,
|
|
|
|
|
+ bordered: true,
|
|
|
|
|
+ showIndexColumn: true,
|
|
|
|
|
+ showActionColumn: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ exportConfig: {
|
|
|
|
|
+ url: '/province/alarm/exportProvinceAlarmHistory',
|
|
|
|
|
+ name: '历史数据',
|
|
|
|
|
+ params: {
|
|
|
|
|
+ alarmType: 'fireAlarm',
|
|
|
|
|
+ goafId,
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
- pagination: true,
|
|
|
|
|
- striped: true,
|
|
|
|
|
- useSearchForm: true,
|
|
|
|
|
- bordered: true,
|
|
|
|
|
- showIndexColumn: false,
|
|
|
|
|
- // actionColumn: {
|
|
|
|
|
- // width: 120,
|
|
|
|
|
- // title: '操作',
|
|
|
|
|
- // dataIndex: 'action',
|
|
|
|
|
- // slots: { customRender: 'action' },
|
|
|
|
|
- // fixed: undefined,
|
|
|
|
|
- // },
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const [registerHistoryTable, historyTable] = tableContext;
|
|
|
|
|
+
|
|
|
async function getAlarmTotalData() {
|
|
async function getAlarmTotalData() {
|
|
|
const params = {
|
|
const params = {
|
|
|
alarmType: 'fireAlarm',
|
|
alarmType: 'fireAlarm',
|