Commit 82866b16 authored by co_dengxiongwen's avatar co_dengxiongwen

用户bug调整

parent 0ccbc64e
......@@ -516,69 +516,69 @@ export default {
})
},
sendMessage(lineId, stationId, code, type) {
setTimeout(() => {
if (!this.$refs.iframe) {
return
}
console.log('type:', type)
if (type == 2) {
//站台
this.$refs.iframe.contentWindow.postMessage(
{
func: 'initPlatform',
data: {
lineId: lineId,
stationId: stationId
}
},
this.src
)
} else if (type == 3) {
//站厅
this.$refs.iframe.contentWindow.postMessage(
{
func: 'initHall',
data: {
lineId: lineId,
stationId: stationId
}
},
this.src
)
} else {
//资源点
this.$refs.iframe.contentWindow.postMessage(
{
func: 'locateByCode',
data: {
lineId: lineId,
stationId: stationId,
code: code
}
},
this.src
)
}
}, 1000)
// setTimeout(() => {
// if (!this.$refs.iframe) {
// return
// }
// console.log('type:', type)
// if (type == 2) {
// //站台
// this.$refs.iframe.contentWindow.postMessage(
// {
// func: 'initPlatform',
// data: {
// lineId: lineId,
// stationId: stationId
// }
// },
// this.src
// )
// } else if (type == 3) {
// //站厅
// this.$refs.iframe.contentWindow.postMessage(
// {
// func: 'initHall',
// data: {
// lineId: lineId,
// stationId: stationId
// }
// },
// this.src
// )
// } else {
// //资源点
// this.$refs.iframe.contentWindow.postMessage(
// {
// func: 'locateByCode',
// data: {
// lineId: lineId,
// stationId: stationId,
// code: code
// }
// },
// this.src
// )
// }
// }, 1000)
},
sendBjMessage(lineId, stationId, code) {
// console.log('********' + code)
setTimeout(() => {
if (!this.$refs.iframe) {
return
}
this.$refs.iframe.contentWindow.postMessage(
{
func: 'alarm',
data: {
lineId: lineId,
stationId: stationId,
code: code
}
},
this.src
)
}, 1000)
// setTimeout(() => {
// if (!this.$refs.iframe) {
// return
// }
// this.$refs.iframe.contentWindow.postMessage(
// {
// func: 'alarm',
// data: {
// lineId: lineId,
// stationId: stationId,
// code: code
// }
// },
// this.src
// )
// }, 1000)
},
// 树节点过滤
filterNode(value, data) {
......@@ -1024,7 +1024,7 @@ export default {
// if (this.transformationSta == 2) {
console.log(1111111111111)
this.sendMessage(node.lineId, node.stationId, node.code)
// this.sendMessage(node.lineId, node.stationId, node.code)
// }
// console.log('资源点列表:', this.list)
......
<template lang='pug'>
<template lang="pug">
el-container(style="padding:0px;height:77.6vh;")
el-header(style='height:42px;line-height:42px;border: 1px solid rgba(195, 195, 195, 1);background: #f4f4f4;')
span.title-bold.title-left-color() 用户管理
......@@ -97,7 +97,7 @@ import dragTable from '../../components/tab'
export default {
name: 'sys-user',
filters: {
ellipsis (value) {
ellipsis(value) {
if (!value) return ''
if (value.length > 20) {
return value.slice(0, 20) + '...'
......@@ -105,7 +105,7 @@ export default {
return value
}
},
data () {
data() {
return {
checkList: [], //筛选数据
tableHeader: [
......@@ -131,7 +131,13 @@ export default {
label: 'name'
},
isCollapse: true,
dataForm: { name: '', username: '', jobNumber: '', gender: '', status: '' },
dataForm: {
name: '',
username: '',
jobNumber: '',
gender: '',
status: ''
},
sysOrgList: [],
dataList: [],
pageIndex: 1,
......@@ -154,16 +160,17 @@ export default {
dragTable
},
watch: {
totalPage() { //注意这个函数的名字必须和你监听data中的属性的名字一样,这样才能当你data中的属性发生变化时,触发这个函数
let pages = Math.ceil(this.totalPage / this.pageSize)//新数据总页数
totalPage() {
//注意这个函数的名字必须和你监听data中的属性的名字一样,这样才能当你data中的属性发生变化时,触发这个函数
let pages = Math.ceil(this.totalPage / this.pageSize) //新数据总页数
//总页数小于当前页数则重新加载列表数据
if (pages < this.pageIndex) {
this.pageIndex = pages || 1
this.getDataList()//获取表格数据的方法
this.pageIndex = pages || 1
this.getDataList() //获取表格数据的方法
}
}
},
created () {
created() {
// this.getList()
this.getDataList()
this.getAllJob()
......@@ -173,7 +180,13 @@ export default {
//重置
reSet() {
this.pageIndex = 1
this.dataForm = { name: '', username: '', jobNumber: '', gender: '', status: '' }
this.dataForm = {
name: '',
username: '',
jobNumber: '',
gender: '',
status: ''
}
this.getDataList()
},
//排序
......@@ -191,26 +204,26 @@ export default {
// this.getDataList()
// },
//修改用户角色
updateUserRole (userId, roles) {
updateUserRole(userId, roles) {
// roleIds :角色ids(多个角色id用逗号隔开)
//updateRoleList(String userId, String roleIds)
},
//查看当前用户角色信息
queryHandle (id) {
queryHandle(id) {
this.queryDetailVisible = true
this.$nextTick(() => {
this.$refs.queryView.init(id)
})
},
//获取职业字典信息
getAllJob () {
getAllJob() {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getAllJobList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
stationId: ''
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.allJob = data.list
} else {
......@@ -219,7 +232,7 @@ export default {
})
},
//配置角色
configHandle (row) {
configHandle(row) {
// console.log('row', row)
this.configRoleVisible = true
this.$nextTick(() => {
......@@ -227,12 +240,12 @@ export default {
})
},
// 重置密码
updatePassword () {
const ids = this.dataListSelections.map(item => {
updatePassword() {
const ids = this.dataListSelections.map((item) => {
return item.user_id
})
let userIds = ''
ids.forEach(item => {
ids.forEach((item) => {
userIds = userIds + item + ','
})
userIds = userIds.substring(0, userIds.length - 1)
......@@ -243,7 +256,7 @@ export default {
params: this.$http.adornParams({
userIds: userIds
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
......@@ -259,14 +272,14 @@ export default {
}
})
},
resetPassword (row) {
resetPassword(row) {
this.resetPasswordVisible = true
this.$nextTick(() => {
this.$refs.resetView.init(row)
})
},
//是否可以点击删除
del_disable (id) {
del_disable(id) {
return localStorage.getItem('userId') === id
},
// handleNodeClick (data) {
......@@ -289,7 +302,7 @@ export default {
// },
// 获取数据列表
getDataList (sort, order) {
getDataList(sort, order) {
// console.log(this.sort, this.order)
this.dataListLoading = true
this.$http({
......@@ -305,9 +318,9 @@ export default {
size: this.pageSize,
sort: sort,
order: order,
stationId: localStorage.getItem('stationId')
stationId: ''
}
}).then(data => {
}).then((data) => {
// console.log('data', data)
if (data && data.code === 0) {
const datas = data.data
......@@ -321,67 +334,72 @@ export default {
})
},
// 每页数
sizeChangeHandle (val) {
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
deleteHandle(id) {
var userIds = id
? [id]
: this.dataListSelections.map(item => {
return item.userId
})
: this.dataListSelections.map((item) => {
return item.userId
})
this.$confirm(`确认删除该用户?`, '删除用户', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/user/delete'),
method: 'post',
data: this.$http.adornData(userIds, false)
}).then(data => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/sys/user/delete'),
method: 'post',
data: this.$http.adornData(userIds, false)
}).then((data) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script>
<style lang='scss'>
.box_main /deep/.el-table .el-table--fit .el-table--striped .el-table--enable-row-hover .el-table--enable-row-transition{
border: 1px solid !important;
<style lang="scss">
.box_main
/deep/.el-table
.el-table--fit
.el-table--striped
.el-table--enable-row-hover
.el-table--enable-row-transition {
border: 1px solid !important;
}
</style>
......@@ -3,9 +3,6 @@ el-dialog( :close-on-click-modal="false", :visible.sync="visible", :append-to-bo
.title-bold(slot="title") {{'详情' }}
el-form( :model="dataForm", :rules="dataRule", ref="dataForm", label-width="100px" )
el-row(:span="24")
el-col(:span="12")
el-form-item(label="所属机构:", prop="orgId")
el-input.mywidth(v-model="dataForm.orgId" readonly)
el-col(:span="12")
el-form-item(label="用户姓名:", prop="name")
el-input.mywidth(v-model="dataForm.name" readonly)
......@@ -100,7 +97,6 @@ export default {
],
dataForm: {
userId: '',
orgId: '',
name: '',
username: '',
password: '',
......@@ -117,7 +113,7 @@ export default {
politicCountenance: '',
gender: 1,
status: 1,
stationId: localStorage.getItem('stationId')
stationId: ''
// byx1:'',
},
dataRule: {}
......@@ -144,13 +140,12 @@ export default {
}).then((data) => {
// console.log(data)
this.dataForm = data.user || {}
this.dataForm.stationId = localStorage.getItem('stationId')
this.allJob.map(item => {
this.allJob.map((item) => {
if (item.id === this.dataForm.job) {
this.dataForm.jobName = item.name
}
})
this.nations.map(item => {
this.nations.map((item) => {
if (item.id.toString() === this.dataForm.nation) {
this.dataForm.nationName = item.name
}
......@@ -160,7 +155,6 @@ export default {
this.show = true
this.dataForm = {
user_id: '',
orgId: '',
name: '',
username: '',
password: '',
......@@ -179,7 +173,7 @@ export default {
politicCountenance: '',
gender: 1,
status: 1,
stationId: localStorage.getItem('stationId')
stationId: ''
// byx1: ''
}
}
......@@ -192,7 +186,7 @@ export default {
//获取民族信息
getNation() {
this.$http({
url: this.$http.adornUrl('/emPerson/getAllNation'),
url: this.$http.adornUrl('/sys/user/getAllNation'),
method: 'get'
}).then((data) => {
// console.log("data", data);
......@@ -207,7 +201,7 @@ export default {
url: this.$http.adornUrl('/sysDictionary/getAllJobList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
stationId: ''
})
}).then((data) => {
if (data && data.code === 0) {
......
......@@ -3,9 +3,6 @@ el-dialog( :close-on-click-modal="false", :visible.sync="visible", :append-to-bo
.title-bold(slot="title") {{ id ? '编辑用户' : '新增用户' }}
el-form( :model="dataForm", :rules="dataRule", ref="dataForm", label-width="100px" )
el-row(:span="24")
el-col(:span="12")
el-form-item(label="所属机构:", prop="orgId")
el-input.mywidth(readonly v-model="dataForm.orgId", placeholder="请填写所属机构", clearable)
el-col(:span="12")
el-form-item(label="用户姓名:", prop="name")
el-input.mywidth(v-model="dataForm.name", placeholder="请填写姓名", clearable)
......@@ -148,7 +145,6 @@ export default {
],
dataForm: {
userId: '',
orgId: '',
name: '',
username: '',
password: '',
......@@ -165,18 +161,10 @@ export default {
politicCountenance: '',
gender: 1,
status: 1,
stationId: localStorage.getItem('stationId')
stationId: ''
// byx1:'',
},
dataRule: {
orgId: [
{
min: 1,
max: 100,
message: '长度在 1 到 100 个字符',
trigger: ['change', 'blur']
}
],
// roleId: [
// { required: true, message: '至少选择一个角色', trigger: 'blur' }],
username: [
......@@ -288,26 +276,24 @@ export default {
}).then((data) => {
// console.log(data)
this.dataForm = data.user || {}
this.dataForm.stationId = localStorage.getItem('stationId')
if (this.allJob) {
let flag = true
this.allJob.forEach(element => {
if (this.dataForm.job === element.id) {
flag = false
return false
}
})
if (flag) {
this.dataForm.job = ''
let flag = true
this.allJob.forEach((element) => {
if (this.dataForm.job === element.id) {
flag = false
return false
}
})
if (flag) {
this.dataForm.job = ''
}
}
})
} else {
this.show = true
this.dataForm = {
user_id: '',
orgId: JSON.parse(localStorage.getItem('sysSystem')).name,
name: '',
username: '',
password: '',
......@@ -324,7 +310,7 @@ export default {
politicCountenance: '',
gender: 1,
status: 1,
stationId: localStorage.getItem('stationId')
stationId: ''
// byx1: ''
}
}
......@@ -384,7 +370,7 @@ export default {
//获取民族信息
getNation() {
this.$http({
url: this.$http.adornUrl('/emPerson/getAllNation'),
url: this.$http.adornUrl('/sys/user/getAllNation'),
method: 'get'
}).then((data) => {
// console.log("data", data);
......@@ -399,7 +385,7 @@ export default {
url: this.$http.adornUrl('/sysDictionary/getAllJobList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
stationId: ''
})
}).then((data) => {
if (data && data.code === 0) {
......@@ -409,22 +395,6 @@ export default {
}
})
},
// 获取所属部门列表
// initOrgTreeList() {
// this.$http({
// url: this.$http.adornUrl('/sysOrg/orgAllList'),
// method: 'GET'
// }).then(data => {
// if (data) {
// this.treeData = data.list
// if (this.dataForm.orgId) {
// this.checkedNode = this.$refs.tree.getNode(this.dataForm.orgId).data
// } else {
// this.checkedNode = this.treeData[0]
// }
// }
// })
// },
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
......@@ -445,10 +415,7 @@ export default {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.clickFlag = true
let sta = localStorage.getItem('stationId')
let submitBean = { ...this.dataForm }
submitBean.stationId = sta
submitBean.orgId = sta
this.$http({
url: this.$http.adornUrl(
`/sys/user/${!submitBean.userId ? 'save' : 'update'}`
......@@ -477,11 +444,15 @@ export default {
},
//取消
cancel() {
this.$confirm('确认取消?', this.dataForm.userId ? '编辑用户' : '新增用户', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
this.$confirm(
'确认取消?',
this.dataForm.userId ? '编辑用户' : '新增用户',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
this.handleClose()
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment