diff --git a/web/.eslintrc.js b/web/.eslintrc.js index 631fc67..b2cb0da 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -55,7 +55,7 @@ module.exports = { 'no-this-before-super': 0, // 在调用super()之前不能使用this或super 'no-undef': 2, // 不能有未定义的变量 'no-use-before-define': 2, // 未定义前不能使用 - camelcase: 2, // 强制驼峰法命名 + camelcase: 'off', // 关闭强制驼峰法命名 'vue/multi-word-component-names': 0, 'jsx-quotes': [2, 'prefer-double'], // 强制在JSX属性(jsx-quotes)中一致使用双引号 // 'react/sort-comp': 2, // 强制组件方法顺序 diff --git a/web/public/config/columnList.js b/web/public/config/columnList.js index 124b3ed..4eb1013 100644 --- a/web/public/config/columnList.js +++ b/web/public/config/columnList.js @@ -1,3 +1,4 @@ +import { deviceTypeList, logTypes } from '@/utils/config' export const columnList = [ { page: 'user', @@ -7,119 +8,48 @@ export const columnList = [ dataIndex: 'user_id', key: 'user_id', ellipsis: true, - filterable: true, + // filterable: true, fixed: 'left' }, { title: '用户名', dataIndex: 'account', - key: 'account', - filterable: true + key: 'account' + // filterable: true }, { title: '姓名', dataIndex: 'name', key: 'name', - ellipsis: true, - filterable: true + ellipsis: true + // filterable: true }, { title: '性别', dataIndex: 'gender', key: 'gender', - filterable: true, scopedSlots: { customRender: 'gender' } }, { title: '年龄', dataIndex: 'age', - key: 'age', - filterable: true + key: 'age' }, { title: '手机号', dataIndex: 'phone', - key: 'phone', - filterable: true + key: 'phone' }, { title: '邮箱', dataIndex: 'email', - key: 'email', - filterable: true - }, - { - title: '角色ID', - dataIndex: 'role_id', - key: 'role_id', - filterable: true + key: 'email' }, + { title: '角色名称', dataIndex: 'role_name', - key: 'role_name', - filterable: true - }, - { - title: '操作', - dataIndex: 'operate', - key: 'operate', - scopedSlots: { customRender: 'action' } - } - ] - }, - { - page: 'menu', - columns: [ - { - title: '菜单名称', - dataIndex: 'name', - key: 'name', - ellipsis: true, - filterable: true, - fixed: 'left' - }, - { - title: '菜单路由', - dataIndex: 'route', - key: 'route', - filterable: true - }, - { - title: '顺序', - dataIndex: 'seq', - align: 'center', - key: 'seq', - ellipsis: true, - width: 120, - - filterable: true - }, - { - title: '图标', - dataIndex: 'icon', - align: 'center', - key: 'icon', - width: 120, - scopedSlots: { customRender: 'icon' } - }, - { - title: '创建时间', - dataIndex: 'createTime', - key: 'createTime', - align: 'center', - ellipsis: true, - filterable: true, - width: 180 - }, - { - title: '更新时间', - dataIndex: 'updateTime', - key: 'updateTime', - align: 'center', - ellipsis: true, - filterable: true, - width: 180 + key: 'role_name' }, { title: '操作', @@ -133,17 +63,268 @@ export const columnList = [ page: 'role', columns: [ { - title: '角色名称', - dataIndex: 'name', - key: 'name', + title: '角色ID', + dataIndex: 'role_id', + key: 'role_id', ellipsis: true, - filterable: true, - width: 180, - + // filterable: true, fixed: 'left' }, { - title: '角色类型', + title: '角色名称', + dataIndex: 'name', + key: 'name' + // filterable: true + }, + { + title: '角色描述', + dataIndex: 'describe', + key: 'describe', + ellipsis: true + // filterable: true + }, + { + title: '关联权限', + dataIndex: 'permission', + key: 'permission', + scopedSlots: { customRender: 'permission' } + }, + { + title: '是否启用', + dataIndex: 'is_open', + key: 'is_open', + scopedSlots: { customRender: 'is_open' } + }, + { + title: '创建时间', + dataIndex: 'create_time', + key: 'create_time' + }, + { + title: '更新时间', + dataIndex: 'update_time', + key: 'update_time' + }, + + { + title: '操作', + dataIndex: 'operate', + key: 'operate', + scopedSlots: { customRender: 'action' } + } + ] + }, + { + page: 'station', + columns: [ + { + title: '场站ID', + dataIndex: 'station_id', + key: 'station_id', + ellipsis: true, + // filterable: true, + fixed: 'left' + }, + { + title: '场站名称', + dataIndex: 'name', + key: 'name' + // filterable: true + }, + { + title: '场站位置', + dataIndex: 'address', + key: 'address' + // filterable: true + }, + { + title: '场站经度', + dataIndex: 'lon', + width: 50, + key: 'lon' + // filterable: true + }, + { + title: '场站纬度', + dataIndex: 'lat', + width: 50, + key: 'lat' + // filterable: true + }, + { + title: '储能容量', + dataIndex: 'capacity', + key: 'capacity' + // filterable: true + }, + { + title: '场站电话', + dataIndex: 'tel', + key: 'tel', + ellipsis: true + // filterable: true + }, + { + title: '场站类别', + dataIndex: 'capacity', + key: 'capacity', + scopedSlots: { customRender: 'capacity' } + }, + { + title: '场站状态', + dataIndex: 'status', + key: 'status', + scopedSlots: { customRender: 'status' } + }, + { + title: '场站运行模式', + dataIndex: 'work_mode_id', + key: 'work_mode_id', + scopedSlots: { customRender: 'work_mode_id' } + }, + { + title: '场站运行策略', + dataIndex: 'policy_id', + key: 'policy_id', + scopedSlots: { customRender: 'policy_id' } + }, + + { + title: '操作', + dataIndex: 'operate', + key: 'operate', + scopedSlots: { customRender: 'action' } + } + ] + }, + { + page: 'device', + columns: [ + { + title: '设备ID', + dataIndex: 'device_id', + key: 'device_id', + ellipsis: true, + fixed: 'left' + }, + { + title: '所属场站', + dataIndex: 'station_id', + key: 'station_id' + // filterable: true + }, + { + title: '设备类型', + dataIndex: 'type', + key: 'type', + type: 'slot', + scopedSlots: { customRender: 'type' } + }, + { + title: '设备名称', + dataIndex: 'name' + }, + { + title: '设备编号', + dataIndex: 'code' + }, + + { + title: '厂家信息', + dataIndex: 'factory' + }, + { + title: '厂家电话', + dataIndex: 'factory_tel' + }, + { + title: '是否启用', + dataIndex: 'is_open', + key: 'is_open', + align: 'center', + scopedSlots: { customRender: 'isEnable' } + }, + + { + title: '属性参数', + dataIndex: 'attrs' + }, + { + title: '操作', + dataIndex: 'operate', + key: 'operate', + scopedSlots: { customRender: 'action' } + } + ] + }, + { + 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', + align: 'center', + ellipsis: true, + width: 180 + }, + { + title: '状态', + dataIndex: 'status', + key: 'status', + ellipsis: true, + scopedSlots: { customRender: 'status' }, + width: 80, + align: 'center' + }, + { + title: '操作', + dataIndex: 'operate', + key: 'operate', + scopedSlots: { customRender: 'action' } + } + ] + }, + { + page: 'log', + columns: [ + { + title: '用户', + dataIndex: 'userName', + width: 180 + }, + + { + title: '日志类型', dataIndex: 'type', key: 'type', width: 120, @@ -151,124 +332,282 @@ export const columnList = [ scopedSlots: { customRender: 'type' } }, { - title: '描述', - dataIndex: 'desc', - align: 'center', - key: 'desc', + title: '操作类型', + dataIndex: 'opType', + key: 'opType', + width: 120, + + scopedSlots: { customRender: 'opType' } + }, + { + title: 'ip', + dataIndex: 'ip', + key: 'ip' + }, + { + title: '内容', + dataIndex: 'msg', + key: 'msg', ellipsis: true }, { - title: '权限名称', - dataIndex: 'permissions', - align: 'center', - key: 'permissions', - width: 180, - - ellipsis: true, - scopedSlots: { customRender: 'permissions' } - }, - { - title: '创建时间', + title: '生成时间', dataIndex: 'createTime', key: 'createTime', align: 'center', ellipsis: true, - filterable: true, width: 180 }, { - title: '更新时间', - dataIndex: 'updateTime', - key: 'updateTime', - align: 'center', + title: '状态', + dataIndex: 'status', + key: 'status', ellipsis: true, - filterable: true, - width: 180 + scopedSlots: { customRender: 'status' }, + width: 80, + align: 'center' }, - - { - title: '操作', - dataIndex: 'operate', - scopedSlots: { customRender: 'action' } - } - ] - }, - { - page: 'permission', - columns: [ - { - title: '权限名称', - dataIndex: 'name', - key: 'name', - ellipsis: true, - filterable: true, - fixed: 'left', - width: 180 - }, - { - title: '描述', - dataIndex: 'desc', - key: 'desc' - }, - { - title: '是否可查询', - dataIndex: 'isQuery', - key: 'isQuery', - align: 'center', - width: 120, - scopedSlots: { customRender: 'isQuery' } - }, - { - title: '是否可编辑', - dataIndex: 'isControl', - align: 'center', - key: 'isEdit', - width: 120, - scopedSlots: { customRender: 'isEdit' } - }, - { - title: '是否可控制', - dataIndex: 'isEdit', - align: 'center', - key: 'isEdit', - key: 'isControl', - width: 120, - scopedSlots: { customRender: 'isControl' } - }, - - { - title: '创建时间', - dataIndex: 'createTime', - key: 'createTime', - align: 'center', - ellipsis: true, - filterable: true, - width: 180 - }, - { - title: '更新时间', - dataIndex: 'updateTime', - key: 'updateTime', - align: 'center', - ellipsis: true, - filterable: true, - width: 180 - }, - { title: '操作', dataIndex: 'operate', + key: 'operate', + width: 80, scopedSlots: { customRender: 'action' } } ] } ] -export const options = [ +export const userOptions = [ { title: '基础信息', icon: 'icon-xinxi', list: [ + { + label: '用户名', + value: '', + key: 'account', + type: 'input' + }, + { + label: '姓名', + value: '', + key: 'name', + type: 'input' + }, + { + label: '性别', + value: undefined, + key: 'gender', + type: 'select', + list: [ + { + label: '女', + value: '0' + }, + { + label: '男', + value: '1' + } + ] + }, + { + label: '年龄', + value: '', + key: 'age', + type: 'input' + }, + { + label: '手机号', + value: '', + key: 'phone', + type: 'input' + }, + { + label: '邮箱', + value: '', + key: 'email', + type: 'input' + }, + { + label: '角色名称', + value: undefined, //根据角色id回显角色 + key: 'role_id', + type: 'slot', + slotName: 'role_id' + } + ], + ruleForm: {} + } +] +export const roleOptions = [ + { + title: '基础信息', + icon: 'icon-xinxi', + list: [ + { + label: '角色名称', + value: '', + key: 'name', + type: 'input' + }, + + { + label: '关联权限', + value: '', + key: 'permission', + type: 'slot', + slotName: 'permission', + className: 'item-l' + }, + { + // 0:禁用; 1:启用 + label: '是否启用', + value: undefined, + key: 'is_open', + type: 'switch', + className: 'item-l', + + list: [ + { + label: '禁用', + value: '0' + }, + { + label: '启用', + value: '1' + } + ] + }, + { + label: '角色描述', + value: '', + key: 'describe', + type: 'textarea' + } + ], + ruleForm: {} + } +] +export const stationOptions = [ + { + title: '基础信息', + icon: 'icon-xinxi', + list: [ + { + label: '场站名称', + value: '', + key: 'name', + type: 'input' + }, + { + label: '场站位置', + value: '', + key: 'address', + type: 'input' + }, + { + label: '场站经度', + value: '', + key: 'lon', + type: 'input' + }, + { + label: '场站纬度', + value: '', + key: 'lat', + type: 'input' + }, + { + label: '储能容量', + value: '', + key: 'capacity', + type: 'input' + }, + { + label: '场站电话', + value: '', + key: 'tel', + type: 'input' + }, + { + // 0:未启用,1:启用 + label: '场站状态', + value: undefined, + key: 'status', + type: 'switch', + className: 'item-l', + + list: [ + { + label: '未启用', + value: '0' + }, + { + label: '启用', + value: '1' + } + ] + }, + { + // 0:未启用,1:启用 + + label: '场站运行模式', + value: undefined, + key: 'work_mode_id', + type: 'select', + list: [ + { + label: '最优经济化', + value: '1' + }, + { + label: '支撑电网稳定', + value: '2' + }, + { + label: '自定义', + value: '3' + } + ] + }, + { + // 0:未启用,1:启用 + + label: '场站运行策略', + value: undefined, + key: 'policy_id', + type: 'select', + list: [ + { + label: '削峰套利', + value: '1' + }, + { + label: '需求响应', + value: '2' + }, + { + label: '自发自用', + value: '3' + } + ] + } + ], + ruleForm: {} + } +] +export const deviceOptions = [ + { + title: '基础信息', + icon: 'icon-xinxi', + list: [ + { + label: '编号', + value: '', + key: 'code', + type: 'input' + }, { label: '名称', value: '', @@ -276,67 +615,209 @@ export const options = [ type: 'input' }, { - label: '账户类型', - value: undefined, - // dataIndex: 'type', + label: '类型', + value: '', key: 'type', type: 'select', - list: [ - { - label: '虚拟账户', - value: 0 - }, - { - label: '卡账户', - value: 1 - } - ] + list: deviceTypeList, + options: { + label: 'label', + value: 'value' + } }, { - label: '账号', - value: [], - key: 'code', + label: '所属场站', + value: undefined, + key: 'station_id', + type: 'select', + list: [], + options: { + label: 'name', + value: 'station_id' + } + // slotName: 'searchSelect' + }, + { + label: '厂家', + value: '', + key: 'factory', type: 'input' }, { - label: '用户', - value: undefined, - // dataIndex: 'userId', - key: 'userId', - type: 'select', - list: [] + label: '厂家电话', + value: '', + key: 'factory_tel', + type: 'input' }, { - label: '余额', + label: '是否启用', value: '', - key: 'money', - type: 'input', - inputType: 'number' - }, - { - label: '账户状态', - value: '', - key: 'status', - type: 'select', - list: [ - { - label: '正常', - value: 0 - }, - { - label: '注销', - value: 1 - }, - { - label: '异常', - value: 9 - } - ] + key: 'is_open', + type: 'switch' } ], - ruleForm: { - // selectTableData: [], - } + 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 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: '请选择场站名称' + } + ] +} diff --git a/web/public/index.html b/web/public/index.html index 11a9498..c6133d9 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -6,7 +6,7 @@ <%= htmlWebpackPlugin.options.title %> - +