代码提交

This commit is contained in:
ym1026
2025-09-12 11:43:32 +08:00
parent f0720439d2
commit 1a66c87a5a
23 changed files with 63 additions and 198 deletions

View File

@@ -76,7 +76,6 @@ export default {
const res = await getReq('/login',this.form )
this.loading = false
console.log(res);
if (res.errcode === 0) {
this.$message.success('登录成功')
@@ -91,7 +90,6 @@ export default {
// this.$message.error(res.message || '登录失败')
// }
} catch (error) {
console.log(error);
this.loading = false
this.$message.error('请求失败,请稍后重试')

View File

@@ -76,7 +76,6 @@ export default {
$route: {
immediate: true,
handler(to) {
console.log(this.dynamicMenuList, 'this.dynamicMenuList')
// // 更新当前激活的菜单项
// // this.currentKey = to.matched[0]?.path || ''
this.menuList = this.dynamicMenuList
@@ -146,7 +145,6 @@ export default {
}
},
generateMenu(routes) {
console.log(routes, 'routes')
return routes.map((route) => ({
...route,
title: route.name,

View File

@@ -535,7 +535,6 @@ export default {
this.startRealtimeRefresh()
},
beforeUnmount() {
console.log('beforeUnmount')
clearInterval(this.interval) // 组件销毁时清除定时器
},
methods: {
@@ -661,30 +660,7 @@ export default {
this.getStatCharts()
},
// async getEchartsList() {
// const key = activeKey || this.activeKey;
// if (!key) return;
// const currentInfo = this.echartsInfo[this.activeKey]
// const query = {
// ...this.paramsDate,
// category: this.activeKey
// }
// try {
// const res = await getReq('/queryStatDayList', query)
// if (res.errcode === 0) {
// this.echartsInfo[this.activeKey].chartData = res.data
// console.log(
// this.echartsInfo[this.activeKey].chartData,
// ' this.echartsInfo[this.activeKey].chartData'
// )
// } else {
// throw res
// }
// } catch (error) {
// this.echartsInfo[this.activeKey].chartData = {}
// }
// },
async getStatCharts() {
const currentInfo = this.echartsInfo[this.activeKey]
const query = {
@@ -695,12 +671,7 @@ export default {
try {
const res = await getReq('/queryStatCharts', query)
if (res.errcode === 0) {
this.echartsInfo[this.activeKey].chartDatav = {
V: [100.0, 100.0, 100.0], // 电压曲线
I: [10.0, 10.0, 10.0], // 电流曲线
P: [1000.0, 1000.0, 1000.0] // 功率曲线
}
this.echartsInfo[this.activeKey].chartDatav = res.data
// x轴0点到24点
} else {
throw res
@@ -714,75 +685,7 @@ export default {
}
}
// async getTableList() {
// const currentInfo = this.tableList[this.activeKey]
// const query = {
// ...this.paramsDate,
// category: this.activeKey,
// page_size: currentInfo.pageOption.pageSize,
// pageNumber: currentInfo.pageOption.page
// }
// try {
// const res = await getReq('/queryStatDayList', query)
// if (res.errcode === 0) {
// this.tableList[this.activeKey].pageOption.tableData = res.data
// this.tableList[this.activeKey].pageOption.pageOption = {
// page: res.data.page,
// pageSize: res.data.page_size,
// count: res.data.count
// }
// } else {
// throw res
// }
// } catch (error) {
// this.tableList[this.activeKey].pageOption.tableData = [
// {
// key1: '1515151515',
// key2: '设备1111',
// key3: '类型',
// key4: '电量',
// key5: '时长',
// key6: '时长',
// key7: 'dianl',
// key8: '时长',
// key9: '时长11'
// },
// {
// key1: '1515151515',
// key2: '设备1111',
// key3: '类型',
// key4: '电量',
// key5: '时长',
// key6: '时长',
// key7: 'dianl',
// key8: '时长',
// key9: '时长11'
// },
// {
// key1: '1515151515',
// key2: '设备1111',
// key3: '类型',
// key4: '电量',
// key5: '时长',
// key6: '时长',
// key7: 'dianl',
// key8: '时长',
// key9: '时长11'
// },
// {
// key1: '1515151515',
// key2: '设备1111',
// key3: '类型',
// key4: '电量',
// key5: '时长',
// key6: '时长',
// key7: 'dianl',
// key8: '时长',
// key9: '时长11'
// }
// ]
// }
// }
}
}
</script>

View File

@@ -117,7 +117,22 @@ export default {
this.getStatDayList(1),
this.getStatDayList(2),
this.getStatDayList(3)
])
]).then((r)=>{
if (
this.deviceInfo.energy.length &&
this.deviceInfo.charge.length &&
this.deviceInfo.pv.length
) {
const newArr = this.mergedArray(
this.deviceInfo.energy,
this.deviceInfo.charge,
this.deviceInfo.pv
)
this.deviceInfo.alarm = newArr
}
console.log(r,'11111')
})
// this.showFlag=true
},
@@ -189,6 +204,7 @@ export default {
// 示例获取7天前的日期
// 查询场站日统计信息
async getStatDayList(category) {
console.log(category,"category")
try {
// station_id: 场站ID
// category: 类别: 1储能设备,2:充电设备,3:光伏设备
@@ -205,18 +221,7 @@ export default {
if (res.errcode === 0) {
this.list.forEach((item) => {
this.deviceInfo[arr[category]] = res.data
if (
this.deviceInfo.energy.length &&
this.deviceInfo.charge.length &&
this.deviceInfo.pv.length
) {
const newArr = this.mergedArray(
this.deviceInfo.energy,
this.deviceInfo.charge,
this.deviceInfo.pv
)
this.deviceInfo.alarm = newArr
}
})
} else {
throw res

View File

@@ -17,11 +17,13 @@
>
<template #is_open="record">
<!-- 0:禁用; 1:启用 -->
<span>{{ ['禁用', '启用'][record.is_open] }}</span>
<a-tag :color="record.is_open == 0 ? 'red' : 'green'">{{
record.is_open == 0 ? '禁用' : '启用'
}}</a-tag>
</template>
<template #permission="record">
<!-- 0:禁用; 1:启用 -->
<span>{{record.permission.map(item=>item.name).toString() }}</span>
<span>{{ record.permission.map((item) => item.name).toString() }}</span>
</template>
<template #action="record">
@@ -50,9 +52,7 @@ import { createVNode } from 'vue'
export default {
name: '',
components: {
},
components: {},
props: {},
data() {
return {
@@ -103,13 +103,12 @@ export default {
this.$refs.comTable.loading = false
// this.tableData = res.data
this.tableData =JSON.parse( localStorage.getItem('permission')).map((item)=>{
this.tableData = JSON.parse(localStorage.getItem('permission')).map((item) => {
return {
...item,
key:item.permission_id,
key: item.permission_id
}
})
console.log( this.tableData," this.tableData")
this.pageOption = {
page: res.page,
pageSize: res.page_size,
@@ -124,24 +123,11 @@ export default {
}
},
operateForm(type, record = {}) {
console.log(record,record.id,'rrrrrrrrrr')
this.formStatus = type
switch (type) {
// case 'add':
// this.formModal = true
// this.formState = {}
// this.getRuleFormInfo()
// break
// case 'edit':
// case 'read':
// this.formModal = true
// this.formState = record
// this.getRuleFormInfo(record)
// break
case 'del':
// this.handleDelete([record.permission_id],this.getList)
break
@@ -155,7 +141,7 @@ export default {
}
},
// 删除操作
async handleDelete(id,callback) {
async handleDelete(id, callback) {
const that = this
Modal.confirm({
title: '你确认删除数据吗?',
@@ -163,10 +149,10 @@ export default {
async onOk() {
try {
const res = await getReq('/deletepermission',{permission_id:id})
const res = await getReq('/deletepermission', { permission_id: id })
if (res.errcode === 0) {
this.$message.success(res.errmsg)
this.pageOption.page=1
this.pageOption.page = 1
callback()
} else {
throw res
@@ -197,7 +183,6 @@ export default {
row = record
// this.type='edit'
}
},
handlePagesizeChange(pageOption) {
this.pageOption.pageSize = pageOption.pageSize

View File

@@ -16,8 +16,10 @@
:page-option="pageOption"
>
<template #is_open="record">
<!-- 0:禁用; 1:启用 -->
<span>{{ ['禁用', '启用'][record.is_open] }}</span>
<!-- 0:禁用; 1:启用 -->
<a-tag :color="record.is_open == 0 ? 'red' : 'green'">{{
record.is_open == 0 ? '禁用' : '启用'
}}</a-tag>
</template>
<template #permission="record">
<!-- 0:禁用; 1:启用 -->
@@ -245,7 +247,6 @@ export default {
}
},
operateForm(type, record = {}) {
console.log(record, 'rrrrrrrrrr')
this.formStatus = type
switch (type) {
case 'add':
@@ -295,7 +296,6 @@ export default {
}
},
onCancel() {
// console.log("Cancel");
},
class: 'test'
})

View File

@@ -16,7 +16,10 @@
:page-option="pageOption"
>
<template #is_open="record">
<span>{{ ['禁用', '启用'][record.is_open] }}</span>
<!-- 0:禁用; 1:启用 -->
<a-tag :color="record.is_open == 0 ? 'red' : 'green'">{{
record.is_open == 0 ? '禁用' : '启用'
}}</a-tag>
</template>
@@ -149,7 +152,6 @@ export default {
}
},
operateForm(type, record = {}) {
console.log(record,record.id,'rrrrrrrrrr')
this.formStatus = type
switch (type) {
case 'add':
@@ -201,7 +203,6 @@ export default {
}
},
onCancel() {
// console.log("Cancel");
},
class: 'test'
})

View File

@@ -16,14 +16,17 @@
:page-option="pageOption"
>
<template #status="record">
<span>{{ ['未启用', '启用'][record.status] }}</span>
<a-tag :color="record.status == 0 ? 'red' : 'green'">{{
record.status == 0 ? '未投运' : '投运'
}}</a-tag>
<span>{{}}</span>
</template>
<template #work_mode="record">
<span>{{ workModeList.find((item) => record.value == item.value)?.label || '' }}</span>
</template>
</template>
<template #policy_id="record">
<span>{{ policyList.find((item) => record.value == item.value)?.label || '' }}</span>
</template>
</template>
<template #action="record">
<OperateCom :record="record" :operate-list="operateList" @operateForm="operateForm" />
</template>
@@ -63,7 +66,7 @@ export default {
data() {
return {
tableOption: {
select:false
select: false
},
formModal: false,
formState: {},
@@ -161,11 +164,9 @@ export default {
} catch (error) {
//统一处理报错提示
this.$refs.comTable.loading = false
}
},
operateForm(type, record = {}) {
console.log(record, record.id, 'rrrrrrrrrr')
this.formStatus = type
switch (type) {
case 'add':
@@ -217,7 +218,6 @@ export default {
}
},
onCancel() {
// console.log("Cancel");
},
class: 'test'
})

View File

@@ -120,7 +120,6 @@ export default {
}
},
operateForm(type, record = {}) {
console.log(record,record.id,'rrrrrrrrrr')
this.formStatus = type
switch (type) {
case 'add':
@@ -172,7 +171,6 @@ export default {
}
},
onCancel() {
// console.log("Cancel");
},
class: 'test'
})