Merge pull request 'pc-master' (#133) from pc-master into portal

Reviewed-on: #133
portal
xiaomeng 2024-03-14 03:09:16 +00:00
commit c9882caa0e
4 changed files with 153 additions and 36 deletions

View File

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

View File

@ -37,7 +37,7 @@
:class="item.routerList.indexOf(routerNow) != -1 && routerIndex == item1.index ? 'active' : ''" :class="item.routerList.indexOf(routerNow) != -1 && routerIndex == item1.index ? 'active' : ''"
v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div
class="status" :class="item1.deviceState == 0 ? 'outline' : 'online'" class="status" :class="item1.deviceState == 0 ? 'outline' : 'online'"
v-if="item1.deviceState >= 0">{{ v-if="item1.deviceState >= 0 && item1.deviceState">{{
item1.deviceState == 0 ? '离线' : '在线' }}</div> item1.deviceState == 0 ? '离线' : '在线' }}</div>
</li> </li>
</ul> </ul>
@ -241,6 +241,29 @@ export default {
}) })
} }
}) })
this.api.geteqetdata(userInfo.userid).then((res) => {
if (res.data.code == 200) {
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) => { this.leftList.forEach((el1, index1) => {
if (el1.name == '温室') { if (el1.name == '温室') {
this.leftList[index1].list.sort(this.compare('equipmentStatu')) this.leftList[index1].list.sort(this.compare('equipmentStatu'))
@ -265,11 +288,16 @@ export default {
}) })
} }
}) })
}
})
}, },
gerRouter() { gerRouter() {
var store = this.$store.state var store = this.$store.state
this.routerIndex = this.$route.query.index ? this.$route.query.index : store.equipmentIndex this.routerIndex = this.$route.query.index ? this.$route.query.index : store.equipmentIndex
this.routerNow = this.$route.name; this.routerNow = this.$route.name;
if (store.equipmentList.length) { if (store.equipmentList.length) {
this.deviceName = store.equipmentList[this.routerIndex - 1].deviceName this.deviceName = store.equipmentList[this.routerIndex - 1].deviceName
} else { } else {
@ -312,7 +340,11 @@ export default {
this.$router.push({ path: `/dataAnalysis` }) this.$router.push({ path: `/dataAnalysis` })
} else if (item.router == 'status') { } else if (item.router == 'status') {
if(this.deviceName == '10' || this.deviceName == '30'){ if (this.deviceName == '30') {
this.$message('气象站无该页面');
return
}
if (this.deviceName == '10') {
this.$router.push({ path: `/control` }) this.$router.push({ path: `/control` })
} else { } else {
this.$router.push({ path: `/formula` }) this.$router.push({ path: `/formula` })
@ -322,6 +354,13 @@ export default {
this.$router.push({ path: `/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) { } else if (item.router == 'status' && item.routerList.indexOf(this.routerNow) != -1) {
return return
@ -364,16 +403,21 @@ export default {
this.$store.state.equipmentIndex = item.index this.$store.state.equipmentIndex = item.index
this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` }) this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` })
} else { } else {
if (item.deviceName == 10) {
//
this.$store.state.equipmentIndex = item.index this.$store.state.equipmentIndex = item.index
this.routerIndex = item.index this.routerIndex = item.index
if (item.deviceName == 10 || item.deviceName == 30) {
//
if (this.routerNow != 'skylight' && this.leftList[1].routerList.indexOf(this.$route.name) != -1) { if (this.routerNow != 'skylight' && this.leftList[1].routerList.indexOf(this.$route.name) != -1) {
return return
} }
this.$router.push({ path: `/control?change=${item.index}` }) this.$router.push({ path: `/control?change=${item.index}` })
} else if (item.deviceName == 1 && this.routerNow != 'irrigateSet') { } 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}` }) 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) { } 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=""> <img src="../../assets/image/left-img1.png" alt="">
{{ scope.row.data3 }} {{ scope.row.data3 }}
</div> </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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -160,7 +190,7 @@ export default {
data1: '0', data1: '0',
data2: '0', data2: '0',
data3: '', data3: '',
type: 4 type: 5
}, { }, {
data0: 'G肥选择', data0: 'G肥选择',
open: true, open: true,
@ -168,7 +198,7 @@ export default {
data1: '0', data1: '0',
data2: '0', data2: '0',
data3: '', data3: '',
type: 4 type: 6
}, { }, {
data0: 'H肥选择', data0: 'H肥选择',
open: true, open: true,
@ -176,7 +206,7 @@ export default {
data1: '0', data1: '0',
data2: '0', data2: '0',
data3: '', data3: '',
type: 4 type: 7
}, { }, {
data0: '酸 选择', data0: '酸 选择',
open: true, open: true,
@ -284,7 +314,7 @@ export default {
var data = { var data = {
equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId, equipmentId: store.equipmentList[store.equipmentIndex - 1].deviceId,
pattern: store.formulaNum[this.indexs - 1], // //6ph- pattern: store.formulaNum[this.indexs - 1], // //6ph-
regNum: 26, regNum: 29,
}; };
this.api.postReg(data).then((res) => { this.api.postReg(data).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {

View File

@ -96,6 +96,14 @@
placeholder="0" placeholder="0"
/> />
<span>号配方</span> <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> </div>
<div class="flex-view"> <div class="flex-view">
@ -131,6 +139,36 @@
type="text" type="text"
placeholder="0" 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>
<!-- <div class="btn green"> <!-- <div class="btn green">
<img src="../../assets/image/rotate.png" alt="" />轮模式启用 <img src="../../assets/image/rotate.png" alt="" />轮模式启用
@ -959,7 +997,7 @@ export default {
var data = { var data = {
equipmentId:store.equipmentList[store.equipmentIndex-1].deviceId, equipmentId:store.equipmentList[store.equipmentIndex-1].deviceId,
pattern: 10 + (this.indexs - 1) + "00", // //6ph- pattern: 10 + (this.indexs - 1) + "00", // //6ph-
regNum: 61, regNum: 67,
}; };
this.api.postReg(data).then((res) => { this.api.postReg(data).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {