联调前置数据补招接口

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

@@ -28,7 +28,7 @@ export const updateModelState = async (id: number, state: number) => {
return await createAxios({ url: '/bpm/model/update-state', method: 'put', data: data })
}
export const createModel = async (data) => {
export const createModel = async data => {
return await createAxios({ url: '/bpm/model/create', method: 'POST', data: data })
}

View File

@@ -96,3 +96,11 @@ export function getXbLineRank(data:any) {
data: data
})
}
// 数据补招
export function recall(data:any) {
return request({
url: '/data-processing-boot/data/recall',
method: 'post',
data: data
})
}

View File

@@ -1,16 +1,25 @@
<template>
<div ref="tableHeader" class="cn-table-header">
<div class="table-header ba-scroll-style">
<el-form style="flex: 1; height: 28px; display: flex; flex-wrap: wrap" ref="headerForm"
@submit.prevent="" @keyup.enter="onComSearch" label-position="left" :inline="true">
<el-form
style="flex: 1; height: 28px; display: flex; flex-wrap: wrap"
ref="headerForm"
@submit.prevent=""
@keyup.enter="onComSearch"
label-position="left"
:inline="true"
>
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 590px">
<template #label>
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="时间" />
<span v-else>时间</span>
</template>
<DatePicker ref="datePickerRef" v-if="timeAll" :nextFlag="nextFlag"
:theCurrentTime="theCurrentTime"></DatePicker>
<DatePicker
ref="datePickerRef"
v-if="timeAll"
:nextFlag="nextFlag"
:theCurrentTime="theCurrentTime"
></DatePicker>
</el-form-item>
<el-form-item label="区域" v-if="area">
@@ -23,19 +32,43 @@
<Icon size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
</el-button>
<el-button @click="onComSearch" v-if="showSearch" :loading="tableStore.table.loading" type="primary"
:icon="Search">查询</el-button>
<el-button @click="onResetForm" v-if="showSearch && showReset" :loading="tableStore.table.loading"
:icon="RefreshLeft">重置</el-button>
<el-button @click="onExport" v-if="showExport" :loading="tableStore.table.loading" type="primary"
icon="el-icon-Download">导出</el-button>
<el-button
@click="onComSearch"
v-if="showSearch"
:loading="tableStore.table.loading"
type="primary"
:icon="Search"
>
查询
</el-button>
<el-button
@click="onResetForm"
v-if="showSearch && showReset"
:loading="tableStore.table.loading"
:icon="RefreshLeft"
>
重置
</el-button>
<el-button
@click="onExport"
v-if="showExport"
:loading="tableStore.table.loading"
type="primary"
icon="el-icon-Download"
>
导出
</el-button>
</template>
<slot name="operation"></slot>
</div>
<el-form :style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
ref="headerFormSecond" @submit.prevent="" @keyup.enter="onComSearch" label-position="left"
:inline="true"></el-form>
<el-form
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
ref="headerFormSecond"
@submit.prevent=""
@keyup.enter="onComSearch"
label-position="left"
:inline="true"
></el-form>
</div>
</template>
@@ -48,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { Search, RefreshLeft } from '@element-plus/icons-vue'
import { defineProps } from 'vue'
const emit = defineEmits(['selectChange',])
const emit = defineEmits(['selectChange'])
const tableStore = inject('tableStore') as TableStore
const tableHeader = ref()
const datePickerRef = ref()
@@ -66,7 +99,6 @@ interface Props {
showReset?: boolean //是否显示重置按钮
showExport?: boolean //导出控制
showTimeAll?: boolean //控制时间是否显示
}
const props = withDefaults(defineProps<Props>(), {
@@ -78,7 +110,6 @@ const props = withDefaults(defineProps<Props>(), {
showReset: true,
showExport: false,
showTimeAll: false
})
// 动态计算table高度
const resizeObserver = new ResizeObserver(entries => {
@@ -101,20 +132,19 @@ const headerFormSecondStyleClose = {
watch(
() => tableStore.table.params.deptIndex,
(newVal) => {
newVal => {
setTimeout(() => {
areaRef.value.change()
}, 0);
areaRef.value && areaRef.value.change()
}, 0)
}
)
watch(
() => timeAll.value,
(newVal) => {
newVal => {
tableStore.timeAll = newVal
setTimeout(() => {
computedSearchRow()
}, 500)
}
)
onMounted(() => {
@@ -179,7 +209,6 @@ const showSelectChange = () => {
emit('selectChange', showSelect.value)
}
const onComSearch = async () => {
if (props.datePicker && timeAll.value) {
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
@@ -206,7 +235,16 @@ const onExport = () => {
tableStore.onTableAction('export', { showAllFlag: true })
}
defineExpose({ onComSearch, areaRef, setDatePicker, setTheDate, datePickerRef, showSelectChange,computedSearchRow,onExport })
defineExpose({
onComSearch,
areaRef,
setDatePicker,
setTheDate,
datePickerRef,
showSelectChange,
computedSearchRow,
onExport
})
</script>
<style scoped lang="scss">
@@ -301,7 +339,6 @@ defineExpose({ onComSearch, areaRef, setDatePicker, setTheDate, datePickerRef, s
html.dark {
.table-search-button-group {
button:focus,
button:active {
background-color: var(--el-color-info-dark-2);

View File

@@ -1477,7 +1477,7 @@
placeholder="请输入电压下偏差"
></el-input>
</el-form-item>
<el-form-item
<!-- <el-form-item
class="form-item"
label="对象名称:"
:prop="
@@ -1495,7 +1495,7 @@
disabled="true"
placeholder="请输入对象名称"
></el-input>
</el-form-item>
</el-form-item> -->
<el-form-item
class="form-item"
@@ -1601,12 +1601,29 @@
placeholder="请输入拥有者职务"
></el-input>
</el-form-item> -->
<el-form-item class="form-item" label="电网侧变电站:">
<!-- <el-form-item class="form-item" label="电网侧变电站:">
<el-input
v-model="lineItem.powerSubstationName"
disabled
placeholder="请输入电网侧变电站"
></el-input>
</el-form-item> -->
<el-form-item class="form-item" label="实际安裝粒置:">
<el-select
filterable
v-model="lineItem.areaSelect"
placeholder="请选择实际安裝粒置"
:disabled="pageStatus == 1"
style="width: 100%"
>
<el-option
v-for="item in treeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item class="form-item" label="上级变电站:">
:prop=" 不校验
@@ -1836,6 +1853,7 @@ const monitorPointDetail: any = ref({
calssificationGrade: 1,
//电网测变电站
powerSubstationName: '',
areaSelect: '',
//监测点拥有着
owner: '',
//拥有者职位

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,7 +224,7 @@ const tableStore = new TableStore({
treeNode: true,
width: 350,
formatter: function (row) {
console.log("🚀 ~ row:", row)
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) => {

View File

@@ -299,7 +299,7 @@ const boundaryList: any = ref([
},
{
orgName: '朝阳',
LngLat: [121.42, 41.58],
LngLat: [119.640944, 41.39657],
boundary: mapJson['朝阳']
},
{
@@ -309,7 +309,7 @@ const boundaryList: any = ref([
},
{
orgName: '锦州',
LngLat: [119.140944, 41.39657],
LngLat: [121.42, 41.58],
boundary: mapJson['锦州']
},
{

View File

@@ -622,7 +622,7 @@ const resetForm: any = async () => {
terminalModel: terminalModelList[1].id, //终端模型
terminalPort: '102', //端口
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalType: terminalTypeList[0]?.id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型
@@ -684,7 +684,7 @@ const devReportForm: any = ref({
terminalModel: terminalModelList[1].id, //终端模型
terminalPort: '', //端口
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalType: terminalTypeList[0]?.id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型

View File

@@ -645,7 +645,7 @@ const resetForm: any = async () => {
terminalModel: terminalModelList[1].id, //终端模型
terminalPort: '102', //端口
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalType: terminalTypeList[0]?.id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型
@@ -707,7 +707,7 @@ const devReportForm: any = ref({
terminalModel: terminalModelList[1].id, //终端模型
terminalPort: '', //端口
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalType: terminalTypeList[0]?.id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型