完善用户管理模块表格数据组件
This commit is contained in:
parent
59912db464
commit
6d3c05d9a0
|
|
@ -9,7 +9,6 @@
|
||||||
点击上传
|
点击上传
|
||||||
</n-upload>
|
</n-upload>
|
||||||
<n-modal
|
<n-modal
|
||||||
v-model:show="showModal"
|
|
||||||
preset="card"
|
preset="card"
|
||||||
style="width: 600px"
|
style="width: 600px"
|
||||||
>
|
>
|
||||||
|
|
@ -50,8 +49,8 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
function handleChange(file) {
|
function handleChange(res) {
|
||||||
console.log(222, file)
|
console.log('已选择的文件:', res.file.file)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 上传前判断文件是否符合条件
|
* @description: 上传前判断文件是否符合条件
|
||||||
|
|
@ -60,7 +59,6 @@ export default defineComponent({
|
||||||
*/
|
*/
|
||||||
function handleBeforeUpload(options) {
|
function handleBeforeUpload(options) {
|
||||||
const { file, fileList } = options
|
const { file, fileList } = options
|
||||||
console.log(11, file, fileList)
|
|
||||||
if (props.size) {
|
if (props.size) {
|
||||||
const size = file.file.size
|
const size = file.file.size
|
||||||
if (size < props.size * 1024 * 1024) {
|
if (size < props.size * 1024 * 1024) {
|
||||||
|
|
|
||||||
|
|
@ -38,63 +38,20 @@
|
||||||
<script>
|
<script>
|
||||||
import headSearch from '@/components/Search/index.vue'
|
import headSearch from '@/components/Search/index.vue'
|
||||||
import dataTable from '@/components/DataTable/index.vue'
|
import dataTable from '@/components/DataTable/index.vue'
|
||||||
import TableAction from '@/components/DataTable/tools/Action.vue'
|
|
||||||
import TableImage from '@/components/DataTable/tools/Image.vue'
|
|
||||||
import TableTags from '@/components/DataTable/tools/Tags.vue'
|
|
||||||
import TableSwitch from '@/components/DataTable/tools/Switch.vue'
|
import TableSwitch from '@/components/DataTable/tools/Switch.vue'
|
||||||
|
import TableAction from '@/components/DataTable/tools/Action.vue'
|
||||||
import { getUserList, resetPassword, deleteUser, setUserStatus } from '@/api/system/user/index.js'
|
import { getUserList, resetPassword, deleteUser, setUserStatus } from '@/api/system/user/index.js'
|
||||||
import { h, unref, ref, toRefs, reactive } from 'vue'
|
import { h, unref, ref, toRefs, reactive } from 'vue'
|
||||||
import UserModal from './components/UserModal.vue'
|
import UserModal from './components/UserModal.vue'
|
||||||
import info from './info.js'
|
import info from './info.js'
|
||||||
|
import table from './table.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuPage',
|
name: 'MenuPage',
|
||||||
components: { dataTable, UserModal, headSearch },
|
components: { dataTable, UserModal, headSearch },
|
||||||
setup() {
|
setup() {
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
...table.columns,
|
||||||
type: 'selection'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '用户编号',
|
|
||||||
key: 'code',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '头像',
|
|
||||||
key: 'avatar',
|
|
||||||
align: 'center',
|
|
||||||
render(row) {
|
|
||||||
return h(TableImage, {
|
|
||||||
images: {
|
|
||||||
width: 36,
|
|
||||||
height: 36,
|
|
||||||
src: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQiKrYt-fEfJ4SZhF9KfLLaX9f15KV6Ve1ptA&usqp=CAU'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '用户账号',
|
|
||||||
key: 'username',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '用户姓名',
|
|
||||||
key: 'realname',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '角色',
|
|
||||||
key: 'roleList',
|
|
||||||
align: 'center',
|
|
||||||
render(row) {
|
|
||||||
return h(TableTags, {
|
|
||||||
data: row.roleList,
|
|
||||||
rowKey: 'name'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
|
|
@ -110,23 +67,6 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '部门',
|
|
||||||
key: 'deptName',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
key: 'createTime',
|
|
||||||
align: 'center',
|
|
||||||
width: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '更新时间',
|
|
||||||
key: 'updateTime',
|
|
||||||
align: 'center',
|
|
||||||
width: 160
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
import { h } from 'vue'
|
||||||
|
import TableImage from '@/components/DataTable/tools/Image.vue'
|
||||||
|
import TableTags from '@/components/DataTable/tools/Tags.vue'
|
||||||
|
|
||||||
|
const table = {
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
type: 'selection'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户编号',
|
||||||
|
key: 'code',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '头像',
|
||||||
|
key: 'avatar',
|
||||||
|
align: 'center',
|
||||||
|
render(row) {
|
||||||
|
return h(TableImage, {
|
||||||
|
images: {
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
src: row.avatar
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户账号',
|
||||||
|
key: 'username',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户姓名',
|
||||||
|
key: 'realname',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '角色',
|
||||||
|
key: 'roleList',
|
||||||
|
align: 'center',
|
||||||
|
render(row) {
|
||||||
|
return h(TableTags, {
|
||||||
|
data: row.roleList,
|
||||||
|
rowKey: 'name'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '部门',
|
||||||
|
key: 'deptName',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
key: 'createTime',
|
||||||
|
align: 'center',
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '更新时间',
|
||||||
|
key: 'updateTime',
|
||||||
|
align: 'center',
|
||||||
|
width: 160
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
export default table
|
||||||
Loading…
Reference in New Issue