|
|
@@ -37,35 +37,49 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-table :data="list" size="mini" border>
|
|
|
- <el-table-column label="操作" align="center" fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button size="small" @click="opendatadialog(2,scope.row,scope.$index);" type="text" icon="el-icon-edit"
|
|
|
- title="编辑"></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deletedata(scope.row)"></el-button>
|
|
|
- <!-- <el-button size="small" type="text" style="margin-left:1px" title="权限" @click="permission(scope.row)"><i class="icon icon-lock"></i></el-button> -->
|
|
|
- <!-- <el-button size="small" type="text" style="margin-left:3px" title="密码重置" @click="resetpwd(scope.row)">
|
|
|
- <i class="icon icon-spinner11"></i>
|
|
|
- </el-button> -->
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="设置角色" @click="roleset(scope.row)">
|
|
|
- <i class="icon icon-users"></i>
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
|
|
|
- <el-table-column prop="Departmentname" align="center" label="部门"></el-table-column>
|
|
|
- <el-table-column prop="Unit" align="center" label="单位"></el-table-column>
|
|
|
- <!-- <el-table-column prop="RealnameRole" align="center" label="角色"></el-table-column> -->
|
|
|
- <el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column v-if="this.appclient != 'lims'" prop="Description" align="center" label="备注"
|
|
|
- show-overflow-tooltip></el-table-column>
|
|
|
- </el-table>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <el-tree highlight-current :expand-on-click-node="true" node-key="id" :data="orgtreelist" :props="orgtreeprops" :default-expanded-keys="userdepartment"
|
|
|
+ @node-click="orgtreeNodeClick" ref="orgmanagetree">
|
|
|
+ </el-tree>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <el-table :data="list" size="mini" border>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="small" @click="opendatadialog(2,scope.row,scope.$index);" type="text" icon="el-icon-edit"
|
|
|
+ title="编辑"></el-button>
|
|
|
+ <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deletedata(scope.row)"></el-button>
|
|
|
+ <!-- <el-button size="small" type="text" style="margin-left:1px" title="权限" @click="permission(scope.row)"><i class="icon icon-lock"></i></el-button> -->
|
|
|
+ <!-- <el-button size="small" type="text" style="margin-left:3px" title="密码重置" @click="resetpwd(scope.row)">
|
|
|
+ <i class="icon icon-spinner11"></i>
|
|
|
+ </el-button> -->
|
|
|
+ <el-button size="small" type="text" style="margin-left:3px" title="设置角色" @click="roleset(scope.row)">
|
|
|
+ <i class="icon icon-users"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
|
|
|
+ <el-table-column prop="Departmentname" align="center" label="部门"></el-table-column>
|
|
|
+ <el-table-column prop="Unit" align="center" label="单位"></el-table-column>
|
|
|
+ <!-- <el-table-column prop="RealnameRole" align="center" label="角色"></el-table-column> -->
|
|
|
+ <el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column v-if="this.appclient != 'lims'" prop="Description" align="center" label="备注"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-card>
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
- </el-pagination>
|
|
|
|
|
|
<el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" width="720px">
|
|
|
<el-form :model="userform" :rules="rulesuser" ref="userform" label-width="100px">
|
|
|
@@ -167,26 +181,27 @@
|
|
|
export default {
|
|
|
name: 'users',
|
|
|
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
var checkusername = (rule, value, callback) => {
|
|
|
if (!value) {
|
|
|
callback(new Error('请输入账号'))
|
|
|
} else {
|
|
|
- if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
|
|
|
+ if (this.appclient === 'lims') { // 大港油田lims系统不用邮箱
|
|
|
callback()
|
|
|
}
|
|
|
- /*let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
|
|
|
+ /* let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
|
|
|
if (!re.test(value)) {
|
|
|
callback(new Error('请输入正确的邮箱地址'))
|
|
|
} else {
|
|
|
callback()
|
|
|
- }*/
|
|
|
+ } */
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ orgnodeId: '',
|
|
|
downloading: '',
|
|
|
- imghost: "",
|
|
|
+ imghost: '',
|
|
|
organdialogVisible: false,
|
|
|
currentItemCount: 0,
|
|
|
currentItemCount2: 0,
|
|
|
@@ -285,11 +300,13 @@
|
|
|
const params = {
|
|
|
_currentPage: this.currentPage,
|
|
|
_size: this.size,
|
|
|
- keyword: this.searchForm.keyword,
|
|
|
- username: this.searchForm.UserName,
|
|
|
- departmentname: this.searchForm.DepartmentName
|
|
|
+ // keyword: this.searchForm.keyword,
|
|
|
+ // username: this.searchForm.UserName,
|
|
|
+ // departmentname: this.searchForm.DepartmentName,
|
|
|
+ orgnodeId: this.orgnodeId
|
|
|
}
|
|
|
Object.assign(params, this.searchForm)
|
|
|
+ console.log(params, 'params')
|
|
|
// request
|
|
|
this.$axios.get('users/list', {
|
|
|
params
|
|
|
@@ -298,6 +315,7 @@
|
|
|
// response
|
|
|
_this.list = res.data.items
|
|
|
_this.currentItemCount = res.data.currentItemCount
|
|
|
+ this.orgnodeId = ''
|
|
|
})
|
|
|
.catch(err => {
|
|
|
// handle error
|
|
|
@@ -357,14 +375,13 @@
|
|
|
let rdx = 0
|
|
|
for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
|
|
|
if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
|
|
|
- flag = true;
|
|
|
- break;
|
|
|
+ flag = true
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
if (!flag) {
|
|
|
_this.mustrolelist.push(parseInt(res.data[i]))
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
let checkedCount = this.selectedrole.length
|
|
|
@@ -376,7 +393,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- rolesave() {
|
|
|
+ rolesave () {
|
|
|
let _this = this
|
|
|
for (let mdx in this.mustrolelist) {
|
|
|
if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
|
|
|
@@ -409,16 +426,16 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- handlecheckedrolechange() {
|
|
|
+ handlecheckedrolechange () {
|
|
|
let checkedCount = this.selectedrole.length
|
|
|
this.roleCheckAll = checkedCount === this.rolelist.length
|
|
|
this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
|
|
|
},
|
|
|
- handleCheckAllChange(val) {
|
|
|
+ handleCheckAllChange (val) {
|
|
|
this.selectedrole = val ? this.rolelistcheckall : []
|
|
|
this.isrolecheckall = false
|
|
|
},
|
|
|
- roleisexist(val) {
|
|
|
+ roleisexist (val) {
|
|
|
for (let i = 0; i < this.rolelist.length; i++) {
|
|
|
if (this.rolelist[i].Id === val) {
|
|
|
return true
|
|
|
@@ -442,32 +459,32 @@
|
|
|
// this.loading = false
|
|
|
// })
|
|
|
// },
|
|
|
- seachdata() {
|
|
|
+ seachdata () {
|
|
|
this.list = []
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
- searchCommand(command) {
|
|
|
- if (command == 'clear') {
|
|
|
+ searchCommand (command) {
|
|
|
+ if (command === 'clear') {
|
|
|
this.clearSearch()
|
|
|
}
|
|
|
},
|
|
|
- handleSizeChange(value) {
|
|
|
+ handleSizeChange (value) {
|
|
|
this.list = []
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
- handleCurrentChange(value) {
|
|
|
+ handleCurrentChange (value) {
|
|
|
this.currentPage = value
|
|
|
this.list = []
|
|
|
this.initData()
|
|
|
},
|
|
|
- jstimehandle(val) {
|
|
|
+ jstimehandle (val) {
|
|
|
val = val.replace('T', ' ')
|
|
|
return val.substring(0, 19)
|
|
|
},
|
|
|
- opendatadialog(item, v, index) {
|
|
|
+ opendatadialog (item, v, index) {
|
|
|
let _this = this
|
|
|
this.operatingitem = item
|
|
|
this.datadialogVisible = true
|
|
|
@@ -510,7 +527,7 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- savedata(formName) {
|
|
|
+ savedata (formName) {
|
|
|
let _this = this
|
|
|
if (this.selectedorg.length === 0) {
|
|
|
_this.$message({
|
|
|
@@ -580,7 +597,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- deletedata(val) {
|
|
|
+ deletedata (val) {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -608,7 +625,7 @@
|
|
|
.catch(() => {})
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- resetForm(formName) {
|
|
|
+ resetForm (formName) {
|
|
|
// this.$refs[formName].resetFields()
|
|
|
},
|
|
|
clearuserForm() {
|
|
|
@@ -620,7 +637,7 @@
|
|
|
description: ''
|
|
|
}
|
|
|
},
|
|
|
- permission(v) {
|
|
|
+ permission (v) {
|
|
|
let _this = this
|
|
|
_this.ischeckbj = true // 过滤字段勾选时触发的选中事件
|
|
|
this.userpermissdevicesselects = []
|
|
|
@@ -640,11 +657,11 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- getorgbyeid(v) {
|
|
|
+ getorgbyeid (v) {
|
|
|
let _this = this
|
|
|
this.$axios.put('equipment/getorgidsbyeqids', {
|
|
|
- EquipmentIds: v
|
|
|
- })
|
|
|
+ EquipmentIds: v
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
setTimeout(function () {
|
|
|
@@ -660,11 +677,11 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- savepermission() {
|
|
|
+ savepermission () {
|
|
|
let _this = this
|
|
|
_this.$axios.put('users/permission/' + this.userform.id, {
|
|
|
- channelids: this.userpermissdevicesselects + ''
|
|
|
- })
|
|
|
+ channelids: this.userpermissdevicesselects + ''
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -682,7 +699,7 @@
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
- resetpwd(val) {
|
|
|
+ resetpwd (val) {
|
|
|
let _this = this
|
|
|
_this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -708,7 +725,7 @@
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
// 选择组织树时触发
|
|
|
- userpermissorgcheckedchange(data, checked, indeterminate) {
|
|
|
+ userpermissorgcheckedchange (data, checked, indeterminate) {
|
|
|
let _this = this
|
|
|
if (!_this.ischeckbj) {
|
|
|
if (!_this.isfristchecked) {
|
|
|
@@ -720,7 +737,7 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- checkorgusermanage() {
|
|
|
+ checkorgusermanage () {
|
|
|
let orgids = []
|
|
|
let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
|
|
|
selectnodes.forEach(row => {
|
|
|
@@ -731,8 +748,8 @@
|
|
|
}
|
|
|
let _this = this
|
|
|
this.$axios.get('equipment/getidsbyoid', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.userpermissdevicesselects = []
|
|
|
@@ -751,6 +768,11 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ orgtreeNodeClick (data) {
|
|
|
+ console.log(data)
|
|
|
+ this.orgnodeId = data.id
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
getorgtreelist() {
|
|
|
let _this = this
|
|
|
// request
|
|
|
@@ -758,8 +780,8 @@
|
|
|
IsInnerOrganize: 1
|
|
|
}
|
|
|
_this.$axios.get('organizes/list', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
|
|
|
})
|
|
|
@@ -768,7 +790,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- clearSearch() {
|
|
|
+ clearSearch () {
|
|
|
this.searchForm.keyword = ''
|
|
|
this.searchForm.UserName = ''
|
|
|
this.list = []
|