Compare commits

...

5 Commits

Author SHA1 Message Date
xiaomeng e0ce09bf87 Merge pull request 'pc-master' (#64) from pc-master into portal
Reviewed-on: #64
2023-12-07 00:57:05 +00:00
孙萌 d7251628c7 1 2023-12-06 17:36:41 +08:00
孙萌 b59b193b7f 1 2023-12-06 14:57:38 +08:00
孙萌 b49faf0d47 上风口新参数添加/实时数据status添加删除提交 2023-12-06 11:19:40 +08:00
孙萌 04be0ddef6 1 2023-12-06 11:11:01 +08:00
12 changed files with 431 additions and 71 deletions

View File

@ -224,8 +224,18 @@ export default {
getStatePermissionStatus(data){
return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data)
},
//获取当前权限能看到的设备
getPermissionStatus(data){
return sendGetRequest(`/getcontrol/getPermissionStatus`, data)
},
//根据id删除status设备
delPermissionStatus(id1,id2){
return sendPostRequest(`/getcontrol/delPermissionStatus?deviceId=${id1}&permissionid=${id2}`, '')
},
//根据id添加status设备
addPermissionStatus(id1,id2){
return sendPostRequest(`/getcontrol/addStatepermission?deviceId=${id1}&Permissionid=${id2}`, '')
}
};

View File

