|
|
@ -189,18 +189,16 @@ |
|
|
<script> |
|
|
<script> |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
|
|
|
|
|
|
import {debounce, throttle} from "../../../utils/common"; |
|
|
|
|
|
import { |
|
|
|
|
|
|
|
|
import {debounce, throttle} from '../../../utils/common' |
|
|
|
|
|
import { |
|
|
getUnSelectedSiteData, |
|
|
getUnSelectedSiteData, |
|
|
getAccessSiteData, |
|
|
getAccessSiteData, |
|
|
addAccessSite, |
|
|
addAccessSite, |
|
|
deleteAccessSite, |
|
|
|
|
|
} from "@/api/base/site.js" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteAccessSite |
|
|
|
|
|
} from '@/api/base/site.js' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
|
|
|
|
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
showButton: true, |
|
|
showButton: true, |
|
|
height: 200, |
|
|
height: 200, |
|
|
@ -209,67 +207,67 @@ |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
transferData: [], |
|
|
transferData: [], |
|
|
checked: [], |
|
|
checked: [], |
|
|
//设置 |
|
|
|
|
|
|
|
|
// 设置 |
|
|
setUp: { |
|
|
setUp: { |
|
|
reviewFlag: false, |
|
|
reviewFlag: false, |
|
|
saveButton: false, |
|
|
|
|
|
|
|
|
saveButton: false |
|
|
}, |
|
|
}, |
|
|
dataForm: { |
|
|
dataForm: { |
|
|
userName: '', |
|
|
userName: '', |
|
|
userDisplay: '', |
|
|
|
|
|
|
|
|
userDisplay: '' |
|
|
}, |
|
|
}, |
|
|
columnList: [ |
|
|
columnList: [ |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
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', |
|
|
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, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnWidth: 70, |
|
|
columnWidth: 70, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
|
|
|
|
|
|
fixed: '' |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
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', |
|
|
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, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
columnWidth: 20, |
|
|
columnWidth: 20, |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
|
|
|
|
|
|
fixed: '' |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
userId: this.$store.state.user.name, |
|
|
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', |
|
|
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, |
|
|
columnHidden: true, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
columnWidth: 10, |
|
|
columnWidth: 10, |
|
|
sortLv: 0, |
|
|
sortLv: 0, |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
fixed: '' |
|
|
|
|
|
} |
|
|
], |
|
|
], |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
workCenterVisible: false, |
|
|
workCenterVisible: false, |
|
|
@ -283,109 +281,108 @@ |
|
|
dataListSelections: [], |
|
|
dataListSelections: [], |
|
|
addOrUpdateVisible: false, |
|
|
addOrUpdateVisible: false, |
|
|
accessSiteFlag: false, |
|
|
accessSiteFlag: false, |
|
|
SiteList1:[], |
|
|
|
|
|
SiteList2:[], |
|
|
|
|
|
SiteRow1:null, |
|
|
|
|
|
SiteRow2:null, |
|
|
|
|
|
userData:{ |
|
|
|
|
|
username:'', |
|
|
|
|
|
userDisplay:'', |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
SiteList1: [], |
|
|
|
|
|
SiteList2: [], |
|
|
|
|
|
SiteRow1: null, |
|
|
|
|
|
SiteRow2: null, |
|
|
|
|
|
userData: { |
|
|
|
|
|
username: '', |
|
|
|
|
|
userDisplay: '' |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
AddOrUpdate |
|
|
AddOrUpdate |
|
|
}, |
|
|
}, |
|
|
activated() { |
|
|
|
|
|
|
|
|
activated () { |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
|
|
|
|
|
|
mounted () { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.height = window.innerHeight - 220; |
|
|
|
|
|
|
|
|
this.height = window.innerHeight - 220 |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
accessSiteModal(row){ |
|
|
|
|
|
let inData={ |
|
|
|
|
|
username:row.username |
|
|
|
|
|
|
|
|
accessSiteModal (row) { |
|
|
|
|
|
let inData = { |
|
|
|
|
|
username: row.username |
|
|
} |
|
|
} |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
this.SiteList1 = data.rows; |
|
|
|
|
|
|
|
|
this.SiteList1 = data.rows |
|
|
}) |
|
|
}) |
|
|
getAccessSiteData(inData).then(({data}) => { |
|
|
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)); |
|
|
|
|
|
|
|
|
clickSite1 (row) { |
|
|
|
|
|
this.SiteRow1 = JSON.parse(JSON.stringify(row)) |
|
|
}, |
|
|
}, |
|
|
clickSite2(row){ |
|
|
|
|
|
this.SiteRow2 = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
|
|
|
clickSite2 (row) { |
|
|
|
|
|
this.SiteRow2 = JSON.parse(JSON.stringify(row)) |
|
|
}, |
|
|
}, |
|
|
addSite(){ |
|
|
|
|
|
if(this.SiteRow1==null){ |
|
|
|
|
|
this.$alert("请选择可选工厂!", '错误', { |
|
|
|
|
|
|
|
|
addSite () { |
|
|
|
|
|
if (this.SiteRow1 == null) { |
|
|
|
|
|
this.$alert('请选择可选工厂!', '错误', { |
|
|
confirmButtonText: '确定' |
|
|
confirmButtonText: '确定' |
|
|
}) |
|
|
}) |
|
|
return false; |
|
|
|
|
|
|
|
|
return false |
|
|
} |
|
|
} |
|
|
let inSiteData={ |
|
|
|
|
|
site:this.SiteRow1.siteID, |
|
|
|
|
|
userID:this.userData.username, |
|
|
|
|
|
|
|
|
let inSiteData = { |
|
|
|
|
|
site: this.SiteRow1.siteID, |
|
|
|
|
|
userID: this.userData.username |
|
|
} |
|
|
} |
|
|
addAccessSite(inSiteData).then(({data}) => { |
|
|
addAccessSite(inSiteData).then(({data}) => { |
|
|
let inData={ |
|
|
|
|
|
username:this.userData.username |
|
|
|
|
|
|
|
|
let inData = { |
|
|
|
|
|
username: this.userData.username |
|
|
} |
|
|
} |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
this.SiteList1 = data.rows; |
|
|
|
|
|
|
|
|
this.SiteList1 = data.rows |
|
|
}) |
|
|
}) |
|
|
getAccessSiteData(inData).then(({data}) => { |
|
|
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("请选择已选工厂!", '错误', { |
|
|
|
|
|
|
|
|
deleteSite () { |
|
|
|
|
|
if (this.SiteRow2 == null) { |
|
|
|
|
|
this.$alert('请选择已选工厂!', '错误', { |
|
|
confirmButtonText: '确定' |
|
|
confirmButtonText: '确定' |
|
|
}) |
|
|
}) |
|
|
return false; |
|
|
|
|
|
|
|
|
return false |
|
|
} |
|
|
} |
|
|
let inSiteData={ |
|
|
|
|
|
site:this.SiteRow2.siteID, |
|
|
|
|
|
userID:this.userData.username, |
|
|
|
|
|
|
|
|
let inSiteData = { |
|
|
|
|
|
site: this.SiteRow2.siteID, |
|
|
|
|
|
userID: this.userData.username |
|
|
} |
|
|
} |
|
|
deleteAccessSite(inSiteData).then(({data}) => { |
|
|
deleteAccessSite(inSiteData).then(({data}) => { |
|
|
let inData={ |
|
|
|
|
|
username:this.userData.username |
|
|
|
|
|
|
|
|
let inData = { |
|
|
|
|
|
username: this.userData.username |
|
|
} |
|
|
} |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
getUnSelectedSiteData(inData).then(({data}) => { |
|
|
this.SiteList1 = data.rows; |
|
|
|
|
|
|
|
|
this.SiteList1 = data.rows |
|
|
}) |
|
|
}) |
|
|
getAccessSiteData(inData).then(({data}) => { |
|
|
getAccessSiteData(inData).then(({data}) => { |
|
|
this.SiteList2 = data.rows; |
|
|
|
|
|
|
|
|
this.SiteList2 = data.rows |
|
|
}) |
|
|
}) |
|
|
this.SiteRow2=null; |
|
|
|
|
|
|
|
|
this.SiteRow2 = null |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 选中行 |
|
|
// 选中行 |
|
|
handleCurrentChange(val) { |
|
|
|
|
|
|
|
|
handleCurrentChange (val) { |
|
|
this.selectUser = val |
|
|
this.selectUser = val |
|
|
this.showButton = false |
|
|
this.showButton = false |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 保存用户加工中心 |
|
|
// 保存用户加工中心 |
|
|
saveUserWorkCenter() { |
|
|
|
|
|
|
|
|
saveUserWorkCenter () { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 获取用户已授权的加工中心 |
|
|
// 获取用户已授权的加工中心 |
|
|
searchUserWorkCenterList() { |
|
|
|
|
|
|
|
|
searchUserWorkCenterList () { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -399,7 +396,7 @@ |
|
|
'page': this.pageIndex, |
|
|
'page': this.pageIndex, |
|
|
'limit': this.pageSize, |
|
|
'limit': this.pageSize, |
|
|
'username': this.dataForm.userName, |
|
|
'username': this.dataForm.userName, |
|
|
'userDisplay': this.dataForm.userDisplay, |
|
|
|
|
|
|
|
|
'userDisplay': this.dataForm.userDisplay |
|
|
}) |
|
|
}) |
|
|
}).then(({data}) => { |
|
|
}).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
@ -413,29 +410,29 @@ |
|
|
}) |
|
|
}) |
|
|
}, 1000), |
|
|
}, 1000), |
|
|
// 每页数 |
|
|
// 每页数 |
|
|
sizeChangeHandle(val) { |
|
|
|
|
|
|
|
|
sizeChangeHandle (val) { |
|
|
this.pageSize = val |
|
|
this.pageSize = val |
|
|
this.pageIndex = 1 |
|
|
this.pageIndex = 1 |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
}, |
|
|
}, |
|
|
// 当前页 |
|
|
// 当前页 |
|
|
currentChangeHandle(val) { |
|
|
|
|
|
|
|
|
currentChangeHandle (val) { |
|
|
this.pageIndex = val |
|
|
this.pageIndex = val |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
}, |
|
|
}, |
|
|
// 多选 |
|
|
// 多选 |
|
|
selectionChangeHandle(val) { |
|
|
|
|
|
|
|
|
selectionChangeHandle (val) { |
|
|
this.dataListSelections = val |
|
|
this.dataListSelections = val |
|
|
}, |
|
|
}, |
|
|
// 新增 / 修改 |
|
|
// 新增 / 修改 |
|
|
addOrUpdateHandle(id) { |
|
|
|
|
|
|
|
|
addOrUpdateHandle (id) { |
|
|
this.addOrUpdateVisible = true |
|
|
this.addOrUpdateVisible = true |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.addOrUpdate.init(id) |
|
|
this.$refs.addOrUpdate.init(id) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 删除 |
|
|
// 删除 |
|
|
deleteHandle(id) { |
|
|
|
|
|
|
|
|
deleteHandle (id) { |
|
|
var userIds = id ? [id] : this.dataListSelections.map(item => { |
|
|
var userIds = id ? [id] : this.dataListSelections.map(item => { |
|
|
return item.userId |
|
|
return item.userId |
|
|
}) |
|
|
}) |
|
|
|