联调
This commit is contained in:
@@ -20,6 +20,21 @@
|
||||
</template>
|
||||
|
||||
<script setup name="RoleEmployee">
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
||||
const props = defineProps({
|
||||
roleId: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.roleId,
|
||||
(newValue) => {
|
||||
getList(newValue)
|
||||
}
|
||||
)
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
@@ -27,15 +42,25 @@ const pageSize = ref(20)
|
||||
const currentPage = ref(1)
|
||||
|
||||
const columns = ref([
|
||||
{ prop: 'userName', label: '姓名' },
|
||||
{ prop: '', label: '手机号' },
|
||||
{ prop: '', label: '部门' },
|
||||
{ prop: '', label: '角色', width: '300px' },
|
||||
{ prop: '', label: '性别' }
|
||||
{ prop: 'nickname', label: '姓名' },
|
||||
{ prop: 'mobile', label: '手机号' },
|
||||
{ prop: 'deptName', label: '部门' },
|
||||
{ prop: '', label: '角色', width: '300px' }
|
||||
])
|
||||
|
||||
function getList() {
|
||||
tableList.value = [{ userName: '测试', phone: '18899998888' }]
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await UserApi.getUserPage({
|
||||
pageNo: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
roleId: props.roleId
|
||||
})
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user