冀北项目添加表格导出功能 技术监督添加下载模版上传功能
This commit is contained in:
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<!-- 用户投诉 -->
|
||||
<!-- 2 有新增 发起 预警单 -->
|
||||
|
||||
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="是否解决">
|
||||
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
|
||||
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 新增 -->
|
||||
<complaintsForm ref="formRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 详情 -->
|
||||
<detail ref="detailRef" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import complaintsForm from './form/complaintsForm.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { sureInitiateWarningLeaflet } from '@/api/process-boot/electricitymanagement'
|
||||
import detail from './complaintsDetail.vue';
|
||||
// Steady_Statis
|
||||
const dictData = useDictData()
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const tableRef = ref()
|
||||
const planAddRef = ref()
|
||||
const formRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const detailRef = ref()
|
||||
const router = useRouter() // 路由对象
|
||||
const dealStateList = ref([
|
||||
{
|
||||
label: '未解决',
|
||||
value: '0'
|
||||
},
|
||||
|
||||
])
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/SupervisionUserComplaint/list',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
align: 'center',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'userName', title: '用户名称' },
|
||||
{ field: 'userNumber', title: '用户编号' },
|
||||
{ field: 'dutyOrgName', title: '负责单位', minWidth: '80' },
|
||||
// { field: 'userCategory', title: '用户类别' },
|
||||
|
||||
{ field: 'complaintText', title: '投诉内容' },
|
||||
{ field: 'steadyIndicator', title: '稳态指标' },
|
||||
{ field: 'transientIndicators', title: '暂态指标' },
|
||||
{
|
||||
field: 'monitorName',
|
||||
title: '监测点名称',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'detectionFlag',
|
||||
title: '是否实现监测',
|
||||
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'primary',
|
||||
|
||||
},
|
||||
replaceValue: {
|
||||
0: '否',
|
||||
1: '是',
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '填报人',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dealState',
|
||||
title: '是否解决',
|
||||
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'primary',
|
||||
null: 'info'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未解决',
|
||||
1: '已解决',
|
||||
null: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
minWidth: 120,
|
||||
align: 'center',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '发起告警单',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.dealState != 0
|
||||
},
|
||||
// popconfirm: {
|
||||
// confirmButtonText: '确认',
|
||||
// cancelButtonText: '取消',
|
||||
// confirmButtonType: 'primary',
|
||||
// title: '请确认发起告警单!'
|
||||
// },
|
||||
click: async row => {
|
||||
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '请输入整改意见'
|
||||
})
|
||||
sureInitiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
|
||||
ElMessage.success('发起告警单成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.dealState == 0
|
||||
},
|
||||
|
||||
click: row => {
|
||||
detailRef.value.open({
|
||||
row: row,
|
||||
title: '详情',
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '查看告警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.initiateWarningFlag == 0
|
||||
},
|
||||
click: row => {
|
||||
router.push({
|
||||
name: 'supervision/supervision/manage',
|
||||
query: {
|
||||
type: 1,
|
||||
t: Date.now()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data = [
|
||||
// {
|
||||
// userName: '东润开阳堡光伏电站用户',
|
||||
// userId: '8115771123274',
|
||||
// complaintContent: '终端频繁重启',
|
||||
// complaintTime: '2024-05-16'
|
||||
// }
|
||||
// ]
|
||||
}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.dealState = ''
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
// 新增
|
||||
const add = () => {
|
||||
formRef.value.open({ text: '新增投诉' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="dialogVisible" draggable :title="title" width="1000">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="用户名称">
|
||||
{{ list.userName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用户编号">
|
||||
{{ list.userNumber }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="负责单位">
|
||||
{{ list.dutyOrgName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="稳态指标">
|
||||
{{ list.steadyIndicator }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="暂态指标">
|
||||
{{ list.transientIndicators }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监测点名称">
|
||||
{{ list.monitorName || '/' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否实现监测">
|
||||
<el-tag :type='list.detectionFlag == 0 ? "warning" : "primary"'>{{ list.detectionFlag == 0 ? "否" :
|
||||
"是" }}</el-tag>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="填报人">
|
||||
{{ dictData.state.userList.filter(item => item.id == list.createBy)[0]?.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="投诉内容">
|
||||
{{ list.complaintText }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="整改意见">
|
||||
{{ list.reformAdvice }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="采取的措施">
|
||||
{{ list.takeStep }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="1" label="处理成效报告">
|
||||
<el-icon class="elView " v-if="list?.reportName" >
|
||||
<View @click="openFile(list?.reportName)" />
|
||||
</el-icon>
|
||||
<a :href="list.reportPath" target="_blank">{{ list.reportName }}</a>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { View } from '@element-plus/icons-vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const dictData = useDictData()
|
||||
const list: any = ref({})
|
||||
const open = (row: any) => {
|
||||
list.value={}
|
||||
title.value = row.title
|
||||
dialogVisible.value = true
|
||||
list.value = JSON.parse(JSON.stringify(row.row))
|
||||
getFileNameAndFilePath({ filePath: row.row.reportPath }).then(res => {
|
||||
list.value.reportPath = res.data.url
|
||||
list.value.reportName = res.data.fileName
|
||||
})
|
||||
}
|
||||
const openFile = (name: any) => {
|
||||
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.elView {
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
}</style>
|
||||
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<el-dialog draggable v-model="dialogVisible" :title="title" width="80%" :before-close="handleClose">
|
||||
<div v-loading="loading">
|
||||
<div style="height: 45vh">
|
||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="List">
|
||||
<vxe-column field="dept" title="负责单位"></vxe-column>
|
||||
<vxe-column field="substation" title="变电站名称"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称"></vxe-column>
|
||||
<vxe-column
|
||||
field="businessType"
|
||||
title="监测对象类型"
|
||||
:formatter="row => industry.find((item: any) => item.id == row.cellValue)?.name || '/'"
|
||||
></vxe-column>
|
||||
<vxe-column field="objectName" title="监测对象名称"></vxe-column>
|
||||
<vxe-column
|
||||
field="targetType"
|
||||
title="指标类型"
|
||||
:formatter="row => exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'"
|
||||
></vxe-column>
|
||||
<vxe-column
|
||||
field="overLimitDay"
|
||||
title="累计超标天数"
|
||||
:formatter="row => (row.cellValue != null ? row.cellValue : '/')"
|
||||
></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<el-form :model="form" ref="formRef" class="form-two mt10 alarmForm" :rules="rules" label-width="auto">
|
||||
<el-form-item label="问题描述:" prop="issueDetail">
|
||||
<el-input
|
||||
v-model="form.issueDetail"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入问题描述"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="整改意见:" prop="reformAdvice">
|
||||
<el-input
|
||||
v-model="form.reformAdvice"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入整改意见"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="编号:" prop="year">
|
||||
<div style="width: 100%; display: flex; justify-content: space-between">
|
||||
<el-input style="width: 49%" v-model="form.year" placeholder="请输入年份">
|
||||
<template #append>年份</template>
|
||||
</el-input>
|
||||
<el-input style="width: 49%" v-model="form.number" placeholder="请输入编号">
|
||||
<template #append>编号</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submit" :loading="loading">发起</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { report } from '@/api/process-boot/electricitymanagement'
|
||||
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
const emits = defineEmits(['onSubmit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const title: any = ref('')
|
||||
const industry = dictData.getBasicData('Business_Type')
|
||||
const form: any = ref({})
|
||||
const exceeded = dictData.getBasicData('Indicator_Type')
|
||||
const loading = ref(false)
|
||||
const resetForm = () => {
|
||||
form.value = {
|
||||
issueDetail: '',
|
||||
reformAdvice: '',
|
||||
year: new Date().getFullYear() + '',
|
||||
number: '0'
|
||||
}
|
||||
}
|
||||
const List = ref([])
|
||||
resetForm()
|
||||
const rules = {
|
||||
issueDetail: [{ required: true, message: '请输入问题描述', trigger: 'blur' }],
|
||||
reformAdvice: [{ required: true, message: '请输入整改意见', trigger: 'blur' }],
|
||||
year: [{ required: true, message: '请输入编号', trigger: 'blur' }],
|
||||
number: [{ required: true, message: '请输入编号', trigger: 'blur' }]
|
||||
}
|
||||
const formRef = ref()
|
||||
const submit = () => {
|
||||
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
report({
|
||||
...form.value,
|
||||
type: title.value == '发起预警单' ? 1 : 2,
|
||||
idList: List.value.map(item => item.id)
|
||||
})
|
||||
.then(res => {
|
||||
loading.value = false
|
||||
ElMessage.success('发起成功')
|
||||
|
||||
dialogVisible.value = false
|
||||
emits('onSubmit')
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const open = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
List.value = row.row
|
||||
title.value = row.text
|
||||
|
||||
form.value = { ...form.value, ...row.form }
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
formRef.value && formRef.value.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<el-dialog draggable v-model="dialogVisible" :title="title" style="width: 800px" :before-close="handleClose">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto" :scroll-to-error="true">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item for="-" label="用户名称:" prop="userName">
|
||||
<el-input v-model="form.userName" clearable style="width: 100%"
|
||||
placeholder="请输入用户名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item for="-" label="用户编号:" prop="userNumber">
|
||||
<el-input v-model="form.userNumber" clearable style="width: 100%"
|
||||
placeholder="请输入用户编号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item for="-" label="是否实现监测:" prop="detectionFlag">
|
||||
<el-radio-group v-model="form.detectionFlag">
|
||||
<el-radio value="0">否</el-radio>
|
||||
<el-radio value="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item for="-" label="负责单位:" prop="dutyOrgId">
|
||||
<Area ref="areaRef" v-model="form.dutyOrgId" style="width: 100%" />
|
||||
<!-- <el-select v-model="form.dutyOrgId" clearable placeholder="请选择负责单位">
|
||||
<el-option
|
||||
v-for="item in areaOptionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.detectionFlag == '1'" :span="12">
|
||||
<!-- <el-form-item for="-" label="监测点名称:" prop="monitorName">
|
||||
<el-input
|
||||
v-model="form.monitorName"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入监测点名称"
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item for="-" label="监测点:" prop="monitorNumber">
|
||||
<el-select v-model="form.monitorNumber" clearable style="width: 100%" placeholder="请选择监测点">
|
||||
<el-option v-for="item in minitorList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row v-if="form.detectionFlag == '1'">
|
||||
<el-col :span="12">
|
||||
<el-form-item for="-" label="监测点编号:" prop="monitorNumber">
|
||||
<el-input
|
||||
v-model="form.monitorNumber"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请输入监测点编号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
|
||||
<el-form-item for="-" label="投诉内容:" prop="complaintText">
|
||||
<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入内容"
|
||||
v-model="form.complaintText"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="稳态指标:">
|
||||
<el-checkbox-group v-model="form.steadyIndicator">
|
||||
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
|
||||
<el-checkbox style="flex: none; width: 120px" v-for="(item, ind) in steadyStateList" :key="ind"
|
||||
:label="item.name">
|
||||
<!-- @change="changeSteadyState" -->
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="暂态指标:">
|
||||
<el-checkbox-group v-model="form.transientIndicators">
|
||||
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
|
||||
<el-checkbox style="flex: none; width: 120px" v-for="(item, ind) in transientIndicatorsList"
|
||||
:key="ind" :label="item.name">
|
||||
<!-- @change="changeTransientIndicators" -->
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submit" :loading="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { genFileId, ElMessage } from 'element-plus'
|
||||
import { addComplaintsData, getLineDetailByDeptId } from '@/api/process-boot/electricitymanagement'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
const emits = defineEmits(['onSubmit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const loading = ref(false)
|
||||
const title: any = ref('')
|
||||
const steadyStateList = dictData.getBasicData('Steady_Indicator')
|
||||
const transientIndicatorsList = dictData.getBasicData('Transient_Indicators')
|
||||
const form: any = ref({})
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
//获取监测点信息
|
||||
const minitorList = ref([])
|
||||
const getMinitorList = () => {
|
||||
getLineDetailByDeptId({ id: adminInfo.$state.deptId }).then(res => {
|
||||
minitorList.value = res.data
|
||||
})
|
||||
}
|
||||
getMinitorList()
|
||||
const resetForm = () => {
|
||||
form.value = {
|
||||
complaintText: '', //投诉内容
|
||||
detectionFlag: '0', //是否实现监测
|
||||
steadyIndicator: [], //稳态指标
|
||||
transientIndicators: [], //暂态指标
|
||||
userName: '', //用户名称
|
||||
userNumber: '', //用户编号
|
||||
userCategory: '', //用户类别
|
||||
monitorName: '', //监测点名称
|
||||
monitorNumber: '', //监测点编号
|
||||
dutyOrgId: ''
|
||||
}
|
||||
}
|
||||
//字典获取所在地市
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
|
||||
const rules = {
|
||||
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
|
||||
userNumber: [{ required: true, message: '请输入用户编号', trigger: 'blur' }],
|
||||
userCategory: [{ required: true, message: '请选择用户类别', trigger: 'change' }],
|
||||
complaintText: [{ required: true, message: '请输入投诉内容', trigger: 'blur' }],
|
||||
detectionFlag: [{ required: true, message: '请选择是否实现监测', trigger: 'change' }],
|
||||
transientIndicators: [{ required: true, message: '请选择暂态指标', trigger: 'change' }],
|
||||
steadyIndicator: [{ required: true, message: '请选择稳态指标', trigger: 'change' }],
|
||||
monitorName: [{ required: true, message: '请输入监测点名称', trigger: 'blur' }],
|
||||
monitorNumber: [{ required: true, message: '请选择监测点', trigger: 'change' }],
|
||||
dutyOrgId: [{ required: true, message: '请选择负责单位', trigger: 'change' }]
|
||||
}
|
||||
const formRef = ref()
|
||||
const submit = async () => {
|
||||
loading.value = true
|
||||
formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
form.value = {
|
||||
...form.value,
|
||||
steadyIndicator: form.value.steadyIndicator.join(','),
|
||||
transientIndicators: form.value.transientIndicators.join(','),
|
||||
monitorName: minitorList.value.find(item => {
|
||||
return item.id == form.value.monitorNumber
|
||||
})?.name
|
||||
}
|
||||
await addComplaintsData(form.value).then(res => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
})
|
||||
emits('onSubmit')
|
||||
formRef.value && formRef.value.resetFields()
|
||||
resetForm()
|
||||
handleClose()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('表单验证失败')
|
||||
return false
|
||||
}
|
||||
})
|
||||
await setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const open = (row: any) => {
|
||||
resetForm()
|
||||
dialogVisible.value = true
|
||||
title.value = row.text
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
formRef.value && formRef.value.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const changeSteadyState = () => {
|
||||
form.value.transientIndicators = []
|
||||
}
|
||||
const changeTransientIndicators = () => {
|
||||
form.value.steadyIndicator = []
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-form {
|
||||
width: 96%;
|
||||
margin: 0 auto;
|
||||
height: 400px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<el-dialog draggable v-model="dialogVisible" v-loading="loading" :title="title" width="80%" :before-close="handleClose">
|
||||
<div style="height: 45vh">
|
||||
<vxe-table show-overflow v-bind="defaultAttribute" :data="List">
|
||||
<vxe-column field="time" title="日期" width="230px"></vxe-column>
|
||||
<vxe-column field="overLimitInfo" title="越限详情"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { overLimitDetail } from '@/api/process-boot/electricitymanagement'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
const emits = defineEmits(['onSubmit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const title: any = ref('')
|
||||
const List: any = ref([])
|
||||
const loading = ref(false)
|
||||
const open = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
title.value = row.text
|
||||
loading.value = true
|
||||
List.value = []
|
||||
overLimitDetail({
|
||||
lineId: row.row.lineId,
|
||||
targetId: row.row.targetType,
|
||||
searchBeginTime: row.list.searchBeginTime,
|
||||
searchEndTime: row.list.searchEndTime
|
||||
}).then(res => {
|
||||
List.value = res.data
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 提升 VxeTable tooltip 的层级 */
|
||||
</style>
|
||||
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<el-dialog draggable v-model="dialogVisible" :title="title" style="width: 1100px" :before-close="handleClose">
|
||||
<el-form :model="ordinaryA" :inline="true" class="form">
|
||||
<el-form-item>
|
||||
<Area v-model="ordinaryA.orgNo"></Area>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="普测结果上传时间">
|
||||
<el-date-picker
|
||||
v-model="ordinaryA.planStartTime"
|
||||
type="month"
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择月"
|
||||
@change="queryPlanName"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="普测计划名称">
|
||||
<el-select v-model="ordinaryA.planName" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in planNameList"
|
||||
:key="item.planName"
|
||||
:label="item.planName"
|
||||
:value="item.planName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="searchFnExcessive">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<vxe-table v-bind="defaultAttribute" height="350" ref="xTable2Ref" :data="ordinaryAddData">
|
||||
<vxe-column type="radio" width="60"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站名称"></vxe-column>
|
||||
<vxe-column field="voltageLevelName" title="变电站电压等级"></vxe-column>
|
||||
</vxe-table>
|
||||
|
||||
<el-form :model="ordinaryA" :rules="rules" ref="ordinaryARef" label-width="auto" :inline="true" class="form">
|
||||
<el-form-item label="稳态指标" prop="steadyState">
|
||||
<el-checkbox-group v-model="ordinaryA.steadyState">
|
||||
<el-checkbox v-for="(item, ind) in steadyStateList" :key="ind" :label="item.code">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item label="暂态指标" prop="transientIndicators">
|
||||
<el-checkbox-group v-model="ordinaryA.transientIndicators">
|
||||
<el-checkbox v-for="(item, ind) in transientIndicatorsList" :key="ind" :label="item.code">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item label="上传附件">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:limit="1"
|
||||
:on-change="beforeUpload"
|
||||
>
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const emit = defineEmits(['onsubmit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const title: any = ref('')
|
||||
const steadyStateList = dictData.getBasicData('Steady_Indicator')
|
||||
const transientIndicatorsList = dictData.getBasicData('Transient_Indicators')
|
||||
|
||||
const ordinaryA = ref({
|
||||
orgNo: '',
|
||||
orgName: '',
|
||||
planName: '',
|
||||
planStartTime: '',
|
||||
uploadTime: '',
|
||||
name: '',
|
||||
steadyState: [],
|
||||
transientIndicators: []
|
||||
})
|
||||
const defaultAttribute = ref([])
|
||||
const rules = {
|
||||
problemName: [{ required: true, message: '请输入问题名称', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
|
||||
userNo: [{ required: true, message: '请输入用户编号', trigger: 'blur' }],
|
||||
complaintContent: [{ required: true, message: '请输入投诉内容', trigger: 'blur' }],
|
||||
complaintTime: [{ required: true, message: '请选择时间', trigger: 'change' }],
|
||||
problemSources: [{ required: true, message: '情选择问题来源', trigger: 'change' }],
|
||||
abnormalDevTime: [{ required: true, message: '请选择时间', trigger: 'change' }],
|
||||
transientIndicators: [{ required: true, message: '请选择暂态指标', trigger: 'change' }],
|
||||
steadyState: [{ required: true, message: '请选择稳态指标', trigger: 'change' }],
|
||||
eventDescription: [{ required: true, message: '请输入终端异常描述', trigger: 'blur' }],
|
||||
abnormalDevName: [{ required: true, message: '请输入问题名称', trigger: 'blur' }]
|
||||
}
|
||||
const submit = () => {
|
||||
handleClose()
|
||||
}
|
||||
|
||||
const open = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
title.value = row.text
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const beforeUpload = () => {}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-upload-list__item) {
|
||||
width: 400px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<!-- <div>1 监测点信息 发起预告警单 </div> -->
|
||||
|
||||
<TableHeader datePicker nextFlag theCurrentTime ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="区域">
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptId" @changeValue="changeArea"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="监测点性质">
|
||||
<el-select v-model="tableStore.table.params.lineType" clearable placeholder="请选择监测点性质">
|
||||
<el-option label="电网侧" value="0"/>
|
||||
<el-option label="非电网侧" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="超标指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.targetList"
|
||||
clearable
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择超标指标"
|
||||
>
|
||||
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据类型">
|
||||
<el-switch
|
||||
v-model="tableStore.table.params.dataType"
|
||||
inline-prompt
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-text="超标数据"
|
||||
inactive-text="无数据"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警阈值">
|
||||
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
|
||||
<el-input-number
|
||||
v-model="tableStore.table.params.alertThreshold"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
@change="changeAlert"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警阈值">
|
||||
<el-input-number
|
||||
v-model="tableStore.table.params.alarmThreshold"
|
||||
:min="0"
|
||||
:step="1"
|
||||
step-strictly
|
||||
@change="changeAlarm"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="搜索">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="输入变电站、终端、监测点名称"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起预警单')">
|
||||
发起预警单
|
||||
</el-button>
|
||||
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起告警单')">
|
||||
发起告警单
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"/>
|
||||
<!-- /告警单 -->
|
||||
<alarmList ref="alarmListRef" @onSubmit="tableStore.index()"/>
|
||||
<!-- 详情 -->
|
||||
<detail ref="detailRef"/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted, provide, nextTick} from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {useDictData} from '@/stores/dictData'
|
||||
import alarmList from './form/alarmList.vue'
|
||||
import detail from './form/detail.vue'
|
||||
|
||||
const dictData = useDictData()
|
||||
import {useRouter} from 'vue-router'
|
||||
|
||||
const router = useRouter() // 路由对象
|
||||
//字典获取超标指标
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const tableRef = ref()
|
||||
const industry = dictData.getBasicData('Business_Type')
|
||||
const TableHeaderRef = ref()
|
||||
const alarmListRef = ref()
|
||||
const flagTime = ref(false)
|
||||
const detailRef = ref()
|
||||
const list: any = ref({
|
||||
deptId: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
alertThreshold: '',
|
||||
alarmThreshold: ''
|
||||
})
|
||||
const level: any = ref(dictData.state.area[0]?.level)
|
||||
const flag: any = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/list',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
// isWebPaging:true,
|
||||
column: [
|
||||
{title: '', type: 'checkbox', width: 40},
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
align: 'center',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{field: 'dept', title: '负责单位'},
|
||||
{field: 'substation', title: '变电站名称'},
|
||||
{field: 'deviceName', title: '终端名称'},
|
||||
{field: 'lineName', title: '监测点名称'},
|
||||
|
||||
{
|
||||
field: 'businessType',
|
||||
title: '监测对象类型',
|
||||
|
||||
formatter: (row: any) => {
|
||||
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{field: 'objectName', title: '监测对象名称'},
|
||||
{
|
||||
field: 'targetType',
|
||||
title: '指标类型',
|
||||
formatter: (row: any) => {
|
||||
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'overLimitDay',
|
||||
title: '累计超标天数',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue != null ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
visible: flagTime,
|
||||
title: '最新数据时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
align: 'center',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.targetType == 0
|
||||
},
|
||||
click: row => {
|
||||
detailRef.value.open({
|
||||
text: '详情',
|
||||
row: row,
|
||||
list: list.value
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '查看预警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.step != 1
|
||||
},
|
||||
click: row => {
|
||||
router.push({
|
||||
name: 'supervision/supervision/manage',
|
||||
query: {
|
||||
type: 0,
|
||||
t: Date.now()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '查看告警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.step != 2
|
||||
},
|
||||
click: row => {
|
||||
router.push({
|
||||
name: 'supervision/supervision/manage',
|
||||
query: {
|
||||
type: 1,
|
||||
t: Date.now()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// {
|
||||
// name: 'productSetting',
|
||||
// title: '发起告警单',
|
||||
// type: 'warning',
|
||||
// disabled: row => {
|
||||
// return row.overLimitDay < tableStore.table.params.alarmThreshold
|
||||
// },
|
||||
// icon: 'el-icon-EditPen',
|
||||
// render: 'basicButton',
|
||||
|
||||
// click: async row => {
|
||||
// // handleWarningAlarmFlag(row).then(res => {
|
||||
// // console.log(res)
|
||||
// // ElMessage.success('发起告警单成功!')
|
||||
// // tableStore.index()
|
||||
// // })
|
||||
// const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
|
||||
// inputType: 'textarea',
|
||||
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
// inputErrorMessage: '请输入整改意见'
|
||||
// })
|
||||
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
|
||||
// ElMessage.success('发起告警单成功!')
|
||||
// tableStore.index()
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: 'edit',
|
||||
// title: '发起预警单',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-Open',
|
||||
// disabled: row => {
|
||||
// return row.overLimitDay >= tableStore.table.params.alarmThreshold
|
||||
// },
|
||||
// render: 'basicButton',
|
||||
|
||||
// click: async row => {
|
||||
// // handleWarningAlarmFlag(row).then(res => {
|
||||
// // console.log(res)
|
||||
// // ElMessage.success('发起预警单成功!')
|
||||
// // tableStore.index()
|
||||
// // })
|
||||
// const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
|
||||
// inputType: 'textarea',
|
||||
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
// inputErrorMessage: '请输入整改意见'
|
||||
// })
|
||||
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
|
||||
// ElMessage.success('发起预警单成功!')
|
||||
// tableStore.index()
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
list.value.deptId = tableStore.table.params.deptId
|
||||
|
||||
list.value.searchBeginTime = tableStore.table.params.searchBeginTime
|
||||
list.value.searchEndTime = tableStore.table.params.searchEndTime
|
||||
if (tableStore.table.params.alertThreshold != '') {
|
||||
list.value.alertThreshold = tableStore.table.params.alertThreshold
|
||||
}
|
||||
list.value.lineType = tableStore.table.params.lineType
|
||||
list.value.alarmThreshold = tableStore.table.params.alarmThreshold
|
||||
flag.value = level.value
|
||||
flagTime.value = tableStore.table.params.dataType == 0 ? true : false
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data = [
|
||||
// {
|
||||
// orgName: '张家口',
|
||||
// subName: '110kV马头山风电场',
|
||||
// lineName: '111口头线',
|
||||
// voltageScale: '110kV',
|
||||
// overDay: '20',
|
||||
// overDays: '10'
|
||||
// },
|
||||
// {
|
||||
// orgName: '张家口',
|
||||
// subName: '110kV韩家庄风电场',
|
||||
// lineName: '111缘韩一线',
|
||||
// voltageScale: '110kV',
|
||||
// overDay: '20',
|
||||
// overDays: '16'
|
||||
// }
|
||||
// ]
|
||||
}
|
||||
})
|
||||
tableStore.table.params.alertThreshold = 5
|
||||
tableStore.table.params.alarmThreshold = 5
|
||||
tableStore.table.params.targetList = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
|
||||
? [exceeded.filter(item => item.code == 'Total_Indicator')[0].id]
|
||||
: []
|
||||
tableStore.table.params.lineType = ''
|
||||
tableStore.table.params.dataType = '1'
|
||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setDatePicker([{label: '月', value: 3}])
|
||||
|
||||
tableStore.index()
|
||||
setTimeout(() => {
|
||||
TableHeaderRef.value.showSelectChange()
|
||||
}, 10)
|
||||
})
|
||||
|
||||
const changeAlert = e => {
|
||||
if (e == null) {
|
||||
tableStore.table.params.alertThreshold = 5
|
||||
} else {
|
||||
if (e > tableStore.table.params.alarmThreshold) {
|
||||
ElMessage.warning('预警阈值不能大于报警阈值')
|
||||
tableStore.table.params.alertThreshold = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
const changeAlarm = e => {
|
||||
if (e == null) {
|
||||
tableStore.table.params.alarmThreshold = 5
|
||||
} else {
|
||||
if (e < tableStore.table.params.alertThreshold) {
|
||||
ElMessage.warning('报警阈值不能小于预警阈值')
|
||||
tableStore.table.params.alarmThreshold = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
// 发起预警单
|
||||
const launch = (title: string) => {
|
||||
if (tableStore.table.selection.length == 0) {
|
||||
ElMessage.warning('请选择一条数据')
|
||||
return
|
||||
}
|
||||
|
||||
alarmListRef.value.open({
|
||||
text: title,
|
||||
form: list.value,
|
||||
row: tableStore.table.selection
|
||||
})
|
||||
console.log('🚀 ~ launch ~ list.value:', list.value)
|
||||
}
|
||||
const changeArea = e => {
|
||||
level.value = e.data.level
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<!-- <div> 普测结果 发起预告警单</div> -->
|
||||
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="计划名称">
|
||||
<el-input style="width: 200px" v-model="tableStore.table.params.searchValue" clearable
|
||||
placeholder="请输入计划名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否解决">
|
||||
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
|
||||
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<testQuestionsForm ref="testQuestionsFormRef" />
|
||||
<!-- 详情 -->
|
||||
<el-dialog draggable v-model="dialogVisible" v-if="dialogVisible" title="详情" width="1000">
|
||||
<detail :id="detailId" :flag="flag" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import testQuestionsForm from './form/testQuestionsForm.vue'
|
||||
import { initiateWarningLeaflet } from '@/api/supervision-boot/survey/test'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import detail from '@/views/pqs/supervise/harmonicSurvey/test/detail.vue'
|
||||
|
||||
const dictData = useDictData()
|
||||
const { push } = useRouter()
|
||||
const router = useRouter() // 路由对象
|
||||
const tableRef = ref()
|
||||
const flag = ref(false)
|
||||
const TableHeaderRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const detailId = ref('')
|
||||
const testQuestionsFormRef = ref()
|
||||
const dealStateList = ref([
|
||||
{
|
||||
label: '未解决',
|
||||
value: '0'
|
||||
},
|
||||
|
||||
])
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/surveyTest/pageProblemSurvey',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
align: 'center',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'planName', title: '计划名称', minWidth: 120 },
|
||||
{ field: 'deptName', title: '负责单位', minWidth: 120 },
|
||||
{ field: 'substationName', title: '变电站', minWidth: 120 },
|
||||
{ field: 'planStartTime', title: '计划开始时间', minWidth: 100 },
|
||||
{ field: 'planEndTime', title: '计划结束时间', minWidth: 100 },
|
||||
{ field: 'completeTime', title: '实际完成时间', minWidth: 100 },
|
||||
{ field: 'completeBy', title: '测试负责人', minWidth: 120 },
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '填报人',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dealState',
|
||||
title: '是否解决',
|
||||
minWidth: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'primary',
|
||||
null: 'info'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未解决',
|
||||
1: '已解决',
|
||||
null: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
minWidth: '180',
|
||||
align: 'center',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
|
||||
click: async row => {
|
||||
flag.value = row.dealState == 1 ? true : false
|
||||
dialogVisible.value = true
|
||||
detailId.value = row.id
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '发起告警单',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.dealState != 0
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '请输入整改意见'
|
||||
})
|
||||
initiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
|
||||
ElMessage.success('发起告警成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '查看告警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.initiateWarningFlag == 0
|
||||
},
|
||||
click: row => {
|
||||
router.push({
|
||||
name: 'supervision/supervision/manage',
|
||||
query: {
|
||||
type: 1,
|
||||
t: Date.now()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
}
|
||||
})
|
||||
tableStore.table.params.dealState = ''
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
/**
|
||||
* 发起告警单
|
||||
*/
|
||||
const initiateAlarm = async (id: string) => {
|
||||
await initiateWarningLeaflet(id)
|
||||
ElMessage.success('发起告警成功!')
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,302 @@
|
||||
<!---试运行列表-->
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="流程状态">
|
||||
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
|
||||
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否解决">
|
||||
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
|
||||
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
|
||||
<!-- 详情 -->
|
||||
<detail ref="detailRef" />
|
||||
</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 { useRouter } from 'vue-router'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { addRunTest, initiateWarningLeaflet } from '@/api/supervision-boot/lineRunTest'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { VxeTablePropTypes } from 'vxe-table'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import detail from './testRunDetail.vue'
|
||||
|
||||
const dictData = useDictData()
|
||||
const statusSelect = dictData.statusSelect()
|
||||
const { push } = useRouter()
|
||||
const adminInfo = useAdminInfo()
|
||||
const TableHeaderRef = ref()
|
||||
const tableRef = ref()
|
||||
const detailRef = ref()
|
||||
const dealStateList = ref([
|
||||
{
|
||||
label: '未解决',
|
||||
value: '0'
|
||||
},
|
||||
|
||||
])
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/lineRunTestProblem/pageProblem',
|
||||
method: 'POST',
|
||||
publicHeight: 65,
|
||||
column: [
|
||||
{
|
||||
title: '序号', width: 80, formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: 160 },
|
||||
{ field: 'connectedBus', title: '接入母线', minWidth: 160 },
|
||||
// { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 },
|
||||
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 140, },
|
||||
{
|
||||
field: 'powerSubstationName', title: '变电站', minWidth: 160, formatter: row => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'reason', title: '调试原因', minWidth: 160 },
|
||||
|
||||
{
|
||||
field: 'testRunState',
|
||||
title: '试运行状态',
|
||||
minWidth: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'primary',
|
||||
2: 'success',
|
||||
3: 'danger',
|
||||
1: 'warning'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '待试运行',
|
||||
1: '试运行中',
|
||||
2: '试运行成功',
|
||||
3: '试运行失败',
|
||||
null: '待试运行'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'testRunTime',
|
||||
title: '试运行时间范围',
|
||||
minWidth: 200,
|
||||
formatter: row => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'problemReason', title: '试运行评估问题', minWidth: 200 },
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '填报人',
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dealState',
|
||||
title: '是否解决',
|
||||
minWidth: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'primary',
|
||||
null: 'info'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未解决',
|
||||
1: '已解决',
|
||||
null: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
minWidth: 230,
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
// {
|
||||
// name: 'productSetting',
|
||||
// title: '流程详情',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-EditPen',
|
||||
// render: 'basicButton',
|
||||
// click: row => {
|
||||
// handleAudit(row.processInstanceId, row.historyInstanceId)
|
||||
// },
|
||||
// disabled: row => {
|
||||
// return row.testRunState != 2 || !row.processInstanceId
|
||||
// }
|
||||
// },
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '下载报告',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
downloadTheReport(row.testRunReport)
|
||||
},
|
||||
disabled: row => {
|
||||
return row.testRunReport == null || row.testRunReport.length == 0
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'edit',
|
||||
title: '发起告警单',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.dealState != 0
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '请输入整改意见'
|
||||
})
|
||||
initiateWarningLeaflet({
|
||||
id: row.id,
|
||||
problemId: row.problemId,
|
||||
reformAdvice: value,
|
||||
type: 2,
|
||||
issueDetail: row.problemReason
|
||||
}).then(res => {
|
||||
ElMessage.success('发起告警单成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.dealState == 0
|
||||
},
|
||||
|
||||
click: row => {
|
||||
detailRef.value.open({
|
||||
row: row,
|
||||
title: '详情',
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '查看告警单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.problemType == null
|
||||
},
|
||||
click: row => {
|
||||
push({
|
||||
name: 'supervision/supervision/manage',
|
||||
query: {
|
||||
type: 1,
|
||||
t: Date.now()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.statveList = [2]
|
||||
// tableStore.table.params.relationUserName = tableStore.table.params.userName
|
||||
}
|
||||
})
|
||||
tableStore.table.params.status = ''
|
||||
tableStore.table.params.dealState = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig>({
|
||||
labelField: '',
|
||||
checkMethod: ({ row }) => {
|
||||
return !(row.testRunState == 1 || row.testRunState == 2)
|
||||
}
|
||||
})
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any, historyInstanceId: any) => {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
state: {
|
||||
id: instanceId,
|
||||
historyInstanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 下载报告
|
||||
const downloadTheReport = (url: string) => {
|
||||
getFileNameAndFilePath({ filePath: url }).then((res: any) => {
|
||||
const link = document.createElement('a')
|
||||
link.href = res.data.url
|
||||
link.download = res.data.name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
|
||||
const runTestSubmit = (type: number) => {
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() + 1)
|
||||
start.setHours(0, 0, 0)
|
||||
|
||||
const end = new Date()
|
||||
end.setDate(end.getDate() + 3)
|
||||
end.setHours(23, 59, 59)
|
||||
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
|
||||
const endString = formatDate(end, 'YYYY-MM-DD')
|
||||
const data = {
|
||||
startTime: startString,
|
||||
endTime: endString,
|
||||
lineIds: monitorIds,
|
||||
operateType: type
|
||||
}
|
||||
addRunTest(data).then((res: any) => {
|
||||
if (res.code === 'A0000') {
|
||||
ElMessage({
|
||||
message: '发起试运行成功',
|
||||
type: 'success'
|
||||
})
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="dialogVisible" draggable :title="title" width="1000">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="监测点名称">
|
||||
{{ list.lineName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="接入母线">
|
||||
{{ list.connectedBus }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="终端名称">
|
||||
{{ list.monitoringTerminalName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="变电站">
|
||||
{{ list.powerSubstationName ||'/'}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="调试原因">
|
||||
{{ list.reason }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="试运行状态">
|
||||
<el-tag
|
||||
:type='list.testRunState == 0 ? "primary" : list.testRunState == 1 ? "warning" : list.testRunState == 2 ? "success" : list.testRunState == 3 ? "danger" : "primary"'>{{
|
||||
list.testRunState == 0 ? "待试运行" : list.testRunState == 1 ? "试运行中" : list.testRunState == 2
|
||||
? "试运行成功" : list.testRunState == 3 ? "试运行失败" : "待试运行" }}</el-tag>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="试运行时间范围">
|
||||
{{ list.testRunTime ||'/' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="试运行评估问题">
|
||||
{{ list.problemReason ||'/' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="填报人">
|
||||
{{ dictData.state.userList.filter(item => item.id == list.createBy)[0]?.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="整改意见">
|
||||
{{ list.reformAdvice }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="采取的措施">
|
||||
{{ list.takeStep }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="处理成效报告">
|
||||
<el-icon class="elView " v-if="list?.reportName">
|
||||
<View @click="openFile(list?.reportName)" />
|
||||
</el-icon>
|
||||
<a :href="list.reportPath" target="_blank">{{ list.reportName }}</a>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { View } from '@element-plus/icons-vue'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const list: any = ref({})
|
||||
const dictData = useDictData()
|
||||
const open = (row: any) => {
|
||||
list.value = {}
|
||||
title.value = row.title
|
||||
dialogVisible.value = true
|
||||
list.value = JSON.parse(JSON.stringify(row.row))
|
||||
getFileNameAndFilePath({ filePath: row.row.reportPath }).then(res => {
|
||||
list.value.reportPath = res.data.url
|
||||
list.value.reportName = res.data.fileName
|
||||
})
|
||||
}
|
||||
const openFile = (name: any) => {
|
||||
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.elView {
|
||||
cursor: pointer;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user