diff --git a/web/babel.config.js b/web/babel.config.js index 162a3ea..59dfb82 100644 --- a/web/babel.config.js +++ b/web/babel.config.js @@ -1,3 +1,12 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"], -}; + plugins: [ + [ + 'import', + { + libraryName: 'ant-design-vue', + libraryDirectory: 'es', + style: true // 或 true(使用 less) + } + ] + ] +} diff --git a/web/public/config/columnList.js b/web/public/config/columnList.js index f4f9fee..e00475e 100644 --- a/web/public/config/columnList.js +++ b/web/public/config/columnList.js @@ -288,7 +288,9 @@ export const columnList = [ title: '操作', dataIndex: 'operate', key: 'operate', - scopedSlots: { customRender: 'action' } + scopedSlots: { customRender: 'action' }, + fixed: 'right', + align: 'center' } ] }, @@ -350,45 +352,30 @@ export const columnList = [ ] }, { - page: 'log', + page: 'syslog', columns: [ { - title: '用户', - dataIndex: 'userName', - width: 180 + title: '日志ID', + dataIndex: 'log_id' }, { - title: '日志类型', - dataIndex: 'type', - key: 'type', - width: 120, + title: '操作用户', + dataIndex: 'user_id', + key: 'user_id', + width: 120 + }, - scopedSlots: { customRender: 'type' } - }, { - title: '操作类型', - dataIndex: 'opType', - key: 'opType', - width: 120, - - scopedSlots: { customRender: 'opType' } - }, - { - title: 'ip', - dataIndex: 'ip', - key: 'ip' - }, - { - title: '内容', - dataIndex: 'msg', - key: 'msg', + title: '日志内容', + dataIndex: 'content', + key: 'content', ellipsis: true }, { - title: '生成时间', - dataIndex: 'createTime', - key: 'createTime', + title: '记录时间', + dataIndex: 'create_time', + key: 'create_time', align: 'center', ellipsis: true, width: 180 @@ -406,7 +393,6 @@ export const columnList = [ title: '操作', dataIndex: 'operate', key: 'operate', - width: 80, scopedSlots: { customRender: 'action' } } ] @@ -871,8 +857,58 @@ export const alarmlogOptions = [ label: '状态', type: 'select', list: [ - { value: 0, label: '异常' }, - { value: 1, label: '正常' } + { 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' diff --git a/web/src/components/ComTable.vue b/web/src/components/ComTable.vue index d425351..ac2eac0 100644 --- a/web/src/components/ComTable.vue +++ b/web/src/components/ComTable.vue @@ -161,8 +161,11 @@ const scroll = ref({}) onMounted(async () => { data.newColumns = [...props.columns] data.realTableData = [...props.tableData] + await nextTick() // console.log(props.tableH, 'props.tableH'); + console.log(comtable.value.offsetHeight,'comtable.value.offsetHeight'); + scroll.value = { y: comtable.value.offsetHeight - 56 } }) @@ -220,10 +223,11 @@ defineExpose({ ...toRefs(data), loading, mountedScroll, scroll: data.scroll }) diff --git a/web/src/components/DetailInfo.vue b/web/src/components/DetailInfo.vue index 186847e..923f945 100644 --- a/web/src/components/DetailInfo.vue +++ b/web/src/components/DetailInfo.vue @@ -371,7 +371,7 @@ import { onMounted, defineExpose } from 'vue' -import { TreeSelect } from 'ant-design-vue' + import iconfonts from '../assets/iconfont/iconfont.json' import validateRulesObj from '../utils/decorator' @@ -641,7 +641,7 @@ defineExpose({ } .form-item { - width: 320px !important; + // width: 320px !important; } } } diff --git a/web/src/components/EditCom.vue b/web/src/components/EditCom.vue index 07502d3..0d3373b 100644 --- a/web/src/components/EditCom.vue +++ b/web/src/components/EditCom.vue @@ -174,6 +174,7 @@ export default { case 'alarmLog': this.detailInfos = alarmlogOptions this.formRules = {} + break case 'serviceApi': this.detailInfos = serviceApiOptions this.formRules = serviceApiFormRules diff --git a/web/src/components/monitor/device.vue b/web/src/components/monitor/device.vue index 6e44c7f..9ba5315 100644 --- a/web/src/components/monitor/device.vue +++ b/web/src/components/monitor/device.vue @@ -35,9 +35,15 @@ {{ info.v }} -
- 实时数据: - 查看 +
+
+ 实时数据: + 查看 +
+
+ 单体信息: + 查看 +
-
-
-
电流电压
- +
+
+
+
电流电压
+ +
+
+ +
-
- +
+
+
功率
+ +
+
+ +
-
-
-
功率
- -
-
- -
+ +
+ +
@@ -98,19 +119,7 @@ export default { return { modalOpen: false, deviceList: [], - chunengInfo: [ - { label: '运行模式', key: 'operationMode', value: '并网运行' }, - { label: '电池储能容量', key: 'batteryCapacity', value: '100kWh' }, - { label: '实时电压', key: 'voltage', value: '232.5V' }, - { label: '功率因数', key: 'powerFactor', value: '0.95' }, - { label: '实时电流', key: 'current', value: '0.01A' }, - { label: '额定电压', key: 'ratedVoltage', value: '232.5V' }, - { label: '实时功率', key: 'power', value: '0.01kW' }, - { label: '额定电流', key: 'ratedCurrent', value: '0.01A' }, - { label: '实时数据', key: 'realTimeData', value: '0.01kWh' }, - { label: '额定功率', key: 'ratedPower', value: '0.01kW' }, - { label: '冷却方式', key: 'coolingMethod', value: '风冷' } - ], + chartOptions: [ { type: 'line', @@ -173,6 +182,52 @@ export default { chartData: { xdata: [], ydata: {} + }, + modalComponent: 1, + columns: [ + { + title: '序号', + dataIndex: 'id', + key: 'id', + ellipsis: true, + fixed: 'left' + }, + { + title: '单体SOC(%)', + dataIndex: 'SOC', + key: 'SOC' + }, + { + title: '单体SOH(%)', + dataIndex: 'SOH', + key: 'SOH' + }, + { + title: '单体电压(V)', + dataIndex: 'V', + key: 'V' + }, + { + title: '单体温度(℃)', + dataIndex: 'T', + key: 'T' + }, + { + title: '单体内阻(Ω)', + dataIndex: 'R_i', + key: 'R_i' + } + ], + tableData: [], + pageOption: { + // pageSize: 1000, + // page: 1 + }, + tableOption: { + scroll: { + y: 500 + }, + page: false } } }, @@ -193,6 +248,11 @@ export default { this.getDeviceList() }, methods: { + handlePagesizeChange(pageOption) { + this.pageOption.pageSize = pageOption.pageSize + this.pageOption.page = pageOption.page + this.getList() + }, getIcongont(ele) { return deviceTypeList.find((item) => item.value == ele.type).iconfont || '' }, @@ -228,7 +288,22 @@ export default { this.chartData.xdata = this.generateTimePoints() this.$refs.chartRef1.initCharts() this.$refs.chartRef2.initCharts() + } catch (error) { + console.log(error) + } + }, + //查询BCU单体信息 + async getDeviceBCUDetail(item) { + try { + const res = await getReq('/queryDeviceBCUDetail', { + station_id: this.stationId, + device_id: item.device_id + }) + this.tableData = res.data.map((item, index) => { + item.id = index + 1 + return item + }) } catch (error) { console.log(error) } @@ -249,8 +324,14 @@ export default { console.log(error) } }, - async openModal(item) { - await this.getDevicCharts(item) + async openModal(item, val) { + console.log(item, '=============') + this.modalComponent = val + if (val == 1) { + await this.getDevicCharts(item) + } else { + await this.getDeviceBCUDetail(item) + } this.modalOpen = true }, @@ -268,13 +349,16 @@ export default { margin-left: 20px; display: grid; grid-gap: 20px; - grid-template-columns: 1fr 1fr 1fr; overflow-y: auto; + grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); .device-item { border-radius: 15px; - background: $bg2-color; padding: 15px; + min-width: 340px; + max-width: 430px; + max-height: 230px; + flex: 1; .item-header { display: flex; align-items: center; @@ -290,7 +374,7 @@ export default { background: linear-gradient(90deg, #3dfefa 0%, #2a82e4 2.96%, #27a188 100%), linear-gradient(90deg, #3dfefa 0%, #01dfef 2.96%, #08a5ff 100%); .iconfont { - font-size: 50px; + font-size: 45px; } } .title { @@ -332,8 +416,8 @@ export default { grid-template-columns: 1fr 1fr; color: #fff; display: grid; - // line-height: 45px; margin-top: 15px; + margin-bottom: 3px; padding: 0 10px; height: 120px; overflow-y: auto; @@ -345,7 +429,12 @@ export default { } } .item-button { + width: 100%; padding-left: 10px; + display: flex; + div { + width: calc(50% - 10px); + } } .text { color: $text-color; @@ -354,26 +443,35 @@ export default { margin-top: 10px; } } + .content-table { + height: 700px; + margin-top: 40px; + + :deep(.ant-table-header tr th) { + background: $table-border !important; + color: #fff; + } + :deep(.ant-table-body tr td, .ant-table-cell) { + background: $table-bg !important; + color: #fff; + } + } } .environment { width: 200px; } -:deep(.modal-device) { - color: #fff; - .title { - display: flex; - font-weight: 700; - flex-direction: column; - img { - width: 232px; - height: 6px; - margin-top: 10px; - } +:deep(.ant-modal-body) { + :deep(.ant-table-wrapper .ant-table-row-expand-icon) { + color: $green !important; } - .echarts { - width: 100%; - height: 280px; + //表格行悬浮样式 + .no-hover-row:hover > td { + // background-color: transparent !important; + background-color: #f0f8ff !important; } } +// .a-modal :deep(.ant-table-thead > tr > th) { +// background-color: #f0f8ff !important; +// } diff --git a/web/src/components/monitor/videos.vue b/web/src/components/monitor/videos.vue index f175643..56537c1 100644 --- a/web/src/components/monitor/videos.vue +++ b/web/src/components/monitor/videos.vue @@ -1,8 +1,8 @@