|
@@ -1,11 +1,91 @@
|
|
<template>
|
|
<template>
|
|
- <div>用户管理</div>
|
|
|
|
|
|
+ <v-card class="pa-5 card-box">
|
|
|
|
+ <v-data-table
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :items="items"
|
|
|
|
+ hide-default-header
|
|
|
|
+ height="70vh"
|
|
|
|
+ >
|
|
|
|
+ <template #bottom></template>
|
|
|
|
+ <template v-slot:item.actions="{ item }">
|
|
|
|
+ <v-btn v-if="item.status === '1'" color="primary" variant="text" @click="handleEnable(item)">启用</v-btn>
|
|
|
|
+ <v-btn v-if="item.status === '0'" color="primary" variant="text" @click="handleDisabled(item)">禁用</v-btn>
|
|
|
|
+ </template>
|
|
|
|
+ </v-data-table>
|
|
|
|
+ <CtPagination
|
|
|
|
+ :total="total"
|
|
|
|
+ :page="query.pageNo"
|
|
|
|
+ :limit="query.pageSize"
|
|
|
|
+ @handleChange="handleChangePage"
|
|
|
|
+ ></CtPagination>
|
|
|
|
+ </v-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({ name: 'system-management-user'})
|
|
defineOptions({ name: 'system-management-user'})
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
+import { timesTampChange } from '@/utils/date'
|
|
|
|
+import { getEnterpriseUserList } from '@/api/enterprise'
|
|
|
|
+
|
|
|
|
+const total = ref(10)
|
|
|
|
+const query = ref({
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ status: 0
|
|
|
|
+})
|
|
|
|
+const items = ref([
|
|
|
|
+ // {
|
|
|
|
+ // "id": "1",
|
|
|
|
+ // "enterpriseId": "1",
|
|
|
|
+ // "enterpriseName": "门墩儿信息科技有限公司",
|
|
|
|
+ // "name": "史迪奇",
|
|
|
|
+ // "sex": "2",
|
|
|
|
+ // "avatar": "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/2b64902c7e0ca60347fe5f23d63b0d620a03eed298b8bb2fd3b80ad1fa27f00f.jpg",
|
|
|
|
+ // "status": "0",
|
|
|
|
+ // "loginDate": 1718354706000,
|
|
|
|
+ // "phone": "13229740091",
|
|
|
|
+ // "email": "1687584225@qq.com",
|
|
|
|
+ // "logoUrl": "https://www.menduner.com/static/img/loginlogo2.7924c12.png",
|
|
|
|
+ // "userType": "1",
|
|
|
|
+ // "updateTime": 1718354706000
|
|
|
|
+ // }
|
|
|
|
+])
|
|
|
|
+const headers = [
|
|
|
|
+ { title: '用户名', key: 'name' },
|
|
|
|
+ { title: '所属企业', key: 'enterpriseName' },
|
|
|
|
+ { title: '手机号', key: 'phone' },
|
|
|
|
+ { title: '邮箱', key: 'email' },
|
|
|
|
+ { title: '最后登录时间', key: 'loginDate', value: item => timesTampChange(item.loginDate) },
|
|
|
|
+ { title: '操作', key: 'actions' }
|
|
|
|
+]
|
|
|
|
+
|
|
|
|
+// 获取企业用户列表
|
|
|
|
+const getData = async () => {
|
|
|
|
+ const { list, total: number } = await getEnterpriseUserList(query.value)
|
|
|
|
+ items.value = list
|
|
|
|
+ total.value = number
|
|
|
|
+}
|
|
|
|
+getData()
|
|
|
|
+
|
|
|
|
+const handleChangePage = (e) => {
|
|
|
|
+ query.value.pageNo = e
|
|
|
|
+ getData()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const handleEnable = (item) => {
|
|
|
|
+ console.log(item, '启用')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const handleDisabled = (item) => {
|
|
|
|
+ console.log(item, '禁用')
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-
|
|
|
|
|
|
+:deep(.v-table > .v-table__wrapper > table > thead) {
|
|
|
|
+ background-color: #f7f8fa !important
|
|
|
|
+}
|
|
|
|
+:deep(.v-selection-control__input) {
|
|
|
|
+ color: #767778
|
|
|
|
+}
|
|
</style>
|
|
</style>
|