pull/64/head
孙萌 2023-12-06 11:11:01 +08:00
parent efdaa5ec80
commit 04be0ddef6
8 changed files with 227 additions and 34 deletions

View File

@ -224,8 +224,18 @@ export default {
getStatePermissionStatus(data){ getStatePermissionStatus(data){
return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data) return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data)
}, },
//获取当前权限能看到的设备
getPermissionStatus(data){ getPermissionStatus(data){
return sendGetRequest(`/getcontrol/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; max-height: 50px;
} }
.upload .upload-content > div > .no-sel { .upload .upload-content > div .no-sel {
margin-right: 10px; margin-right: 10px;
width: 35px; width: 35px;
height: 35px; height: 35px;
@ -1858,6 +1858,15 @@
flex-direction: column; 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 { .realTime .page-content .status-view .status-view-content .status-noTrue > img {
width: 40px; width: 40px;
height: 35px; height: 35px;
@ -2949,3 +2958,48 @@
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -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; white-space: nowrap;
max-height: 50px; max-height: 50px;
>.no-sel { .no-sel {
margin-right: 10px; margin-right: 10px;
width: 35px; width: 35px;
height: 35px; height: 35px;
@ -1956,7 +1956,13 @@ margin-top: 20px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
&.status-add{
cursor: pointer;
>img{
width: 40px;
height: 40px;
}
}
>img { >img {
width: 40px; width: 40px;
height: 35px; height: 35px;
@ -3077,3 +3083,46 @@ color: #FFFFFF;
} }
} }
} }
.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) { export function statusCharts(id, data) {
console.log(id,11);
var chartDom = document.getElementById(id); var chartDom = document.getElementById(id);
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;

View File

@ -69,17 +69,9 @@
<div class="status-view" v-for="item, index in statusList" :key="index"> <div class="status-view" v-for="item, index in statusList" :key="index">
<div class="status-view-top"> <div class="status-view-top">
<div class="status-view-top-left">{{ item.name }}</div> <div class="status-view-top-left">{{ item.name }}</div>
<el-popover placement="top" width="140"> <el-popover placement="top" width="140" v-model="item.deltrue">
<!-- <div class="set-status-blue">进入修改设定值</div> --> <div class="set-status-red" @click="delStatus(item, index)">删除</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>
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt="">
</el-popover> </el-popover>
<!-- <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> --> <!-- <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> -->
@ -157,7 +149,8 @@
</div> </div>
<div class="status-true-text"> <div class="status-true-text">
<div class="status-true-text-left">{{ getNumberStatus(item) }}</div> <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">{{ <div class="status-true-text-right"
v-if="item.type == 6 || item.type == 5 || item.type == 2">{{
item.progress }}%</div> item.progress }}%</div>
</div> </div>
</div> </div>
@ -167,9 +160,33 @@
</div> </div>
</div> </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> </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> </template>
<script> <script>
import EZUIKit from 'ezuikit-js'; import EZUIKit from 'ezuikit-js';
@ -225,6 +242,8 @@ export default {
allDevicestatus: [],// allDevicestatus: [],//
nowDevicestatus: [],// nowDevicestatus: [],//
selDevicestatus: [],//
addModel: false,//
} }
}, },
watch: { watch: {
@ -296,7 +315,6 @@ export default {
width: divW, // 1920 px width: divW, // 1920 px
height: divH, // 1080 px height: divH, // 1080 px
}) })
console.log(this.player);
}, },
getNumberStatus(item) { getNumberStatus(item) {
var index = item.index var index = item.index
@ -575,7 +593,7 @@ export default {
} }
// console.log(this.controlList); // console.log(this.controlList);
}) })
this.getPermissionStatus()
this.getStatus() this.getStatus()
this.getStatePermissionStatus() this.getStatePermissionStatus()
clearInterval(this.statusInterval) && this.statusInterval clearInterval(this.statusInterval) && this.statusInterval
@ -657,6 +675,7 @@ export default {
this.api.getStatePermissionStatus().then(res => { this.api.getStatePermissionStatus().then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.allDevicestatus = res.data.data this.allDevicestatus = res.data.data
this.getPermissionStatus()
} }
}) })
}, },
@ -669,9 +688,72 @@ export default {
this.api.getPermissionStatus(TargetValue).then(res => { this.api.getPermissionStatus(TargetValue).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.nowDevicestatus = res.data.data 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() { getStatus() {
var store = this.$store.state var store = this.$store.state
var TargetValue = { var TargetValue = {
@ -679,7 +761,7 @@ export default {
} }
this.api.getControlGetState(TargetValue).then(res => { this.api.getControlGetState(TargetValue).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.statusList = [] const statusList = []
this.nowDevicestatus.forEach((el, index) => { this.nowDevicestatus.forEach((el, index) => {
if (el.id == 1) { if (el.id == 1) {
// //
@ -694,38 +776,38 @@ export default {
var openListNew = [] var openListNew = []
openListNew = num1.split("") openListNew = num1.split("")
fandata.status = openListNew.reverse() 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) { } 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))] } 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) { } 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'] } 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) { } 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'] } 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) { } 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'] } 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) { } 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'] } 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) { } 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'] } 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) { } 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'] } 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(); this.$forceUpdate();
setTimeout(() => { setTimeout(() => {
this.statusList.forEach((el, index) => { this.statusList.forEach((el, index) => {

View File

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