Browse Source

推送配置

develop^2
bobol 8 months ago
parent
commit
98443b7985
  1. 49
      src/views/model/heatapiconf/index.vue

49
src/views/model/heatapiconf/index.vue

@ -17,13 +17,13 @@
class="my-custom-form"> class="my-custom-form">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="排除设备" prop="excludeDevices" label-width="auto"> <el-form-item label="推送方" prop="pushingCounterpart" label-width="auto">
<el-select v-model="queryParams.excludeDevices" placeholder="请选择排除设备" clearable multiple> <el-select v-model="queryParams.pushingCounterpart" placeholder="请选择推送方" clearable>
<el-option <el-option
v-for="dict in listDeviceAll" v-for="dict in pushing_counterpart"
:key="dict.uuid" :key="dict.value"
:label="dict.deviceName" :label="dict.label"
:value="dict.uuid" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -34,12 +34,6 @@
@keyup.enter="handleQuery"/> @keyup.enter="handleQuery"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label="发送地址" prop="sendIp" label-width="auto">
<el-input v-model="queryParams.sendIp" placeholder="请输入发送地址" clearable
@keyup.enter="handleQuery"/>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item class="childTextAlignLeft"> <el-form-item class="childTextAlignLeft">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -67,19 +61,11 @@
<el-table v-loading="loading" :data="heatapiconfList" @selection-change="handleSelectionChange" <el-table v-loading="loading" :data="heatapiconfList" @selection-change="handleSelectionChange"
:max-height="tableHeight" :border="true" :column-width-draggable="true"> :max-height="tableHeight" :border="true" :column-width-draggable="true">
<el-table-column type="selection" width="55" align="center" fixed="left"/> <el-table-column type="selection" width="55" align="center" fixed="left"/>
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="机构编号" align="center" prop="orgCode"/> <el-table-column label="机构编号" align="center" prop="orgCode"/>
<el-table-column label="机构名称" align="center" prop="orgName"/> <el-table-column label="机构名称" align="center" prop="orgName"/>
<!-- <el-table-column label="排除设备" align="center" prop="excludeDevices" show-overflow-tooltip="true" >-->
<!-- <template #default="scope">-->
<!-- {{getDevicesNames(scope.row.excludeDevices)}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="推送方" align="center" prop="pushingCounterpart" <el-table-column label="推送方" align="center" prop="pushingCounterpart"
:formatter="formatterPushingCounterpart"/> :formatter="formatterPushingCounterpart"/>
<!-- <el-table-column label="策略" align="center" prop="strategy" :formatter="formatterStrategy"/>-->
<el-table-column label="标准值" align="center" prop="standard"/> <el-table-column label="标准值" align="center" prop="standard"/>
<!-- <el-table-column label="发送地址" align="center" prop="sendIp"/>-->
<el-table-column label="是否发送" align="center" prop="available"> <el-table-column label="是否发送" align="center" prop="available">
<template #default="scope"> <template #default="scope">
<el-switch v-model="scope.row.available" @change="changeEnabled(scope.row)"/> <el-switch v-model="scope.row.available" @change="changeEnabled(scope.row)"/>
@ -113,7 +99,7 @@
</el-row> </el-row>
<!-- 添加或修改供热办推送接口配置对话框 --> <!-- 添加或修改供热办推送接口配置对话框 -->
<el-dialog :title="title" v-model="open" width="1000px" append-to-body draggable :close-on-click-modal="false"> <el-dialog :title="title" v-model="open" width="1000px" append-to-body draggable :close-on-click-modal="false" destroy-on-close>
<el-form ref="heatapiconfRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="heatapiconfRef" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -191,7 +177,7 @@
</el-dialog> </el-dialog>
<el-dialog title="编辑设备调整策略" v-model="openStrategyConfEditForm" width="500px" append-to-body draggable <el-dialog title="编辑设备调整策略" v-model="openStrategyConfEditForm" width="500px" append-to-body draggable
:close-on-click-modal="false"> :close-on-click-modal="false" destroy-on-close>
<el-form ref="strategyConfEditFormRef" :model="strategyConfEditForm" :rules="strategyConfEditRules" <el-form ref="strategyConfEditFormRef" :model="strategyConfEditForm" :rules="strategyConfEditRules"
label-width="80px"> label-width="80px">
<el-form-item label="设备:" prop="deviceName"> <el-form-item label="设备:" prop="deviceName">
@ -216,7 +202,7 @@
</el-dialog> </el-dialog>
<el-dialog title="新增设备" v-model="openStrategyConfAddForm" width="500px" append-to-body draggable <el-dialog title="新增设备" v-model="openStrategyConfAddForm" width="500px" append-to-body draggable
:close-on-click-modal="false"> :close-on-click-modal="false" destroy-on-close>
<el-form ref="strategyConfSaveFormRef" :model="strategyConfSaveForm" :rules="strategyConfSaveRules" <el-form ref="strategyConfSaveFormRef" :model="strategyConfSaveForm" :rules="strategyConfSaveRules"
label-width="70px"> label-width="70px">
<el-form-item label="设备:" prop="deviceList"> <el-form-item label="设备:" prop="deviceList">
@ -302,7 +288,13 @@ const data = reactive({
standard: null, standard: null,
excludeDevices: [], excludeDevices: [],
}, },
rules: {} rules: {
orgCode: [{required: true, message: "请选择热源", trigger: "change"}],
pushingCounterpart: [{required: true, message: "请选择推送方", trigger: "change"}],
standard: [{required: true, message: "请选择标准值", trigger: "blur"}],
dateRange: [{required: true, message: "请选择日期范围", trigger: "change"}],
pushingInterval: [{required: true, message: "请输入时间间隔", trigger: "blur"}],
}
}); });
const {queryParams, form, rules} = toRefs(data); const {queryParams, form, rules} = toRefs(data);
@ -531,7 +523,7 @@ function handleNodeClick(data) {
queryParams.value.orgCode = data.id; queryParams.value.orgCode = data.id;
form.value.orgCode = data.id; form.value.orgCode = data.id;
form.value.orgName = data.label; form.value.orgName = data.label;
disabled.value = data.isLeaf // disabled.value = data.isLeaf
treeSelected.value = data.id; treeSelected.value = data.id;
handleQuery(); handleQuery();
} }
@ -758,14 +750,15 @@ function dateRangeChange(dataRange) {
function handleAddStrategyConf() { function handleAddStrategyConf() {
deviceList.value = JSON.parse(JSON.stringify(listDevices.value)); deviceList.value = JSON.parse(JSON.stringify(listDevices.value));
console.log("deviceList", deviceList.value, deviceStrategyConfList.value); let deviceArr = [];
if (deviceStrategyConfList.value && deviceStrategyConfList.value.length > 0) { if (deviceStrategyConfList.value && deviceStrategyConfList.value.length > 0) {
deviceList.value.forEach(device => { deviceList.value.forEach(device => {
let arr = deviceStrategyConfList.value.filter(item => item.deviceUuid === device.uuid); let arr = deviceStrategyConfList.value.filter(item => item.deviceUuid === device.uuid);
if (arr && arr.length > 0) { if (!arr || arr.length === 0) {
device.disabled = true; deviceArr.push(device);
} }
}) })
deviceList.value = deviceArr;
} }
strategyConfSaveForm.value.deviceList = []; strategyConfSaveForm.value.deviceList = [];
openStrategyConfAddForm.value = true; openStrategyConfAddForm.value = true;

Loading…
Cancel
Save