|
|
@@ -1,7 +1,6 @@
|
|
|
import { BasicColumn } from '/@/components/Table';
|
|
|
import { FormSchema } from '/@/components/Table';
|
|
|
import { h } from 'vue';
|
|
|
-import { Ref } from 'vue';
|
|
|
import { StatusColorEnum } from '/@/enums/jeecgEnum';
|
|
|
import { isEmpty } from 'lodash-es';
|
|
|
|
|
|
@@ -26,101 +25,104 @@ export type ProductionStatusMap = Record<
|
|
|
>;
|
|
|
|
|
|
// 3. 生成动态表格列(接收动态状态映射)
|
|
|
-export function getColumns(dynamicStatusMap: Ref<ProductionStatusMap>): BasicColumn[] {
|
|
|
- return [
|
|
|
- {
|
|
|
- title: '煤矿编号',
|
|
|
- dataIndex: 'mineCode',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '所属上级',
|
|
|
- dataIndex: 'managementName',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '煤矿名称',
|
|
|
- dataIndex: 'mineName',
|
|
|
- width: 200,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '煤矿简称',
|
|
|
- dataIndex: 'mineNameAbbr',
|
|
|
- width: 100,
|
|
|
- ifShow: false,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '生产状态',
|
|
|
- dataIndex: 'gjMineStatus',
|
|
|
- width: 100,
|
|
|
- // customRender: ({ record }) => {
|
|
|
- // // 空值/异常值处理
|
|
|
- // const status = String(record.productionStatus || '');
|
|
|
- // // 从动态映射取值,兜底未知状态
|
|
|
- // const { label, color } = dynamicStatusMap.value[status] || {
|
|
|
- // label: '-',
|
|
|
- // };
|
|
|
- // // 渲染带颜色的文字
|
|
|
- // return h(
|
|
|
- // 'span',
|
|
|
- // {
|
|
|
- // style: { color: StatusColorEnum[color] },
|
|
|
- // },
|
|
|
- // label
|
|
|
- // );
|
|
|
- // },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '自燃倾向性',
|
|
|
- dataIndex: 'alarmLevel',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '接入状态',
|
|
|
- dataIndex: 'accessStatus',
|
|
|
- width: 100,
|
|
|
- customRender: ({ record }) => {
|
|
|
- // 空值/异常值处理
|
|
|
- const status = String(record.accessStatus);
|
|
|
- if (isEmpty(status)) {
|
|
|
- return h('span', '-');
|
|
|
- }
|
|
|
- const text = status === '1' ? '接入' : '未接入';
|
|
|
- const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.gold;
|
|
|
- return h('span', { style: { color: textColor } }, text);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '在线状态',
|
|
|
- dataIndex: 'status',
|
|
|
- width: 100,
|
|
|
- customRender: ({ record }) => {
|
|
|
- const status = String(record.status);
|
|
|
- if (isEmpty(status)) {
|
|
|
- return h('span', '-');
|
|
|
- }
|
|
|
- const text = status === '1' ? '在线' : '离线';
|
|
|
- const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.red;
|
|
|
- return h('span', { style: { color: textColor } }, text);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '应接数量',
|
|
|
- dataIndex: 'yingjieNum',
|
|
|
- width: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '已接数量',
|
|
|
- dataIndex: 'accessGoafNum',
|
|
|
- width: 100,
|
|
|
+export const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '煤矿编号',
|
|
|
+ dataIndex: 'mineCode',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所属上级',
|
|
|
+ dataIndex: 'parentArea',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '煤矿名称',
|
|
|
+ dataIndex: 'mineName',
|
|
|
+ width: 200,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '煤矿简称',
|
|
|
+ dataIndex: 'mineNameAbbr',
|
|
|
+ width: 100,
|
|
|
+ ifShow: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '生产状态',
|
|
|
+ dataIndex: 'gjMineStatus',
|
|
|
+ width: 100,
|
|
|
+ // customRender: ({ record }) => {
|
|
|
+ // // 空值/异常值处理
|
|
|
+ // const status = String(record.productionStatus || '');
|
|
|
+ // // 从动态映射取值,兜底未知状态
|
|
|
+ // const { label, color } = dynamicStatusMap.value[status] || {
|
|
|
+ // label: '-',
|
|
|
+ // };
|
|
|
+ // // 渲染带颜色的文字
|
|
|
+ // return h(
|
|
|
+ // 'span',
|
|
|
+ // {
|
|
|
+ // style: { color: StatusColorEnum[color] },
|
|
|
+ // },
|
|
|
+ // label
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '自燃倾向性',
|
|
|
+ dataIndex: 'alarmLevel',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '瓦斯等级',
|
|
|
+ dataIndex: 'gasLevelName',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '接入状态',
|
|
|
+ dataIndex: 'accessStatus',
|
|
|
+ width: 100,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ // 空值/异常值处理
|
|
|
+ const status = String(record.accessStatus);
|
|
|
+ if (isEmpty(status)) {
|
|
|
+ return h('span', '-');
|
|
|
+ }
|
|
|
+ const text = status === '1' ? '接入' : '未接入';
|
|
|
+ const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.gold;
|
|
|
+ return h('span', { style: { color: textColor } }, text);
|
|
|
},
|
|
|
- {
|
|
|
- title: '未接数量',
|
|
|
- dataIndex: 'notAccessGoafNum',
|
|
|
- width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '在线状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ width: 100,
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ const status = String(record.status);
|
|
|
+ if (isEmpty(status)) {
|
|
|
+ return h('span', '-');
|
|
|
+ }
|
|
|
+ const text = status === '1' ? '在线' : '离线';
|
|
|
+ const textColor = status === '1' ? StatusColorEnum.green : StatusColorEnum.red;
|
|
|
+ return h('span', { style: { color: textColor } }, text);
|
|
|
},
|
|
|
- ];
|
|
|
-}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '应接数量',
|
|
|
+ dataIndex: 'yingjieNum',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '已接数量',
|
|
|
+ dataIndex: 'accessGoafNum',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '未接数量',
|
|
|
+ dataIndex: 'notAccessGoafNum',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+];
|
|
|
|
|
|
// 4. 生成动态搜索表单配置(接收动态下拉选项)
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
@@ -171,6 +173,19 @@ export const searchFormSchema: FormSchema[] = [
|
|
|
},
|
|
|
colProps: { span: 6 },
|
|
|
},
|
|
|
+ {
|
|
|
+ field: 'gasLevelName',
|
|
|
+ label: '瓦斯等级',
|
|
|
+ component: 'Select',
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ { label: '低瓦斯', value: '低瓦斯' },
|
|
|
+ { label: '高瓦斯', value: '高瓦斯' },
|
|
|
+ { label: '突出', value: '突出' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ colProps: { span: 6 },
|
|
|
+ },
|
|
|
{
|
|
|
field: 'riskLevel',
|
|
|
label: '风险等级',
|