|
|
@@ -57,6 +57,48 @@ const handleSearchUser = () => {
|
|
|
const handleDelete = (id: any) => {
|
|
|
console.log(id)
|
|
|
}
|
|
|
+
|
|
|
+// 用户table
|
|
|
+const userTableData = ref([])
|
|
|
+const total = ref(0)
|
|
|
+const curPage = ref(1)
|
|
|
+const loading = ref(false)
|
|
|
+
|
|
|
+const getUserTableData = () => {
|
|
|
+ loading.value = true
|
|
|
+ // props.crud
|
|
|
+ // ?.getList({
|
|
|
+ // ...query.value,
|
|
|
+ // pageSize: props.pageSize,
|
|
|
+ // page: curPage.value
|
|
|
+ // })
|
|
|
+ // .then((res: any) => {
|
|
|
+ // tableData.value = res.data
|
|
|
+ // total.value = res.total
|
|
|
+ // })
|
|
|
+ // .finally(() => {
|
|
|
+ // loading.value = false
|
|
|
+ // })
|
|
|
+}
|
|
|
+getUserTableData()
|
|
|
+
|
|
|
+const pageChange = () => {
|
|
|
+ getUserTableData()
|
|
|
+}
|
|
|
+
|
|
|
+const dialogVisible = ref(false)
|
|
|
+const slectedUser = ref<any>([])
|
|
|
+const userList = ref<any>([])
|
|
|
+
|
|
|
+const handleAddUser = () => {
|
|
|
+ dialogVisible.value = true
|
|
|
+}
|
|
|
+const closeDialog = () => {
|
|
|
+ dialogVisible.value = false
|
|
|
+}
|
|
|
+const handleSubmit = () => {
|
|
|
+ //
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -72,34 +114,53 @@ const handleDelete = (id: any) => {
|
|
|
</pro-table>
|
|
|
</el-col>
|
|
|
<el-col :span="12" v-if="curRole">
|
|
|
- <el-card>
|
|
|
+ <el-card class="h-full" :body-style="{ height: '100%' }">
|
|
|
<template #header>
|
|
|
<div class="flex justify-between">
|
|
|
<div>分配用户</div>
|
|
|
<el-button icon="back" link @click="curRole = null">关闭</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div class="flex justify-between mb-sm">
|
|
|
- <el-button type="primary">添加用户</el-button>
|
|
|
- <div>
|
|
|
- <el-input placeholder="姓名">
|
|
|
- <template #append><el-button icon="Search" @click="handleSearchUser" /></template>
|
|
|
- </el-input>
|
|
|
+ <div class="flex flex-col" style="height: calc(100% - 53px)">
|
|
|
+ <div class="flex justify-between mb-sm">
|
|
|
+ <el-button type="primary" @click="handleAddUser">添加用户</el-button>
|
|
|
+ <div>
|
|
|
+ <el-input placeholder="姓名">
|
|
|
+ <template #append><el-button icon="Search" @click="handleSearchUser" /></template>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table class="flex-grow-1 h-full" border :data="userTableData">
|
|
|
+ <el-table-column prop="name" label="登录名"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="姓名"></el-table-column>
|
|
|
+ <el-table-column prop="phone" label="手机号"></el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button link type="danger" size="small" @click="handleDelete(row.id)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="flex justify-end shrink-0">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next, jumper, total"
|
|
|
+ :page-size="10"
|
|
|
+ :total="total"
|
|
|
+ @current-change="pageChange"
|
|
|
+ class="mt-16px"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-table border>
|
|
|
- <el-table-column prop="name" label="登录名"></el-table-column>
|
|
|
- <el-table-column prop="name" label="姓名"></el-table-column>
|
|
|
- <el-table-column prop="phone" label="手机号"></el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button link type="danger" size="small" @click="handleDelete(row.id)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-dialog v-model="dialogVisible" title="添加用户" @close="closeDialog">
|
|
|
+ <el-transfer v-model="slectedUser" :data="userList" :titles="['用户列表', '已选用户']" />
|
|
|
+ <template #footer>
|
|
|
+ <el-button icon="Close" @click="closeDialog">取消</el-button>
|
|
|
+ <el-button icon="Check" type="primary" @click="handleSubmit">保存</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|