feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 17:12:24 +08:00
parent 771320a839
commit 743568861d
77 changed files with 734 additions and 1870 deletions

View File

@@ -91,22 +91,22 @@ let tableState: TabeStateType = reactive({
let tableColumns: ColumnsType = [
{
title: '用户编号',
dataIndex: 'id',
dataIndex: 'userId',
align: 'center',
},
{
title: '登录账号',
dataIndex: 'accountId',
dataIndex: 'userName',
align: 'center',
},
{
title: '用户',
dataIndex: 'name',
title: '用户昵称',
dataIndex: 'nickName',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
dataIndex: 'phonenumber',
align: 'center',
},
{
@@ -125,13 +125,13 @@ let tableColumns: ColumnsType = [
dataIndex: 'createTime',
align: 'center',
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(opt.value);
if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value);
},
},
{
title: '操作',
key: 'id',
key: 'userId',
align: 'center',
},
];
@@ -170,7 +170,7 @@ function fnTableSize({ key }: MenuInfo) {
}
/**表格斑马纹 */
function fnTableStriped(_record: unknown, index: number):any {
function fnTableStriped(_record: unknown, index: number): any {
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
}
@@ -209,23 +209,25 @@ function fnModalOk(userIds: string[] | number[]) {
message.error(`请选择要分配的用户`, 2);
return;
}
const hide = message.loading('请稍等...', 0);
const key = 'authUserChecked';
message.loading({ content: '请稍等...', key });
authUserChecked({
checked: true,
userIds: userIds.join(','),
roleId: roleId,
}).then(res => {
hide();
if (res.code === RESULT_CODE_SUCCESS) {
modalState.visibleBySelectUser = false;
message.success({
content: `授权用户添加成功`,
key,
duration: 3,
});
fnGetList();
} else {
message.error({
content: `${res.msg}`,
key,
duration: 3,
});
}
@@ -244,19 +246,21 @@ function fnRecordDelete(userId: string | number) {
title: '提示',
content: `确认取消用户编号为 【${userId}】 的数据项授权?`,
onOk() {
const hide = message.loading('请稍等...', 0);
const key = 'authUserChecked';
message.loading({ content: '请稍等...', key });
authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then(
res => {
hide();
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `取消授权成功`,
key,
duration: 3,
});
fnGetList();
} else {
message.error({
content: `${res.msg}`,
key,
duration: 3,
});
}
@@ -334,7 +338,7 @@ onMounted(() => {
></a-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="6" :md="12" :xs="24">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="手机号码" name="phonenumber">
<a-input
v-model:value="queryParams.phonenumber"
@@ -343,7 +347,7 @@ onMounted(() => {
placeholder="请输入手机号码"
></a-input>
</a-form-item>
</a-col> -->
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="用户状态" name="status">
<a-select
@@ -429,9 +433,9 @@ onMounted(() => {
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<a-tooltip placement="topRight">
<template #title>密度</template>
<a-dropdown trigger="click">
<a-dropdown placement="bottomRight" trigger="click">
<a-button type="text">
<template #icon><ColumnHeightOutlined /></template>
</a-button>
@@ -453,7 +457,7 @@ onMounted(() => {
<!-- 表格列表 -->
<a-table
class="table"
row-key="id"
row-key="userId"
:columns="tableColumns"
:loading="tableState.loading"
:data-source="tableState.data"
@@ -471,13 +475,13 @@ onMounted(() => {
<template v-if="column.key === 'status'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
</template>
<template v-if="column.key === 'id'">
<template v-if="column.key === 'userId'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>取消授权</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record.id)"
@click.prevent="fnRecordDelete(record.userId)"
v-perms:has="['system:role:remove']"
>
<template #icon><UserDeleteOutlined /></template>