Compare commits

...

2 Commits

Author SHA1 Message Date
xiaomeng e763bb1eb5 Merge pull request '1' (#171) from pc-master into portal
Reviewed-on: #171
2024-08-31 00:17:08 +00:00
sunmeng ff4f3288d7 1 2024-08-30 18:25:17 +08:00
9 changed files with 200 additions and 39 deletions

View File

@ -679,5 +679,13 @@ getIccid(data){
readFi_sensorchannelfi(data) { readFi_sensorchannelfi(data) {
return sendGetRequest("/readFi/sensorchannelfi", data); return sendGetRequest("/readFi/sensorchannelfi", data);
}, },
//智能灌溉的名称
getFi_getName(data) {
return sendGetRequest("/getFi/getName", data);
},
//修改智能灌溉名称
getFi_updateName(data){
return sendPutRequest(`/getFi/updateName`, data)
},
}; };

View File

@ -18,10 +18,11 @@
<!-- --> <!-- -->
<ul class="table-ul"> <ul class="table-ul">
<li @click="toRouter(item1)" <li @click="toRouter(item1)"
:class="routerNow == item1.router && routerIndex == index1 + 1 ? 'active' : ''" class="table-li" :class="routerNow == item1.router && routerIndex == index1 + 1 ? 'active' : ''"
v-for="item1, index1 in item.list" :key="index1">{{ class="table-li" v-for="item1, index1 in item.list" :key="index1">{{
item1.name }} <div class="status" :class="item1.status == 0 ? 'outline' : 'online'" item1.name }} <div class="status" :class="item1.status == 0 ? 'outline' : 'online'"
v-if="item1.status >= 0">{{ item1.status v-if="item1.status >= 0">{{
item1.status
== 0 == 0
? '离线' : '在线' }}</div> ? '离线' : '在线' }}</div>
</li> </li>
@ -103,7 +104,25 @@ export default {
// }else{ // }else{
// this.getList() // this.getList()
// } // }
var store = this.$store.state
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
};
this.api.getFi_getName(data).then(res => {
if (res.data.code == 200) {
// name1name16
const namesArray = [];
for (let i = 1; i <= 16; i++) {
namesArray.push(res.data.data[`name${i}`]);
}
// routerList[1].listname
this.routerList[1].list.forEach((item, index) => {
if (index < namesArray.length) {
item.name = namesArray[index];
}
});
}
})
}, },
getList() { getList() {
@ -144,7 +163,9 @@ export default {
if (item.http) { if (item.http) {
window.location.href = item.http; window.location.href = item.http;
} else if (item.router == 'irrigateSet-soil' && this.$route.query.id != item.index) { } else if (item.router == 'irrigateSet-soil' && this.$route.query.id != item.index) {
this.$router.push({ path: `/irrigateSet-soil?id=${item.index}` }) this.$router.push({ path: `/irrigateSet-soil`,query:{
id:item.index,name:item.name
} })
} }
// else if (item.router == 'formula' && this.$route.query.id != item.index) { // else if (item.router == 'formula' && this.$route.query.id != item.index) {
// this.$router.push({ path: `/formula?id=${item.index}` }) // this.$router.push({ path: `/formula?id=${item.index}` })
@ -222,4 +243,3 @@ export default {
} }
} }
</style> </style>

View File

