Commit 33a93f43 authored by liuzhaoh's avatar liuzhaoh

设备管理

parent 44bcd6c2
const infoEnum = reactive([
{
label: "点位名称",
propKey: 'deviceName',
type: "input",
},
{
label: "仓室数量",
propKey: 'compartNum',
type: "input",
},
{
label: "地址",
propKey: 'address',
type: "input",
},
{
label: "脉冲阀故障阈值",
propKey: 'pulseValveFaultThreshold',
type: "input",
},
{
label: "斜率",
propKey: 'slope',
type: "input",
},
{
label: "脉冲数量",
propKey: 'pulseValveNum',
type: "input",
},
{
label: "截距",
propKey: 'intercept',
type: "input",
},
{
label: "反吹间隔时间",
propKey: 'backblowInterval',
type: "input",
},
{
label: "基线阈值",
propKey: 'baselineThreshold',
type: "input",
},
{
label: "延时时间",
propKey: 'delayTime',
type: "input",
},
{
label: "群聚值",
propKey: "clusterValue",
type: "input",
},
{
label: "积分时间",
propKey: 'integrationTime',
type: "input",
},
{
label: "通信口",
propKey: 'communicationPort',
type: "select",
options: []
},
{
label: "泄露阈值",
propKey: 'leakThreshold',
type: "input",
},
{
label: "故障阈值",
propKey: "faultThreshold",
type: "input",
},
{
label: "谷值判定(%)",
propKey: "valleyDection",
type: "input",
},
{
label: "阀数量",
propKey: "valveNum",
type: "input",
},
{
label: "提升阀故障",
propKey: "liftValveFailure",
type: "input",
},
{
label: "提升阀延迟时间",
propKey: "liftValveDelayTime",
type: "input",
},
]);
\ No newline at end of file
......@@ -12,9 +12,9 @@
<span class="label">{{ item.label }}</span>
<el-input
v-if="item.type === 'input'"
v-model="item.value"
v-model="infoObj[item.propKey]"
></el-input>
<el-select v-model="item.value" v-if="item.type === 'select'">
<el-select v-model="infoObj[item.propKey]" v-if="item.type === 'select'">
<el-option
v-for="option in item.options"
:key="option.code"
......@@ -35,7 +35,7 @@
<span class="label">{{ item.label }}</span>
<el-input
v-if="item.type === 'input'"
v-model="item.value"
v-model="infoObj[item.propKey]"
></el-input>
</div>
</div>
......@@ -127,14 +127,17 @@ const props = defineProps({
watch(
() => props.infoObjProps,
(newVal) => {
Object.assign(infoObj, newVal);
console.log(newVal);
// Object.assign(infoObj, newVal);
infoObj = newVal;
console.log(infoObj);
},
{ deep: true, inmediate: true }
);
const emit = defineEmits(["close"]);
const infoObj = reactive({
let infoObj = reactive({
deviceName: "", // 点位名称
compartNum: "", // 仓室数量
address: "", // 地址
......@@ -165,102 +168,102 @@ const infoObj = reactive({
indoorPulseBlow: "", // 室内卖出轮流喷吹
liftValveDelayTime: "", // 提升阀延迟时间
});
const communicationPortOptions = ref([])
const communicationPortOptions = ref([]);
const infoEnum = reactive([
{
label: "点位名称",
value: infoObj.deviceName,
propKey: "deviceName",
type: "input",
},
{
label: "仓室数量",
value: infoObj.compartNum,
propKey: "compartNum",
type: "input",
},
{
label: "地址",
value: infoObj.address,
propKey: "address",
type: "input",
},
{
label: "脉冲阀故障阈值",
value: infoObj.pulseValveFaultThreshold,
propKey: "pulseValveFaultThreshold",
type: "input",
},
{
label: "斜率",
value: infoObj.slope,
propKey: "slope",
type: "input",
},
{
label: "脉冲数量",
value: infoObj.pulseValveNum,
propKey: "pulseValveNum",
type: "input",
},
{
label: "截距",
value: infoObj.intercept,
propKey: "intercept",
type: "input",
},
{
label: "反吹间隔时间",
value: infoObj.backblowInterval,
propKey: "backblowInterval",
type: "input",
},
{
label: "基线阈值",
value: infoObj.baselineThreshold,
propKey: "baselineThreshold",
type: "input",
},
{
label: "延时时间",
value: infoObj.delayTime,
propKey: "delayTime",
type: "input",
},
{
label: "群聚值",
value: infoObj.clusterValue,
propKey: "clusterValue",
type: "input",
},
{
label: "积分时间",
value: infoObj.integrationTime,
propKey: "integrationTime",
type: "input",
},
{
label: "通信口",
value: infoObj.communicationPort,
propKey: "communicationPort",
type: "select",
options: []
options: [],
},
{
label: "泄露阈值",
value: infoObj.leakThreshold,
propKey: "leakThreshold",
type: "input",
},
{
label: "故障阈值",
value: infoObj.faultThreshold,
propKey: "faultThreshold",
type: "input",
},
{
label: "谷值判定(%)",
value: infoObj.valleyDection,
propKey: "valleyDection",
type: "input",
},
{
label: "阀数量",
value: infoObj.valveNum,
propKey: "valveNum",
type: "input",
},
{
label: "提升阀故障",
value: infoObj.liftValveFailure,
propKey: "liftValveFailure",
type: "input",
},
{
label: "提升阀延迟时间",
value: infoObj.liftValveDelayTime,
propKey: "liftValveDelayTime",
type: "input",
},
]);
......@@ -291,16 +294,18 @@ const cancelFun = () => {
// 获取通信口
const getCommunicationPort = () => {
const url = "/queryCommunicationPort";
getDataFun(url, {}).then((res) => {
communicationPortOptions.value = res && res.data || []
for(let i = 0; i < infoEnum.length; i++) {
if (infoEnum[i].label === '通信口') {
infoEnum[i].options = communicationPortOptions.value
break
getDataFun(url, {})
.then((res) => {
communicationPortOptions.value = (res && res.data) || [];
for (let i = 0; i < infoEnum.length; i++) {
if (infoEnum[i].label === "通信口") {
infoEnum[i].options = communicationPortOptions.value;
break;
}
}
}).catch(err => {
communicationPortOptions.value = []
})
.catch((err) => {
communicationPortOptions.value = [];
});
};
onMounted(() => {
......
......@@ -120,6 +120,7 @@
<setParamsDialog
v-model:dialogVisible="dialogVisible"
@close="closeDialog"
:infoObjProps="infoObj"
></setParamsDialog>
</div>
</template>
......@@ -368,6 +369,9 @@ const beforeUpload = (file) => {
return true;
}
};
const infoObj = ref({
})
// 获取参数
const getParamsConfig = (val) => {
const url = "/getSensorConfig";
......@@ -375,42 +379,42 @@ const getParamsConfig = (val) => {
deviceNo: val.deviceNo,
};
getDataFun(url, params).then((res) => {
console.log(res);
res.data = {
id: 7,
customerId: 26,
deviceNo: "cgq_001",
deviceName: "布袋传感器001",
compartNum: 12,
address: "地址",
pulseValveFaultThreshold: "脉冲阀故障阈值",
slope: "斜率",
pulseValveNum: "脉冲阀数量",
intercept: "截距",
backblowInterval: "反吹间隔时间",
baselineThreshold: "基线阈值",
delayTime: "延时时间",
clusterValue: "群聚值",
integrationTime: "积分时间",
communicationPort: "通信口",
leakThreshold: "泄露阈值",
onlineBackblow: true,
fastBlow: true,
faultThreshold: "故障阈值",
d01Alarm: true,
d13Alarm: true,
valleyDection: "谷值判定",
valveNum: "阀数量",
liftValveFailure: "提升阀故障",
compartSort: "仓室顺序",
liftValveDelayTime: "提升阀延迟时间",
diInput: true,
showEarlyWarn: true,
relateDevicesNum: "关联设备",
liftValveCommunicationIp: "脉冲的设备通信ip",
indoorPulseBlow: true,
};
// res.data = {
// id: 7,
// customerId: 26,
// deviceNo: "cgq_001",
// deviceName: "布袋传感器001",
// compartNum: 12,
// address: "地址",
// pulseValveFaultThreshold: "脉冲阀故障阈值",
// slope: "斜率",
// pulseValveNum: "脉冲阀数量",
// intercept: "截距",
// backblowInterval: "反吹间隔时间",
// baselineThreshold: "基线阈值",
// delayTime: "延时时间",
// clusterValue: "群聚值",
// integrationTime: "积分时间",
// communicationPort: "通信口",
// leakThreshold: "泄露阈值",
// onlineBackblow: true,
// fastBlow: true,
// faultThreshold: "故障阈值",
// d01Alarm: true,
// d13Alarm: true,
// valleyDection: "谷值判定",
// valveNum: "阀数量",
// liftValveFailure: "提升阀故障",
// compartSort: "仓室顺序",
// liftValveDelayTime: "提升阀延迟时间",
// diInput: true,
// showEarlyWarn: true,
// relateDevicesNum: "关联设备",
// liftValveCommunicationIp: "脉冲的设备通信ip",
// indoorPulseBlow: true,
// };
dialogVisible.value = true;
infoObj.value = res.data || {}
}).catch(err => {
ElMessage.error('获取参数设置失败');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment