| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- import type { BasicColumn, FormSchema } from '/@/components/Table';
- import { h } from 'vue';
- import { StatusColorEnum } from '/@/enums/jeecgEnum';
- /** 顶部统计卡片 */
- export const boardData = [
- { label: '风速超限报警', value: '-' },
- { label: '风量不足报警', value: '-' },
- { label: '风量不闭合报警', value: '-' },
- { label: '今日已处理报警', value: '-' },
- ];
- /** 报警级别映射 */
- export const alarmLevelMap: Record<string, { label: string; color: string }> = {
- '1': { label: '一级', color: StatusColorEnum.red },
- '2': { label: '二级', color: StatusColorEnum.orange },
- '3': { label: '三级', color: StatusColorEnum.yellow },
- };
- /** 报警状态映射 */
- export const alarmStatusMap: Record<string, { label: string; color: string }> = {
- '0': { label: '未处理', color: StatusColorEnum.red },
- '1': { label: '处理中', color: StatusColorEnum.orange },
- '2': { label: '已处理', color: StatusColorEnum.green },
- };
- /** 超限报警列表表格列 */
- export const columns: BasicColumn[] = [
- {
- title: '煤矿名称',
- dataIndex: 'mineName',
- fixed: 'left',
- width: 180,
- },
- {
- title: '测风点名称',
- dataIndex: 'pointName',
- width: 160,
- },
- {
- title: '监测区域',
- dataIndex: 'monitorArea',
- width: 120,
- },
- {
- title: '报警类型',
- dataIndex: 'alarmType',
- width: 120,
- customRender: ({ text }) => {
- const map: Record<string, string> = {
- windSpeedOver: '风速超限',
- windVolumeLow: '风量不足',
- windVolumeUnclosed: '风量不闭合',
- };
- return map[text] || text;
- },
- },
- {
- title: '实测值',
- dataIndex: 'measuredValue',
- width: 100,
- },
- {
- title: '标准/阈值',
- dataIndex: 'thresholdValue',
- width: 100,
- },
- {
- title: '偏差',
- dataIndex: 'deviation',
- width: 90,
- customRender: ({ text }) => (text != null ? `${text}%` : '-'),
- },
- {
- title: '报警级别',
- dataIndex: 'alarmLevel',
- width: 90,
- customRender: ({ text }) => {
- const info = alarmLevelMap[text];
- return info ? h('span', { style: { color: info.color, fontWeight: 'bold' } }, info.label) : text;
- },
- },
- {
- title: '报警时间',
- dataIndex: 'alarmTime',
- width: 170,
- },
- {
- title: '状态',
- dataIndex: 'status',
- width: 90,
- customRender: ({ text }) => {
- const info = alarmStatusMap[text];
- return info ? h('span', { style: { color: info.color } }, info.label) : text;
- },
- },
- ];
- /** 测风点监测地点列表表格列 */
- export const pointListColumns: BasicColumn[] = [
- {
- title: '测风点编号',
- dataIndex: 'pointCode',
- width: 130,
- },
- {
- title: '监测地点名称',
- dataIndex: 'locationName',
- width: 200,
- },
- {
- title: '类型',
- dataIndex: 'pointType',
- width: 120,
- customRender: ({ text }) => {
- const map: Record<string, string> = {
- totalInlet: '总进风',
- totalOutlet: '总回风',
- workingFace: '工作面',
- districtReturn: '采区回风',
- headingFace: '掘进面',
- };
- return map[text] || text;
- },
- },
- {
- title: '当前状态',
- dataIndex: 'currentStatus',
- width: 100,
- customRender: ({ text }) => {
- const color = text === 'normal' ? StatusColorEnum.green : StatusColorEnum.red;
- const label = text === 'normal' ? '正常' : '异常';
- return h('span', { style: { color, fontWeight: 'bold' } }, label);
- },
- },
- ];
- /** 查询表单 */
- export const schemas: FormSchema[] = [
- {
- label: '煤矿名称',
- field: 'deptId',
- component: 'MineCascader',
- colProps: { span: 6 },
- rules: [],
- },
- {
- label: '报警类型',
- field: 'alarmType',
- component: 'Select',
- colProps: { span: 6 },
- componentProps: {
- options: [
- { label: '全部', value: '' },
- { label: '风速超限', value: 'windSpeedOver' },
- { label: '风量不足', value: 'windVolumeLow' },
- { label: '风量不闭合', value: 'windVolumeUnclosed' },
- ],
- },
- rules: [],
- },
- {
- label: '报警级别',
- field: 'alarmLevel',
- component: 'Select',
- colProps: { span: 6 },
- componentProps: {
- options: [
- { label: '全部', value: '' },
- { label: '一级', value: '1' },
- { label: '二级', value: '2' },
- { label: '三级', value: '3' },
- ],
- },
- rules: [],
- },
- {
- label: '日期范围',
- field: 'dateRange',
- component: 'RangePicker',
- colProps: { span: 8 },
- componentProps: {
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
- showTime: { format: 'HH:mm:ss' },
- },
- rules: [],
- },
- ];
- /** 处理记录表格列 */
- export const handleRecordColumns: BasicColumn[] = [
- {
- title: '煤矿名称',
- dataIndex: 'mineName',
- fixed: 'left',
- width: 180,
- },
- {
- title: '报警类型',
- dataIndex: 'alarmType',
- width: 120,
- customRender: ({ text }) => {
- const map: Record<string, string> = {
- windSpeedOver: '风速超限',
- windVolumeLow: '风量不足',
- windVolumeUnclosed: '风量不闭合',
- };
- return map[text] || text;
- },
- },
- {
- title: '测风点名称',
- dataIndex: 'pointName',
- width: 160,
- },
- {
- title: '处理人',
- dataIndex: 'handler',
- width: 100,
- },
- {
- title: '处理情况',
- dataIndex: 'handleContent',
- width: 250,
- ellipsis: true,
- },
- {
- title: '处理时间',
- dataIndex: 'handleTime',
- width: 170,
- },
- ];
|