fix : 修复非超级管理员的名称搜索问题
This commit is contained in:
@@ -44,6 +44,13 @@ export const getJobOpt = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getMosrUserList = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/mosr/user',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
export const getUserList = (params) => {
|
export const getUserList = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/admin/user',
|
url: '/admin/user',
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ import {User, Lock, Key} from '@element-plus/icons-vue'
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const loginForm = reactive({
|
const loginForm = reactive({
|
||||||
username: '',
|
username: 'superAdmin',
|
||||||
password: '',
|
password: '123456',
|
||||||
code: '',
|
code: '',
|
||||||
uuid: ''
|
uuid: ''
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,62 @@
|
|||||||
<template>
|
<template>
|
||||||
<fvSearchForm ref="form" :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
|
<fvSearchForm ref="form" :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
|
||||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
<!-- <fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>-->
|
||||||
|
<div class="table-header-btn">
|
||||||
|
<el-button color="#DED0B2" @click="handleAdd" v-perm="['admin:user:add']" >新增</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="fv-table">
|
||||||
|
<el-table
|
||||||
|
:data="list"
|
||||||
|
row-key="userId"
|
||||||
|
:lazy="true"
|
||||||
|
v-loading="loading"
|
||||||
|
v-tabh
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" type="index" align="center" width="80">
|
||||||
|
<template #default="scope">
|
||||||
|
{{(pageInfo.pageNum - 1) * pageInfo.pageSize + scope.$index + 1}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column prop="userId" label="用户编号" align="center"/>-->
|
||||||
|
<el-table-column prop="userName" label="用户账号" align="center"/>
|
||||||
|
<el-table-column prop="nickName" label="用户名称" align="center"/>
|
||||||
|
<el-table-column prop="subCompanyName" label="公司名称" align="center"/>
|
||||||
|
<el-table-column prop="jobActivityDesc" label="岗位名称" align="center"/>
|
||||||
|
<el-table-column prop="departmentName" label="部门" align="center"/>
|
||||||
|
<el-table-column prop="mobile" label="手机号码" align="center"/>
|
||||||
|
<el-table-column prop="accountType" label="主子账号" align="center" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<Tag dictType="account_type" :value="scope.row.accountType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="state" label="状态" align="center" width="80">
|
||||||
|
<template #default="scope">
|
||||||
|
<tag dict-type="normal_disable" :value="scope.row.state"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="创建时间" align="center" width="180px"/>
|
||||||
|
<el-table-column label="操作" align="center" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" v-perm="auths.edit"
|
||||||
|
@click="handleEdit(scope.row)" link>编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" v-perm="auths.agentSetting"
|
||||||
|
@click="handleAgentSetting(scope.row)" link>设置代理
|
||||||
|
</el-button>
|
||||||
|
<el-button type="danger" v-if="scope.row.userType != 0" v-perm="auths.del"
|
||||||
|
@click="handleDel(scope.row)" link>删除
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" v-if="scope.row.accountType == 0" v-perm="auths.bindUser"
|
||||||
|
@click="handleBindAccount(scope.row)" link>绑定账号
|
||||||
|
</el-button>
|
||||||
|
<!-- <popover-delete :name="scope.row.userName" :type="'用户'"-->
|
||||||
|
<!-- @delete="handleDelete(scope.row.userId)"/>-->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
|
||||||
|
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
|
||||||
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
|
<user-picker :multiple="true" ref="userPicker" title="请选择研发人员" v-model:value="userList" @ok="selected"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,9 +65,10 @@ import Tag from '@/components/Tag.vue'
|
|||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||||
import {useAuthStore} from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
import {getDeptOpt, getSubCompOpt, bindAccount, getBindAccount} from '@/api/user/user.js';
|
import {getDeptOpt, getSubCompOpt, bindAccount, getBindAccount,getMosrUserList} from '@/api/user/user.js';
|
||||||
import {ElMessageBox, ElNotification} from 'element-plus';
|
import {ElMessageBox, ElNotification} from 'element-plus';
|
||||||
|
|
||||||
|
import Paging from "@/components/pagination/index.vue";
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@@ -79,8 +136,15 @@ const searchConfig = ref([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
//页面信息
|
||||||
|
const pageInfo = reactive({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
});
|
||||||
|
const list = ref([]);
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
|
const total = ref()
|
||||||
|
const loading = ref(false)
|
||||||
const currentId = ref('')
|
const currentId = ref('')
|
||||||
const userList = ref([])
|
const userList = ref([])
|
||||||
const userPicker = ref()
|
const userPicker = ref()
|
||||||
@@ -190,6 +254,47 @@ const tableConfig = reactive({
|
|||||||
{name: '新增', color: "#DED0B2", auth: ['admin:user:add'], key: 'add'}
|
{name: '新增', color: "#DED0B2", auth: ['admin:user:add'], key: 'add'}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const search = (val) => {
|
||||||
|
tableConfig.params = {...val}
|
||||||
|
// tableIns.value.refresh()
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
//切换每页显示条数
|
||||||
|
const handleSizeChange = (val) => {
|
||||||
|
pageInfo.pageSize = val;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
//点击页码进行分页功能
|
||||||
|
const handleCurrentChange = (val) => {
|
||||||
|
pageInfo.pageNum = val;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
//获取用户数据
|
||||||
|
const getList = async () => {
|
||||||
|
let params = {
|
||||||
|
...tableConfig.params,
|
||||||
|
...pageInfo
|
||||||
|
};
|
||||||
|
loading.value = true
|
||||||
|
getMosrUserList(params).then(res => {
|
||||||
|
|
||||||
|
if (res.code === 1000) {
|
||||||
|
list.value = res.data.rows;
|
||||||
|
total.value = res.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}else{
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
getList()
|
||||||
const handleAgentSetting = (row) => {
|
const handleAgentSetting = (row) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'AgentSetting',
|
name: 'AgentSetting',
|
||||||
@@ -202,22 +307,19 @@ const init = async () => {
|
|||||||
// console.log(authStore.roles,'userinfo');
|
// console.log(authStore.roles,'userinfo');
|
||||||
if (!authStore.roles.includes('superAdmin')) {
|
if (!authStore.roles.includes('superAdmin')) {
|
||||||
searchConfig.value = searchConfig.value.slice(1)
|
searchConfig.value = searchConfig.value.slice(1)
|
||||||
|
}else{
|
||||||
|
const res = await getSubCompOpt()
|
||||||
|
searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data
|
||||||
}
|
}
|
||||||
searchConfig.value = searchConfig.value
|
|
||||||
const {data} = await getDeptOpt()
|
const {data} = await getDeptOpt()
|
||||||
searchConfig.value.find(item => item.prop == 'departmentId').props.data = data
|
searchConfig.value.find(item => item.prop == 'departmentId').props.data = data
|
||||||
const res = await getSubCompOpt()
|
// searchConfig.value = searchConfig.value
|
||||||
searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data
|
// const res = await getSubCompOpt()
|
||||||
// console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value)
|
// searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|
||||||
const search = (val) => {
|
|
||||||
tableConfig.params = {...val}
|
|
||||||
tableIns.value.refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Useradd',
|
name: 'Useradd',
|
||||||
@@ -299,7 +401,7 @@ const headBtnClick = (key) => {
|
|||||||
:deep(.el-table__header) {
|
:deep(.el-table__header) {
|
||||||
.is-leaf:first-child {
|
.is-leaf:first-child {
|
||||||
.cell {
|
.cell {
|
||||||
margin-left: -25px !important;
|
margin-left: -20px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -307,7 +409,7 @@ const headBtnClick = (key) => {
|
|||||||
:deep(.el-table__body) {
|
:deep(.el-table__body) {
|
||||||
.el-table__cell:first-child {
|
.el-table__cell:first-child {
|
||||||
.cell {
|
.cell {
|
||||||
margin-left: -13px !important;
|
margin-left: -10px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user