mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
代码提交
This commit is contained in:
@@ -213,6 +213,11 @@ export const columnList = [
|
|||||||
key: 'status',
|
key: 'status',
|
||||||
scopedSlots: { customRender: 'status' }
|
scopedSlots: { customRender: 'status' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '投运时间',
|
||||||
|
dataIndex: 'touyuntime',
|
||||||
|
key: 'touyuntime'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '场站运行模式',
|
title: '场站运行模式',
|
||||||
dataIndex: 'work_mode',
|
dataIndex: 'work_mode',
|
||||||
|
|||||||
@@ -163,8 +163,6 @@ onMounted(async () => {
|
|||||||
data.realTableData = [...props.tableData]
|
data.realTableData = [...props.tableData]
|
||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
// console.log(props.tableH, 'props.tableH');
|
|
||||||
console.log(comtable.value.offsetHeight,'comtable.value.offsetHeight');
|
|
||||||
|
|
||||||
|
|
||||||
scroll.value = { y: comtable.value.offsetHeight - 56 }
|
scroll.value = { y: comtable.value.offsetHeight - 56 }
|
||||||
|
|||||||
@@ -455,7 +455,6 @@ function confirm() {
|
|||||||
resolve(true)
|
resolve(true)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log('error', error)
|
|
||||||
resolve(false)
|
resolve(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
workModeIdSelect: {
|
workModeIdSelect: {
|
||||||
handler(n) {
|
handler(n) {
|
||||||
console.log(n,'nnnnnnnnnnnnnnnnworkModeIdSelectn')
|
|
||||||
|
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case '1':
|
case '1':
|
||||||
@@ -371,23 +370,8 @@ export default {
|
|||||||
add: '/insertRole',
|
add: '/insertRole',
|
||||||
edit: '/updateRole'
|
edit: '/updateRole'
|
||||||
}
|
}
|
||||||
const { selectedRowKeys, selectedArr } = this.$refs.treeTable[0]
|
const { selectedRowKeys } = this.$refs.treeTable[0]
|
||||||
console.log(selectedRowKeys, selectedArr, 'selectedRowKeys')
|
|
||||||
// const arr = selectedArr.map((item) => ({
|
|
||||||
// ...item,
|
|
||||||
|
|
||||||
// // 转换操作权限为布尔值
|
|
||||||
// ...this.getPerOperBoolean(item),
|
|
||||||
// // 递归处理children
|
|
||||||
// children: item.children
|
|
||||||
// ? item.children.map((child) => ({
|
|
||||||
// ...child,
|
|
||||||
// ...this.getPerOperBoolean(child),
|
|
||||||
|
|
||||||
// }))
|
|
||||||
// : []
|
|
||||||
// }))
|
|
||||||
// console.log(arr,"arr")
|
|
||||||
|
|
||||||
const data = this.filterTreeData(selectedRowKeys, this.$refs.treeTable[0].tableData)
|
const data = this.filterTreeData(selectedRowKeys, this.$refs.treeTable[0].tableData)
|
||||||
const arr = data.map((item) => ({
|
const arr = data.map((item) => ({
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default {
|
|||||||
this.energyChartData.ydata[index] = {
|
this.energyChartData.ydata[index] = {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
smooth: true,
|
smooth: true,
|
||||||
type: 'bar',
|
type: 'line',
|
||||||
barWidth: 5,
|
barWidth: 5,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderRadius: [5, 5, 0, 0],
|
borderRadius: [5, 5, 0, 0],
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
center: [116.404, 39.915], // 默认中心点(北京)
|
center: [113.5, 33.875], // 默认中心点(河南)
|
||||||
zoom: 12,
|
zoom: 10,
|
||||||
map: null,
|
map: null,
|
||||||
currentMarker: {},
|
currentMarker: {},
|
||||||
showCtrModal: false,
|
showCtrModal: false,
|
||||||
|
|||||||
@@ -96,18 +96,14 @@ export default {
|
|||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (newVal !== oldVal) {
|
if (newVal !== oldVal) {
|
||||||
this.list.forEach((item) => {
|
this.list.forEach((item) => {
|
||||||
console.log(this.propsTotal,this.propsTotal[item.key],"this.propsTotal[item.key]")
|
|
||||||
if (item.key == 'coolingStatus') {
|
if (item.key == 'coolingStatus') {
|
||||||
console.log(this.coolingList.find(
|
|
||||||
(e) => e.value == this.propsTotal[item.key]
|
|
||||||
))
|
|
||||||
item.value = this.coolingList.find(
|
item.value = this.coolingList.find(
|
||||||
(e) => e.value == this.propsTotal[item.key]
|
(e) => e.value == this.propsTotal[item.key]
|
||||||
).label
|
).label ||'关机'
|
||||||
} else if (item.key == 'aircStatus') {
|
} else if (item.key == 'aircStatus') {
|
||||||
item.value = this.aircList.map(
|
item.value = this.aircList.map(
|
||||||
(e) => e.value == this.propsTotal[item.key]
|
(e) => e.value == this.propsTotal[item.key]
|
||||||
).label
|
)[0].label||'关机'
|
||||||
} else {
|
} else {
|
||||||
item.value = this.propsTotal[item.key]
|
item.value = this.propsTotal[item.key]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default {
|
|||||||
|
|
||||||
.item {
|
.item {
|
||||||
height: 50%;
|
height: 50%;
|
||||||
width: 30%;
|
width: 45%;
|
||||||
// height: 47px;
|
// height: 47px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
key: 'power_rated',
|
key: 'power_rated',
|
||||||
value: 100,
|
value: 100,
|
||||||
d: 'Kw',
|
d: 'Kw',
|
||||||
label: 'PCS额定功率',
|
label: '额定功率',
|
||||||
class: 'item-6'
|
class: 'item-6'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default {
|
|||||||
key: 'runDays',
|
key: 'runDays',
|
||||||
value: 26,
|
value: 26,
|
||||||
d: '天',
|
d: '天',
|
||||||
label: '场站运行天数',
|
label: '运行天数',
|
||||||
class: 'item-1',
|
class: 'item-1',
|
||||||
iconPath: require('@/assets/home/wendu.png')
|
iconPath: require('@/assets/home/wendu.png')
|
||||||
},
|
},
|
||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
key: 'incomeTotal',
|
key: 'incomeTotal',
|
||||||
value: 26,
|
value: 26,
|
||||||
d: '元',
|
d: '元',
|
||||||
label: '场站累计收益',
|
label: '累计收益',
|
||||||
class: 'item-4',
|
class: 'item-4',
|
||||||
iconPath: require('@/assets/home/dianliu.png')
|
iconPath: require('@/assets/home/dianliu.png')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.total,'total')
|
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,6 @@ export default {
|
|||||||
this.selectedRowKeys = selectedRowKeys
|
this.selectedRowKeys = selectedRowKeys
|
||||||
this.selectedRows = selectedRows[selectedRows.length - 1]
|
this.selectedRows = selectedRows[selectedRows.length - 1]
|
||||||
this.selectedArr=selectedRows
|
this.selectedArr=selectedRows
|
||||||
console.log(selectedRowKeys, this.selectedArr ,"selectedRowKeys")
|
|
||||||
this.$emit('getSelectedIds', selectedRowKeys)
|
this.$emit('getSelectedIds', selectedRowKeys)
|
||||||
},
|
},
|
||||||
onSelect(record, selected) {
|
onSelect(record, selected) {
|
||||||
|
|||||||
@@ -333,7 +333,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async openModal(item, val) {
|
async openModal(item, val) {
|
||||||
console.log(item, '=============')
|
|
||||||
this.modalComponent = val
|
this.modalComponent = val
|
||||||
this.modalOpen = true
|
this.modalOpen = true
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ export function getRunDays(date) {
|
|||||||
const timeDiff = today - launchDate // 毫秒差
|
const timeDiff = today - launchDate // 毫秒差
|
||||||
const daysRun = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)) // 转换为天数
|
const daysRun = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)) // 转换为天数
|
||||||
|
|
||||||
console.log(`从 2023-01-01 到今天已经运行了 ${daysRun} 天`)
|
|
||||||
|
|
||||||
return daysRun
|
return daysRun
|
||||||
}
|
}
|
||||||
export function processData(data, keys) {
|
export function processData(data, keys) {
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ export default {
|
|||||||
const res = await getReq('/login',this.form )
|
const res = await getReq('/login',this.form )
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
this.$message.success('登录成功')
|
this.$message.success('登录成功')
|
||||||
@@ -91,7 +90,6 @@ export default {
|
|||||||
// this.$message.error(res.message || '登录失败')
|
// this.$message.error(res.message || '登录失败')
|
||||||
// }
|
// }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
|
||||||
|
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$message.error('请求失败,请稍后重试')
|
this.$message.error('请求失败,请稍后重试')
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ export default {
|
|||||||
$route: {
|
$route: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(to) {
|
handler(to) {
|
||||||
console.log(this.dynamicMenuList, 'this.dynamicMenuList')
|
|
||||||
// // 更新当前激活的菜单项
|
// // 更新当前激活的菜单项
|
||||||
// // this.currentKey = to.matched[0]?.path || ''
|
// // this.currentKey = to.matched[0]?.path || ''
|
||||||
this.menuList = this.dynamicMenuList
|
this.menuList = this.dynamicMenuList
|
||||||
@@ -146,7 +145,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
generateMenu(routes) {
|
generateMenu(routes) {
|
||||||
console.log(routes, 'routes')
|
|
||||||
return routes.map((route) => ({
|
return routes.map((route) => ({
|
||||||
...route,
|
...route,
|
||||||
title: route.name,
|
title: route.name,
|
||||||
|
|||||||
@@ -535,7 +535,6 @@ export default {
|
|||||||
this.startRealtimeRefresh()
|
this.startRealtimeRefresh()
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
console.log('beforeUnmount')
|
|
||||||
clearInterval(this.interval) // 组件销毁时清除定时器
|
clearInterval(this.interval) // 组件销毁时清除定时器
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -661,30 +660,7 @@ export default {
|
|||||||
this.getStatCharts()
|
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() {
|
async getStatCharts() {
|
||||||
const currentInfo = this.echartsInfo[this.activeKey]
|
const currentInfo = this.echartsInfo[this.activeKey]
|
||||||
const query = {
|
const query = {
|
||||||
@@ -695,12 +671,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const res = await getReq('/queryStatCharts', query)
|
const res = await getReq('/queryStatCharts', query)
|
||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
this.echartsInfo[this.activeKey].chartDatav = {
|
this.echartsInfo[this.activeKey].chartDatav = res.data
|
||||||
V: [100.0, 100.0, 100.0], // 电压曲线
|
|
||||||
I: [10.0, 10.0, 10.0], // 电流曲线
|
|
||||||
P: [1000.0, 1000.0, 1000.0] // 功率曲线
|
|
||||||
}
|
|
||||||
|
|
||||||
// x轴0点到24点
|
// x轴0点到24点
|
||||||
} else {
|
} else {
|
||||||
throw res
|
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>
|
</script>
|
||||||
|
|||||||
@@ -117,7 +117,22 @@ export default {
|
|||||||
this.getStatDayList(1),
|
this.getStatDayList(1),
|
||||||
this.getStatDayList(2),
|
this.getStatDayList(2),
|
||||||
this.getStatDayList(3)
|
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
|
// this.showFlag=true
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -189,6 +204,7 @@ export default {
|
|||||||
// 示例:获取7天前的日期
|
// 示例:获取7天前的日期
|
||||||
// 查询场站日统计信息
|
// 查询场站日统计信息
|
||||||
async getStatDayList(category) {
|
async getStatDayList(category) {
|
||||||
|
console.log(category,"category")
|
||||||
try {
|
try {
|
||||||
// station_id: 场站ID
|
// station_id: 场站ID
|
||||||
// category: 类别: 1:储能设备,2:充电设备,3:光伏设备
|
// category: 类别: 1:储能设备,2:充电设备,3:光伏设备
|
||||||
@@ -205,18 +221,7 @@ export default {
|
|||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
this.list.forEach((item) => {
|
this.list.forEach((item) => {
|
||||||
this.deviceInfo[arr[category]] = res.data
|
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 {
|
} else {
|
||||||
throw res
|
throw res
|
||||||
|
|||||||
@@ -17,11 +17,13 @@
|
|||||||
>
|
>
|
||||||
<template #is_open="record">
|
<template #is_open="record">
|
||||||
<!-- 0:禁用; 1:启用 -->
|
<!-- 0:禁用; 1:启用 -->
|
||||||
<span>{{ ['禁用', '启用'][record.is_open] }}</span>
|
<a-tag :color="record.is_open == 0 ? 'red' : 'green'">{{
|
||||||
|
record.is_open == 0 ? '禁用' : '启用'
|
||||||
|
}}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #permission="record">
|
<template #permission="record">
|
||||||
<!-- 0:禁用; 1:启用 -->
|
<!-- 0:禁用; 1:启用 -->
|
||||||
<span>{{record.permission.map(item=>item.name).toString() }}</span>
|
<span>{{ record.permission.map((item) => item.name).toString() }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #action="record">
|
<template #action="record">
|
||||||
@@ -50,9 +52,7 @@ import { createVNode } from 'vue'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: '',
|
name: '',
|
||||||
components: {
|
components: {},
|
||||||
|
|
||||||
},
|
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -103,13 +103,12 @@ export default {
|
|||||||
this.$refs.comTable.loading = false
|
this.$refs.comTable.loading = false
|
||||||
|
|
||||||
// this.tableData = res.data
|
// this.tableData = res.data
|
||||||
this.tableData =JSON.parse( localStorage.getItem('permission')).map((item)=>{
|
this.tableData = JSON.parse(localStorage.getItem('permission')).map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
key:item.permission_id,
|
key: item.permission_id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log( this.tableData," this.tableData")
|
|
||||||
this.pageOption = {
|
this.pageOption = {
|
||||||
page: res.page,
|
page: res.page,
|
||||||
pageSize: res.page_size,
|
pageSize: res.page_size,
|
||||||
@@ -124,24 +123,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateForm(type, record = {}) {
|
operateForm(type, record = {}) {
|
||||||
console.log(record,record.id,'rrrrrrrrrr')
|
|
||||||
this.formStatus = type
|
this.formStatus = type
|
||||||
switch (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':
|
case 'del':
|
||||||
// this.handleDelete([record.permission_id],this.getList)
|
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -155,7 +141,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除操作
|
// 删除操作
|
||||||
async handleDelete(id,callback) {
|
async handleDelete(id, callback) {
|
||||||
const that = this
|
const that = this
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '你确认删除数据吗?',
|
title: '你确认删除数据吗?',
|
||||||
@@ -163,10 +149,10 @@ export default {
|
|||||||
|
|
||||||
async onOk() {
|
async onOk() {
|
||||||
try {
|
try {
|
||||||
const res = await getReq('/deletepermission',{permission_id:id})
|
const res = await getReq('/deletepermission', { permission_id: id })
|
||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
this.$message.success(res.errmsg)
|
this.$message.success(res.errmsg)
|
||||||
this.pageOption.page=1
|
this.pageOption.page = 1
|
||||||
callback()
|
callback()
|
||||||
} else {
|
} else {
|
||||||
throw res
|
throw res
|
||||||
@@ -197,7 +183,6 @@ export default {
|
|||||||
row = record
|
row = record
|
||||||
// this.type='edit'
|
// this.type='edit'
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
handlePagesizeChange(pageOption) {
|
handlePagesizeChange(pageOption) {
|
||||||
this.pageOption.pageSize = pageOption.pageSize
|
this.pageOption.pageSize = pageOption.pageSize
|
||||||
|
|||||||
@@ -16,8 +16,10 @@
|
|||||||
:page-option="pageOption"
|
:page-option="pageOption"
|
||||||
>
|
>
|
||||||
<template #is_open="record">
|
<template #is_open="record">
|
||||||
<!-- 0:禁用; 1:启用 -->
|
<!-- 0:禁用; 1:启用 -->
|
||||||
<span>{{ ['禁用', '启用'][record.is_open] }}</span>
|
<a-tag :color="record.is_open == 0 ? 'red' : 'green'">{{
|
||||||
|
record.is_open == 0 ? '禁用' : '启用'
|
||||||
|
}}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #permission="record">
|
<template #permission="record">
|
||||||
<!-- 0:禁用; 1:启用 -->
|
<!-- 0:禁用; 1:启用 -->
|
||||||
@@ -245,7 +247,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateForm(type, record = {}) {
|
operateForm(type, record = {}) {
|
||||||
console.log(record, 'rrrrrrrrrr')
|
|
||||||
this.formStatus = type
|
this.formStatus = type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
@@ -295,7 +296,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
// console.log("Cancel");
|
|
||||||
},
|
},
|
||||||
class: 'test'
|
class: 'test'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -16,7 +16,10 @@
|
|||||||
:page-option="pageOption"
|
:page-option="pageOption"
|
||||||
>
|
>
|
||||||
<template #is_open="record">
|
<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>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@@ -149,7 +152,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateForm(type, record = {}) {
|
operateForm(type, record = {}) {
|
||||||
console.log(record,record.id,'rrrrrrrrrr')
|
|
||||||
this.formStatus = type
|
this.formStatus = type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
@@ -201,7 +203,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
// console.log("Cancel");
|
|
||||||
},
|
},
|
||||||
class: 'test'
|
class: 'test'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -16,14 +16,17 @@
|
|||||||
:page-option="pageOption"
|
:page-option="pageOption"
|
||||||
>
|
>
|
||||||
<template #status="record">
|
<template #status="record">
|
||||||
<span>{{ ['未启用', '启用'][record.status] }}</span>
|
<a-tag :color="record.status == 0 ? 'red' : 'green'">{{
|
||||||
|
record.status == 0 ? '未投运' : '投运'
|
||||||
|
}}</a-tag>
|
||||||
|
<span>{{}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #work_mode="record">
|
<template #work_mode="record">
|
||||||
<span>{{ workModeList.find((item) => record.value == item.value)?.label || '' }}</span>
|
<span>{{ workModeList.find((item) => record.value == item.value)?.label || '' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #policy_id="record">
|
<template #policy_id="record">
|
||||||
<span>{{ policyList.find((item) => record.value == item.value)?.label || '' }}</span>
|
<span>{{ policyList.find((item) => record.value == item.value)?.label || '' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #action="record">
|
<template #action="record">
|
||||||
<OperateCom :record="record" :operate-list="operateList" @operateForm="operateForm" />
|
<OperateCom :record="record" :operate-list="operateList" @operateForm="operateForm" />
|
||||||
</template>
|
</template>
|
||||||
@@ -63,7 +66,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableOption: {
|
tableOption: {
|
||||||
select:false
|
select: false
|
||||||
},
|
},
|
||||||
formModal: false,
|
formModal: false,
|
||||||
formState: {},
|
formState: {},
|
||||||
@@ -161,11 +164,9 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
//统一处理报错提示
|
//统一处理报错提示
|
||||||
this.$refs.comTable.loading = false
|
this.$refs.comTable.loading = false
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateForm(type, record = {}) {
|
operateForm(type, record = {}) {
|
||||||
console.log(record, record.id, 'rrrrrrrrrr')
|
|
||||||
this.formStatus = type
|
this.formStatus = type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
@@ -217,7 +218,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
// console.log("Cancel");
|
|
||||||
},
|
},
|
||||||
class: 'test'
|
class: 'test'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateForm(type, record = {}) {
|
operateForm(type, record = {}) {
|
||||||
console.log(record,record.id,'rrrrrrrrrr')
|
|
||||||
this.formStatus = type
|
this.formStatus = type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
@@ -172,7 +171,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
// console.log("Cancel");
|
|
||||||
},
|
},
|
||||||
class: 'test'
|
class: 'test'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user