Files
energy_storage/web/public/config/columnList.js

1049 lines
20 KiB
JavaScript
Raw Normal View History

import { deviceTypeList, logTypes } from '@/utils/config'
2025-09-05 09:26:14 +08:00
export const columnList = [
{
page: 'user',
columns: [
{
title: '用户ID',
dataIndex: 'user_id',
key: 'user_id',
ellipsis: true,
2025-09-05 16:40:35 +08:00
// filterable: true,
2025-09-05 09:26:14 +08:00
fixed: 'left'
},
{
title: '用户名',
dataIndex: 'account',
2025-09-05 16:40:35 +08:00
key: 'account'
// filterable: true
2025-09-05 09:26:14 +08:00
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
2025-09-05 16:40:35 +08:00
ellipsis: true
// filterable: true
2025-09-05 09:26:14 +08:00
},
{
title: '性别',
dataIndex: 'gender',
key: 'gender',
scopedSlots: { customRender: 'gender' }
},
{
title: '年龄',
dataIndex: 'age',
2025-09-05 16:40:35 +08:00
key: 'age'
2025-09-05 09:26:14 +08:00
},
{
title: '手机号',
dataIndex: 'phone',
2025-09-05 16:40:35 +08:00
key: 'phone'
2025-09-05 09:26:14 +08:00
},
{
title: '邮箱',
dataIndex: 'email',
2025-09-05 16:40:35 +08:00
key: 'email'
2025-09-05 09:26:14 +08:00
},
2025-09-05 16:40:35 +08:00
2025-09-05 09:26:14 +08:00
{
title: '角色名称',
dataIndex: 'role_name',
2025-09-05 16:40:35 +08:00
key: 'role_name'
2025-09-05 09:26:14 +08:00
},
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
scopedSlots: { customRender: 'action' }
}
]
},
{
2025-09-05 16:40:35 +08:00
page: 'role',
2025-09-05 09:26:14 +08:00
columns: [
{
2025-09-05 16:40:35 +08:00
title: '角色ID',
dataIndex: 'role_id',
key: 'role_id',
2025-09-05 09:26:14 +08:00
ellipsis: true,
2025-09-05 16:40:35 +08:00
// filterable: true,
2025-09-05 09:26:14 +08:00
fixed: 'left'
},
{
2025-09-05 16:40:35 +08:00
title: '角色名称',
dataIndex: 'name',
key: 'name'
// filterable: true
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
title: '角色描述',
dataIndex: 'describe',
key: 'describe',
ellipsis: true
// filterable: true
},
{
title: '关联权限',
dataIndex: 'permission',
key: 'permission',
2025-09-11 19:01:01 +08:00
ellipsis: true,
2025-09-05 16:40:35 +08:00
scopedSlots: { customRender: 'permission' }
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
title: '是否启用',
dataIndex: 'is_open',
key: 'is_open',
scopedSlots: { customRender: 'is_open' }
2025-09-05 09:26:14 +08:00
},
{
title: '创建时间',
2025-09-05 16:40:35 +08:00
dataIndex: 'create_time',
key: 'create_time'
2025-09-05 09:26:14 +08:00
},
{
title: '更新时间',
2025-09-05 16:40:35 +08:00
dataIndex: 'update_time',
key: 'update_time'
2025-09-05 09:26:14 +08:00
},
2025-09-05 16:40:35 +08:00
2025-09-05 09:26:14 +08:00
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
scopedSlots: { customRender: 'action' }
}
]
},
{
page: 'permission',
columns: [
{
title: '权限ID',
dataIndex: 'permission_id',
key: 'permission_id',
ellipsis: true,
// filterable: true,
fixed: 'left'
},
{
title: '权限名称',
dataIndex: 'name',
key: 'name'
// filterable: true
},
{
title: '权限描述',
dataIndex: 'describe',
key: 'describe',
ellipsis: true
// filterable: true
},
{
title: '是否启用',
dataIndex: 'is_open',
key: 'is_open',
scopedSlots: { customRender: 'is_open' }
}
// {
// title: '操作',
// dataIndex: 'operate',
// key: 'operate',
// scopedSlots: { customRender: 'action' }
// }
]
},
2025-09-05 09:26:14 +08:00
{
2025-09-05 16:40:35 +08:00
page: 'station',
2025-09-05 09:26:14 +08:00
columns: [
{
2025-09-05 16:40:35 +08:00
title: '场站ID',
dataIndex: 'station_id',
key: 'station_id',
2025-09-05 09:26:14 +08:00
ellipsis: true,
2025-09-05 16:40:35 +08:00
// filterable: true,
2025-09-05 09:26:14 +08:00
fixed: 'left'
},
{
2025-09-05 16:40:35 +08:00
title: '场站名称',
dataIndex: 'name',
key: 'name'
// filterable: true
},
{
title: '场站位置',
dataIndex: 'address',
key: 'address'
// filterable: true
},
{
title: '场站经度',
dataIndex: 'lon',
key: 'lon'
},
{
title: '场站纬度',
dataIndex: 'lat',
key: 'lat'
},
{
title: '储能容量',
dataIndex: 'capacity',
key: 'capacity'
// filterable: true
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
title: '场站电话',
dataIndex: 'tel',
key: 'tel',
2025-09-05 09:26:14 +08:00
ellipsis: true
2025-09-05 16:40:35 +08:00
// filterable: true
2025-09-05 09:26:14 +08:00
},
{
title: '储能容量',
2025-09-05 16:40:35 +08:00
dataIndex: 'capacity',
key: 'capacity'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
title: '场站状态',
dataIndex: 'status',
key: 'status',
scopedSlots: { customRender: 'status' }
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
title: '场站运行模式',
2025-09-09 10:00:01 +08:00
dataIndex: 'work_mode',
key: 'work_mode',
scopedSlots: { customRender: 'work_mode' }
2025-09-05 16:40:35 +08:00
},
{
title: '场站运行策略',
dataIndex: 'policy_id',
key: 'policy_id',
scopedSlots: { customRender: 'policy_id' }
2025-09-05 09:26:14 +08:00
},
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
scopedSlots: { customRender: 'action' }
}
]
},
2025-09-05 09:26:14 +08:00
{
page: 'device',
2025-09-05 09:26:14 +08:00
columns: [
{
title: '设备ID',
dataIndex: 'device_id',
key: 'device_id',
2025-09-05 09:26:14 +08:00
ellipsis: true,
fixed: 'left'
},
{
title: '所属场站',
dataIndex: 'station_id',
key: 'station_id'
// filterable: true
},
{
title: '设备类型',
2025-09-05 09:26:14 +08:00
dataIndex: 'type',
key: 'type',
type: 'slot',
2025-09-05 09:26:14 +08:00
scopedSlots: { customRender: 'type' }
},
{
title: '设备名称',
dataIndex: 'name'
},
{
title: '设备编号',
dataIndex: 'code'
2025-09-05 09:26:14 +08:00
},
2025-09-05 09:26:14 +08:00
{
title: '厂家信息',
dataIndex: 'factory'
},
{
title: '厂家电话',
dataIndex: 'factory_tel'
},
{
title: '是否启用',
dataIndex: 'is_open',
key: 'is_open',
2025-09-05 09:26:14 +08:00
align: 'center',
scopedSlots: { customRender: 'isEnable' }
},
2025-09-05 09:26:14 +08:00
{
title: '属性参数',
dataIndex: 'attrs'
2025-09-05 09:26:14 +08:00
},
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
scopedSlots: { customRender: 'action' },
fixed: 'right',
align: 'center'
}
]
},
{
page: 'alarmLog',
columns: [
{
title: '日志ID',
dataIndex: 'log_id'
},
{
title: '日志类型',
dataIndex: 'type',
key: 'type',
width: 120,
scopedSlots: { customRender: 'type' }
},
{
title: '操作用户',
dataIndex: 'user_id',
key: 'user_id',
width: 120
},
{
title: '设备ID',
dataIndex: 'device_id',
key: 'device_id'
},
{
title: '日志内容',
dataIndex: 'content',
key: 'content',
ellipsis: true
},
{
title: '记录时间',
dataIndex: 'create_time',
key: 'create_time',
2025-09-05 09:26:14 +08:00
align: 'center',
ellipsis: true,
width: 180
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
2025-09-05 09:26:14 +08:00
ellipsis: true,
scopedSlots: { customRender: 'status' },
width: 80,
align: 'center'
2025-09-05 09:26:14 +08:00
},
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
2025-09-05 09:26:14 +08:00
scopedSlots: { customRender: 'action' }
}
]
},
{
page: 'syslog',
2025-09-05 09:26:14 +08:00
columns: [
{
title: '日志ID',
dataIndex: 'log_id'
2025-09-05 09:26:14 +08:00
},
2025-09-05 09:26:14 +08:00
{
title: '操作用户',
dataIndex: 'user_id',
key: 'user_id',
width: 120
2025-09-05 09:26:14 +08:00
},
2025-09-05 09:26:14 +08:00
{
title: '日志内容',
dataIndex: 'content',
key: 'content',
ellipsis: true
2025-09-05 09:26:14 +08:00
},
{
title: '记录时间',
dataIndex: 'create_time',
key: 'create_time',
2025-09-05 09:26:14 +08:00
align: 'center',
ellipsis: true,
width: 180
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
2025-09-05 09:26:14 +08:00
ellipsis: true,
scopedSlots: { customRender: 'status' },
width: 80,
align: 'center'
2025-09-05 09:26:14 +08:00
},
{
title: '操作',
dataIndex: 'operate',
key: 'operate',
2025-09-05 09:26:14 +08:00
scopedSlots: { customRender: 'action' }
}
]
2025-09-09 09:52:52 +08:00
},
{
page: 'serviceApi',
columns: [
{
title: '接口ID',
dataIndex: 'api_id',
key: 'api_id',
ellipsis: true,
// filterable: true,
fixed: 'left'
},
{
title: '接口名称',
dataIndex: 'name',
key: 'name'
// filterable: true
},
{
title: '接口描述',
dataIndex: 'describe',
key: 'describe'
// filterable: true
},
{
title: '接口参数',
dataIndex: 'params',
key: 'params'
},
{
title: '是否启用',
dataIndex: 'is_open',
key: 'is_open',
scopedSlots: { customRender: 'is_open' }
},
2025-09-05 09:26:14 +08:00
{
title: '操作',
dataIndex: 'operate',
2025-09-05 16:40:35 +08:00
key: 'operate',
2025-09-05 09:26:14 +08:00
scopedSlots: { customRender: 'action' }
}
]
2025-09-05 16:40:35 +08:00
}
]
export const userOptions = [
2025-09-05 09:26:14 +08:00
{
2025-09-05 16:40:35 +08:00
title: '基础信息',
icon: 'icon-xinxi',
list: [
2025-09-05 09:26:14 +08:00
{
2025-09-05 16:40:35 +08:00
label: '用户名',
value: '',
key: 'account',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '姓名',
value: '',
key: 'name',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '性别',
value: undefined,
key: 'gender',
type: 'select',
list: [
{
label: '女',
value: '0'
},
{
label: '男',
value: '1'
}
]
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '年龄',
value: '',
key: 'age',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '手机号',
value: '',
key: 'phone',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '邮箱',
value: '',
key: 'email',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '角色名称',
value: undefined, //根据角色id回显角色
key: 'role_id',
type: 'slot',
slotName: 'role_id'
2025-09-05 09:26:14 +08:00
}
2025-09-05 16:40:35 +08:00
],
ruleForm: {}
2025-09-05 09:26:14 +08:00
}
]
2025-09-05 16:40:35 +08:00
export const roleOptions = [
2025-09-05 09:26:14 +08:00
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
2025-09-05 16:40:35 +08:00
label: '角色名称',
2025-09-05 09:26:14 +08:00
value: '',
key: 'name',
type: 'input'
},
2025-09-05 16:40:35 +08:00
{
label: '关联权限',
value: '',
key: 'permission',
type: 'slot',
slotName: 'treetable',
className: 'item-l',
tableData: [],
selectTableData: [],
columns: [
{
title: '名称',
dataIndex: 'name',
key: 'name',
ellipsis: true,
filterable: true,
fixed: 'left'
},
{
title: '页面路径',
dataIndex: 'route',
key: 'route'
// filterable: true
},
{
title: '是否允许新增操作',
dataIndex: 'is_add',
key: 'is_add',
align: 'center',
scopedSlots: { customRender: 'is_add' }
},
{
title: '是否允许删除操作',
dataIndex: 'is_del',
key: 'is_del',
align: 'center',
scopedSlots: { customRender: 'is_del' }
},
{
title: '是否允许编辑操作',
dataIndex: 'is_edit',
key: 'is_edit',
align: 'center',
scopedSlots: { customRender: 'is_edit' }
},
{
title: '是否允许查看操作',
dataIndex: 'is_view',
key: 'is_view',
align: 'center',
2025-09-11 19:01:01 +08:00
scopedSlots: { customRender: 'is_view' }
}
]
2025-09-05 16:40:35 +08:00
},
2025-09-05 09:26:14 +08:00
{
2025-09-05 16:40:35 +08:00
// 0:禁用; 1:启用
label: '是否启用',
2025-09-05 09:26:14 +08:00
value: undefined,
2025-09-05 16:40:35 +08:00
key: 'is_open',
type: 'switch',
className: 'item-l',
2025-09-05 09:26:14 +08:00
list: [
{
2025-09-05 16:40:35 +08:00
label: '禁用',
value: '0'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '启用',
value: '1'
2025-09-05 09:26:14 +08:00
}
]
},
{
2025-09-05 16:40:35 +08:00
label: '角色描述',
value: '',
key: 'describe',
type: 'textarea'
}
],
ruleForm: {}
}
]
export const stationOptions = [
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
label: '场站名称',
value: '',
key: 'name',
2025-09-05 09:26:14 +08:00
type: 'input'
},
{
2025-09-05 16:40:35 +08:00
label: '场站位置',
value: '',
key: 'address',
type: 'input'
},
{
label: '场站经度',
value: '',
key: 'lon',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '场站纬度',
2025-09-05 09:26:14 +08:00
value: '',
2025-09-05 16:40:35 +08:00
key: 'lat',
type: 'input'
2025-09-05 09:26:14 +08:00
},
{
2025-09-05 16:40:35 +08:00
label: '储能容量',
2025-09-05 09:26:14 +08:00
value: '',
2025-09-05 16:40:35 +08:00
key: 'capacity',
type: 'input'
},
{
label: '场站电话',
value: '',
key: 'tel',
type: 'input'
},
{
// 0未启用1启用
label: '场站状态',
value: undefined,
2025-09-05 09:26:14 +08:00
key: 'status',
2025-09-05 16:40:35 +08:00
type: 'switch',
className: 'item-l',
list: [
{
label: '未启用',
value: '0'
},
{
label: '启用',
value: '1'
}
]
},
{
// 0未启用1启用
label: '场站运行模式',
value: undefined,
2025-09-09 10:00:01 +08:00
key: 'work_mode',
2025-09-05 09:26:14 +08:00
type: 'select',
list: [
{
label: '峰谷套利',
2025-09-05 16:40:35 +08:00
value: '1'
2025-09-05 09:26:14 +08:00
},
{
label: '增网配容',
2025-09-05 16:40:35 +08:00
value: '2'
2025-09-05 09:26:14 +08:00
},
{
label: '应急供电',
2025-09-05 16:40:35 +08:00
value: '3'
},
{
label: '并网保电',
value: '4'
},
{
label: '自定时段',
value: '5'
2025-09-05 16:40:35 +08:00
}
]
},
{
// 0未启用1启用
label: '场站运行策略',
value: undefined,
key: 'policy_id',
type: 'select',
list: [
{
label: '削峰套利',
value: '1'
},
{
label: '需求响应',
value: '2'
},
{
label: '自发自用',
value: '3'
2025-09-05 09:26:14 +08:00
}
]
}
],
2025-09-05 16:40:35 +08:00
ruleForm: {}
2025-09-05 09:26:14 +08:00
}
]
export const deviceOptions = [
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
label: '编号',
value: '',
key: 'code',
type: 'input'
},
{
label: '名称',
value: '',
key: 'name',
type: 'input'
},
{
label: '类型',
value: '',
key: 'type',
type: 'select',
list: deviceTypeList,
options: {
label: 'label',
value: 'value'
}
},
{
label: '所属场站',
value: undefined,
key: 'station_id',
type: 'select',
list: [],
options: {
label: 'name',
value: 'station_id'
}
// slotName: 'searchSelect'
},
{
label: '厂家',
value: '',
key: 'factory',
2025-09-11 16:14:55 +08:00
type: 'textarea'
},
{
label: '厂家电话',
value: '',
key: 'factory_tel',
type: 'input'
},
{
label: '是否启用',
value: '',
key: 'is_open',
type: 'switch'
}
],
ruleForm: {}
},
{
title: '设备属性参数',
icon: 'icon-xinxi',
list: [
{
label: '额定电压',
value: '',
key: 'rated_voltage',
type: 'input-number'
},
{
label: '额定电流',
value: '',
key: 'rated_current',
type: 'input-number'
},
{
label: '额定功率',
value: '',
key: 'reted_power',
type: 'input-number'
},
{
label: '额定容量',
value: undefined,
key: 'rated_capacity',
type: 'input-number'
}
],
ruleForm: {}
}
]
// log
export const alarmlogOptions = [
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
label: '日志ID',
value: '',
key: 'log_id',
type: 'input'
},
{
label: '日志类型',
value: '',
key: 'type',
type: 'select',
list: logTypes,
disabled: true
},
{
label: '操作用户ID',
value: '',
key: 'user_id',
type: 'input',
disabled: true
},
{
label: '设备ID',
value: '',
key: 'device_id',
type: 'input',
disabled: true
},
{
label: '日志内容',
value: '',
key: 'content',
type: 'textarea',
disabled: true,
className: 'item-l',
rows: 8
},
{
label: '记录时间',
value: '',
key: 'create_time',
type: 'input'
},
{
label: '状态',
type: 'select',
list: [
{ value: '0', label: '异常' },
{ value: '1', label: '正常' }
],
value: [],
key: 'status'
}
],
ruleForm: {}
}
]
export const syslogOptions = [
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
label: '日志ID',
value: '',
key: 'log_id',
type: 'input'
},
{
label: '操作用户ID',
value: '',
key: 'user_id',
type: 'input',
disabled: true
},
{
label: '日志内容',
value: '',
key: 'content',
type: 'textarea',
disabled: true,
className: 'item-l',
rows: 8
},
{
label: '记录时间',
value: '',
key: 'create_time',
type: 'input'
},
{
label: '状态',
type: 'select',
list: [
{ value: '0', label: '异常' },
{ value: '1', label: '正常' }
],
value: [],
key: 'status'
}
],
ruleForm: {}
}
]
export const serviceApiOptions = [
{
title: '基础信息',
icon: 'icon-xinxi',
list: [
{
label: '接口名称',
value: '',
key: 'name',
type: 'input'
},
{
label: '接口参数',
value: '',
key: 'params',
type: 'input'
},
{
label: '接口描述',
value: '',
key: 'describe',
type: 'textarea'
},
{
label: '是否启用',
value: '',
key: 'is_open',
type: 'switch',
className: 'item-l',
list: [
{
label: '禁用',
value: '0'
},
{
label: '启用',
value: '1'
}
]
}
],
ruleForm: {}
}
]
2025-09-05 16:40:35 +08:00
export const userFormRules = {
account: [
{
trigger: 'blur',
required: true,
message: '请输入用户名'
}
],
name: [
{
trigger: 'blur',
required: true,
message: '请输入姓名'
}
]
}
export const roleFormRules = {
name: [
{
trigger: 'blur',
required: true,
message: '请输入角色名称'
}
]
}
export const stationFormRules = {
name: [
{
trigger: 'blur',
required: true,
message: '请输入场站名称'
}
]
}
export const deviceFormRules = {
name: [
{
trigger: 'blur',
required: true,
message: '请输入设备名称'
}
],
code: [
{
trigger: 'blur',
required: true,
message: '请输入设备编号'
}
],
type: [
{
trigger: 'change',
required: true,
message: '请选择设备类型'
}
],
station_id: [
{
trigger: 'change',
required: true,
message: '请选择场站名称'
}
]
}
2025-09-09 09:52:52 +08:00
export const serviceApiFormRules = {
name: [
{
trigger: 'blur',
required: true,
message: '请输入接口名称'
}
]
}