Commit 82866b16 authored by co_dengxiongwen's avatar co_dengxiongwen

用户bug调整

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