Commit 58986c0a authored by Cai Wei's avatar Cai Wei

Merge branch 'dev' of https://app.bmetech.com/liuzhaohui/dctomproject into dev

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