From 013a2245f58c58311fb564b0393ca03d32c5ac3a Mon Sep 17 00:00:00 2001 From: ym1026 <1539963735@qq.com> Date: Fri, 5 Sep 2025 09:26:14 +0800 Subject: [PATCH] =?UTF-8?q?store+=E7=BB=9F=E8=AE=A1=E5=88=86=E6=9E=90+?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/public/config/columnList.js | 342 ++++++++++++++++++ web/src/components/ComTable.vue | 14 +- web/src/components/Home/Map.vue | 2 +- web/src/components/Home/Modal.vue | 27 +- web/src/components/Home/Modal/PrefabCabin.vue | 49 ++- .../components/Home/Modal/StatisticalInfo.vue | 4 +- web/src/components/OperateCom.vue | 107 ++++++ web/src/main.js | 4 + web/src/store/index.js | 7 +- web/src/store/systemUser.js | 17 + web/src/utils/btnList.js | 54 +++ web/src/utils/column.js | 93 +++++ web/src/views/MainView.vue | 2 +- web/src/views/sub/Home.vue | 261 ++----------- web/src/views/system/user.vue | 206 +++++++++-- 15 files changed, 911 insertions(+), 278 deletions(-) create mode 100644 web/public/config/columnList.js create mode 100644 web/src/components/OperateCom.vue create mode 100644 web/src/store/systemUser.js create mode 100644 web/src/utils/btnList.js create mode 100644 web/src/utils/column.js diff --git a/web/public/config/columnList.js b/web/public/config/columnList.js new file mode 100644 index 0000000..124b3ed --- /dev/null +++ b/web/public/config/columnList.js @@ -0,0 +1,342 @@ +export const columnList = [ + { + page: 'user', + columns: [ + { + title: '用户ID', + dataIndex: 'user_id', + key: 'user_id', + ellipsis: true, + filterable: true, + fixed: 'left' + }, + { + title: '用户名', + dataIndex: 'account', + key: 'account', + filterable: true + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + ellipsis: true, + filterable: true + }, + { + title: '性别', + dataIndex: 'gender', + key: 'gender', + filterable: true, + scopedSlots: { customRender: 'gender' } + }, + { + title: '年龄', + dataIndex: 'age', + key: 'age', + filterable: true + }, + { + title: '手机号', + dataIndex: 'phone', + key: 'phone', + filterable: true + }, + { + title: '邮箱', + dataIndex: 'email', + key: 'email', + filterable: true + }, + { + title: '角色ID', + dataIndex: 'role_id', + key: 'role_id', + filterable: true + }, + { + 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 + }, + { + title: '操作', + dataIndex: 'operate', + key: 'operate', + scopedSlots: { customRender: 'action' } + } + ] + }, + { + page: 'role', + columns: [ + { + title: '角色名称', + dataIndex: 'name', + key: 'name', + ellipsis: true, + filterable: true, + width: 180, + + fixed: 'left' + }, + { + title: '角色类型', + dataIndex: 'type', + key: 'type', + width: 120, + + scopedSlots: { customRender: 'type' } + }, + { + title: '描述', + dataIndex: 'desc', + align: 'center', + key: 'desc', + ellipsis: true + }, + { + title: '权限名称', + dataIndex: 'permissions', + align: 'center', + key: 'permissions', + width: 180, + + ellipsis: true, + scopedSlots: { customRender: 'permissions' } + }, + { + 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', + 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', + scopedSlots: { customRender: 'action' } + } + ] + } +] + +export const options = [ + { + title: '基础信息', + icon: 'icon-xinxi', + list: [ + { + label: '名称', + value: '', + key: 'name', + type: 'input' + }, + { + label: '账户类型', + value: undefined, + // dataIndex: 'type', + key: 'type', + type: 'select', + list: [ + { + label: '虚拟账户', + value: 0 + }, + { + label: '卡账户', + value: 1 + } + ] + }, + + { + label: '账号', + value: [], + key: 'code', + type: 'input' + }, + { + label: '用户', + value: undefined, + // dataIndex: 'userId', + key: 'userId', + type: 'select', + list: [] + }, + { + label: '余额', + value: '', + key: 'money', + type: 'input', + inputType: 'number' + }, + { + label: '账户状态', + value: '', + key: 'status', + type: 'select', + list: [ + { + label: '正常', + value: 0 + }, + { + label: '注销', + value: 1 + }, + { + label: '异常', + value: 9 + } + ] + } + ], + ruleForm: { + // selectTableData: [], + } + } +] diff --git a/web/src/components/ComTable.vue b/web/src/components/ComTable.vue index 3d9794d..2c3e035 100644 --- a/web/src/components/ComTable.vue +++ b/web/src/components/ComTable.vue @@ -53,8 +53,8 @@ @@ -107,9 +107,9 @@ const props = defineProps({ type: Object, default: () => { return { - current: 1, + count: 1, pageSize: 10, - total: 1 + page: 1 } } }, @@ -206,7 +206,7 @@ function rowClassName(record, index) { } function expandIcon(props) {} function onChange(page, pageSize) { - data.newPageOption.current = page + data.newPageOption.page = page data.newPageOption.pageSize = pageSize emit('handlePagesizeChange', data.newPageOption) } diff --git a/web/src/components/Home/Map.vue b/web/src/components/Home/Map.vue index 91b334f..faec418 100644 --- a/web/src/components/Home/Map.vue +++ b/web/src/components/Home/Map.vue @@ -41,7 +41,7 @@ export default { showCtrModal: false, testVal: { name: '场站211', - id: '124563' + id: '2' }, changeStationId:'' } diff --git a/web/src/components/Home/Modal.vue b/web/src/components/Home/Modal.vue index 67da635..fd7f99f 100644 --- a/web/src/components/Home/Modal.vue +++ b/web/src/components/Home/Modal.vue @@ -9,7 +9,7 @@ @@ -59,7 +59,7 @@ export default { title: '预制舱信息', class: '', componentId: PrefabCabin, - infoKey: '' + infoKey: 'prefab' }, { title: '储能充放电量', @@ -114,6 +114,7 @@ export default { async mounted() { await Promise.all([ this.getStatTotalList(), + this.queryStationInfo(), this.getStatDayList(1), ]) }, @@ -128,7 +129,7 @@ export default { // category:类别,1:储能设备,2:充电设备,3:光伏设备,为0或不传查询所有类别总计 const query = { date: getDateDaysAgo(0), - stationId: this.stationId, + station_id: this.stationId, category: 0 } const res = await getReq('/api/queryStatTotal', query) @@ -144,6 +145,24 @@ export default { this.modalInfo.allTotal = {} } }, + // 查询场站信息 + async queryStationInfo() { + try { + // station_id:场站ID + + const query = { + station_id: this.stationId, + } + const res = await getReq('/api//queryStationInfo', query) + if (res.errcode === 0) { + this.modalInfo.prefabTotal = res.data + } else { + throw res + } + } catch (error) { + this.modalInfo.allTotal = {} + } + }, // 查询场站日统计信息 async getStatDayList(category) { try { @@ -152,7 +171,7 @@ export default { // start_date:开始日期,格式:yyyy-mm-dd // end_date:结束日期,格式:yyyy-mm-dd const query = { - stationId: this.stationId, + station_id: this.stationId, category, start_date: getDateDaysAgo(7 - 1), end_date: getDateDaysAgo(0) diff --git a/web/src/components/Home/Modal/PrefabCabin.vue b/web/src/components/Home/Modal/PrefabCabin.vue index 370ba11..a734b5c 100644 --- a/web/src/components/Home/Modal/PrefabCabin.vue +++ b/web/src/components/Home/Modal/PrefabCabin.vue @@ -44,42 +44,68 @@ export default { curStatus: '充电', list: [ { - key: 'tianshu', + key: 'batttey_type', value: '磷酸铁锂电池', d: '', label: '电池类型', class: 'item-1' }, { - key: 'shouyi', + key: 'cooling_type', value: '风冷', d: '', label: '冷却方式', class: 'item-2' }, { - key: 'shuliang', + key: 'voltage_rated', value: 20, d: 'V', label: '电池额定总电压', class: 'item-3' }, { - key: 'shuliang', + key: 'work_mode', value: '最优经济化运行模式', d: '', label: '运行模式', - class: 'item-4' + class: 'item-4', + list:[ + { + label:'手动', + value:0 + }, + { + label:'峰谷套利', + value:1 + }, + { + label:'增网配容', + value:2 + }, + { + label:'应急供电', + value:3 + }, + { + label:'并网保电', + value:4 + }, + { + label:'自定时段', + value:5 + }, + ] }, { - key: 'fadianliang', + key: 'capacity', value: 20, d: 'Wh', label: '电池储能容量', class: 'item-5' }, { - key: 'rongliang', + key: 'power_rated', value: 100, d: 'Kw', label: 'PCS额定功率', @@ -100,8 +126,15 @@ export default { propsTotal: { handler(newVal, oldVal) { if (newVal !== oldVal) { + // 0正常 1故障 + this.curStatus=['正常','故障'][this.propsTotal.status] this.list.forEach((item) => { - item.value = this.propsTotal[item.key] + if(item.key=='work_mode'){ + item.value =item.list.map((item)=>this.propsTotal[item.key]==item.value)[0].label + }else { + item.value = this.propsTotal[item.key] + + } }) } } diff --git a/web/src/components/Home/Modal/StatisticalInfo.vue b/web/src/components/Home/Modal/StatisticalInfo.vue index 8850454..ebb641a 100644 --- a/web/src/components/Home/Modal/StatisticalInfo.vue +++ b/web/src/components/Home/Modal/StatisticalInfo.vue @@ -1,5 +1,5 @@