Files
admin-sjzx/src/views/pqs/bearingCapacity/evaluationList/index.vue

199 lines
6.8 KiB
Vue
Raw Normal View History

2024-03-04 20:33:32 +08:00
<template>
<div class="default-main">
<div v-show="addedShow">
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="评估类型">
2024-03-07 19:02:49 +08:00
<el-select
v-model="tableStore.table.params.evaluateType"
2024-03-07 19:02:49 +08:00
clearable
placeholder="请选择评估类型"
2024-03-07 19:02:49 +08:00
>
<el-option v-for="item in uesrList" :key="item.id" :label="item.name" :value="item.id" />
2024-03-05 16:21:13 +08:00
</el-select>
2024-03-04 20:33:32 +08:00
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Setting" type="primary" @click="configuration">承载能力评估策略</el-button>
2024-11-22 08:45:42 +08:00
<el-button icon="el-icon-Plus" type="primary" @click="addAssess">
2024-03-04 20:33:32 +08:00
新增承载能力评估
</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
2024-03-21 20:13:25 +08:00
2024-03-04 20:33:32 +08:00
<policy v-if="policyView" @View="policyView = false" />
</div>
2024-03-05 16:21:13 +08:00
<!-- <Added v-if="!addedShow" @quit="addedShow = true" /> -->
<div v-if="!addedShow" style="position: relative">
<el-tabs v-model="activeName" type="border-card" :style="{ height: height }">
2024-03-21 20:13:25 +08:00
<el-tab-pane label="光伏电站承载能力评估" name="1" v-if="code == null || code == 1">
<photovoltaic :rowList="rowList" />
</el-tab-pane>
<el-tab-pane
label="充电站、电加热负荷、电气化铁路承载能力评估"
name="2"
v-if="code == null || code == 2"
>
<charge :rowList="rowList" />
2024-03-05 16:21:13 +08:00
</el-tab-pane>
</el-tabs>
2024-11-22 08:45:42 +08:00
<el-button class="quit" icon="el-icon-Back" @click="quit">返回</el-button>
2024-03-05 16:21:13 +08:00
</div>
2024-03-04 20:33:32 +08:00
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import Area from '@/components/form/area/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
2024-03-06 20:37:36 +08:00
import policy from './components/policy.vue'
import photovoltaic from './components/photovoltaic.vue'
import charge from './components/charge.vue'
2024-03-21 20:13:25 +08:00
import { remove } from '@/api/advance-boot/bearingCapacity'
2024-03-04 20:33:32 +08:00
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
defineOptions({
name: 'estimate/evaluationList'
})
2024-03-05 16:21:13 +08:00
const height = mainHeight(20).height
2024-03-04 20:33:32 +08:00
const dictData = useDictData()
const levelList = dictData.getBasicData('Dev_Voltage_Stand')
2024-03-07 19:02:49 +08:00
const uesrList = dictData.getBasicData('CARRY_CAPCITY_USER_TYPE')
2024-03-05 16:21:13 +08:00
const activeName = ref('1')
2024-03-21 20:13:25 +08:00
2024-03-04 20:33:32 +08:00
const policyView = ref(false)
2024-03-05 16:21:13 +08:00
const addedShow = ref(true)
2024-03-21 20:13:25 +08:00
const code = ref(null)
const rowList = ref({})
2024-03-04 20:33:32 +08:00
const TableHeaderRef = ref()
2024-03-21 20:13:25 +08:00
const tableStore: any = new TableStore({
url: '/advance-boot/result/queryResultList',
2024-03-04 20:33:32 +08:00
method: 'POST',
column: [
{
2024-03-04 20:33:32 +08:00
title: '序号',
width: '80',
2024-03-04 20:33:32 +08:00
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'lineName',
title: '配变台区',
width: '500',
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'evaluateType',
title: '评估类型',
formatter: (row: any) => {
return uesrList.filter(item => item.id == row.cellValue)[0].name
}
},
2024-03-04 20:33:32 +08:00
{ field: 'userName', title: '预评估用户' },
{
field: 'reslutLevel',
title: '评估结果',
formatter: (row: any) => {
// 1-安全2-III级预警3-II级预警4-I 级预警,5-禁止接入
return row.cellValue == 1
? '合格'
: row.cellValue == 2
? 'III级预警'
: row.cellValue == 3
? 'II级预警'
: row.cellValue == 4
? 'I 级预警'
: row.cellValue == 5
? '禁止接入'
: row.cellValue == 6
? '允许接入'
: ''
}
},
{ field: 'evaluateDate', title: '评估日期' },
2024-03-04 20:33:32 +08:00
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
2024-03-21 20:13:25 +08:00
rowList.value = row
let data = uesrList.filter(item => item.id == row.evaluateType)[0].code
data == 'Power_Station_Users'
? ((code.value = 1), (activeName.value = '1'))
: ((code.value = 2), (activeName.value = '2'))
addedShow.value = false
2024-03-04 20:33:32 +08:00
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
2024-03-21 20:13:25 +08:00
click: row => {
remove({ ids: row.id }).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
2024-03-04 20:33:32 +08:00
}
]
}
],
loadCallback: () => {}
2024-03-04 20:33:32 +08:00
})
tableStore.table.params.evaluateType = ''
tableStore.table.params.id = dictData.state.area[0].id
2024-03-04 20:33:32 +08:00
provide('tableStore', tableStore)
2024-03-21 20:13:25 +08:00
const quit = () => {
addedShow.value = true
tableStore.index()
2024-03-21 20:13:25 +08:00
rowList.value = {}
}
2024-03-04 20:33:32 +08:00
onMounted(() => {
2024-03-21 20:13:25 +08:00
tableStore.index()
2024-03-04 20:33:32 +08:00
})
2024-11-22 08:45:42 +08:00
const addAssess=()=>{
addedShow.value = false
code.value = null
activeName.value='1'
}
2024-03-04 20:33:32 +08:00
// 配置
const configuration = () => {
policyView.value = true
}
</script>
2024-03-05 16:21:13 +08:00
<style lang="scss" scoped>
.quit {
position: absolute;
top: 5px;
right: 10px;
}
</style>