【modify】使用ESLint格式化代码
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="真实名字">
|
||||
@@ -184,7 +183,6 @@
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
@@ -204,250 +202,250 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RoleAssignment from './modules/RoleAssignment'
|
||||
import UserModal from './modules/UserModal'
|
||||
import PasswordModal from './modules/PasswordModal'
|
||||
import {getAction,getFileAccessHttpUrl} from '@/api/manage';
|
||||
import {frozenBatch,queryall} from '@/api/api'
|
||||
import {JeroListMixin} from '@/mixins/JeroListMixin'
|
||||
import JInput from '@/components/jero/JInput'
|
||||
import UserRecycleBinModal from './modules/UserRecycleBinModal'
|
||||
import JSuperQuery from '@/components/jero/JSuperQuery'
|
||||
import RoleAssignment from './modules/RoleAssignment'
|
||||
import UserModal from './modules/UserModal'
|
||||
import PasswordModal from './modules/PasswordModal'
|
||||
import { getAction, getFileAccessHttpUrl } from '@/api/manage'
|
||||
import { frozenBatch, queryall } from '@/api/api'
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import JInput from '@/components/jero/JInput'
|
||||
import UserRecycleBinModal from './modules/UserRecycleBinModal'
|
||||
import JSuperQuery from '@/components/jero/JSuperQuery'
|
||||
|
||||
export default {
|
||||
name: "UserList",
|
||||
mixins: [JeroListMixin],
|
||||
components: {
|
||||
RoleAssignment,
|
||||
UserModal,
|
||||
PasswordModal,
|
||||
JInput,
|
||||
UserRecycleBinModal,
|
||||
JSuperQuery
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
description: '这是用户管理页面',
|
||||
queryParam: {},
|
||||
recycleBinVisible: false,
|
||||
selectedRowKeys: [],
|
||||
categoryTreeList:[], // 组织机构查询的组织机构树数据
|
||||
rolesList:[], // 角色查询的角色数据
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:60,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
align: "center",
|
||||
width: 120,
|
||||
dataIndex: 'avatar',
|
||||
scopedSlots: {customRender: "avatarslot"}
|
||||
},
|
||||
{
|
||||
title: '用户账号',
|
||||
align: "center",
|
||||
dataIndex: 'username',
|
||||
width: 120,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '用户姓名',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'realname',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: "center",
|
||||
width: 80,
|
||||
dataIndex: 'sex_dictText',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: "center",
|
||||
width: 180,
|
||||
dataIndex: 'orgCodeTxt'
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
align: "center",
|
||||
width: 180,
|
||||
dataIndex: 'roleTxt'
|
||||
},
|
||||
// {
|
||||
// title: '生日',
|
||||
// align: "center",
|
||||
// width: 100,
|
||||
// dataIndex: 'birthday'
|
||||
// },
|
||||
// {
|
||||
// title: '负责部门',
|
||||
// align: "center",
|
||||
// width: 180,
|
||||
// dataIndex: 'departIds_dictText'
|
||||
// },
|
||||
{
|
||||
title: '状态',
|
||||
align: "center",
|
||||
width: 80,
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
export default {
|
||||
name: 'UserList',
|
||||
mixins: [JeroListMixin],
|
||||
components: {
|
||||
RoleAssignment,
|
||||
UserModal,
|
||||
PasswordModal,
|
||||
JInput,
|
||||
UserRecycleBinModal,
|
||||
JSuperQuery
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: '这是用户管理页面',
|
||||
queryParam: {},
|
||||
recycleBinVisible: false,
|
||||
selectedRowKeys: [],
|
||||
categoryTreeList: [], // 组织机构查询的组织机构树数据
|
||||
rolesList: [], // 角色查询的角色数据
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
],
|
||||
superQueryFieldList: [
|
||||
{ type: 'input', value: 'username', text: '用户账号', },
|
||||
{ type: 'input', value: 'realname', text: '用户姓名', },
|
||||
{ type: 'select', value: 'sex', dbType: 'int', text: '性别', dictCode: 'sex' },
|
||||
],
|
||||
url: {
|
||||
syncUser: "/act/process/extActProcess/doSyncUser",
|
||||
list: "/sys/user/page",
|
||||
delete: "/sys/user/delete",
|
||||
deleteBatch: "/sys/user/deleteBatch",
|
||||
exportXlsUrl: "/sys/user/exportXls",
|
||||
importExcelUrl: "sys/user/importExcel",
|
||||
getSysCategoryTree: '/sys/sysDepart/queryTreeList', // 获取组织机构树
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
dataIndex: 'avatar',
|
||||
scopedSlots: { customRender: 'avatarslot' }
|
||||
},
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'username',
|
||||
width: 120,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '用户姓名',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'realname'
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'sex_dictText',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'orgCodeTxt'
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'roleTxt'
|
||||
},
|
||||
// {
|
||||
// title: '生日',
|
||||
// align: "center",
|
||||
// width: 100,
|
||||
// dataIndex: 'birthday'
|
||||
// },
|
||||
// {
|
||||
// title: '负责部门',
|
||||
// align: "center",
|
||||
// width: 180,
|
||||
// dataIndex: 'departIds_dictText'
|
||||
// },
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
align: 'center',
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
superQueryFieldList: [
|
||||
{ type: 'input', value: 'username', text: '用户账号' },
|
||||
{ type: 'input', value: 'realname', text: '用户姓名' },
|
||||
{ type: 'select', value: 'sex', dbType: 'int', text: '性别', dictCode: 'sex' }
|
||||
],
|
||||
url: {
|
||||
syncUser: '/act/process/extActProcess/doSyncUser',
|
||||
list: '/sys/user/page',
|
||||
delete: '/sys/user/delete',
|
||||
deleteBatch: '/sys/user/deleteBatch',
|
||||
exportXlsUrl: '/sys/user/exportXls',
|
||||
importExcelUrl: 'sys/user/importExcel',
|
||||
getSysCategoryTree: '/sys/sysDepart/queryTreeList' // 获取组织机构树
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getSysCategoryTree()
|
||||
this.initRoleList()
|
||||
},
|
||||
methods: {
|
||||
getAvatarView: function (avatar) {
|
||||
return getFileAccessHttpUrl(avatar)
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getSysCategoryTree()
|
||||
this.initRoleList()
|
||||
},
|
||||
methods: {
|
||||
getAvatarView: function (avatar) {
|
||||
return getFileAccessHttpUrl(avatar)
|
||||
},
|
||||
|
||||
batchFrozen: function (status) {
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
this.$message.warning('请选择一条记录!');
|
||||
return false;
|
||||
} else {
|
||||
let ids = "";
|
||||
let that = this;
|
||||
let isAdmin = false;
|
||||
that.selectionRows.forEach(function (row) {
|
||||
if (row.username == 'admin') {
|
||||
isAdmin = true;
|
||||
}
|
||||
});
|
||||
if (isAdmin) {
|
||||
that.$message.warning('管理员账号不允许此操作,请重新选择!');
|
||||
return;
|
||||
}
|
||||
that.selectedRowKeys.forEach(function (val) {
|
||||
ids += val + ",";
|
||||
});
|
||||
that.$confirm({
|
||||
title: "确认操作",
|
||||
content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
|
||||
onOk: function () {
|
||||
frozenBatch({ids: ids, status: status}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleMenuClick(e) {
|
||||
if (e.key == 1) {
|
||||
this.batchDel();
|
||||
} else if (e.key == 2) {
|
||||
this.batchFrozen(2);
|
||||
} else if (e.key == 3) {
|
||||
this.batchFrozen(1);
|
||||
}
|
||||
},
|
||||
handleFrozen: function (id, status, username) {
|
||||
let that = this;
|
||||
if ('admin' == username) {
|
||||
that.$message.warning('管理员账号不允许此操作!');
|
||||
return;
|
||||
}
|
||||
frozenBatch({ids: id, status: status}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleChangePassword(username) {
|
||||
this.$refs.passwordmodal.show(username);
|
||||
},
|
||||
passwordModalOk() {
|
||||
console.log("密码修改完成")
|
||||
},
|
||||
// 获取组织机构树
|
||||
getSysCategoryTree() {
|
||||
getAction(this.url.getSysCategoryTree, {}).then((res) => {
|
||||
if (res.success) {
|
||||
this.categoryTreeList = res.result
|
||||
} else {
|
||||
this.categoryTreeList = []
|
||||
batchFrozen: function (status) {
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
this.$message.warning('请选择一条记录!')
|
||||
return false
|
||||
} else {
|
||||
let ids = ''
|
||||
const that = this
|
||||
let isAdmin = false
|
||||
that.selectionRows.forEach(function (row) {
|
||||
if (row.username == 'admin') {
|
||||
isAdmin = true
|
||||
}
|
||||
})
|
||||
},
|
||||
//初始化角色字典
|
||||
initRoleList(){
|
||||
queryall().then((res)=>{
|
||||
if(res.success){
|
||||
this.rolesList = res.result.map((item,index,arr)=>{
|
||||
let c = {text:item.roleName, value:item.id}
|
||||
return c;
|
||||
if (isAdmin) {
|
||||
that.$message.warning('管理员账号不允许此操作,请重新选择!')
|
||||
return
|
||||
}
|
||||
that.selectedRowKeys.forEach(function (val) {
|
||||
ids += val + ','
|
||||
})
|
||||
that.$confirm({
|
||||
title: '确认操作',
|
||||
content: '是否' + (status == 1 ? '解冻' : '冻结') + '选中账号?',
|
||||
onOk: function () {
|
||||
frozenBatch({ ids: ids, status: status }).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.loadData()
|
||||
that.onClearSelected()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// 角色配置
|
||||
roleAssignment() {
|
||||
if(this.selectedRowKeys.length == 0) {
|
||||
this.$message.warning("请选择至少一条数据")
|
||||
})
|
||||
}
|
||||
},
|
||||
handleMenuClick (e) {
|
||||
if (e.key == 1) {
|
||||
this.batchDel()
|
||||
} else if (e.key == 2) {
|
||||
this.batchFrozen(2)
|
||||
} else if (e.key == 3) {
|
||||
this.batchFrozen(1)
|
||||
}
|
||||
},
|
||||
handleFrozen: function (id, status, username) {
|
||||
const that = this
|
||||
if (username == 'admin') {
|
||||
that.$message.warning('管理员账号不允许此操作!')
|
||||
return
|
||||
}
|
||||
frozenBatch({ ids: id, status: status }).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.loadData()
|
||||
} else {
|
||||
this.$refs.roleAssignmentModal.show();
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
},
|
||||
rolevisibleMethods(val) {
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
})
|
||||
},
|
||||
handleChangePassword (username) {
|
||||
this.$refs.passwordmodal.show(username)
|
||||
},
|
||||
passwordModalOk () {
|
||||
console.log('密码修改完成')
|
||||
},
|
||||
// 获取组织机构树
|
||||
getSysCategoryTree () {
|
||||
getAction(this.url.getSysCategoryTree, {}).then((res) => {
|
||||
if (res.success) {
|
||||
this.categoryTreeList = res.result
|
||||
} else {
|
||||
this.categoryTreeList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化角色字典
|
||||
initRoleList () {
|
||||
queryall().then((res) => {
|
||||
if (res.success) {
|
||||
this.rolesList = res.result.map((item, index, arr) => {
|
||||
const c = { text: item.roleName, value: item.id }
|
||||
return c
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 角色配置
|
||||
roleAssignment () {
|
||||
if (this.selectedRowKeys.length == 0) {
|
||||
this.$message.warning('请选择至少一条数据')
|
||||
} else {
|
||||
this.$refs.roleAssignmentModal.show()
|
||||
}
|
||||
},
|
||||
rolevisibleMethods (val) {
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user