Browse Source

特殊权限 2022-05-28 sxm

master
[li_she] 4 years ago
parent
commit
0515a02565
  1. 108
      src/views/modules/sys/user.vue

108
src/views/modules/sys/user.vue

@ -20,6 +20,7 @@
<el-table
:data="dataList"
border
:height="height"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
highlight-current-row
@ -120,14 +121,13 @@
v-drag
:title="'特殊性权限'"
:visible.sync="specialVisible"
width="600px"
width="820px"
:append-to-body="true">
<el-table
:data="securityList"
border
:height="securityHeight"
v-loading="dataListLoading"
highlight-current-row
@current-change="handleCurrentChange"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
@ -137,23 +137,20 @@
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnHidden">
<el-checkbox v-model="scope.row[item.columnProp] "></el-checkbox>
</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary">确定</el-button>
<el-button type="primary" @click="saveUserSecurity()">确定</el-button>
<el-button @click="specialVisible = false" type="primary">取消</el-button>
</span>
</el-dialog>
@ -191,6 +188,8 @@ export default {
data() {
return {
showButton: true,
height: 200,
securityHeight: 200,
specialVisible: false,
siteVisible: false,
currentData: {},
@ -206,24 +205,62 @@ export default {
dataForm: {
userName: ''
},
columnList: [{
columnList: [
{
userId: this.$store.state.user.name,
serialNumber: 'security'+this.$route.meta.menuId+'securitydesc',
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc',
tableId: this.$route.meta.menuId + 'security',
tableName: "locationTable",
tableName: "securityTable",
columnProp: "securitydesc",
headerAlign: "center",
align: "center",
columnLabel: "",
align: "left",
columnLabel: "参数描述",
columnHidden: false,
columnImage: false,
columnWidth: 70,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc',
tableId: this.$route.meta.menuId + 'security',
tableName: "securityTable",
columnProp: "module",
headerAlign: "center",
align: "left",
columnLabel: "模块",
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 20,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc',
tableId: this.$route.meta.menuId + 'security',
tableName: "securityTable",
columnProp: "itemvalue",
headerAlign: "center",
align: "center",
columnLabel: "参数值",
columnHidden: true,
columnImage: false,
columnSortable: false,
columnWidth: 10,
sortLv: 0,
status: true,
fixed: false,
},],
},
],
dataList: [],
securityList: [],
selectSpecialList: [],
siteList: [],
selectSitList: [],
selectUser: {},
@ -241,11 +278,48 @@ export default {
activated() {
this.getDataList()
},
mounted() {
this.$nextTick(() => {
this.securityHeight = window.innerHeight - 400;
this.height = window.innerHeight - 200;
})
},
methods: {
//
specialAuthorize() {
this.specialVisible = true
this.searchUserSpecialSecurity()
},
//
searchUserSpecialSecurity() {
saveUserSpecialSecurity({userid: this.selectUser.username}).then(({data}) => {
if (data.code === 0) {
getUserSpecialSecurity(this.selectUser.username).then(({data}) => {
if (data.code === 0) {
this.securityList = data.dataList.map(item => {
item.itemvalue = item.itemvalue == 'Y' ? true : false;
return item;
})
}
})
}
})
},
//
saveUserSecurity() {
let securityList = JSON.parse(JSON.stringify(this.securityList)).map(item => {
item.itemvalue = item.itemvalue === true ? 'Y' : 'N';
return item;
})
updateUserSpecialSecurity(securityList).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg)
this.specialVisible = false
}else {
this.$message.success(data.msg)
}
})
},
//
siteAuthorize() {

Loading…
Cancel
Save