pc-master #133

Merged
xiaomeng merged 3 commits from pc-master into portal 2024-03-14 03:09:17 +00:00
4 changed files with 153 additions and 36 deletions

View File

@ -119,7 +119,10 @@ export default {
getEqbyid(data) {
return sendGetRequest("/sel/eqbyid/" + data, '');
},
//气象站显示
geteqetdata(data) {
return sendGetRequest(`/getcontrol/geteqetdata?userId=`+data ,"")
},
//测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口
postReg(data) {
return sendPostRequest("/readFs/reg", data);
@ -387,6 +390,8 @@ cameraStart(cameraSerialNumber,cameraChannelNumber,num) {
cameraStop(cameraSerialNumber,cameraChannelNumber,num) {
return sendPostRequest(`/camera/stop?cameraid=${cameraSerialNumber}&channelid=${cameraChannelNumber}&direction=${num}`)
},
//二维码溯源
//查看农事作物信息
getAgriculturalInformation(data) {

View File

@ -37,7 +37,7 @@
:class="item.routerList.indexOf(routerNow) != -1 && routerIndex == item1.index ? 'active' : ''"
v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div
class="status" :class="item1.deviceState == 0 ? 'outline' : 'online'"
v-if="item1.deviceState >= 0">{{
v-if="item1.deviceState >= 0 && item1.deviceState">{{
item1.deviceState == 0 ? '离线' : '在线' }}</div>
</li>
</ul>
@ -106,10 +106,10 @@ export default {
"$route"(newName, oldName) {
this.gerRouter();
var store = this.$store.state
if(!store.equipmentName){
if (!store.equipmentName) {
this.getByid()
}
},
},
mounted() {
@ -241,35 +241,63 @@ export default {
})
}
})
this.leftList.forEach((el1, index1) => {
if (el1.name == '温室') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
if (el1.name == '施肥机') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
if (el1.name == '生态气象站') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
})
this.gerRouter()
this.getByid()
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getControlGetState(data).then(res => {
this.api.geteqetdata(userInfo.userid).then((res) => {
if (res.data.code == 200) {
this.statusData = res.data.data;
var list = this.$store.state.equipmentList
this.$store.state.equipmentList = list.concat(res.data.data.map(function (item, index) {
return {
deviceId: item.deviceId,
userId: item.userId,
deviceTypeName: item.deviceName,
index: list[list.length - 1].index + index + 1,
router: 'formula',
deviceName: '30'
};
}))
this.$store.state.equipmentList.forEach((el, index) => {
if (el.deviceName == '30') {
this.leftList.forEach((el1, index1) => {
if (el1.name == '生态气象站') {
this.leftList[index1].list.push(el)
}
})
}
})
this.leftList.forEach((el1, index1) => {
if (el1.name == '温室') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
if (el1.name == '施肥机') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
if (el1.name == '生态气象站') {
this.leftList[index1].list.sort(this.compare('equipmentStatu'))
}
})
this.gerRouter()
this.getByid()
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getControlGetState(data).then(res => {
if (res.data.code == 200) {
this.statusData = res.data.data;
}
})
}
})
}
})
},
gerRouter() {
var store = this.$store.state
this.routerIndex = this.$route.query.index ? this.$route.query.index : store.equipmentIndex
this.routerNow = this.$route.name;
if (store.equipmentList.length) {
this.deviceName = store.equipmentList[this.routerIndex - 1].deviceName
} else {
@ -312,16 +340,27 @@ export default {
this.$router.push({ path: `/dataAnalysis` })
} else if (item.router == 'status') {
if(this.deviceName == '10' || this.deviceName == '30'){
this.$router.push({ path: `/control` })
}else{
this.$router.push({ path: `/formula` })
if (this.deviceName == '30') {
this.$message('气象站无该页面');
return
}
if (this.deviceName == '10') {
this.$router.push({ path: `/control` })
} else {
this.$router.push({ path: `/formula` })
}
} else if (item.router == 'realTime') {
this.$router.push({ path: `/realTime` })
} else if (item.router == 'videoMonitoring') {
if (this.deviceName == '30') {
this.$message('气象站无该页面');
return
}
this.$router.push({ path: `/videoMonitoring` })
} else if (item.router == 'status' && item.routerList.indexOf(this.routerNow) != -1) {
return
@ -363,17 +402,22 @@ export default {
} else if (this.routerNow == 'historyData') {
this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` })
} else{
this.$store.state.equipmentIndex = item.index
this.routerIndex = item.index
if (item.deviceName == 10 || item.deviceName == 30) {
} else {
if (item.deviceName == 10) {
//
this.$store.state.equipmentIndex = item.index
this.routerIndex = item.index
if (this.routerNow != 'skylight' && this.leftList[1].routerList.indexOf(this.$route.name) != -1) {
return
}
this.$router.push({ path: `/control?change=${item.index}` })
} else if (item.deviceName == 1 && this.routerNow != 'irrigateSet') {
this.$store.state.equipmentIndex = item.index
this.routerIndex = item.index
this.$router.push({ path: `/irrigateSet?change=${item.index}` })
} else if (item.deviceName == 30) {
this.$message('气象站无该页面');
}
}
} else if (item.router == 'formula' && this.$route.query.index == item.index) {

View File

@ -95,6 +95,36 @@
<img src="../../assets/image/left-img1.png" alt="">
{{ scope.row.data3 }}
</div>
<div class="type1" v-if="scope.row.type == 5">
<div class="input-main-80">
<span>ph初始值</span>
<input @blur="blurChange(store.formulaNum[indexs - 1] + 26 , $event)"
v-model="inputData[store.formulaNum[indexs - 1] + 26]"
@input="change(store.formulaNum[indexs - 1] + 26, $event)" type="number" style="height: 34px;margin: 0 5px;"
placeholder="0.0">
<span style="padding:0">%</span>
</div>
</div>
<div class="type1" v-if="scope.row.type == 6">
<div class="input-main-80">
<span>ec初始值</span>
<input @blur="blurChange(store.formulaNum[indexs - 1] + 27 , $event)"
v-model="inputData[store.formulaNum[indexs - 1] + 27]"
@input="change(store.formulaNum[indexs - 1] + 27, $event)" type="number" style="height: 34px;margin: 0 5px;"
placeholder="0.0">
<span style="padding:0">%</span>
</div>
</div>
<div class="type1" v-if="scope.row.type == 7">
<div class="input-main-80">
<span>初始时间</span>
<input @blur="blurChange(store.formulaNum[indexs - 1] + 28 , $event)"
v-model="inputData[store.formulaNum[indexs - 1] + 28]"
@input="change(store.formulaNum[indexs - 1] + 28, $event)" type="number" style="height: 34px;margin: 0 5px;"
placeholder="0.0">
<span style="padding:0">%</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
@ -160,7 +190,7 @@ export default {
data1: '0',
data2: '0',
data3: '',
type: 4
type: 5
}, {
data0: 'G肥选择',
open: true,
@ -168,7 +198,7 @@ export default {
data1: '0',
data2: '0',
data3: '',
type: 4
type: 6
}, {
data0: 'H肥选择',
open: true,
@ -176,7 +206,7 @@ export default {
data1: '0',
data2: '0',
data3: '',
type: 4
type: 7
}, {
data0: '酸 选择',
open: true,
@ -284,7 +314,7 @@ export default {
var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
pattern: store.formulaNum[this.indexs - 1], // //6ph-
regNum: 26,
regNum: 29,
};
this.api.postReg(data).then((res) => {
if (res.data.code == 200) {

View File

@ -96,6 +96,14 @@
placeholder="0"
/>
<span>号配方</span>
<span>达到中液位混合</span>
<input @blur="blurChange(10 + (indexs - 1) + '66', $event)"
v-model="inputData[10 + (indexs - 1) + '66']"
@input="change(10 + (indexs - 1) + '66', $event)"
type="number"
placeholder="0"
/>
<span>()电磁阀开始输出</span>
</div>
</div>
<div class="flex-view">
@ -131,6 +139,36 @@
type="text"
placeholder="0"
/>
<input @blur="blurChange(10 + (indexs - 1) + '61', $event)"
v-model="inputData[10 + (indexs - 1) + '61']"
@input="change(10 + (indexs - 1) + '61', $event)"
type="text"
placeholder="0"
/>
<input @blur="blurChange(10 + (indexs - 1) + '62', $event)"
v-model="inputData[10 + (indexs - 1) + '62']"
@input="change(10 + (indexs - 1) + '62', $event)"
type="text"
placeholder="0"
/>
<input @blur="blurChange(10 + (indexs - 1) + '63', $event)"
v-model="inputData[10 + (indexs - 1) + '63']"
@input="change(10 + (indexs - 1) + '63', $event)"
type="text"
placeholder="0"
/>
<input @blur="blurChange(10 + (indexs - 1) + '64', $event)"
v-model="inputData[10 + (indexs - 1) + '64']"
@input="change(10 + (indexs - 1) + '64', $event)"
type="text"
placeholder="0"
/>
<input @blur="blurChange(10 + (indexs - 1) + '65', $event)"
v-model="inputData[10 + (indexs - 1) + '65']"
@input="change(10 + (indexs - 1) + '65', $event)"
type="text"
placeholder="0"
/>
</div>
<!-- <div class="btn green">
<img src="../../assets/image/rotate.png" alt="" />轮模式启用
@ -959,7 +997,7 @@ export default {
var data = {
equipmentId:store.equipmentList[store.equipmentIndex-1].deviceId,
pattern: 10 + (this.indexs - 1) + "00", // //6ph-
regNum: 61,
regNum: 67,
};
this.api.postReg(data).then((res) => {
if (res.data.code == 200) {