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

Reviewed-on: #171
portal
xiaomeng 2024-08-31 00:17:08 +00:00
commit e763bb1eb5
9 changed files with 200 additions and 39 deletions

View File

@ -679,5 +679,13 @@ getIccid(data){
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

@ -4,8 +4,8 @@
<img src="../assets/image/set-icon.png" alt="">设定值参数
</div>
<!-- -->
<div class="set-tips" @click="toHome($store.state.equipmentIndex)">
<div >
<div class="set-tips" @click="toHome($store.state.equipmentIndex)">
<div>
{{ $store.state.equipmentList[$store.state.equipmentIndex - 1].deviceTypeName }}</div>
</div>
<el-collapse v-model="$store.state.activeNames">
@ -18,18 +18,19 @@
<!-- -->
<ul class="table-ul">
<li @click="toRouter(item1)"
:class="routerNow == item1.router && routerIndex == index1 + 1 ? 'active' : ''" class="table-li"
v-for="item1, index1 in item.list" :key="index1">{{
item1.name }} <div class="status" :class="item1.status == 0 ? 'outline' : 'online'"
v-if="item1.status >= 0">{{ item1.status
== 0
? '离线' : '在线' }}</div>
:class="routerNow == item1.router && routerIndex == index1 + 1 ? 'active' : ''"
class="table-li" v-for="item1, index1 in item.list" :key="index1">{{
item1.name }} <div class="status" :class="item1.status == 0 ? 'outline' : 'online'"
v-if="item1.status >= 0">{{
item1.status
== 0
? '离线' : '在线' }}</div>
</li>
</ul>
</el-collapse-item>
<div @click="toRouter(item)" :class="routerNow == item.router ? 'active' : ''" class="no-list" v-else>{{
item.name
}}</div>
item.name
}}</div>
</template>
</el-collapse>
</div>
@ -40,7 +41,7 @@ export default {
return {
routerList: [
// { name: '', list: [], router: 'formula' },
{ name: `${ this.$store.state.equipmentList[this.$store.state.equipmentIndex - 1].deviceTypeName }状态显示`, list: [], router: 'status-soil', isRouter: true, },
{ name: `${this.$store.state.equipmentList[this.$store.state.equipmentIndex - 1].deviceTypeName}状态显示`, list: [], router: 'status-soil', isRouter: true, },
{
name: '灌溉组配置', router: 'irrigateSet-soil', list: [
{ name: '1#灌溉组配置', status: -1, router: 'irrigateSet-soil', index: 1 },
@ -80,8 +81,8 @@ export default {
this.dataInit()
},
methods: {
///
getByid() {
///
getByid() {
var store = this.$store.state
var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,
@ -103,10 +104,28 @@ export default {
// }else{
// 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() {
var store = this.$store.state
// store.nameList.forEach((el, index) => {
// if (index < 8) {
@ -144,7 +163,9 @@ export default {
if (item.http) {
window.location.href = item.http;
} 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) {
// this.$router.push({ path: `/formula?id=${item.index}` })
@ -222,4 +243,3 @@ export default {
}
}
</style>

View File

@ -17,7 +17,7 @@
智能控制器
</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-column label="序号">
<template slot-scope="scope">
@ -29,7 +29,7 @@
</el-table-column>
<el-table-column prop="deviceTypeName" label="设备名称">
</el-table-column>
<el-table-column label="操作" width="260px">
<el-table-column label="操作">
<template slot-scope="scope">
<div class="table-flex">
<div class="table-operate blue" @click="openModel(scope.row, scope.$index)">
@ -45,7 +45,7 @@
</el-table>
</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-column label="序号">
<template slot-scope="scope">
@ -69,7 +69,7 @@
</el-table-column>
</el-table>
</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-column label="序号">
<template slot-scope="scope">
@ -87,6 +87,9 @@
<div class="table-operate blue" @click="openModel1(scope.row, scope.$index)">
<img src="../../assets/manageImg/table-edit.png" alt="">编辑
</div>
<div class="table-operate red" @click="openModelName1(scope.row, scope.$index)">
<img src="../../assets/manageImg/table-edit.png" alt="">修改更多名称
</div>
</div>
</template>
@ -140,7 +143,7 @@
<div class="vrcode-btn cancle-btn w-100" @click="addModel = false">取消</div>
</span>
</el-dialog>
<!-- 施肥机的修改名字 -->
<el-dialog title="提示" top="10vh" :visible.sync="changeName" width="760px" class="vrcode-model manage-model"
:append-to-body="true">
<div class="vrcode-model-title">
@ -251,7 +254,7 @@
<div class="vrcode-btn cancle-btn w-100" @click="changeName = false">取消</div>
</span>
</el-dialog>
<!-- 控制器编辑 -->
<el-dialog title="提示" top="10vh" :visible.sync="addModel1" width="564px" class="vrcode-model manage-model"
:append-to-body="true">
<div class="vrcode-model-title">
@ -302,6 +305,73 @@
<div class="vrcode-btn cancle-btn w-100" @click="addModel1 = false">取消</div>
</span>
</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>
</template>
<script>
@ -317,9 +387,18 @@ export default {
changeName: false,
nowData: null,
nowData1: null,
nameList:null,
nameList:null,//
name20List:null,//
changeName1:false,//
}
},
// watch:{
// active(){
// setTimeout(() => {
// this.$forceUpdate()
// }, 10);
// },
// },
mounted() { this.dataInit() },
methods: {
dataInit() {
@ -379,6 +458,43 @@ export default {
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() {
this.loading = this.$loading({

View File

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

View File

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

View File

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

View File

@ -18,9 +18,12 @@
</div>
</div>
<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>
<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">
<input v-model="inputDataNew[10080+index]" type="text" class="input-input" placeholder="无">
<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">{{
item.label }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown> -->
</div>
<div class="input-sel input-sel-w180">
<div class=" input-main-80">
<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">
<input v-model="inputDataNew[10040+index]" type="text" class="input-input" placeholder="无">
<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">{{
item.label }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown> -->
</div>
</div>
@ -219,12 +225,12 @@ modelConfirm(){
this.inputData =JSON.parse(JSON.stringify(res.data.data));
this.inputDataNew=JSON.parse(JSON.stringify(res.data.data))
for (let i = 0; i < 40; i++) {
this.inputDataNew[10080+i]=this.getData1(this.inputData[10080+i])
this.inputDataNew[10040+i]=this.getData2(this.inputData[10040+i])
// for (let i = 0; i < 40; i++) {
// this.inputDataNew[10080+i]=this.getData1(this.inputData[10080+i])
// this.inputDataNew[10040+i]=this.getData2(this.inputData[10040+i])
}
// }
// this.list1.forEach((el,index)=>{
// this.inputDataNew[el]=this.getData1(this.inputData[el])
// })

View File

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

View File

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