@ -17,7 +17,7 @@
智能控制器 智能控制器
</div> </div>
</div> </div>
<div class="table-view" v-if="active == 0"> <div class="table-view" style="width: 100%;" v-if="active === 0">
<el-table :data="tableData" :row-class-name="tableRowClassName" height="620" style="width: 100%"> <el-table :data="tableData" :row-class-name="tableRowClassName" height="620" style="width: 100%">
<!-- <el-table-column label="序号"> <!-- <el-table-column label="序号">
<template slot-scope="scope"> <template slot-scope="scope">
@ -29,7 +29,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="deviceTypeName" label="设备名称"> <el-table-column prop="deviceTypeName" label="设备名称">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260px"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="table-flex"> <div class="table-flex">
<div class="table-operate blue" @click="openModel(scope.row, scope.$index)"> <div class="table-operate blue" @click="openModel(scope.row, scope.$index)">
@ -45,7 +45,7 @@
</el-table> </el-table>
</div> </div>
<div class="table-view" v-else-if="active==1"> <div class="table-view" style="width: 100%;" v-if="active===1">
<el-table :data="tableData1" :row-class-name="tableRowClassName" height="620" style="width: 100%"> <el-table :data="tableData1" :row-class-name="tableRowClassName" height="620" style="width: 100%">
<!-- <el-table-column label="序号"> <!-- <el-table-column label="序号">
<template slot-scope="scope"> <template slot-scope="scope">
@ -69,7 +69,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="table-view" v-else-if="active==2"> <div class="table-view" style="width: 100%;" v-if="active===2">
<el-table :data="tableData2" :row-class-name="tableRowClassName" height="620" style="width: 100%"> <el-table :data="tableData2" :row-class-name="tableRowClassName" height="620" style="width: 100%">
<!-- <el-table-column label="序号"> <!-- <el-table-column label="序号">
<template slot-scope="scope"> <template slot-scope="scope">
@ -87,6 +87,9 @@
<div class="table-operate blue" @click="openModel1(scope.row, scope.$index)"> <div class="table-operate blue" @click="openModel1(scope.row, scope.$index)">
<img src="../../assets/manageImg/table-edit.png" alt="">编辑 <img src="../../assets/manageImg/table-edit.png" alt="">编辑
</div> </div>
<div class="table-operate red" @click="openModelName1(scope.row, scope.$index)">
<img src="../../assets/manageImg/table-edit.png" alt="">修改更多名称
</div>
</div> </div>
</template> </template>
@ -140,7 +143,7 @@
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">取消</div> <div class="vrcode-btn cancle-btn w-100" @click="addModel = false">取消</div>
</span> </span>
</el-dialog> </el-dialog>
<!-- 施肥机的修改名字 -->
<el-dialog title="提示" top="10vh" :visible.sync="changeName" width="760px" class="vrcode-model manage-model" <el-dialog title="提示" top="10vh" :visible.sync="changeName" width="760px" class="vrcode-model manage-model"
:append-to-body="true"> :append-to-body="true">
<div class="vrcode-model-title"> <div class="vrcode-model-title">
@ -251,7 +254,7 @@
<div class="vrcode-btn cancle-btn w-100" @click="changeName = false">取消</div> <div class="vrcode-btn cancle-btn w-100" @click="changeName = false">取消</div>
</span> </span>
</el-dialog> </el-dialog>
<!-- 控制器编辑 -->
<el-dialog title="提示" top="10vh" :visible.sync="addModel1" width="564px" class="vrcode-model manage-model" <el-dialog title="提示" top="10vh" :visible.sync="addModel1" width="564px" class="vrcode-model manage-model"
:append-to-body="true"> :append-to-body="true">
<div class="vrcode-model-title"> <div class="vrcode-model-title">
@ -302,6 +305,73 @@
<div class="vrcode-btn cancle-btn w-100" @click="addModel1 = false">取消</div> <div class="vrcode-btn cancle-btn w-100" @click="addModel1 = false">取消</div>
</span> </span>
</el-dialog> </el-dialog>
<!-- 智能灌溉 -->
<el-dialog title="提示" top="10vh" :visible.sync="changeName1" width="760px" class="vrcode-model manage-model"
:append-to-body="true">
<div class="vrcode-model-title">
修改更多名称
</div>
<div class="vrcode-content" v-if="name20List">
<div class="manage-left">
<div class="manage-input w-160">
<div class="input-title">智能灌溉1-8</div>
<input type="text" v-model="name20List.name1" placeholder="灌溉组1">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name2" placeholder="灌溉组2">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name3" placeholder="灌溉组3">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name4" placeholder="灌溉组4">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name5" placeholder="灌溉组5">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name6" placeholder="灌溉组6">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name7" placeholder="灌溉组7">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name8" placeholder="灌溉组8">
</div>
</div>
<div class="manage-center">
<div class="manage-input w-160">
<div class="input-title">智能灌溉9-16</div>
<input type="text" v-model="name20List.name9" placeholder="灌溉组1">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name10" placeholder="灌溉组2">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name11" placeholder="灌溉组3">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name12" placeholder="灌溉组4">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name13" placeholder="灌溉组5">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name14" placeholder="灌溉组6">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name15" placeholder="灌溉组7">
</div>
<div class="manage-input w-160">
<input type="text" v-model="name20List.name16" placeholder="灌溉组8">
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<div class="vrcode-btn blue-btn w-100" @click="changeAddModel3"></div>
<div class="vrcode-btn cancle-btn w-100" @click="changeName = false">取消</div>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -317,9 +387,18 @@ export default {
changeName: false, changeName: false,
nowData: null, nowData: null,
nowData1: null, nowData1: null,
nameList:null, nameList:null,//
name20List:null,//
changeName1:false,//
} }
}, },
// watch:{
// active(){
// setTimeout(() => {
// this.$forceUpdate()
// }, 10);
// },
// },
mounted() { this.dataInit() }, mounted() { this.dataInit() },
methods: { methods: {
dataInit() { dataInit() {
@ -379,6 +458,43 @@ export default {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}) })
},
openModelName1(item,index){
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
var data={deviceId:item.deviceId}
this.api.getFi_getName(data).then(res=>{
this.loading.close()
if (res.data.code == 200) {
this.name20List=res.data.data
this.changeName1=true
} else {
this.$message.error(res.data.msg);
}
})
},
changeAddModel3(){
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
var data = this.name20List
this.api.getFi_updateName(data).then(res=>{
this.loading.close()
if (res.data.code == 200) {
this.$message.success(res.data.msg);
this.changeName1 = false
} else {
this.$message.error(res.data.msg);
this.changeName1 = false
}
})
}, },
changeAddModel1() { changeAddModel1() {
this.loading = this.$loading({ this.loading = this.$loading({

View File

@ -182,6 +182,8 @@ export default {
return 1 return 1
} else if(e == '气象站'){ } else if(e == '气象站'){
return 30 return 30
} else if(e == '智能灌溉控制器'){
return 20
} }
}, },
handleCommand1(e) { handleCommand1(e) {

View File

@ -296,6 +296,8 @@ export default {
return '施肥机' return '施肥机'
} else if (e == '30') { } else if (e == '30') {
return '气象站' return '气象站'
} else if (e == '20') {
return '智能灌溉控制器'
} else { } else {
return '' return ''
} }
@ -387,6 +389,8 @@ export default {
return 1 return 1
} else if(e == '气象站'){ } else if(e == '气象站'){
return 30 return 30
}else if(e == '智能灌溉控制器'){
return 20
} }
}, },
handleCommand1(e) { handleCommand1(e) {

View File

@ -40,7 +40,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="1000L水与肥料的倍数"> <el-table-column label="水与肥料的倍数">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="input-main-80"> <div class="input-main-80">
<input @blur="blurChange(store.formulaNum[indexs - 1] + 5 + scope.$index, $event)" <input @blur="blurChange(store.formulaNum[indexs - 1] + 5 + scope.$index, $event)"

View File

@ -18,9 +18,12 @@
</div> </div>
</div> </div>
<div class="flex-view border-none shrink-none padding-none" v-for="item,index in 40" :key="index"> <div class="flex-view border-none shrink-none padding-none" v-for="item,index in 40" :key="index">
<div class="input-sel input-sel-w180"> <div class=" input-main-80">
<span>{{index+1}}#灌溉组土壤温度传感器选择</span> <span>{{index+1}}#灌溉组土壤温度传感器选择</span>
<el-dropdown @command="handleCommand($event,10080+index)"> <input @blur="blurChange(10080+index, $event)" v-model="inputData[10080+index]" @input="change(10080+index, $event)"
type="text" placeholder="0">
<span>#土壤温度</span>
<!-- <el-dropdown @command="handleCommand($event,10080+index)">
<div class="el-dropdown-link"> <div class="el-dropdown-link">
<input v-model="inputDataNew[10080+index]" type="text" class="input-input" placeholder="无"> <input v-model="inputDataNew[10080+index]" type="text" class="input-input" placeholder="无">
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div> <div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
@ -29,11 +32,14 @@
<el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{ <el-dropdown-item v-for="item, index in typeList1" :key="index" :command="item.value">{{
item.label }}</el-dropdown-item> item.label }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown> -->
</div> </div>
<div class="input-sel input-sel-w180"> <div class=" input-main-80">
<span>{{index+1}}#灌溉组土壤湿度传感器选择</span> <span>{{index+1}}#灌溉组土壤湿度传感器选择</span>
<el-dropdown @command="handleCommand($event,10040+index)"> <input @blur="blurChange(10040+index, $event)" v-model="inputData[10040+index]" @input="change(10040+index, $event)"
type="text" placeholder="0">
<span>#土壤湿度</span>
<!-- <el-dropdown @command="handleCommand($event,10040+index)">
<div class="el-dropdown-link"> <div class="el-dropdown-link">
<input v-model="inputDataNew[10040+index]" type="text" class="input-input" placeholder="无"> <input v-model="inputDataNew[10040+index]" type="text" class="input-input" placeholder="无">
<div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div> <div class="arrow"><img src="../../assets/image/arrow.png" alt=""></div>
@ -42,7 +48,7 @@
<el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{ <el-dropdown-item v-for="item, index in typeList2" :key="index" :command="item.value">{{
item.label }}</el-dropdown-item> item.label }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown> -->
</div> </div>
</div> </div>
@ -219,12 +225,12 @@ modelConfirm(){
this.inputData =JSON.parse(JSON.stringify(res.data.data)); this.inputData =JSON.parse(JSON.stringify(res.data.data));
this.inputDataNew=JSON.parse(JSON.stringify(res.data.data)) this.inputDataNew=JSON.parse(JSON.stringify(res.data.data))
for (let i = 0; i < 40; i++) { // for (let i = 0; i < 40; i++) {
this.inputDataNew[10080+i]=this.getData1(this.inputData[10080+i]) // this.inputDataNew[10080+i]=this.getData1(this.inputData[10080+i])
this.inputDataNew[10040+i]=this.getData2(this.inputData[10040+i]) // this.inputDataNew[10040+i]=this.getData2(this.inputData[10040+i])
} // }
// this.list1.forEach((el,index)=>{ // this.list1.forEach((el,index)=>{
// this.inputDataNew[el]=this.getData1(this.inputData[el]) // this.inputDataNew[el]=this.getData1(this.inputData[el])
// }) // })

View File

@ -2,7 +2,7 @@
<div class="irrigateSet"> <div class="irrigateSet">
<div class="table-title"> <div class="table-title">
<img src="../../assets/image/irrigateSet.png" alt="" /> <img src="../../assets/image/irrigateSet.png" alt="" />
{{ this.indexs }}#智能灌溉组 {{ pageName }}
<!-- <div class="tips"></div> --> <!-- <div class="tips"></div> -->
</div> </div>
<div class="flex-view"> <div class="flex-view">
@ -602,6 +602,7 @@ export default {
data53: "", data53: "",
inputData: {}, inputData: {},
loading: null, loading: null,
pageName:'',
}; };
}, },
watch: { watch: {
@ -620,6 +621,7 @@ export default {
$route(newVal, oldVal) { $route(newVal, oldVal) {
const that = this; const that = this;
this.indexs = this.$route.query.id ? this.$route.query.id : 1; this.indexs = this.$route.query.id ? this.$route.query.id : 1;
this.pageName=this.$route.query.name?this.$route.query.name:(this.indexs+'#智能灌溉组')
this.loading = this.$loading({ this.loading = this.$loading({
lock: true, lock: true,
text: '加载中', text: '加载中',
@ -634,6 +636,9 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
this.indexs = this.$route.query.id ? this.$route.query.id : 1; 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.loading = this.$loading({ this.loading = this.$loading({
lock: true, lock: true,
text: '加载中', text: '加载中',

View File

@ -5,7 +5,7 @@
$store.state.equipmentList[$store.state.equipmentIndex - 1].deviceTypeName }}状态显示 $store.state.equipmentList[$store.state.equipmentIndex - 1].deviceTypeName }}状态显示
</div> </div>
<div class="flex-view"> <div class="flex-view">
<div class="input-main input-main-w120"> <div class="input-main-80">
<template v-for="item, index in dataInfo2_list"> <template v-for="item, index in dataInfo2_list">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
<input v-model="item.timer" type="text" value="60" disabled placeholder="60" /> <input v-model="item.timer" type="text" value="60" disabled placeholder="60" />