Compare commits
No commits in common. "dc8309352d12e52b161fb17feecab445489454a9" and "e6d8fa6d564665f4972ca8889c2ddc02f4856c02" have entirely different histories.
dc8309352d
...
e6d8fa6d56
|
@ -494,11 +494,6 @@ selControlPermissions(data){
|
|||
putpermission(data){
|
||||
return sendPutRequest(`/getcontrol/putpermission`, data)
|
||||
},
|
||||
//根据权限id修改权限显示或者隐藏
|
||||
updatePermissionState(data){
|
||||
return sendPutRequest(`/getcontrol/updatePermissionState`, data)
|
||||
},
|
||||
|
||||
//根据设备ID获取设备控制值
|
||||
selpermission(data){
|
||||
return sendGetRequest(`/getcontrol/selpermission`, data)
|
||||
|
@ -705,10 +700,6 @@ getIccid(data){
|
|||
readControl_setMemo(data){
|
||||
return sendPostRequest(`/readControl/setMemo`, data)
|
||||
},
|
||||
//根据设备id查询控制器权限
|
||||
getcontrol_cpermission(data){
|
||||
return sendPostRequest(`/getcontrol/cpermission?deviceId=${data}`, '')
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -103,9 +103,6 @@ export default {
|
|||
this.routerList = [];
|
||||
this.purview = res.data.data;
|
||||
this.purview.forEach((el, index) => {
|
||||
if(el.state==1){
|
||||
return
|
||||
}
|
||||
if (el.id == 1) {
|
||||
var list = [
|
||||
{ name: "目标温度", list: [], router: "targetTemperature", isRouter: true, index: 1 },
|
||||
|
|
|
@ -63,9 +63,6 @@
|
|||
<div class="table-operate blue" @click="openModel1(scope.row, scope.$index)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="">编辑
|
||||
</div>
|
||||
<div class="table-operate blue" @click="openRoleModel(scope.row.deviceId)">
|
||||
<img src="../../assets/manageImg/table-edit.png" alt="">权限编辑
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
@ -375,21 +372,6 @@
|
|||
<div class="vrcode-btn cancle-btn w-100" @click="changeName = false">取消</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="控制器权限管理" :append-to-body="true" :visible.sync="roleModel" width="70%">
|
||||
<div class="model-title">控制器权限管理</div>
|
||||
<div class="model-sel scroll">
|
||||
<div v-for="item, index in allDevicestatus" :key="index">
|
||||
<div @click="selClick(item)" :class="item.state==0 ? 'sel' : 'no-sel'"></div>
|
||||
{{ item.nickName }}
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!-- <div class="vrcode-btn blue-btn">添加标准控制器</div> -->
|
||||
<div class="vrcode-btn cancle-btn w-100" @click="roleModel = false">确定</div>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -408,10 +390,6 @@ export default {
|
|||
nameList:null,//施肥机名字
|
||||
name20List:null,//智能灌溉名字
|
||||
changeName1:false,//智能灌溉的弹窗
|
||||
|
||||
allDevicestatus:[],
|
||||
roleModel:false,
|
||||
nowDeviceId:'',
|
||||
}
|
||||
},
|
||||
// watch:{
|
||||
|
@ -423,7 +401,6 @@ export default {
|
|||
// },
|
||||
mounted() { this.dataInit() },
|
||||
methods: {
|
||||
|
||||
dataInit() {
|
||||
var user = JSON.parse(localStorage.getItem('userInfo'))
|
||||
this.api.selUserbyid(user.userid).then(res => {
|
||||
|
@ -443,63 +420,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
selClick(item){
|
||||
var data
|
||||
if(item.state==0){
|
||||
data= {
|
||||
"deviceId": this.nowDeviceId,
|
||||
"permission": item.id,
|
||||
"state":1
|
||||
}
|
||||
}else{
|
||||
data= {
|
||||
"deviceId": this.nowDeviceId,
|
||||
"permission": item.id,
|
||||
"state":0
|
||||
}
|
||||
}
|
||||
item.state = data.state
|
||||
this.$forceUpdate();
|
||||
var apiData=JSON.parse(JSON.stringify(data))
|
||||
this.api.updatePermissionState(apiData).then((res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: "success",
|
||||
});
|
||||
// this.getcontrol_cpermission()
|
||||
} else {
|
||||
this.$message({
|
||||
message: res.data.msg,
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}))
|
||||
},
|
||||
openRoleModel(deviceId) {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: '加载中',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.selDevicestatus = []
|
||||
this.nowDeviceId=deviceId
|
||||
|
||||
// 线调取全部权限
|
||||
this.api.getcontrol_cpermission(deviceId).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.allDevicestatus = res.data.data
|
||||
this.roleModel=true
|
||||
this.loading.close()
|
||||
// 再根据deviceId调取单个设备权限 并且查询共同name
|
||||
// this.getcontrol_cpermission()
|
||||
} else {
|
||||
this.loading.close()
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
changeAddModel() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
|
|
Loading…
Reference in New Issue