support multiple delete users, update database sql file

This commit is contained in:
RockYang
2024-09-10 10:56:04 +08:00
parent 7c272b0efd
commit 327d68a347
14 changed files with 129 additions and 65 deletions

View File

@@ -259,7 +259,8 @@
color #726E6C
&:hover {
background #3C3737
background #5f5958
color #e1e1e1
}
}
}

View File

@@ -303,7 +303,8 @@
color #726E6C
&:hover {
background #3C3737
background #5f5958
color #e1e1e1
}
}
}

View File

@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4125778 */
src: url('iconfont.woff2?t=1725863856362') format('woff2'),
url('iconfont.woff?t=1725863856362') format('woff'),
url('iconfont.ttf?t=1725863856362') format('truetype');
src: url('iconfont.woff2?t=1725929120246') format('woff2'),
url('iconfont.woff?t=1725929120246') format('woff'),
url('iconfont.ttf?t=1725929120246') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-luma:before {
content: "\e704";
}
.icon-exchange:before {
content: "\e6f5";
}

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "41645421",
"name": "luma-logo",
"font_class": "luma",
"unicode": "e704",
"unicode_decimal": 59140
},
{
"icon_id": "7573248",
"name": "exchange",

Binary file not shown.

View File

@@ -124,6 +124,7 @@ const iconMap =ref(
"/apps": "icon-app",
"/member": "icon-vip-user",
"/invite": "icon-share",
"/luma": "icon-luma",
}
)
const bgStyle = {}

View File

@@ -3,8 +3,8 @@
<div class="handle-box">
<el-input v-model="query.username" placeholder="账号" class="handle-input mr10"></el-input>
<el-button type="primary" :icon="Search" @click="handleSearch">搜索</el-button>
<el-button type="success" :icon="Plus" @click="addUser">新增用户</el-button>
<el-button type="danger" :icon="Delete" @click="multipleDelete">删除</el-button>
</div>
<el-row>
@@ -170,8 +170,8 @@
import {onMounted, reactive, ref} from "vue";
import {httpGet, httpPost} from "@/utils/http";
import {ElMessage, ElMessageBox} from "element-plus";
import {dateFormat, disabledDate, removeArrayItem} from "@/utils/libs";
import {Plus, Search} from "@element-plus/icons-vue";
import {dateFormat, disabledDate} from "@/utils/libs";
import {Delete, Plus, Search} from "@element-plus/icons-vue";
// 变量定义
const users = ref({page: 1, page_size: 15, items: []})
@@ -281,7 +281,7 @@ const userEdit = function (row) {
}
const addUser = () => {
user.value = {}
user.value = {chat_id: 0, chat_roles: [], chat_models: []}
title.value = '添加用户'
showUserEditDialog.value = true
add.value = true
@@ -306,8 +306,36 @@ const saveUser = function () {
})
}
const userIds = ref([])
const handleSelectionChange = function (rows) {
// console.log(rows)
userIds.value = []
rows.forEach((row) => {
userIds.value.push(row.id)
})
}
const multipleDelete = function () {
ElMessageBox.confirm(
'此操作将会永久删除用户信息和聊天记录,确认操作吗?',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
loading.value = true
httpGet('/api/admin/user/remove', {ids: userIds.value}).then(() => {
ElMessage.success('操作成功!')
fetchUserList(users.value.page, users.value.page_size)
loading.value = false
}).catch((e) => {
ElMessage.error('操作失败,' + e.message)
loading.value = false
})
}).catch(() => {
ElMessage.info('操作被取消')
})
}
const resetPass = (row) => {