Compare commits

..

No commits in common. "dc8309352d12e52b161fb17feecab445489454a9" and "e6d8fa6d564665f4972ca8889c2ddc02f4856c02" have entirely different histories.

3 changed files with 1 additions and 92 deletions

View File

@ -494,11 +494,6 @@ selControlPermissions(data){
putpermission(data){ putpermission(data){
return sendPutRequest(`/getcontrol/putpermission`, data) return sendPutRequest(`/getcontrol/putpermission`, data)
}, },
//根据权限id修改权限显示或者隐藏
updatePermissionState(data){
return sendPutRequest(`/getcontrol/updatePermissionState`, data)
},
//根据设备ID获取设备控制值 //根据设备ID获取设备控制值
selpermission(data){ selpermission(data){
return sendGetRequest(`/getcontrol/selpermission`, data) return sendGetRequest(`/getcontrol/selpermission`, data)
@ -705,10 +700,6 @@ getIccid(data){
readControl_setMemo(data){ readControl_setMemo(data){
return sendPostRequest(`/readControl/setMemo`, data) return sendPostRequest(`/readControl/setMemo`, data)
}, },
//根据设备id查询控制器权限
getcontrol_cpermission(data){
return sendPostRequest(`/getcontrol/cpermission?deviceId=${data}`, '')
},

View File

@ -103,9 +103,6 @@ export default {
this.routerList = []; this.routerList = [];
this.purview = res.data.data; this.purview = res.data.data;
this.purview.forEach((el, index) => { this.purview.forEach((el, index) => {
if(el.state==1){
return
}
if (el.id == 1) { if (el.id == 1) {
var list = [ var list = [
{ name: "目标温度", list: [], router: "targetTemperature", isRouter: true, index: 1 }, { name: "目标温度", list: [], router: "targetTemperature", isRouter: true, index: 1 },

View File

@ -63,9 +63,6 @@
<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 blue" @click="openRoleModel(scope.row.deviceId)">
<img src="../../assets/manageImg/table-edit.png" alt="">权限编辑
</div>
</div> </div>
</template> </template>
@ -375,21 +372,6 @@
<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 :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> </div>
</template> </template>
<script> <script>
@ -408,10 +390,6 @@ export default {
nameList:null,// nameList:null,//
name20List:null,// name20List:null,//
changeName1:false,// changeName1:false,//
allDevicestatus:[],
roleModel:false,
nowDeviceId:'',
} }
}, },
// watch:{ // watch:{
@ -423,7 +401,6 @@ export default {
// }, // },
mounted() { this.dataInit() }, mounted() { this.dataInit() },
methods: { methods: {
dataInit() { dataInit() {
var user = JSON.parse(localStorage.getItem('userInfo')) var user = JSON.parse(localStorage.getItem('userInfo'))
this.api.selUserbyid(user.userid).then(res => { 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() { changeAddModel() {
this.loading = this.$loading({ this.loading = this.$loading({
lock: true, lock: true,