pc-master #178

Merged
xiaomeng merged 5 commits from pc-master into portal 2024-10-11 05:54:32 +00:00
6 changed files with 5981 additions and 3042 deletions

8736
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -912,7 +912,7 @@ textarea {
}
.formula .page-content {
width: calc(100% - 300px);
width: calc(100% - 250px);
height: 100%;
background: rgba(0, 92, 178, 0.15);
border: 2px solid rgba(0, 186, 255, 0.2);

View File

@ -955,7 +955,7 @@ textarea{
justify-content: space-between;
.page-content {
width: calc(100% - 300px);
width: calc(100% - 250px);
height: 100%;
background: rgba(0, 92, 178, 0.15);
border: 2px solid rgba(0, 186, 255, 0.20);

View File

@ -157,7 +157,7 @@ export default {
</script>
<style lang="scss" scoped>
.set-params {
width: 280px;
width: 230px;
height: 100%;
background: rgba(0, 92, 178, 0.15);
border: 2px solid rgba(0, 186, 255, 0.20);

View File

@ -491,7 +491,7 @@ if (el.child.length) {
<style lang="scss" scoped>
.set-params {
width: 280px;
width: 230px;
height: 100%;
background: rgba(0, 92, 178, 0.15);
border: 2px solid rgba(0, 186, 255, 0.2);

View File

@ -8,16 +8,16 @@
<div class="flex-view">
<div class="input-btn">
<span>控制模式选择</span>
<div class="btn" @click="change00(3)"
:class="inputData['1' + (10 + (indexs - 1)) + '00'] == 3 ? 'blue' : 'green'">
<div class="btn" @click="change00(3)" :class="inputData['1' + (10 + (indexs - 1)) + '00'] == 3 ? 'blue' : 'green'
">
<img src="../../assets/image/irrigateSet1.png" alt="" />停止
</div>
<div class="btn" @click="change00(2)"
:class="inputData['1' + (10 + (indexs - 1)) + '00'] == 2 ? 'blue' : 'green'">
<div class="btn" @click="change00(2)" :class="inputData['1' + (10 + (indexs - 1)) + '00'] == 2 ? 'blue' : 'green'
">
<img src="../../assets/image/irrigateSet3.png" alt="" />手动启动
</div>
<div class="btn" @click="change00(1)"
:class="inputData['1' + (10 + (indexs - 1)) + '00'] == 1 ? 'blue' : 'green'">
<div class="btn" @click="change00(1)" :class="inputData['1' + (10 + (indexs - 1)) + '00'] == 1 ? 'blue' : 'green'
">
<img src="../../assets/image/irrigateSet2.png" alt="" />自动
</div>
</div>
@ -50,6 +50,31 @@
v-model="inputData['1' + (10 + (indexs - 1)) + '05']"
@input="change('1' + (10 + (indexs - 1)) + '05', $event)" type="number" placeholder="0" />
</div>
</div>
<div class="flex-view">
<div class="flex-view border-none padding-none">
<div class="input-main input-main-w120">
<span>下雨禁止灌溉功能</span>
</div>
<div class="input-btn">
<div class="btn btn-w80" @click="change71()"
:class="inputData['1' + (10 + (indexs - 1)) + '71'] == '1' ? 'blue' : 'green'">
{{ inputData['1' + (10 + (indexs - 1)) + '71'] == '1' ? '开启' : '关闭' }}
</div>
</div>
<div class="input-main input-main-w120">
<span>(自动模式下生效)</span>
</div>
</div>
<div class="input-main-80">
<span>雨量达到</span>
<input @blur="blurChange('1' + (10 + (indexs - 1)) + '72', $event)"
v-model="inputData['1' + (10 + (indexs - 1)) + '72']"
@input="change('1' + (10 + (indexs - 1)) + '72', $event)" type="number" placeholder="0" />
<span>mm,本灌溉组停止灌溉</span>
</div>
</div>
<!-- <div class="flex-view">
<div class="input-main-80">
@ -107,14 +132,12 @@
<input @blur="blurChange('1' + (10 + (indexs - 1)) + '61', $event)"
v-model="inputData['1' + (10 + (indexs - 1)) + '61']"
@input="change('1' + (10 + (indexs - 1)) + '61', $event)" type="text" placeholder="0" />
</div>
<!-- <div class="btn green">
<img src="../../assets/image/rotate.png" alt="" />轮模式启用
</div> -->
</div>
<div class="flex-view">
<!-- <div @click="(open1 = !open1), change59()" class="open-btn" :class="open1 ? 'active' : ''">
<img v-if="!open1" src="../../assets/image/irrigateSet-icon1.png" alt="" />
<img v-else src="../../assets/image/irrigateSet-icon1-act.png" alt="" />
@ -473,7 +496,7 @@
<el-dialog :modal-append-to-body="false" :show-close="false" :close-on-click-modal="true" :visible.sync="model4"
width="700px" :before-close="handleClose4">
<div class="page-title title-302">{{ indexs }}#灌溉组控制参数配置</div>
<div style="display: flex;align-items: center;">
<div style="display: flex; align-items: center">
<div class="btn blue">
<img src="../../assets/image/model4-icon.png" alt="" />外控模式
</div>
@ -505,9 +528,13 @@
<div class="model1-top model4-top">
<div class="model-left">
<div class="btn btn-w80" @click="blurChange('1' + (10 + (indexs - 1)) + '71', { target: { value: 1 } }), model4Sel = 1"
:class="model4Sel == 1 ? 'blue' : 'off'">
{{ model4Sel == 1 ? '有效' : '无效' }}
<div class="btn btn-w80" @click="
blurChange('1' + (10 + (indexs - 1)) + '71', {
target: { value: 1 },
}),
(model4Sel = 1)
" :class="model4Sel == 1 ? 'blue' : 'off'">
{{ model4Sel == 1 ? "有效" : "无效" }}
</div>
<span>外部数字量控制方式:</span>
</div>
@ -535,10 +562,13 @@
</div>
<div class="model1-top model4-top">
<div class="model-left">
<div class="btn btn-w80 "
@click="blurChange('1' + (10 + (indexs - 1)) + '71', { target: { value: 2 } }), model4Sel = 2"
:class="model4Sel == 2 ? 'blue' : 'off'">
{{ model4Sel == 2 ? '有效' : '无效' }}
<div class="btn btn-w80" @click="
blurChange('1' + (10 + (indexs - 1)) + '71', {
target: { value: 2 },
}),
(model4Sel = 2)
" :class="model4Sel == 2 ? 'blue' : 'off'">
{{ model4Sel == 2 ? "有效" : "无效" }}
</div>
<span>液位传感器控制方式:</span>
</div>
@ -560,7 +590,6 @@
@input="change('1' + (10 + (indexs - 1)) + '69', $event)" type="number" placeholder="0" />
<span>cm</span>
</div>
</div>
<div>
<div class="input-main-80">
@ -583,7 +612,6 @@
</template>
<script>
export default {
data() {
return {
topActive: 1,
@ -602,17 +630,17 @@ export default {
data53: "",
inputData: {},
loading: null,
pageName:'',
pageName: "",
};
},
watch: {
'$store.state.equipmentIndex': function (newValue, oldValue) {
"$store.state.equipmentIndex": function (newValue, oldValue) {
const that = this;
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
text: "加载中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
setTimeout(() => {
that.dataInit();
@ -621,12 +649,14 @@ export default {
$route(newVal, oldVal) {
const that = this;
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
this.pageName=this.$route.query.name?this.$route.query.name:(this.indexs+'#智能灌溉组')
this.pageName = this.$route.query.name
? this.$route.query.name
: this.indexs + "#智能灌溉组";
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
text: "加载中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
setTimeout(() => {
that.dataInit();
@ -637,39 +667,41 @@ export default {
const that = this;
this.indexs = this.$route.query.id ? this.$route.query.id : 1;
console.log(this.$route);
this.pageName=this.$route.query.name?this.$route.query.name:(this.indexs+'#智能灌溉组')
this.pageName = this.$route.query.name
? this.$route.query.name
: this.indexs + "#智能灌溉组";
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
text: "加载中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
setTimeout(() => {
that.dataInit();
}, 0);
//input
let inputList = document.querySelectorAll('input');
let inputList = document.querySelectorAll("input");
for (let index = 0; index < inputList.length; index++) {
inputList[index].onfocus = this.selectValue;//input
inputList[index].onfocus = this.selectValue; //input
}
},
methods: {
countData10(data) {
if (data) {
return data / 10
return data / 10;
} else {
return 0
return 0;
}
},
changeData10(code, el) {
var data = el.target.value * 10
var data = el.target.value * 10;
var sendData = {
target: {
value: data
}
}
this.change(code, sendData)
value: data,
},
};
this.change(code, sendData);
},
handleCommand(command) {
if (command == "1") {
@ -683,15 +715,14 @@ export default {
} else if (command == "5") {
this.model4 = true;
}
this.inputData['1' + (10 + (this.indexs - 1)) + "51"] = command;
this.get53data(command)
this.inputData["1" + (10 + (this.indexs - 1)) + "51"] = command;
this.get53data(command);
var data53 = {
target: {
value: this.inputData['1' + (10 + (this.indexs - 1)) + "51"],
value: this.inputData["1" + (10 + (this.indexs - 1)) + "51"],
},
}
this.changeBtn('1' + (10 + (this.indexs - 1)) + "51", data53);
};
this.changeBtn("1" + (10 + (this.indexs - 1)) + "51", data53);
},
get53data(index) {
var data = index;
@ -710,7 +741,7 @@ export default {
this.data53 = text53;
},
change00(index) {
this.topActive = index
this.topActive = index;
// var list = ["0", "0", "0"];
// if (index == 1) {
// list[0] = "1";
@ -727,32 +758,52 @@ export default {
// } else {
// list[2] = "0";
// }
this.inputData['1' + (10 + (this.indexs - 1)) + '00'] = index
this.inputData["1" + (10 + (this.indexs - 1)) + "00"] = index;
// var num = list.join("");
var dataNum = {
target: {
value: index,
},
};
this.changeBtn('1' + (10 + (this.indexs - 1)) + "00", dataNum);
this.changeBtn("1" + (10 + (this.indexs - 1)) + "00", dataNum);
},
padString(str, length) {
return str.padStart(length, '0');
return str.padStart(length, "0");
},
getType00() {
var number = this.padString(this.inputData['1' + (10 + (this.indexs - 1)) + "00"].toString(2), 3)
var number = this.padString(
this.inputData["1" + (10 + (this.indexs - 1)) + "00"].toString(2),
3
);
if (Number(number[0])) {
this.topActive = 1
this.topActive = 1;
} else if (Number(number[1])) {
this.topActive = 2
this.topActive = 2;
} else if (Number(number[2])) {
this.topActive = 3
this.topActive = 3;
} else {
this.topActive = 0
this.topActive = 0;
}
console.log(this.topActive, 11);
},
change71() {
var num = 0;
if (this.inputData["1" + (10 + (this.indexs - 1)) + "71"] == 1) {
this.inputData["1" + (10 + (this.indexs - 1)) + "71"] = 0;
num = 0;
} else {
this.inputData["1" + (10 + (this.indexs - 1)) + "71"] = 1;
num = 1;
}
var dataNum = {
target: {
value: num,
},
};
this.changeBtn("1" + (10 + (this.indexs - 1)) + "71", dataNum);
},
change59() {
// var list = ["0", "0", "0", "0"];
// if (this.open1) {
@ -775,13 +826,13 @@ export default {
// } else {
// list[0] = "0";
// }
var num = 0
if (this.inputData['1' + (10 + (this.indexs - 1)) + '62'] == 1) {
this.inputData['1' + (10 + (this.indexs - 1)) + '62'] = 0
num = 0
var num = 0;
if (this.inputData["1" + (10 + (this.indexs - 1)) + "62"] == 1) {
this.inputData["1" + (10 + (this.indexs - 1)) + "62"] = 0;
num = 0;
} else {
this.inputData['1' + (10 + (this.indexs - 1)) + '62'] = 1
num = 1
this.inputData["1" + (10 + (this.indexs - 1)) + "62"] = 1;
num = 1;
}
var dataNum = {
@ -789,10 +840,13 @@ export default {
value: num,
},
};
this.changeBtn('1' + (10 + (this.indexs - 1)) + "62", dataNum);
this.changeBtn("1" + (10 + (this.indexs - 1)) + "62", dataNum);
},
getType() {
var number = this.padString(this.inputData['1' + (10 + (this.indexs - 1)) + "59"].toString(2), 4)
var number = this.padString(
this.inputData["1" + (10 + (this.indexs - 1)) + "59"].toString(2),
4
);
console.log(number);
if (Number(number[3])) {
this.open1 = true;
@ -818,44 +872,66 @@ export default {
}
},
dataInit() {
var indexs = this.indexs
var store = this.$store.state
var indexs = this.indexs;
var store = this.$store.state;
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
// this.api.readFi_irrigate()
this.api.readFi_irrigate(`/readFi/irrigate${indexs}`, data).then((res) => {
this.loading.close()
if (res.data.code == 200) {
this.inputData = res.data.data;
// this.getType();
// this.getType00();
this.get53data(this.inputData['1' + (10 + (this.indexs - 1)) + "51"]);
this.inputData['1' + (10 + (indexs - 1)) + '01'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '01'])
this.inputData['1' + (10 + (indexs - 1)) + '06'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '06'])
this.inputData['1' + (10 + (indexs - 1)) + '17'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '17'])
this.inputData['1' + (10 + (indexs - 1)) + '39'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '39'])
this.inputData['1' + (10 + (indexs - 1)) + '40'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '40'])
this.inputData['1' + (10 + (indexs - 1)) + '43'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '43'])
this.inputData['1' + (10 + (indexs - 1)) + '44'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '44'])
this.inputData['1' + (10 + (indexs - 1)) + '37'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '37'])
this.inputData['1' + (10 + (indexs - 1)) + '38'] = this.countData10(this.inputData['1' + (10 + (indexs - 1)) + '38'])
this.model4Sel = this.inputData['1' + (10 + (indexs - 1)) + '71']
} else {
this.$message.error(res.data.msg);
}
});
this.api
.readFi_irrigate(`/readFi/irrigate${indexs}`, data)
.then((res) => {
this.loading.close();
if (res.data.code == 200) {
this.inputData = res.data.data;
// this.getType();
// this.getType00();
this.get53data(
this.inputData["1" + (10 + (this.indexs - 1)) + "51"]
);
this.inputData["1" + (10 + (indexs - 1)) + "01"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "01"]
);
this.inputData["1" + (10 + (indexs - 1)) + "06"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "06"]
);
this.inputData["1" + (10 + (indexs - 1)) + "17"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "17"]
);
this.inputData["1" + (10 + (indexs - 1)) + "39"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "39"]
);
this.inputData["1" + (10 + (indexs - 1)) + "40"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "40"]
);
this.inputData["1" + (10 + (indexs - 1)) + "43"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "43"]
);
this.inputData["1" + (10 + (indexs - 1)) + "44"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "44"]
);
this.inputData["1" + (10 + (indexs - 1)) + "37"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "37"]
);
this.inputData["1" + (10 + (indexs - 1)) + "38"] = this.countData10(
this.inputData["1" + (10 + (indexs - 1)) + "38"]
);
this.model4Sel = this.inputData["1" + (10 + (indexs - 1)) + "71"];
} else {
this.$message.error(res.data.msg);
}
});
},
//
selectValue(e) {
var store = this.$store.state
store.nowInput = e.target.value
var store = this.$store.state;
store.nowInput = e.target.value;
e.currentTarget.select();
},
//
blurChange10(code, el) {
var store = this.$store.state
var store = this.$store.state;
var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
regAddress: code,
@ -868,11 +944,10 @@ export default {
// this.timer && clearInterval(this.timer);
// this.changeData(data);
// }
},
//
blurChange(code, el) {
var store = this.$store.state
var store = this.$store.state;
var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
regAddress: code,
@ -885,10 +960,9 @@ export default {
// this.timer && clearInterval(this.timer);
// this.changeData(data);
// }
},
changeBtn(code, el) {
var store = this.$store.state
var store = this.$store.state;
var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
regAddress: code,
@ -912,12 +986,10 @@ export default {
}
}, 100);
},
changeModel4() {
},
changeModel4() { },
//
change(code, el) {
var store = this.$store.state
var store = this.$store.state;
var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
regAddress: code,
@ -932,7 +1004,6 @@ export default {
// let j = this.$store.state.lateSend;
// //
// this.timer && clearInterval(this.timer);
// this.timer = setInterval(() => {
// ++i;
// if (i == j) {
@ -942,20 +1013,20 @@ export default {
// }, 100);
},
changeData(data) {
var store = this.$store.state
var store = this.$store.state;
this.api.postwriteFi_write(data).then((res) => {
if (res.data.code == 200) {
this.$message({
message: res.data.msg,
type: "success",
});
store.nowInput = ''
store.nowInput = "";
// this.dataInit();
} else {
this.inputData[data.regAddress] = store.nowInput
this.inputData[data.regAddress] = store.nowInput;
this.$message.error(res.data.msg);
}
this.timer = null
this.timer = null;
});
},
handleClose1(done) {