From 145bb01fdd2ff47ff5a16d17ed6b48fc9472f2a0 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Thu, 17 Oct 2024 22:25:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E9=9D=9E=E8=B6=85?= =?UTF-8?q?=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98=E7=9A=84=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user/user.js | 7 ++ src/views/login/index.vue | 4 +- src/views/system/user/index.vue | 130 ++++++++++++++++++++++++++++---- 3 files changed, 125 insertions(+), 16 deletions(-) diff --git a/src/api/user/user.js b/src/api/user/user.js index 79bf1bb..c7fd25f 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -44,6 +44,13 @@ export const getJobOpt = () => { }) } +export const getMosrUserList = (params) => { + return request({ + url: '/admin/mosr/user', + method: 'get', + params + }) +} export const getUserList = (params) => { return request({ url: '/admin/user', diff --git a/src/views/login/index.vue b/src/views/login/index.vue index bb88587..e442e96 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -43,8 +43,8 @@ import {User, Lock, Key} from '@element-plus/icons-vue' const router = useRouter() const authStore = useAuthStore() const loginForm = reactive({ - username: '', - password: '', + username: 'superAdmin', + password: '123456', code: '', uuid: '' }) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index ac7c74e..bc558de 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -1,6 +1,62 @@ @@ -9,9 +65,10 @@ import Tag from '@/components/Tag.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue' import UserPicker from "@/views/workflow/process/common/UserPicker.vue"; 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 Paging from "@/components/pagination/index.vue"; const authStore = useAuthStore() const router = useRouter() @@ -79,8 +136,15 @@ const searchConfig = ref([ } }, ]) - +//页面信息 +const pageInfo = reactive({ + pageNum: 1, + pageSize: 10 +}); +const list = ref([]); const tableIns = ref() +const total = ref() +const loading = ref(false) const currentId = ref('') const userList = ref([]) const userPicker = ref() @@ -190,6 +254,47 @@ const tableConfig = reactive({ {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) => { router.push({ name: 'AgentSetting', @@ -202,22 +307,19 @@ const init = async () => { // console.log(authStore.roles,'userinfo'); if (!authStore.roles.includes('superAdmin')) { 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() searchConfig.value.find(item => item.prop == 'departmentId').props.data = data - const res = await getSubCompOpt() - searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data - // console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value) + // searchConfig.value = searchConfig.value + // const res = await getSubCompOpt() + // searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data } init() -const search = (val) => { - tableConfig.params = {...val} - tableIns.value.refresh() -} - const handleAdd = () => { router.push({ name: 'Useradd', @@ -299,7 +401,7 @@ const headBtnClick = (key) => { :deep(.el-table__header) { .is-leaf:first-child { .cell { - margin-left: -25px !important; + margin-left: -20px !important; } } } @@ -307,7 +409,7 @@ const headBtnClick = (key) => { :deep(.el-table__body) { .el-table__cell:first-child { .cell { - margin-left: -13px !important; + margin-left: -10px !important; } } }