联调前置数据补招接口

This commit is contained in:
GGJ
2025-05-06 14:31:17 +08:00
parent 81726cde2d
commit f8a26b3320
9 changed files with 204 additions and 76 deletions

View File

@@ -26,7 +26,6 @@
v-model="formData.deptIndex"
:props="defaultProps"
:options="treeData"
clearable
filterable
collapse-tags
placeholder="请选择区域"
@@ -104,7 +103,7 @@
</el-form-item>
</template>
<template #operation>
<el-button type="primary" icon="el-icon-Download" @click="makeUp">补招</el-button>
<el-button type="primary" icon="el-icon-Tickets" @click="makeUp">补招</el-button>
</template>
</TableHeader>
</div>
@@ -114,7 +113,7 @@
<Table
ref="tableRef"
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
:checkbox-config="{ labelField: 'name', }"
:checkbox-config="{ labelField: 'name' }"
:scroll-y="{ enabled: true }"
v-if="activeName == 0"
/>
@@ -124,23 +123,44 @@
</el-tab-pane>
</el-tabs>
</div>
<el-dialog v-model="dialogVisible" draggable title="补招" width="500">
补招时间
<el-date-picker
v-model="timeData"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabledDate="disabledDate"
/>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="makeUpSubmit">确认</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, watch } from 'vue'
import { useDictData } from '@/stores/dictData'
import DatePicker from '@/components/form/datePicker/index.vue'
import { getAreaDept } from '@/api/harmonic-boot/area'
import { getAreaDept, recall } from '@/api/harmonic-boot/area'
import TableHeader from '@/components/table/header/index.vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import charts from './components/charts.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
defineOptions({
name: 'harmonic-boot/harmonic/getIntegrityData'
})
const tableRef = ref()
const chartsRef = ref()
const dictData = useDictData()
const dialogVisible = ref(false)
//字典获取电压等级
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
//字典获取终端厂家
@@ -152,6 +172,7 @@ const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Ty
//调用区域接口获取区域
const treeData = ref([])
const idArr = ref([])
const timeData = ref([])
const activeName = ref(0)
const getTreeData = async () => {
await getAreaDept().then(res => {
@@ -162,6 +183,7 @@ const getTreeData = async () => {
treeData.value = JSON.parse(JSON.stringify(res.data))
})
}
getTreeData()
const formData = ref({
@@ -202,8 +224,8 @@ const tableStore = new TableStore({
treeNode: true,
width: 350,
formatter: function (row) {
console.log("🚀 ~ row:", row)
return 123//row.cellValue ? row.cellValue : '/'
console.log('🚀 ~ row:', row)
return 123 //row.cellValue ? row.cellValue : '/'
}
},
{
@@ -310,6 +332,7 @@ const tableStore = new TableStore({
})
tableStore.table.params.deptIndex = ''
tableStore.table.params.filterName = ''
tableStore.table.params.statisticalType = []
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
@@ -343,11 +366,53 @@ const tree2List = (list: any, id?: string) => {
// 返回结果数组
return arr
}
// 禁用超过当前日期的选择
const disabledDate = (date: Date) => {
return date > new Date() // 如果日期大于当前日期,则禁用
}
onMounted(() => {})
// 补招
const makeUp = () => {
tableRef.value && tableRef.value.getRef().getCheckboxRecords()
console.log("🚀 ~ makeUp ~ tableRef.value.getRef().getCheckboxRecords():", tableRef.value.getRef().getCheckboxRecords())
// tableRef.value && tableRef.value.getRef().getCheckboxRecords()
let list =
tableRef.value
.getRef()
.getCheckboxRecords()
.find((item: any) => item.level == '6') || []
if (list.length == 0) {
return ElMessage({
message: '请选择监测点',
type: 'warning'
})
}
dialogVisible.value = true
}
// 补招提交
const makeUpSubmit = () => {
if (timeData.value.length == 0) {
return ElMessage({
message: '请选择补招时间',
type: 'warning'
})
}
recall({
monitorId: tableRef.value
.getRef()
.getCheckboxRecords()
.filter(item => item.level == 6)
.map(item => item.id),
reCallEndTime: timeData.value[1],
reCallStartTime: timeData.value[0]
}).then(res => {
ElMessage({
message: res.message,
type: 'success'
})
dialogVisible.value = false
})
}
watch(
() => treeData.value,

View File

@@ -11,7 +11,7 @@
<vxe-column field="busBar" title="母线" v-if="voltageLevelFlag"></vxe-column>
<vxe-column field="voltageLevel" title="电压等级"
v-if="statisticalName == '谐波电压(%)' && !voltageLevelFlag"></vxe-column>
v-if="statisticalName == '谐波电压' && !voltageLevelFlag"></vxe-column>
<vxe-column field="data" :title="statisticalName">
<template #default="scope">
<span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
@@ -81,7 +81,7 @@ const open = (row: any, flag: boolean, params: any) => {
voltageLevelFlag.value = flag
loading.value = true
title.value = row.name + '详情'
statisticalName.value = params.statisticalType.name + '(%)'
statisticalName.value = params.statisticalType.name
tableData.value = []
if (flag) {
getLineInfoById({ ...params, deptIndex: row.pid, id: row.id ,powerFlag: row.powerFlag }).then((res: any) => {