ruanqi 3 years ago
parent
commit
d9f2c8cbdc
  1. 4
      src/api/base/site.js
  2. 97
      src/views/modules/sys/user.vue

4
src/api/base/site.js

@ -9,3 +9,7 @@ export const getSiteData = data => createAPI(`/base/getSiteData`,'post',data)
export const siteSave = data => createAPI(`/base/siteSave`,'post',data)
export const getUnSelectedSiteData=data => createAPI(`/base/getUnSelectedSiteData`, 'post', data);
export const getAccessSiteData=data => createAPI(`/base/getAccessSiteData`, 'post', data);
export const addAccessSite=data => createAPI(`/base/addAccessSite`, 'post', data);
export const deleteAccessSite=data => createAPI(`/base/deleteAccessSite`, 'post', data);

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

@ -189,15 +189,13 @@
<script>
import AddOrUpdate from './user-add-or-update'
import {debounce, throttle} from "../../../utils/common";
import {debounce, throttle} from '../../../utils/common'
import {
getUnSelectedSiteData,
getAccessSiteData,
addAccessSite,
deleteAccessSite,
} from "@/api/base/site.js"
deleteAccessSite
} from '@/api/base/site.js'
export default {
data () {
@ -212,64 +210,64 @@
//
setUp: {
reviewFlag: false,
saveButton: false,
saveButton: false
},
dataForm: {
userName: '',
userDisplay: '',
userDisplay: ''
},
columnList: [
{
userId: this.$store.state.user.name,
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc',
tableId: this.$route.meta.menuId + 'security',
tableName: "securityTable",
columnProp: "securitydesc",
headerAlign: "center",
align: "left",
columnLabel: "参数描述",
tableName: 'securityTable',
columnProp: 'securitydesc',
headerAlign: 'center',
align: 'left',
columnLabel: '参数描述',
columnHidden: false,
columnImage: false,
columnWidth: 70,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
fixed: ''
},
{
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: "模块",
tableName: 'securityTable',
columnProp: 'module',
headerAlign: 'center',
align: 'left',
columnLabel: '模块',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 20,
sortLv: 0,
status: true,
fixed: '',
fixed: ''
},
{
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: "参数值",
tableName: 'securityTable',
columnProp: 'itemvalue',
headerAlign: 'center',
align: 'center',
columnLabel: '参数值',
columnHidden: true,
columnImage: false,
columnSortable: false,
columnWidth: 10,
sortLv: 0,
status: true,
fixed: '',
},
fixed: ''
}
],
dataList: [],
workCenterVisible: false,
@ -289,8 +287,8 @@
SiteRow2: null,
userData: {
username: '',
userDisplay:'',
},
userDisplay: ''
}
}
},
components: {
@ -301,7 +299,7 @@
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 220;
this.height = window.innerHeight - 220
})
},
methods: {
@ -310,68 +308,67 @@
username: row.username
}
getUnSelectedSiteData(inData).then(({data}) => {
this.SiteList1 = data.rows;
this.SiteList1 = data.rows
})
getAccessSiteData(inData).then(({data}) => {
this.SiteList2 = data.rows;
this.SiteList2 = data.rows
})
this.userData.username=row.username;
this.userData.userDisplay=row.userDisplay;
this.accessSiteFlag=true;
this.userData.username = row.username
this.userData.userDisplay = row.userDisplay
this.accessSiteFlag = true
},
clickSite1 (row) {
this.SiteRow1 = JSON.parse(JSON.stringify(row));
this.SiteRow1 = JSON.parse(JSON.stringify(row))
},
clickSite2 (row) {
this.SiteRow2 = JSON.parse(JSON.stringify(row));
this.SiteRow2 = JSON.parse(JSON.stringify(row))
},
addSite () {
if (this.SiteRow1 == null) {
this.$alert("请选择可选工厂!", '错误', {
this.$alert('请选择可选工厂!', '错误', {
confirmButtonText: '确定'
})
return false;
return false
}
let inSiteData = {
site: this.SiteRow1.siteID,
userID:this.userData.username,
userID: this.userData.username
}
addAccessSite(inSiteData).then(({data}) => {
let inData = {
username: this.userData.username
}
getUnSelectedSiteData(inData).then(({data}) => {
this.SiteList1 = data.rows;
this.SiteList1 = data.rows
})
getAccessSiteData(inData).then(({data}) => {
this.SiteList2 = data.rows;
this.SiteList2 = data.rows
})
this.SiteRow1=null;
this.SiteRow1 = null
})
},
deleteSite () {
if (this.SiteRow2 == null) {
this.$alert("请选择已选工厂!", '错误', {
this.$alert('请选择已选工厂!', '错误', {
confirmButtonText: '确定'
})
return false;
return false
}
let inSiteData = {
site: this.SiteRow2.siteID,
userID:this.userData.username,
userID: this.userData.username
}
deleteAccessSite(inSiteData).then(({data}) => {
let inData = {
username: this.userData.username
}
getUnSelectedSiteData(inData).then(({data}) => {
this.SiteList1 = data.rows;
this.SiteList1 = data.rows
})
getAccessSiteData(inData).then(({data}) => {
this.SiteList2 = data.rows;
this.SiteList2 = data.rows
})
this.SiteRow2=null;
this.SiteRow2 = null
})
},
//
@ -399,7 +396,7 @@
'page': this.pageIndex,
'limit': this.pageSize,
'username': this.dataForm.userName,
'userDisplay': this.dataForm.userDisplay,
'userDisplay': this.dataForm.userDisplay
})
}).then(({data}) => {
if (data && data.code === 0) {

Loading…
Cancel
Save