@ -1016,7 +1016,7 @@
max-height: 50px;
}
.upload .upload-content > div > .no-sel {
.upload .upload-content > div .no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
@ -1858,6 +1858,15 @@
flex-direction: column;
}
.realTime .page-content .status-view .status-view-content .status-noTrue.status-add {
cursor: pointer;
}
.realTime .page-content .status-view .status-view-content .status-noTrue.status-add > img {
width: 40px;
height: 40px;
}
.realTime .page-content .status-view .status-view-content .status-noTrue > img {
width: 40px;
height: 35px;
@ -1948,6 +1957,7 @@
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.wufang .no-sel {
@ -2164,6 +2174,32 @@
margin: 0;
}
.skylight .flex-sel {
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.skylight .no-sel {
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.5) inset;
border: 1px solid rgba(0, 204, 255, 0.7);
border-radius: 50%;
cursor: pointer;
margin-right: 9px;
}
.skylight .sel {
width: 35px;
height: 35px;
margin-right: 9px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
.skylight .input-sel {
margin-right: 20px;
}
@ -2172,12 +2208,8 @@
border: none;
}
.skylight .input-main {
margin-right: 20px;
}
.skylight .input-main > input {
width: 260px;
.skylight .border-bottom {
border-bottom: 1px solid rgba(2, 148, 226, 0.5);
}
.fan .bold-title {
@ -2949,3 +2981,48 @@
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.model-title {
width: 100%;
text-align: center;
font-size: 20px;
font-weight: bold;
padding: 15px 0;
}
.model-sel {
display: flex;
flex-wrap: wrap;
align-items: center;
min-height: 200px;
max-height: 700px;
overflow: auto;
padding: 0 30px;
}
.model-sel > div {
width: 33%;
white-space: nowrap;
flex-shrink: 0;
display: flex;
align-items: center;
}
.model-sel .no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.5) inset;
border: 1px solid rgba(0, 204, 255, 0.7);
border-radius: 50%;
cursor: pointer;
}
.model-sel .sel {
margin-right: 10px;
width: 35px;
height: 35px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}

File diff suppressed because one or more lines are too long

View File

@ -1061,7 +1061,7 @@ margin-top: 20px;
white-space: nowrap;
max-height: 50px;
>.no-sel {
.no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
@ -1956,7 +1956,13 @@ margin-top: 20px;
align-items: center;
justify-content: center;
flex-direction: column;
&.status-add{
cursor: pointer;
>img{
width: 40px;
height: 40px;
}
}
>img {
width: 40px;
height: 35px;
@ -2060,6 +2066,7 @@ margin-top: 20px;
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.no-sel {
width: 35px;
@ -2293,6 +2300,30 @@ margin-top: 20px;
}
.skylight {
.flex-sel{
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.no-sel {
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.50) inset;
border: 1px solid rgba(0, 204, 255, 0.70);
border-radius: 50%;
cursor: pointer;
margin-right: 9px;
}
.sel {
width: 35px;
height: 35px;
margin-right: 9px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
.input-sel {
margin-right: 20px;
@ -2304,12 +2335,13 @@ margin-top: 20px;
.flex-view {
border: none;
}
.border-bottom{
border-bottom: 1px solid rgba(2, 148, 226, 0.5);
}
.input-main {
margin-right: 20px;
>input {
width: 260px;
// width: 260px;
}
}
}
@ -3076,4 +3108,47 @@ color: #FFFFFF;
-webkit-text-fill-color: transparent;
}
}
}
}
.model-title{
width: 100%;
text-align: center;
font-size: 20px;
font-weight: bold;
padding: 15px 0;
}
.model-sel{
display: flex;
flex-wrap: wrap;
align-items: center;
min-height:200px ;
max-height: 700px;
overflow: auto;
padding: 0 30px;
>div{
width: 33%;
white-space: nowrap;
flex-shrink: 0;
display: flex;
align-items: center;
}
.no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.50) inset;
border: 1px solid rgba(0, 204, 255, 0.70);
border-radius: 50%;
cursor: pointer;
}
.sel {
margin-right: 10px;
width: 35px;
height: 35px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -316,7 +316,6 @@ export function realTimeLine(id, data) {
});
}
export function statusCharts(id, data) {
console.log(id,11);
var chartDom = document.getElementById(id);
var myChart = echarts.init(chartDom);
var option;

View File

@ -44,7 +44,7 @@ export default new Vuex.Store({
{ label: '果实直径', value: 23, countType: 0,unit:'mm' },
{ label: '茎秆直径', value: 24, countType: 0,unit:'mm' },
{ label: '流速', value: 25, countType: 2,unit:'m/s' },
{ label: '瞬时流量', value: 26, countType: 2,unit:'m3' },
{ label: '瞬时流量', value: 26, countType: 2,unit:'m³/H' },
{ label: '当日流量', value: 27, countType: 2,unit:'T' },
{ label: '累计流量', value: 28, countType: 0,unit:'T' },
{ label: '无线气象站电池电压', value: 29, countType: 2,unit:'V' },

View File

@ -69,17 +69,9 @@
<div class="status-view" v-for="item, index in statusList" :key="index">
<div class="status-view-top">
<div class="status-view-top-left">{{ item.name }}</div>
<el-popover placement="top" width="140">
<!-- <div class="set-status-blue">进入修改设定值</div> -->
<el-popover placement="top" width="160">
<p class="del-text"><i style="color:red" class="el-popconfirm__icon el-icon-info"></i>确认删除?
</p>
<div style="text-align: right; margin: 0">
<el-button class="el-button el-button--text el-button--mini color-blue">取消</el-button>
<el-button class="el-button el-button--text el-button--mini color-blue">确定</el-button>
</div>
<div class="set-status-red" slot="reference">删除</div>
</el-popover>
<el-popover placement="top" width="140" v-model="item.deltrue">
<div class="set-status-red" @click="delStatus(item, index)">删除</div>
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt="">
</el-popover>
<!-- <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> -->
@ -157,8 +149,9 @@
</div>
<div class="status-true-text">
<div class="status-true-text-left">{{ getNumberStatus(item) }}</div>
<div class="status-true-text-right" v-if="item.type == 6 || item.type == 5 || item.type == 2">{{
item.progress }}%</div>
<div class="status-true-text-right"
v-if="item.type == 6 || item.type == 5 || item.type == 2">{{
item.progress }}%</div>
</div>
</div>
<div v-else class="status-noTrue">
@ -167,8 +160,32 @@
</div>
</div>
</div>
<div class="status-view">
<div class="status-view-top">
<div class="status-view-top-left">添加设备</div>
</div>
<div class="status-view-content">
<div class="status-noTrue status-add" @click="addModel = true">
<img src="../../assets/img/status-add.png" alt="">
<div>点击添加设备</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="请选择要显示的设备" :append-to-body="true" :visible.sync="addModel" width="70%">
<div class="model-title">请选择要显示的设备</div>
<div class="model-sel scroll">
<div v-for="item, index in selDevicestatus" :key="index">
<div @click="selClick(item)" :class="item.select ? 'sel' : 'no-sel'"></div>
{{ item.statePermissions }}
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addModel = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -225,6 +242,8 @@ export default {
allDevicestatus: [],//
nowDevicestatus: [],//
selDevicestatus: [],//
addModel: false,//
}
},
watch: {
@ -296,11 +315,10 @@ export default {
width: divW, // 1920 px
height: divH, // 1080 px
})
console.log(this.player);
},
getNumberStatus(item) {
var index = item.index
if (item.type == 2||item.type == 5||item.type == 6) {
if (item.type == 2 || item.type == 5 || item.type == 6) {
//
if (index == 0) {
return '静止状态'
@ -338,7 +356,7 @@ export default {
} else {
return ''
}
}
}
},
createVideo() {
@ -575,7 +593,7 @@ export default {
}
// console.log(this.controlList);
})
this.getPermissionStatus()
this.getStatus()
this.getStatePermissionStatus()
clearInterval(this.statusInterval) && this.statusInterval
@ -657,6 +675,7 @@ export default {
this.api.getStatePermissionStatus().then(res => {
if (res.data.code == 200) {
this.allDevicestatus = res.data.data
this.getPermissionStatus()
}
})
},
@ -669,9 +688,72 @@ export default {
this.api.getPermissionStatus(TargetValue).then(res => {
if (res.data.code == 200) {
this.nowDevicestatus = res.data.data
var list1 = this.allDevicestatus
var list2 = this.nowDevicestatus
var resultArray = []
// list1
for (const item1 of list1) {
// list2 id
const matchingItem = list2.find(item2 => item2.id === item1.id);
// list1 select
if (matchingItem) {
item1.select = true;
} else {
// select false
item1.select = false;
}
//
resultArray.push(item1);
}
this.selDevicestatus = resultArray
}
})
},
selClick(item) {
var store = this.$store.state
var deviceId = store.equipmentList[this.indexs - 1].deviceId
var statusId = item.id
if (item.select) {
item.select = false
this.$forceUpdate();
this.api.delPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.$message({
message: '修改成功',
type: "success",
});
this.getPermissionStatus()
}
}))
} else {
item.select = true
this.$forceUpdate();
this.api.addPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.$message({
message: '修改成功',
type: "success",
});
this.getPermissionStatus()
}
}))
}
},
//
delStatus(item, index) {
this.statusList[index].deltrue = false
var store = this.$store.state
var deviceId = store.equipmentList[this.indexs - 1].deviceId
var statusId = item.id
this.api.delPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.getPermissionStatus()
}
}))
},
//
getStatus() {
var store = this.$store.state
var TargetValue = {
@ -679,7 +761,7 @@ export default {
}
this.api.getControlGetState(TargetValue).then(res => {
if (res.data.code == 200) {
this.statusList = []
const statusList = []
this.nowDevicestatus.forEach((el, index) => {
if (el.id == 1) {
//
@ -694,38 +776,38 @@ export default {
var openListNew = []
openListNew = num1.split("")
fandata.status = openListNew.reverse()
this.statusList.push(fandata)
statusList.push(fandata)
} else if (el.id == 2 || el.id == 3 || el.id == 4 || el.id == 5) {
//
var statusData = { name: el.name, type: 2, id: el.id, open: res.data.data[(1025 + ((el.id - 2) * 3))], progress: res.data.data[(1027 + ((el.id - 2) * 3))], index: res.data.data[(1026 + ((el.id - 2) * 3))] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 6) {
//
var statusData = { name: el.name, type: 3, id: el.id, open: res.data.data['1000'], progress: 0, index: res.data.data['1001'] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 7) {
//
var statusData = { name: el.name, type: 4, id: el.id, open: res.data.data['1002'], progress: 0, index: res.data.data['1003'] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 8) {
//
var statusData = { name: el.name, type: 5, id: el.id, open: res.data.data['1004'], progress: res.data.data['1006'], index: res.data.data['1005'] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 9) {
//
var statusData = { name: el.name, type: 5, id: el.id, open: res.data.data['1007'], progress: res.data.data['1009'], index: res.data.data['1008'] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 10) {
//
var statusData = { name: el.name, type: 6, id: el.id, open: res.data.data['1010'], progress: res.data.data['1012'], index: res.data.data['1011'] }
this.statusList.push(statusData)
statusList.push(statusData)
} else if (el.id == 11) {
//
var statusData = { name: el.name, type: 7, id: el.id, open: res.data.data['1013'], progress: 0, index: res.data.data['1014'] }
this.statusList.push(statusData)
statusList.push(statusData)
}
})
this.statusList = statusList
this.$forceUpdate();
setTimeout(() => {
this.statusList.forEach((el, index) => {

View File

@ -3,7 +3,7 @@
<div class="table-title">
<img src="../../assets/image/skylight.png" alt=""> 顶卷膜{{ indexs }}
</div>
<div class="flex-view">
<div class="flex-view border-bottom">
<div class="input-btn">
<div class="btn" @click="changeOpen(1)" :class="openIndex == 1 ? 'blue' : 'green'">
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
@ -20,6 +20,43 @@
</div>
</div>
<div class="flex-view border-bottom">
<div class="flex-sel border-right" @click="changeOpenTrue(0)">
<div v-if="openTrue[0] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
大风保护有效
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(1)">
<div v-if="openTrue[1] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
下雨保护
</div>
<div class="flex-sel" @click="changeOpenTrue(2)">
<div v-if="openTrue[2] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
有雨量桶检测
</div>
</div>
<div class="flex-view border-bottom">
<div class="input-main border-right">
<span>风速大于多少</span>
<input @blur="blurChange10('21662', $event)" v-model="inputData['21662']" @input="changeCount10('21662', $event)"
type="text" value="60" placeholder="60" />
<span>m/s,禁止开窗</span>
</div>
<div class="input-main border-right">
<span>大风保护时间</span>
<input @blur="blurChange('21663', $event)" v-model="inputData['21663']" @input="change('21663', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<span>下雨检测时间</span>
<input @blur="blurChange('21664', $event)" v-model="inputData['21664']" @input="change('21664', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
</div>
<div class="flex-view">
<div class="input-sel">
<div class="title">温度选择</div>
@ -80,23 +117,19 @@
<div>全程运行时间</div>
<input @blur="blurChange(21621 + ((indexs - 1) * 11), $event)" v-model="inputData[21621 + ((indexs - 1) * 11)]"
@input="change(21621 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div>
</div>
<div class="flex-view padding-none">
<div class="input-main">
<div>打开通道</div>
<input @blur="blurChange(21622 + ((indexs - 1) * 11), $event)" v-model="inputData[21622 + ((indexs - 1) * 11)]"
@input="change(21622 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div>
</div>
<div class="flex-view padding-none">
<div class="input-main">
<div>关闭通道</div>
<input @blur="blurChange(21623 + ((indexs - 1) * 11), $event)" v-model="inputData[21623 + ((indexs - 1) * 11)]"
@input="change(21623 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div>
</div>
</div>
@ -124,6 +157,8 @@ export default {
{ name: '8#空气温度', value: 10, },],
//
openIndex: 0,
openTrue: [],
}
},
watch: {
@ -134,9 +169,9 @@ export default {
that.getNowData();
}, 0);
},
'$route.query.change'(newVal, oldVal){
'$route.query.change'(newVal, oldVal) {
this.dataInit();
},
},
},
mounted() {
@ -164,6 +199,33 @@ export default {
};
this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum);
},
//
myReverse(arr) {
return [...arr].reverse()
},
changeOpenTrue(index) {
if (this.openTrue[index] == 0) {
this.openTrue[index] = 1
} else {
this.openTrue[index] = 0
}
this.$forceUpdate();
var num = this.myReverse(this.openTrue).join("")
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.changeBtn('21661', dataNum);
},
get21661() {
var num1 = this.inputData['21661']?this.inputData['21661']:0
var num11 = this.padString(num1.toString(2), 3)
var openList1New
openList1New = num11.split("")
this.openTrue = openList1New.reverse()
},
//
handleCommand(index) {
this.TypeSel = this.typeSelList[index].name
@ -229,14 +291,14 @@ export default {
return 0
}
},
// x/10
countData10(data) {
if (data) {
return data / 10
} else {
return 0
}
},
// x/10
countData10(data) {
if (data) {
return data / 10
} else {
return 0
}
},
dataInit() {
var store = this.$store.state
var data = {
@ -247,6 +309,7 @@ export default {
if (res.data.code == 200) {
this.inputData = res.data.data;
this.getNowData()
this.get21661()
this.inputData[21614] = this.countData10(this.inputData[21614])
this.inputData[21615] = this.countData(this.inputData[21615])
this.inputData[21617] = this.countData(this.inputData[21617])

View File

@ -120,7 +120,6 @@ export default {
this.actList2.push(this.actList2New.length-index-1)
}
})
console.log(this.actList2);
},
dataInit() {
this.actList1New = []

View File

@ -48,11 +48,26 @@
</div>
</div>
<div class="flex-view">
<div class="flex-sel border-right" @click="changeOpenTrue()">
<div v-if="!openTrue" class="no-sel"></div>
<div class="flex-sel border-right" @click="changeOpenTrue(0)">
<div v-if="openTrue[0] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
计算的最大开度
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(1)">
<div v-if="openTrue[1] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
大风保护
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(2)">
<div v-if="openTrue[2] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
下雨保护
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(3)">
<div v-if="openTrue[3] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
有雨量桶检测
</div>
<div class="input-main border-right">
<span>最大开度</span>
<span>{{ statusNum }}</span>
@ -64,7 +79,7 @@
type="text" value="60" placeholder="60" />
</div>
</div>
<div class="flex-view border-none">
<div class="flex-view">
<div class="input-main">
<div>上风口的行程时间</div>
<input @blur="blurChange('21538', $event)" v-model="inputData['21538']" @input="change('21538', $event)"
@ -84,6 +99,28 @@
<span></span>
</div>
</div>
<div class="flex-view border-none">
<div class="input-main border-right">
<span>上风口风速大于多少</span>
<input @blur="blurChange10('21562', $event)"
v-model="inputData['21562']"
@input="changeCount10('21562', $event)"
type="text" value="60" placeholder="60" />
<span>m/s,禁止开窗</span>
</div>
<div class="input-main border-right">
<span>大风保护时间</span>
<input @blur="blurChange('21563', $event)" v-model="inputData['21563']" @input="change('21563', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<span>下雨检测时间</span>
<input @blur="blurChange('21564', $event)" v-model="inputData['21564']" @input="change('21564', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
</div>
</div>
</template>
<script>
@ -92,7 +129,7 @@ export default {
return {
openIndex: 1,
inputData: {},
openTrue: false,
openTrue: [],
statusNum:0,
statusInterval:null,
}
@ -109,15 +146,33 @@ export default {
}
},
methods: {
changeOpenTrue() {
this.openTrue = !this.openTrue
//
myReverse(arr) {
return [...arr].reverse()
},
changeOpenTrue(index) {
if (this.openTrue[index] == 0) {
this.openTrue[index] = 1
} else {
this.openTrue[index] = 0
}
this.$forceUpdate();
var num = this.myReverse(this.openTrue).join("")
var dataNum = {
target: {
value: this.openTrue ? 1 : 0,
value: parseInt(num, 2),
},
};
this.changeBtn('21531', dataNum);
},
get21531() {
var num1 = this.inputData['21531']
var num11 = this.padString(num1.toString(2), 4)
var openList1New
openList1New = num11.split("")
this.openTrue = openList1New.reverse()
},
padString(str, length) {
return str.padStart(length, '0');
},
@ -202,7 +257,7 @@ export default {
if(res.data.code==200){
this.inputData = res.data.data
this.openIndex = this.inputData['21530']
this.openTrue = this.inputData['21531']==0?false:true
this.get21531()
this.inputData['21532'] = this.countData(this.inputData['21532'])
this.inputData['21533'] = this.countData10(this.inputData['21533'])
}

View File

@ -41,7 +41,7 @@
</div>
<div class="flex-view border-none">
<div class="input-main">
<span>室内1#平均温度夜间时段</span>
<span>室内1#平均温度夜间时段</span>
<input @blur="blurChangeCount('21524', $event)" v-model="inputData['21524']"
@input="changeCountData('21524', $event)" type="text" value="60" placeholder="60" />
<span>启动</span>