style(api): 统一代码格式化规范

- 调整 import 语句格式,统一空格和引号风格
- 修复函数参数跨行时的格式对齐问题
- 清理多余空行和注释中的空白字符
- 统一对象属性结尾逗号的使用规范
- 规范化字符串拼接和模板语法的格式
- 优化长参数列表的换行和缩进格式
This commit is contained in:
2026-01-17 17:04:46 +08:00
parent 836fd4d8d0
commit 4af50e6449
416 changed files with 24611 additions and 22733 deletions

View File

@@ -13,11 +13,7 @@
@close="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
class="login-form">
<a-form ref="formRef" :model="form" :rules="rules" class="login-form">
<a-form-item name="accessKey">
<div class="login-input-group">
<a-input
@@ -26,8 +22,7 @@
type="text"
placeholder="请输入API Keys名称"
v-model:value="form.accessSecret"
>
</a-input>
/>
<a-input
v-else
allow-clear
@@ -35,8 +30,7 @@
placeholder="请输入API Keys名称"
:maxlength="6"
v-model:value="form.accessKey"
>
</a-input>
/>
</div>
</a-form-item>
</a-form>
@@ -44,87 +38,86 @@
</template>
<script lang="ts" setup>
import {ref, reactive} from "vue";
import {message} from "ant-design-vue";
import type {AccessKey} from "@/api/system/access-key/model";
import {assignObject} from 'ele-admin-pro';
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
import {addAccessKey} from "@/api/system/access-key";
import {copyText} from "@/utils/common";
import { ref, reactive } from 'vue';
import { message } from 'ant-design-vue';
import type { AccessKey } from '@/api/system/access-key/model';
import { assignObject } from 'ele-admin-pro';
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
import { addAccessKey } from '@/api/system/access-key';
import { copyText } from '@/utils/common';
defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: AccessKey | null;
}>();
defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: AccessKey | null;
}>();
const emit = defineEmits<{
(e: "done", form: AccessKey): void;
(e: "update:visible", value: boolean): void;
}>();
// 提交状态
const loading = ref(false);
const cancelText = ref<string>("取消");
const okText = ref<string>("创建");
// 用户信息
const form = reactive<AccessKey>({
id: 0,
accessKey: undefined,
accessSecret: undefined,
createTime: undefined
});
const emit = defineEmits<{
(e: 'done', form: AccessKey): void;
(e: 'update:visible', value: boolean): void;
}>();
// 提交状态
const loading = ref(false);
const cancelText = ref<string>('取消');
const okText = ref<string>('创建');
// 用户信息
const form = reactive<AccessKey>({
id: 0,
accessKey: undefined,
accessSecret: undefined,
createTime: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit("update:visible", value);
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive<Record<string, Rule[]>>({
accessKey: [
{
required: true,
type: "string",
message: "请输入API Key 名称",
trigger: "blur"
// 表单验证规则
const rules = reactive<Record<string, Rule[]>>({
accessKey: [
{
required: true,
type: 'string',
message: '请输入API Key 名称',
trigger: 'blur'
}
]
});
const formRef = ref<FormInstance | null>(null);
/* 保存编辑 */
const save = () => {
if (form.accessSecret) {
copyText(form.accessSecret);
return false;
}
]
});
const formRef = ref<FormInstance | null>(null);
/* 保存编辑 */
const save = () => {
if(form.accessSecret){
copyText(form.accessSecret)
return false;
}
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
addAccessKey(form)
.then((data) => {
console.log(data,'addData')
if(data){
assignObject(form, data);
cancelText.value = "关闭";
okText.value = "复制";
}
loading.value = false;
message.success('创建成功');
emit("done", {});
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
addAccessKey(form)
.then((data) => {
console.log(data, 'addData');
if (data) {
assignObject(form, data);
cancelText.value = '关闭';
okText.value = '复制';
}
loading.value = false;
message.success('创建成功');
emit('done', {});
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
</script>

View File

@@ -2,8 +2,7 @@
<div class="page">
<a-page-header :ghost="false" title="秘钥管理">
<div class="ele-text-secondary">
API key 是您访WebSoft-API
的密钥具有该账户完全的权限请您妥善保管
API key 是您访WebSoft-API 的密钥具有该账户完全的权限请您妥善保管
</div>
</a-page-header>
<div class="ele-body">
@@ -26,9 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'accessSecret'">
<span>
sk-******************
</span>
<span> sk-****************** </span>
</template>
<template v-if="column.key === 'action'">
<a-space>
@@ -46,110 +43,107 @@
</a-card>
</div>
<!-- 编辑弹窗 -->
<AccessKeyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<AccessKeyEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</template>
<script lang="ts" setup>
import {ref, reactive} from 'vue';
import {message} from 'ant-design-vue/es';
import type {EleProTable} from 'ele-admin-pro/es';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import AccessKeyEdit from './components/accesskey-edit.vue';
import {toDateString} from 'ele-admin-pro/es';
import {pageAccessKey, removeAccessKey} from '@/api/system/access-key';
import {AccessKey, AccessKeyParam} from '@/api/system/access-key/model';
import {messageLoading} from 'ele-admin-pro/es';
import { ref, reactive } from 'vue';
import { message } from 'ant-design-vue/es';
import type { EleProTable } from 'ele-admin-pro/es';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import AccessKeyEdit from './components/accesskey-edit.vue';
import { toDateString } from 'ele-admin-pro/es';
import { pageAccessKey, removeAccessKey } from '@/api/system/access-key';
import { AccessKey, AccessKeyParam } from '@/api/system/access-key/model';
import { messageLoading } from 'ele-admin-pro/es';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '名称',
key: 'accessKey',
dataIndex: 'accessKey',
showSorterTooltip: false
},
{
title: 'Key',
key: 'accessSecret',
dataIndex: 'accessSecret',
showSorterTooltip: false
},
{
title: '创建时间',
dataIndex: 'createTime',
align: 'center',
customRender: ({text}) => toDateString(text, 'yyyy-MM-dd HH:mm:ss'),
width: 180,
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center'
}
]);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '名称',
key: 'accessKey',
dataIndex: 'accessKey',
showSorterTooltip: false
},
{
title: 'Key',
key: 'accessSecret',
dataIndex: 'accessSecret',
showSorterTooltip: false
},
{
title: '创建时间',
dataIndex: 'createTime',
align: 'center',
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss'),
width: 180
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center'
}
]);
// 表格选中数据
const selection = ref<AccessKey[]>([]);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 当前编辑数据
const current = ref<any>(null);
// 表格选中数据
const selection = ref<AccessKey[]>([]);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 当前编辑数据
const current = ref<any>(null);
// 默认搜索条件
const defaultWhere = reactive({
code: '',
phone: '',
username: '',
nickname: '',
userId: undefined
});
// 默认搜索条件
const defaultWhere = reactive({
code: '',
phone: '',
username: '',
nickname: '',
userId: undefined
});
// 表格数据源
const datasource: DatasourceFunction = ({ where }) => {
return pageAccessKey({ ...where });
};
// 表格数据源
const datasource: DatasourceFunction = ({where}) => {
return pageAccessKey({...where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: any) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开编辑弹窗 */
const openEdit = (row?: any) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 删除单个 */
const remove = (row: AccessKey) => {
const hide = messageLoading('请求中..', 0);
removeAccessKey(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 搜索 */
const reload = (where?: AccessKeyParam) => {
selection.value = [];
tableRef?.value?.reload({page: 1, where});
};
/* 删除单个 */
const remove = (row: AccessKey) => {
const hide = messageLoading('请求中..', 0);
removeAccessKey(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 搜索 */
const reload = (where?: AccessKeyParam) => {
selection.value = [];
tableRef?.value?.reload({ page: 1, where });
};
</script>
<script lang="ts">
export default {
name: 'AccessKeyIndex'
};
export default {
name: 'AccessKeyIndex'
};
</script>

View File

@@ -88,7 +88,7 @@
// import { getDictionaryOptions } from '@/utils/common';
import { Organization } from '@/api/system/organization/model';
import { Grade } from '@/api/user/grade/model';
import {TEMPLATE_ID} from "@/config/setting";
import { TEMPLATE_ID } from '@/config/setting';
// 是否开启响应式布局
const themeStore = useThemeStore();

View File

@@ -49,7 +49,9 @@
v-bind="styleResponsive ? { md: 12, sm: 24, xs: 24 } : { span: 12 }"
>
<a-form-item label="可用余额">
<span class="ele-text-success">{{ formatNumber(user.balance) }}</span>
<span class="ele-text-success"
>{{ formatNumber(user.balance) }}</span
>
</a-form-item>
<a-form-item label="可用积分">
<span class="ele-text">{{ user.points }}</span>

View File

@@ -97,11 +97,7 @@
/>
</a-form-item>
<a-form-item label="" name="idcard">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.idcard"
/>
<a-input allow-clear placeholder="请输入" v-model:value="form.idcard" />
</a-form-item>
<a-form-item label="" name="truename">
<a-input
@@ -254,12 +250,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false">
<!-- 表格 -->
@@ -19,7 +19,7 @@
<a-space>
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon>
<plus-outlined/>
<plus-outlined />
</template>
<span>新建</span>
</a-button>
@@ -40,7 +40,7 @@
style="margin-right: 4px"
>
<template #icon>
<UserOutlined/>
<UserOutlined />
</template>
</a-avatar>
</template>
@@ -57,9 +57,9 @@
</a-tag>
</template>
<template v-if="column.key === 'platform'">
<WechatOutlined v-if="record.platform === 'MP-WEIXIN'"/>
<Html5Outlined v-if="record.platform === 'H5'"/>
<ChromeOutlined v-if="record.platform === 'WEB'"/>
<WechatOutlined v-if="record.platform === 'MP-WEIXIN'" />
<Html5Outlined v-if="record.platform === 'H5'" />
<ChromeOutlined v-if="record.platform === 'WEB'" />
</template>
<template v-if="column.key === 'balance'">
<span class="ele-text-success">
@@ -80,9 +80,9 @@
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a @click="resetPsw(record)">重置</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
placement="topRight"
title="确定要删除此用户吗?"
@@ -103,332 +103,332 @@
@done="reload"
/>
<!-- 导入弹窗 -->
<user-import v-model:visible="showImport" @done="reload"/>
<user-import v-model:visible="showImport" @done="reload" />
<!-- 用户详情 -->
<user-info v-model:visible="showInfo" :data="current" @done="reload"/>
<user-info v-model:visible="showInfo" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref, reactive} from 'vue';
import {message, Modal} from 'ant-design-vue/es';
import {
PlusOutlined,
UserOutlined,
Html5Outlined,
ChromeOutlined,
WechatOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro/es';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import {messageLoading, formatNumber} from 'ele-admin-pro/es';
import UserEdit from './components/user-edit.vue';
import UserImport from './components/user-import.vue';
import UserInfo from './components/user-info.vue';
import {toDateString} from 'ele-admin-pro';
import {
pageUsers,
removeUser,
removeUsers,
updateUserPassword,
updateUser
} from '@/api/system/user';
import type {User, UserParam} from '@/api/system/user/model';
import {toTreeData, uuid} from 'ele-admin-pro';
import {listRoles} from '@/api/system/role';
import {listOrganizations} from '@/api/system/organization';
import {Organization} from '@/api/system/organization/model';
import {hasRole} from '@/utils/permission';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
import { createVNode, ref, reactive } from 'vue';
import { message, Modal } from 'ant-design-vue/es';
import {
PlusOutlined,
UserOutlined,
Html5Outlined,
ChromeOutlined,
WechatOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro/es';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import { messageLoading, formatNumber } from 'ele-admin-pro/es';
import UserEdit from './components/user-edit.vue';
import UserImport from './components/user-import.vue';
import UserInfo from './components/user-info.vue';
import { toDateString } from 'ele-admin-pro';
import {
pageUsers,
removeUser,
removeUsers,
updateUserPassword,
updateUser
} from '@/api/system/user';
import type { User, UserParam } from '@/api/system/user/model';
import { toTreeData, uuid } from 'ele-admin-pro';
import { listRoles } from '@/api/system/role';
import { listOrganizations } from '@/api/system/organization';
import { Organization } from '@/api/system/organization/model';
import { hasRole } from '@/utils/permission';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/system/user/components/Extra.vue';
// 加载状态
const loading = ref(true);
// 树形数据
const data = ref<Organization[]>([]);
// 树展开的key
const expandedRowKeys = ref<number[]>([]);
// 树选中的key
const selectedRowKeys = ref<number[]>([]);
// 表格选中数据
const selection = ref<User[]>([]);
// 当前编辑数据
const current = ref<User | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示用户详情
const showInfo = ref(false);
// 是否显示用户导入弹窗
const showImport = ref(false);
const userType = ref<number>();
const searchText = ref('');
// 加载状态
const loading = ref(true);
// 树形数据
const data = ref<Organization[]>([]);
// 树展开的key
const expandedRowKeys = ref<number[]>([]);
// 树选中的key
const selectedRowKeys = ref<number[]>([]);
// 表格选中数据
const selection = ref<User[]>([]);
// 当前编辑数据
const current = ref<User | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示用户详情
const showInfo = ref(false);
// 是否显示用户导入弹窗
const showImport = ref(false);
const userType = ref<number>();
const searchText = ref('');
// 加载角色
const roles = ref<any[]>([]);
const filters = () => {
listRoles().then((result) => {
result.map((d) => {
roles.value.push({
text: d.roleName,
value: d.roleId
// 加载角色
const roles = ref<any[]>([]);
const filters = () => {
listRoles().then((result) => {
result.map((d) => {
roles.value.push({
text: d.roleName,
value: d.roleId
});
});
});
});
};
filters();
// 加载机构
listOrganizations()
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d) => {
d.key = d.organizationId;
d.value = d.organizationId;
d.title = d.organizationName;
if (typeof d.key === 'number') {
eks.push(d.key);
}
});
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
if (typeof list[0].key === 'number') {
selectedRowKeys.value = [list[0].key];
}
// current.value = list[0];
} else {
selectedRowKeys.value = [];
// current.value = null;
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'userId',
width: 90,
showSorterTooltip: false
},
{
title: '真实姓名',
dataIndex: 'realName',
align: 'center',
showSorterTooltip: false
},
{
title: '手机号码',
dataIndex: 'mobile',
align: 'center',
key: 'mobile',
showSorterTooltip: false
},
{
title: '性别',
dataIndex: 'sexName',
align: 'center',
showSorterTooltip: false
},
{
title: '所属部门',
dataIndex: 'organizationName',
key: 'organizationName',
align: 'center'
},
{
title: '角色',
dataIndex: 'roles',
key: 'roles',
align: 'center'
},
{
title: '注册时间',
dataIndex: 'createTime',
sorter: true,
align: 'center',
showSorterTooltip: false,
ellipsis: true,
customRender: ({text}) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center'
}
]);
// 默认搜索条件
const defaultWhere = reactive({
username: '',
nickname: ''
});
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
where = {};
where.roleId = filters.roles;
where.keywords = searchText.value;
where.isAdmin = 1;
return pageUsers({page, limit, ...where, ...orders});
};
/* 搜索 */
const reload = (where?: UserParam) => {
selection.value = [];
tableRef?.value?.reload({where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: User) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开用户详情弹窗 */
const openInfo = (row?: User) => {
current.value = row ?? null;
showInfo.value = true;
};
/* 打开编辑弹窗 */
const openImport = () => {
showImport.value = true;
};
const handleTabs = (e) => {
userType.value = Number(e.target.value);
reload();
};
/* 删除单个 */
const remove = (row: User) => {
const hide = messageLoading('请求中..', 0);
removeUser(row.userId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的用户吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = messageLoading('请求中..', 0);
removeUsers(selection.value.map((d) => d.userId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 重置用户密码 */
const resetPsw = (row: User) => {
Modal.confirm({
title: '提示',
content: '确定要重置此用户的密码吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
const password = uuid(8);
updateUserPassword(row.userId, password)
.then((msg) => {
hide();
message.success(msg + ',新密码:' + password);
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 修改用户状态 */
const updateIsAdmin = (row: User) => {
row.isAdmin = row.isAdmin ? 0 : 1;
updateUser(row)
.then((msg) => {
message.success(msg);
})
.catch((e) => {
message.error(e.message);
});
};
/* 自定义行属性 */
const customRow = (record: User) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
filters();
// 加载机构
listOrganizations()
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d) => {
d.key = d.organizationId;
d.value = d.organizationId;
d.title = d.organizationName;
if (typeof d.key === 'number') {
eks.push(d.key);
}
});
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
if (typeof list[0].key === 'number') {
selectedRowKeys.value = [list[0].key];
}
// current.value = list[0];
} else {
selectedRowKeys.value = [];
// current.value = null;
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'userId',
width: 90,
showSorterTooltip: false
},
{
title: '真实姓名',
dataIndex: 'realName',
align: 'center',
showSorterTooltip: false
},
{
title: '手机号码',
dataIndex: 'mobile',
align: 'center',
key: 'mobile',
showSorterTooltip: false
},
{
title: '性别',
dataIndex: 'sexName',
align: 'center',
showSorterTooltip: false
},
{
title: '所属部门',
dataIndex: 'organizationName',
key: 'organizationName',
align: 'center'
},
{
title: '角色',
dataIndex: 'roles',
key: 'roles',
align: 'center'
},
{
title: '注册时间',
dataIndex: 'createTime',
sorter: true,
align: 'center',
showSorterTooltip: false,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center'
}
]);
// 默认搜索条件
const defaultWhere = reactive({
username: '',
nickname: ''
});
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
where = {};
where.roleId = filters.roles;
where.keywords = searchText.value;
where.isAdmin = 1;
return pageUsers({ page, limit, ...where, ...orders });
};
/* 搜索 */
const reload = (where?: UserParam) => {
selection.value = [];
tableRef?.value?.reload({ where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: User) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开用户详情弹窗 */
const openInfo = (row?: User) => {
current.value = row ?? null;
showInfo.value = true;
};
/* 打开编辑弹窗 */
const openImport = () => {
showImport.value = true;
};
const handleTabs = (e) => {
userType.value = Number(e.target.value);
reload();
};
/* 删除单个 */
const remove = (row: User) => {
const hide = messageLoading('请求中..', 0);
removeUser(row.userId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的用户吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = messageLoading('请求中..', 0);
removeUsers(selection.value.map((d) => d.userId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 重置用户密码 */
const resetPsw = (row: User) => {
Modal.confirm({
title: '提示',
content: '确定要重置此用户的密码吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
const password = uuid(8);
updateUserPassword(row.userId, password)
.then((msg) => {
hide();
message.success(msg + ',新密码:' + password);
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 修改用户状态 */
const updateIsAdmin = (row: User) => {
row.isAdmin = row.isAdmin ? 0 : 1;
updateUser(row)
.then((msg) => {
message.success(msg);
})
.catch((e) => {
message.error(e.message);
});
};
/* 自定义行属性 */
const customRow = (record: User) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
</script>
<script lang="ts">
export default {
name: 'SystemAdmin'
};
export default {
name: 'SystemAdmin'
};
</script>
<style lang="less" scoped>
.user-box {
display: flex;
align-items: center;
.user-info {
.user-box {
display: flex;
flex-direction: column;
align-items: start;
align-items: center;
.user-info {
display: flex;
flex-direction: column;
align-items: start;
}
}
}
</style>

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<ChatConversationEdit v-model:visible="showEdit" :data="current" @done="reload" />
<ChatConversationEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import ChatConversationEdit from './components/chatConversationEdit.vue';
import { pageChatConversation, removeChatConversation, removeBatchChatConversation } from '@/api/system/chatConversation';
import type { ChatConversation, ChatConversationParam } from '@/api/system/chatConversation/model';
import {
pageChatConversation,
removeChatConversation,
removeBatchChatConversation
} from '@/api/system/chatConversation';
import type {
ChatConversation,
ChatConversationParam
} from '@/api/system/chatConversation/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,49 +116,49 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '好友ID',
dataIndex: 'friendId',
key: 'friendId',
align: 'center',
align: 'center'
},
{
title: '消息类型',
dataIndex: 'type',
key: 'type',
align: 'center',
align: 'center'
},
{
title: '消息内容',
dataIndex: 'content',
key: 'content',
align: 'center',
align: 'center'
},
{
title: '未读消息',
dataIndex: 'unRead',
key: 'unRead',
align: 'center',
align: 'center'
},
{
title: '状态, 0未读, 1已读',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
align: 'center'
},
{
title: '注册时间',
@@ -162,7 +173,7 @@
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
align: 'center'
},
{
title: '操作',
@@ -219,7 +230,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchChatConversation(selection.value.map((d) => d.chatConversationId))
removeBatchChatConversation(
selection.value.map((d) => d.chatConversationId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<ChatMessageEdit v-model:visible="showEdit" :data="current" @done="reload" />
<ChatMessageEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import ChatMessageEdit from './components/chatMessageEdit.vue';
import { pageChatMessage, removeChatMessage, removeBatchChatMessage } from '@/api/system/chatMessage';
import type { ChatMessage, ChatMessageParam } from '@/api/system/chatMessage/model';
import {
pageChatMessage,
removeChatMessage,
removeBatchChatMessage
} from '@/api/system/chatMessage';
import type {
ChatMessage,
ChatMessageParam
} from '@/api/system/chatMessage/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,73 +116,73 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '发送人ID',
dataIndex: 'formUserId',
key: 'formUserId',
align: 'center',
align: 'center'
},
{
title: '接收人ID',
dataIndex: 'toUserId',
key: 'toUserId',
align: 'center',
align: 'center'
},
{
title: '消息类型',
dataIndex: 'type',
key: 'type',
align: 'center',
align: 'center'
},
{
title: '消息内容',
dataIndex: 'content',
key: 'content',
align: 'center',
align: 'center'
},
{
title: '屏蔽接收方',
dataIndex: 'sideTo',
key: 'sideTo',
align: 'center',
align: 'center'
},
{
title: '屏蔽发送方',
dataIndex: 'sideFrom',
key: 'sideFrom',
align: 'center',
align: 'center'
},
{
title: '是否撤回',
dataIndex: 'withdraw',
key: 'withdraw',
align: 'center',
align: 'center'
},
{
title: '文件信息',
dataIndex: 'fileInfo',
key: 'fileInfo',
align: 'center',
align: 'center'
},
{
title: '存在联系方式',
dataIndex: 'hasContact',
key: 'hasContact',
align: 'center',
align: 'center'
},
{
title: '状态, 0未读, 1已读',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
align: 'center'
},
{
title: '注册时间',
@@ -186,7 +197,7 @@
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
align: 'center'
},
{
title: '操作',

View File

@@ -1,7 +1,6 @@
<template>
<a-table :columns="columns" :data-source="data" :pagination="false">
<template #bodyCell="{ column, text }">
</template>
<template #bodyCell="{ column, text }"> </template>
<template #footer>
<div class="text-red-500 gap-3">
<div>登录账号u_{{ loginUser.userId }}</div>
@@ -11,58 +10,57 @@
</a-table>
</template>
<script lang="ts" setup>
import {computed, ref} from 'vue';
import {useUserStore} from "@/store/modules/user";
import {CmsWebsite} from "@/api/cms/cmsWebsite/model";
import {getSiteInfo} from "@/api/layout";
import { computed, ref } from 'vue';
import { useUserStore } from '@/store/modules/user';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { getSiteInfo } from '@/api/layout';
const userStore = useUserStore();// 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>()
const userStore = useUserStore(); // 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>();
const columns = [
{
title: '仓库名称',
dataIndex: 'name',
key: 'name'
},
{
title: '仓库地址',
className: 'column-money',
dataIndex: 'url',
key: 'url'
},
{
title: '备注',
dataIndex: 'comments'
}
];
const columns = [
{
title: '仓库名称',
dataIndex: 'name',
key: 'name',
},
{
title: '仓库地址',
className: 'column-money',
dataIndex: 'url',
key: 'url',
},
{
title: '备注',
dataIndex: 'comments',
},
];
const data = [
{
key: '1',
name: '服务端',
url: 'https://git.websoft.top/gxwebsoft/mp-java.git',
comments: '基于 Spring Boot + MyBatis Plus 的企业级后端API服务'
},
{
key: '2',
name: '管理端',
url: 'https://code.websoft.top/gxwebsoft/mp-vue.git',
comments: '基于 Vue 3 + Ant Design Vue 的企业级后台管理系统'
},
{
key: '3',
name: '应用端',
url: 'https://git.websoft.top/gxwebsoft/template-10559.git',
comments: '基于 Taro + React + TypeScript 的跨平台小程序应用'
}
];
const data = [
{
key: '1',
name: '服务端',
url: 'https://git.websoft.top/gxwebsoft/mp-java.git',
comments: '基于 Spring Boot + MyBatis Plus 的企业级后端API服务',
},
{
key: '2',
name: '管理端',
url: 'https://code.websoft.top/gxwebsoft/mp-vue.git',
comments: '基于 Vue 3 + Ant Design Vue 的企业级后台管理系统',
},
{
key: '3',
name: '应用端',
url: 'https://git.websoft.top/gxwebsoft/template-10559.git',
comments: '基于 Taro + React + TypeScript 的跨平台小程序应用',
},
];
const reload = async () => {
website.value = await getSiteInfo();
};
const reload = async () => {
website.value = await getSiteInfo();
};
reload()
reload();
</script>

View File

@@ -1,7 +1,6 @@
<template>
<a-table :columns="columns" :data-source="data" :pagination="false">
<template #bodyCell="{ column, text }">
</template>
<template #bodyCell="{ column, text }"> </template>
<template #footer>
<div class="text-red-500 gap-3">
<div>登录账号u_{{ loginUser.userId }}</div>
@@ -11,58 +10,57 @@
</a-table>
</template>
<script lang="ts" setup>
import {computed, ref} from 'vue';
import {useUserStore} from "@/store/modules/user";
import {CmsWebsite} from "@/api/cms/cmsWebsite/model";
import {getSiteInfo} from "@/api/layout";
import { computed, ref } from 'vue';
import { useUserStore } from '@/store/modules/user';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { getSiteInfo } from '@/api/layout';
const userStore = useUserStore();// 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>()
const userStore = useUserStore(); // 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>();
const columns = [
{
title: '名称',
dataIndex: 'name',
key: 'name'
},
{
title: '内容',
className: 'column-money',
dataIndex: 'url',
key: 'url'
},
{
title: '备注',
dataIndex: 'comments'
}
];
const columns = [
{
title: '名称',
dataIndex: 'name',
key: 'name',
},
{
title: '内容',
className: 'column-money',
dataIndex: 'url',
key: 'url',
},
{
title: '备注',
dataIndex: 'comments',
},
];
const data = [
{
key: '1',
name: '服务端',
url: 'https://git.websoft.top/gxwebsoft/mp-java.git',
comments: '基于 Spring Boot + MyBatis Plus 的企业级后端API服务'
},
{
key: '2',
name: '管理端',
url: 'https://code.websoft.top/gxwebsoft/mp-vue.git',
comments: '基于 Vue 3 + Ant Design Vue 的企业级后台管理系统'
},
{
key: '3',
name: '应用端',
url: 'https://git.websoft.top/gxwebsoft/template-10559.git',
comments: '基于 Taro + React + TypeScript 的跨平台小程序应用'
}
];
const data = [
{
key: '1',
name: '服务端',
url: 'https://git.websoft.top/gxwebsoft/mp-java.git',
comments: '基于 Spring Boot + MyBatis Plus 的企业级后端API服务',
},
{
key: '2',
name: '管理端',
url: 'https://code.websoft.top/gxwebsoft/mp-vue.git',
comments: '基于 Vue 3 + Ant Design Vue 的企业级后台管理系统',
},
{
key: '3',
name: '应用端',
url: 'https://git.websoft.top/gxwebsoft/template-10559.git',
comments: '基于 Taro + React + TypeScript 的跨平台小程序应用',
},
];
const reload = async () => {
website.value = await getSiteInfo();
};
const reload = async () => {
website.value = await getSiteInfo();
};
reload()
reload();
</script>

View File

@@ -16,13 +16,12 @@
<a-tag>LWM6B5NbAP</a-tag>
</div>
</a-descriptions-item>
</a-descriptions>
</template>
<script lang="ts" setup>
import {computed} from 'vue';
import {useUserStore} from "@/store/modules/user";
import { computed } from 'vue';
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();// 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const userStore = useUserStore(); // 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
</script>

View File

@@ -22,25 +22,24 @@
<a-descriptions-item label="到期时间">
<a-tag>{{ website?.expirationTime }}</a-tag>
</a-descriptions-item>
<!-- <a-descriptions-item label="开发">-->
<!-- {{ website }}-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="开发">-->
<!-- {{ website }}-->
<!-- </a-descriptions-item>-->
</a-descriptions>
</template>
<script lang="ts" setup>
import {computed, ref} from 'vue';
import {useUserStore} from "@/store/modules/user";
import {getSiteInfo} from "@/api/layout";
import {CmsWebsite} from "@/api/cms/cmsWebsite/model";
import { computed, ref } from 'vue';
import { useUserStore } from '@/store/modules/user';
import { getSiteInfo } from '@/api/layout';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
const userStore = useUserStore();// 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>()
const userStore = useUserStore(); // 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
const website = ref<CmsWebsite>();
const reload = async () => {
website.value = await getSiteInfo();
};
const reload = async () => {
website.value = await getSiteInfo();
};
reload()
reload();
</script>

View File

@@ -67,7 +67,7 @@
removeDictDataBatch
} from '@/api/system/dict-data';
import type { DictData, DictDataParam } from '@/api/system/dict-data/model';
import { Dict } from "@/api/system/dict/model";
import { Dict } from '@/api/system/dict/model';
const props = defineProps<{
// 字典id

View File

@@ -69,8 +69,8 @@
{{ record.dictName }}
</a-tooltip>
<span class="ele-text-placeholder">
{{ record.dictCode }}
</span>
{{ record.dictCode }}
</span>
</a-space>
</template>
</template>
@@ -107,8 +107,8 @@
import DictEdit from './components/dict-edit.vue';
import { listDictionaries, removeDict } from '@/api/system/dict';
import type { Dict } from '@/api/system/dict/model';
import {getPageTitle} from "@/utils/common";
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
import { getPageTitle } from '@/utils/common';
import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);

View File

@@ -104,8 +104,8 @@
import DictEdit from './components/dict-edit.vue';
import { listDictionaries, removeDict } from '@/api/system/dict';
import type { Dict } from '@/api/system/dict/model';
import {getPageTitle} from "@/utils/common";
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
import { getPageTitle } from '@/utils/common';
import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);

View File

@@ -2,11 +2,7 @@
<div class="ele-body">
<a-card :bordered="false">
<div style="max-width: 960px; margin: 0 auto">
<a-result
status="error"
title="404"
sub-title="您访问的页面走丢了"
>
<a-result status="error" title="404" sub-title="您访问的页面走丢了">
<!-- <div>无访问原因如下:</div>-->
<!-- <div class="error-tips-item">-->
<!-- <close-circle-outlined class="ele-text-danger" />-->

View File

@@ -76,4 +76,4 @@
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
</script>
</script>

View File

@@ -129,8 +129,20 @@
:menu-list="menuData"
@done="reload"
/>
<Delete v-model:visible="showRemoveBatch" :menu-list="menuData" :data="current" :parent-id="parentId" @done="reload" />
<Clone v-model:visible="showClone" :menu-list="menuData" :data="current" :parent-id="parentId" @done="reload" />
<Delete
v-model:visible="showRemoveBatch"
:menu-list="menuData"
:data="current"
:parent-id="parentId"
@done="reload"
/>
<Clone
v-model:visible="showClone"
:menu-list="menuData"
:data="current"
:parent-id="parentId"
@done="reload"
/>
</div>
</template>

View File

@@ -82,7 +82,10 @@
v-model:value="form.totalPrice"
/>
</a-form-item>
<a-form-item label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格" name="reducePrice">
<a-form-item
label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
name="reducePrice"
>
<a-input
allow-clear
placeholder="请输入减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
@@ -124,7 +127,10 @@
v-model:value="form.totalNum"
/>
</a-form-item>
<a-form-item label="0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机" name="payType">
<a-form-item
label="0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机"
name="payType"
>
<a-input
allow-clear
placeholder="请输入0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机"
@@ -138,14 +144,20 @@
v-model:value="form.payStatus"
/>
</a-form-item>
<a-form-item label="0未完成1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款" name="orderStatus">
<a-form-item
label="0未完成1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款"
name="orderStatus"
>
<a-input
allow-clear
placeholder="请输入0未完成1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款"
v-model:value="form.orderStatus"
/>
</a-form-item>
<a-form-item label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡" name="couponType">
<a-form-item
label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
name="couponType"
>
<a-input
allow-clear
placeholder="请输入优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
@@ -159,7 +171,10 @@
v-model:value="form.couponDesc"
/>
</a-form-item>
<a-form-item label="二维码地址,保存订单号,支付成功后才生成" name="qrcode">
<a-form-item
label="二维码地址,保存订单号,支付成功后才生成"
name="qrcode"
>
<a-input
allow-clear
placeholder="请输入二维码地址,保存订单号,支付成功后才生成"
@@ -173,7 +188,10 @@
v-model:value="form.startTime"
/>
</a-form-item>
<a-form-item label="是否已开具发票0未开发票1已开发票2不能开具发票" name="isInvoice">
<a-form-item
label="是否已开具发票0未开发票1已开发票2不能开具发票"
name="isInvoice"
>
<a-input
allow-clear
placeholder="请输入是否已开具发票0未开发票1已开发票2不能开具发票"
@@ -215,7 +233,10 @@
v-model:value="form.expirationTime"
/>
</a-form-item>
<a-form-item label="对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单" name="checkBill">
<a-form-item
label="对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单"
name="checkBill"
>
<a-input
allow-clear
placeholder="请输入对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单"
@@ -433,12 +454,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-split-layout
@@ -15,7 +15,7 @@
<a-space :size="10">
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon>
<plus-outlined/>
<plus-outlined />
</template>
<span>新建</span>
</a-button>
@@ -26,7 +26,7 @@
@click="openEdit(current)"
>
<template #icon>
<edit-outlined/>
<edit-outlined />
</template>
<span>修改</span>
</a-button>
@@ -38,7 +38,7 @@
@click="remove"
>
<template #icon>
<delete-outlined/>
<delete-outlined />
</template>
<span>删除</span>
</a-button>
@@ -76,139 +76,139 @@
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue/es';
import {
PlusOutlined,
EditOutlined,
DeleteOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import {messageLoading, toTreeData, eachTreeData} from 'ele-admin-pro/es';
import OrgUserList from './components/org-user-list.vue';
import OrgEdit from './components/org-edit.vue';
import {
listOrganizations,
removeOrganization
} from '@/api/system/organization';
import type {Organization} from '@/api/system/organization/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue/es';
import {
PlusOutlined,
EditOutlined,
DeleteOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import { messageLoading, toTreeData, eachTreeData } from 'ele-admin-pro/es';
import OrgUserList from './components/org-user-list.vue';
import OrgEdit from './components/org-edit.vue';
import {
listOrganizations,
removeOrganization
} from '@/api/system/organization';
import type { Organization } from '@/api/system/organization/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/system/user/components/Extra.vue';
// 加载状态
const loading = ref(true);
// 加载状态
const loading = ref(true);
// 树形数据
const data = ref<Organization[]>([]);
// 树形数据
const data = ref<Organization[]>([]);
// 树展开的key
const expandedRowKeys = ref<number[]>([]);
// 树展开的key
const expandedRowKeys = ref<number[]>([]);
// 树选中的key
const selectedRowKeys = ref<number[]>([]);
// 树选中的key
const selectedRowKeys = ref<number[]>([]);
// 选中数据
const current = ref<Organization | null>(null);
// 选中数据
const current = ref<Organization | null>(null);
// 是否显示表单弹窗
const showEdit = ref(false);
// 是否显示表单弹窗
const showEdit = ref(false);
// 编辑回显数据
const editData = ref<Organization | null>(null);
// 编辑回显数据
const editData = ref<Organization | null>(null);
/* 查询 */
const query = () => {
loading.value = true;
listOrganizations()
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d, i) => {
d.title = d.organizationName;
d.key = d.organizationId;
d.value = d.organizationId;
/* 查询 */
const query = () => {
loading.value = true;
listOrganizations()
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d, i) => {
d.title = d.organizationName;
d.key = d.organizationId;
d.value = d.organizationId;
if (typeof d.key === 'number') {
eks.push(d.key);
}
});
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
// if (typeof list[0].key === 'number') {
// selectedRowKeys.value = [list[0].key];
// }
// current.value = list[0];
// current.value.organizationId = 0;
} else {
selectedRowKeys.value = [];
current.value = null;
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
};
/* 选择数据 */
const onTreeSelect = () => {
eachTreeData(data.value, (d) => {
if (typeof d.key === 'number' && selectedRowKeys.value.includes(d.key)) {
current.value = d;
return false;
}
});
};
/* 打开编辑弹窗 */
const openEdit = (item?: Organization | null) => {
editData.value = item ?? null;
showEdit.value = true;
};
/* 删除 */
const remove = () => {
Modal.confirm({
title: '提示',
content: '确定要删除选中的部门吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = messageLoading('请求中..', 0);
removeOrganization(current.value?.organizationId)
.then((msg) => {
hide();
message.success(msg);
query();
})
.catch((e) => {
hide();
message.error(e.message);
if (typeof d.key === 'number') {
eks.push(d.key);
}
});
}
});
};
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
// if (typeof list[0].key === 'number') {
// selectedRowKeys.value = [list[0].key];
// }
// current.value = list[0];
// current.value.organizationId = 0;
} else {
selectedRowKeys.value = [];
current.value = null;
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
};
query();
/* 选择数据 */
const onTreeSelect = () => {
eachTreeData(data.value, (d) => {
if (typeof d.key === 'number' && selectedRowKeys.value.includes(d.key)) {
current.value = d;
return false;
}
});
};
/* 打开编辑弹窗 */
const openEdit = (item?: Organization | null) => {
editData.value = item ?? null;
showEdit.value = true;
};
/* 删除 */
const remove = () => {
Modal.confirm({
title: '提示',
content: '确定要删除选中的部门吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = messageLoading('请求中..', 0);
removeOrganization(current.value?.organizationId)
.then((msg) => {
hide();
message.success(msg);
query();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
query();
</script>
<script lang="ts">
export default {
name: 'SystemOrganization'
};
export default {
name: 'SystemOrganization'
};
</script>
<style lang="less" scoped>
.sys-organization-list {
padding: 12px 6px;
height: calc(100vh - 242px);
border-width: 1px;
border-style: solid;
overflow: auto;
}
.sys-organization-list {
padding: 12px 6px;
height: calc(100vh - 242px);
border-width: 1px;
border-style: solid;
overflow: auto;
}
</style>

View File

@@ -122,7 +122,7 @@
import { ref } from 'vue';
import { Company, CompanyParam } from '@/api/system/company/model';
import useSearch from '@/utils/use-search';
import { pagePlug } from "@/api/system/plug";
import { pagePlug } from '@/api/system/plug';
const props = defineProps<{
// 修改回显的数据

View File

@@ -1,31 +1,31 @@
<!-- 搜索表单 -->
<template>
<!-- <a-space style="flex-wrap: wrap">-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl(`/website/plug`)"-->
<!-- >企业官网-->
<!-- </a-button>-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl('/website/plug')"-->
<!-- >项目管理-->
<!-- </a-button-->
<!-- >-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl('/website/plug')"-->
<!-- >河马商店-->
<!-- </a-button-->
<!-- >-->
<!-- </a-space>-->
<!-- <a-space style="flex-wrap: wrap">-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl(`/website/plug`)"-->
<!-- >企业官网-->
<!-- </a-button>-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl('/website/plug')"-->
<!-- >项目管理-->
<!-- </a-button-->
<!-- >-->
<!-- <a-button-->
<!-- type="text"-->
<!-- @click="openUrl('/website/plug')"-->
<!-- >河马商店-->
<!-- </a-button-->
<!-- >-->
<!-- </a-space>-->
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon">-->
<!-- <template #icon>-->
<!-- <PlusOutlined/>-->
<!-- </template>-->
<!-- <span>创建应用</span>-->
<!-- </a-button>-->
<!-- <a-button type="primary" class="ele-btn-icon">-->
<!-- <template #icon>-->
<!-- <PlusOutlined/>-->
<!-- </template>-->
<!-- <span>创建应用</span>-->
<!-- </a-button>-->
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -38,67 +38,66 @@
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import type {CompanyParam} from '@/api/system/company/model';
import {watch} from 'vue';
import useSearch from "@/utils/use-search";
import {openSpmUrl} from "@/utils/common";
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import { PlusOutlined } from '@ant-design/icons-vue';
import type { CompanyParam } from '@/api/system/company/model';
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { openSpmUrl } from '@/utils/common';
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
navigationList?: CmsNavigation[];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
navigationList?: CmsNavigation[];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: CompanyParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: CompanyParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where, resetFields} = useSearch<CompanyParam>({
companyId: undefined,
userId: undefined,
phone: undefined,
tenantId: undefined,
version: undefined,
type: undefined,
official: undefined,
keywords: undefined
});
// 新增
const add = () => {
openSpmUrl(`https://websoft.top/passport/login`)
};
// 按分类查询
const onCategoryId = (id: number) => {
where.categoryId = id;
emit('search', where);
};
const search = () => {
emit('search', {
...where
// 表单数据
const { where, resetFields } = useSearch<CompanyParam>({
companyId: undefined,
userId: undefined,
phone: undefined,
tenantId: undefined,
version: undefined,
type: undefined,
official: undefined,
keywords: undefined
});
};
/* 重置 */
const reset = () => {
resetFields();
search();
};
// 新增
const add = () => {
openSpmUrl(`https://websoft.top/passport/login`);
};
watch(
() => props.selection,
() => {
}
);
// 按分类查询
const onCategoryId = (id: number) => {
where.categoryId = id;
emit('search', where);
};
const search = () => {
emit('search', {
...where
});
};
/* 重置 */
const reset = () => {
resetFields();
search();
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -10,10 +10,8 @@
<a-row :gutter="16">
<a-col
v-bind="
styleResponsive
? { xl: 6, lg: 6, md: 6, sm: 24, xs: 24 }
: { span: 12 }
"
styleResponsive ? { xl: 6, lg: 6, md: 6, sm: 24, xs: 24 } : { span: 12 }
"
class="gutter-row"
v-for="(item, index) in list"
:key="index"
@@ -28,10 +26,10 @@
:preview="false"
class="app-icon"
style="
border: 1px solid #e3e3e3;
box-shadow: 0 0 1px -1px;
border-radius: 12px;
"
border: 1px solid #e3e3e3;
box-shadow: 0 0 1px -1px;
border-radius: 12px;
"
:src="item.companyLogo"
@click="openUrl('/system/plug/detail/' + item.companyId)"
fallback="https://file.wsdns.cn/20230218/550e610d43334dd2a7f66d5b20bd58eb.svg"
@@ -40,9 +38,9 @@
<a
class="name ele-text-heading"
@click="openUrl('/system/plug/detail/' + item.companyId)"
>{{ item.tenantName }}</a
>{{ item.tenantName }}</a
>
<a-rate class="rate" v-model:value="rate" disabled allow-half/>
<a-rate class="rate" v-model:value="rate" disabled allow-half />
<div class="company ele-text-placeholder">
<a-typography-text
type="secondary"
@@ -62,13 +60,13 @@
</div>
<div class="plug-bottom">
<div class="downloads ele-text-placeholder"
>安装 {{ item.clicks }}
>安装 {{ item.clicks }}
</div>
<a-button type="primary" disabled v-if="planId === item.tenantId"
>已安装
>已安装
</a-button>
<a-button v-else type="primary" @click="onClone(item)"
>安装
>安装
</a-button>
</div>
</div>
@@ -86,154 +84,154 @@
</div>
</template>
<script setup lang="ts">
import {getPageTitle, openUrl} from '@/utils/common';
import {onClone} from '@/utils/plug-uitl';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ref} from 'vue';
import {Company, CompanyParam} from '@/api/system/company/model';
import useSearch from '@/utils/use-search';
import {pageCompanyAll} from '@/api/system/company';
import { getPageTitle, openUrl } from '@/utils/common';
import { onClone } from '@/utils/plug-uitl';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ref } from 'vue';
import { Company, CompanyParam } from '@/api/system/company/model';
import useSearch from '@/utils/use-search';
import { pageCompanyAll } from '@/api/system/company';
const props = defineProps<{
// 修改回显的数据
use: boolean;
}>();
const props = defineProps<{
// 修改回显的数据
use: boolean;
}>();
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const searchText = ref('');
const rate = ref(3.5);
const list = ref<Company[]>([]);
const industry = ref<any>();
const total = ref<any>(0);
const planId = ref<number>(Number(localStorage.getItem('PlanId')));
const searchText = ref('');
const rate = ref(3.5);
const list = ref<Company[]>([]);
const industry = ref<any>();
const total = ref<any>(0);
const planId = ref<number>(Number(localStorage.getItem('PlanId')));
// 查询条件
const {where, resetFields} = useSearch<CompanyParam>({
keywords: undefined,
industryParent: '',
industryChild: '',
recommend: undefined,
authoritative: 1,
sceneType: 'recommend',
limit: 20,
page: 1
});
const onIndustry = (item: any) => {
where.industryChild = item[1];
};
const onTabs = (index) => {
if (index == 'recommend') {
where.recommend = true;
}
if (index == 'free') {
where.recommend = false;
}
if (index == 'pay') {
where.recommend = false;
}
if (index == 'new') {
where.sceneType = 'new';
}
if (index == 'collect') {
where.sceneType = 'collect';
}
reload();
};
const reset = () => {
resetFields();
reload();
};
const reload = () => {
where.sort = 'buys';
where.order = 'desc';
pageCompanyAll(where).then((data) => {
total.value = data?.count;
if (data?.list) {
list.value = data?.list;
}
// 查询条件
const { where, resetFields } = useSearch<CompanyParam>({
keywords: undefined,
industryParent: '',
industryChild: '',
recommend: undefined,
authoritative: 1,
sceneType: 'recommend',
limit: 20,
page: 1
});
};
reload();
const onIndustry = (item: any) => {
where.industryChild = item[1];
};
const onTabs = (index) => {
if (index == 'recommend') {
where.recommend = true;
}
if (index == 'free') {
where.recommend = false;
}
if (index == 'pay') {
where.recommend = false;
}
if (index == 'new') {
where.sceneType = 'new';
}
if (index == 'collect') {
where.sceneType = 'collect';
}
reload();
};
const reset = () => {
resetFields();
reload();
};
const reload = () => {
where.sort = 'buys';
where.order = 'desc';
pageCompanyAll(where).then((data) => {
total.value = data?.count;
if (data?.list) {
list.value = data?.list;
}
});
};
reload();
</script>
<style scoped lang="less">
.ele-body-card {
background-color: transparent;
padding: 20px;
}
.ele-body-card {
background-color: transparent;
padding: 20px;
}
.card-title {
display: flex;
justify-content: space-between;
margin-top: 10px;
}
.gutter-row {
margin: 0 auto 30px auto;
.gutter-box {
.card-title {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 200px;
margin-top: 10px;
}
.plug-item {
display: flex;
.app-icon {
}
.info {
font-size: 14px;
margin-left: 12px;
max-width: 234px;
.name {
font-size: 20px;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
font-weight: 500;
}
.rate {
font-size: 13px;
}
.company {
}
}
}
.plug-desc {
padding: 10px 0;
font-size: 16px;
}
.plug-bottom {
.gutter-row {
margin: 0 auto 30px auto;
.gutter-box {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 200px;
.plug-item {
display: flex;
.app-icon {
}
.info {
font-size: 14px;
margin-left: 12px;
max-width: 234px;
.name {
font-size: 20px;
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
font-weight: 500;
}
.rate {
font-size: 13px;
}
.company {
}
}
}
.plug-desc {
padding: 10px 0;
font-size: 16px;
}
.plug-bottom {
display: flex;
justify-content: space-between;
}
}
}
}
.ele-text-heading {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.ele-text-heading {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.plug-page {
display: flex;
justify-content: center;
}
.plug-page {
display: flex;
justify-content: center;
}
</style>

View File

@@ -55,18 +55,18 @@
</a-card>
</div>
</div>
<!-- <div class="goods-item">-->
<!-- <div class="title"> 购买时长 </div>-->
<!-- <div class="info">-->
<!-- <a-radio-group v-model:value="duration">-->
<!-- <a-radio-button value="1">1个月</a-radio-button>-->
<!-- <a-radio-button value="12">1年</a-radio-button>-->
<!-- <a-radio-button value="24">2年</a-radio-button>-->
<!-- <a-radio-button value="36">3年</a-radio-button>-->
<!-- <a-radio-button value="60">5年</a-radio-button>-->
<!-- </a-radio-group>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="goods-item">-->
<!-- <div class="title"> 购买时长 </div>-->
<!-- <div class="info">-->
<!-- <a-radio-group v-model:value="duration">-->
<!-- <a-radio-button value="1">1个月</a-radio-button>-->
<!-- <a-radio-button value="12">1年</a-radio-button>-->
<!-- <a-radio-button value="24">2年</a-radio-button>-->
<!-- <a-radio-button value="36">3年</a-radio-button>-->
<!-- <a-radio-button value="60">5年</a-radio-button>-->
<!-- </a-radio-group>-->
<!-- </div>-->
<!-- </div>-->
<div class="goods-item">
<div class="title"></div>
<div class="info">
@@ -203,7 +203,7 @@
const id = params.id;
if (id) {
getCompanyAll(Number(id)).then((data) => {
console.log(data,'getCompany')
console.log(data, 'getCompany');
assignFields({
...data
});

View File

@@ -9,8 +9,8 @@
<script lang="ts" setup>
import Tenant from './components/tenant.vue';
import {getPageTitle} from "@/utils/common";
import CmsWebsiteSearch from "./components/search.vue";
import { getPageTitle } from '@/utils/common';
import CmsWebsiteSearch from './components/search.vue';
</script>
<script lang="ts">

View File

@@ -41,12 +41,7 @@
@click="openUrl('/system/plug/detail/' + item.companyId)"
>{{ item.tenantName }}</a
>
<a-rate
class="rate"
v-model:value="rate"
disabled
allow-half
/>
<a-rate class="rate" v-model:value="rate" disabled allow-half />
<div class="company ele-text-placeholder">
<a-typography-paragraph
type="secondary"

View File

@@ -52,9 +52,7 @@
:width="80"
:preview="false"
:src="item.companyLogo"
@click="
openUrl('/system/plug/detail/' + item.companyId)
"
@click="openUrl('/system/plug/detail/' + item.companyId)"
fallback="https://file.wsdns.cn/20230218/550e610d43334dd2a7f66d5b20bd58eb.svg"
/>
<div class="info">

View File

@@ -6,97 +6,124 @@
:label-col="styleResponsive ? { md: 3, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="styleResponsive ? { md: 9, sm: 19, xs: 24 } : { flex: '1' }"
>
<a-form-item label="允许被搜索" name="name" extra="关闭后,用户无法通过名称搜索到此网站">
<a-switch v-model:checked="form.searched" checked-children="允许" un-checked-children="不允许" @change="save" />
<a-form-item
label="允许被搜索"
name="name"
extra="关闭后,用户无法通过名称搜索到此网站"
>
<a-switch
v-model:checked="form.searched"
checked-children="允许"
un-checked-children="不允许"
@change="save"
/>
</a-form-item>
<a-form-item label="文章发布审核" name="articleReview" extra="开启需要审核后发布,关闭则直接发布">
<a-switch v-model:checked="form.articleReview" checked-children="需要" un-checked-children="不需要" @change="save" />
<a-form-item
label="文章发布审核"
name="articleReview"
extra="开启需要审核后发布,关闭则直接发布"
>
<a-switch
v-model:checked="form.articleReview"
checked-children="需要"
un-checked-children="不需要"
@change="save"
/>
</a-form-item>
<a-form-item label="开发者模式" name="plugin" extra="开启开发者模式">
<a-switch v-model:checked="form.plugin" checked-children="启用" un-checked-children="禁用" @change="save" />
<a-switch
v-model:checked="form.plugin"
checked-children="启用"
un-checked-children="禁用"
@change="save"
/>
</a-form-item>
<a-form-item label="隐藏底部版权信息" name="showAdminCopyright">
<a-switch v-model:checked="form.showAdminCopyright" checked-children="显示" un-checked-children="隐藏" @change="save" />
<a-switch
v-model:checked="form.showAdminCopyright"
checked-children="显示"
un-checked-children="隐藏"
@change="save"
/>
</a-form-item>
</a-form>
</a-card>
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {message} from 'ant-design-vue';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {FormInstance} from 'ant-design-vue/es/form';
import useFormData from '@/utils/use-form-data';
import {addSetting, updateSettingByKey} from "@/api/system/setting";
import {useWebsiteSettingStore} from "@/store/modules/setting";
import { ref, watch } from 'vue';
import { message } from 'ant-design-vue';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { FormInstance } from 'ant-design-vue/es/form';
import useFormData from '@/utils/use-form-data';
import { addSetting, updateSettingByKey } from '@/api/system/setting';
import { useWebsiteSettingStore } from '@/store/modules/setting';
const props = defineProps<{
value?: string;
// 修改回显的数据
data?: any | null;
}>();
const props = defineProps<{
value?: string;
// 修改回显的数据
data?: any | null;
}>();
// 是否开启响应式布局
const themeStore = useThemeStore();
const settingStore = useWebsiteSettingStore();
const {styleResponsive} = storeToRefs(themeStore);
// 提交状态
const loading = ref(false);
// 是否是修改
const isUpdate = ref(false);
//
const formRef = ref<FormInstance | null>(null);
// 表单数据
const {form, resetFields, assignFields} = useFormData<any>({
settingId: undefined,
settingKey: 'privacy',
searched: undefined,
showAdminCopyright: ''
});
// 是否开启响应式布局
const themeStore = useThemeStore();
const settingStore = useWebsiteSettingStore();
const { styleResponsive } = storeToRefs(themeStore);
// 提交状态
const loading = ref(false);
// 是否是修改
const isUpdate = ref(false);
//
const formRef = ref<FormInstance | null>(null);
// 表单数据
const { form, resetFields, assignFields } = useFormData<any>({
settingId: undefined,
settingKey: 'privacy',
searched: undefined,
showAdminCopyright: ''
});
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
// 更新状态
settingStore.setSetting(form)
const appForm = {
...form,
content: JSON.stringify(form)
};
const saveOrUpdate = isUpdate.value ? updateSettingByKey : addSetting;
saveOrUpdate(appForm)
.then(() => {
message.success('保存成功');
})
.catch((e) => {
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.data,
(data) => {
console.log(data,'propss')
if (data?.settingKey) {
isUpdate.value = true
// 表单赋值
assignFields(data);
} else {
// 新增
isUpdate.value = false
resetFields();
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
// 更新状态
settingStore.setSetting(form);
const appForm = {
...form,
content: JSON.stringify(form)
};
const saveOrUpdate = isUpdate.value ? updateSettingByKey : addSetting;
saveOrUpdate(appForm)
.then(() => {
message.success('保存成功');
})
.catch((e) => {
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.data,
(data) => {
console.log(data, 'propss');
if (data?.settingKey) {
isUpdate.value = true;
// 表单赋值
assignFields(data);
} else {
// 新增
isUpdate.value = false;
resetFields();
}
}
);
</script>

View File

@@ -82,7 +82,11 @@
style="width: calc(100% - 50px)"
/>
<a-tooltip title="复制">
<a-button @click="onCopyText(`https://admin.gxwebsoft.com/api/open/wx-work`)">
<a-button
@click="
onCopyText(`https://admin.gxwebsoft.com/api/open/wx-work`)
"
>
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>

View File

@@ -6,34 +6,34 @@
>
<a-tabs v-model:active-key="active">
<a-tab-pane tab="网站设置" key="website">
<Website v-model:value="active" :data="data"/>
<Website v-model:value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="上传设置" key="upload">
<Upload v-model:value="active" :data="data"/>
<Upload v-model:value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="短信设置" key="sms">
<Sms v-model:value="active" :data="data"/>
<Sms v-model:value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="注册设置" key="register">
<Register :value="active" :data="data"/>
<Register :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="微信小程序" key="mp-weixin">
<MpWeixin :value="active" :data="data"/>
<MpWeixin :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="企业微信" key="wx-work">
<WxWork :value="active" :data="data"/>
<WxWork :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="微信公众号" key="wx-official">
<WxOfficial :value="active" :data="data"/>
<WxOfficial :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="隐私与安全" key="privacy">
<Privacy :value="active" :data="data"/>
<Privacy :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="打印设置" key="printer">
<Printer :value="active" :data="data"/>
<Printer :value="active" :data="data" />
</a-tab-pane>
<a-tab-pane tab="更新缓存" key="clear">
<Clear :value="active" :data="data"/>
<Clear :value="active" :data="data" />
</a-tab-pane>
</a-tabs>
</a-card>
@@ -41,44 +41,44 @@
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {Setting} from '@/api/system/setting/model';
import Website from './components/website.vue';
import Upload from './components/upload.vue';
import Register from './components/register.vue';
import WxWork from './components/wx-work.vue';
import WxOfficial from './components/wx-official.vue';
import MpWeixin from './components/mp-weixin.vue';
import Privacy from './components/privacy.vue';
// import Payment from './components/payment.vue';
import Sms from './components/sms.vue';
import Printer from './components/printer.vue';
import Clear from './components/clear.vue';
import {getSettingByKey} from '@/api/system/setting';
import { ref, watch } from 'vue';
import { Setting } from '@/api/system/setting/model';
import Website from './components/website.vue';
import Upload from './components/upload.vue';
import Register from './components/register.vue';
import WxWork from './components/wx-work.vue';
import WxOfficial from './components/wx-official.vue';
import MpWeixin from './components/mp-weixin.vue';
import Privacy from './components/privacy.vue';
// import Payment from './components/payment.vue';
import Sms from './components/sms.vue';
import Printer from './components/printer.vue';
import Clear from './components/clear.vue';
import { getSettingByKey } from '@/api/system/setting';
// tab页选中
const active = ref('privacy');
// tab页选中
const active = ref('privacy');
const data = ref<Setting>();
const data = ref<Setting>();
const reload = () => {
getSettingByKey(active.value).then(res => {
data.value = res;
})
};
const reload = () => {
getSettingByKey(active.value).then((res) => {
data.value = res;
});
};
reload();
reload();
watch(
() => active.value,
() => {
reload();
}
);
watch(
() => active.value,
() => {
reload();
}
);
</script>
<script lang="ts">
export default {
name: 'Setting'
};
export default {
name: 'Setting'
};
</script>

View File

@@ -1,55 +1,54 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-space
style="flex-wrap: wrap"
v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')"
>
<a-button
type="text"
v-if="hasPermission('sys:org:list')"
@click="openUrl('/staff')"
>人员管理
</a-button
>
>人员管理
</a-button>
<a-button
type="text"
v-if="hasPermission('sys:userVerify:list')"
@click="openUrl('/system/user-verify')"
>实名认证
</a-button
>
>实名认证
</a-button>
<a-button
type="text"
v-if="hasAnyRole(['superAdmin','admin'])"
v-if="hasAnyRole(['superAdmin', 'admin'])"
@click="openUrl('/system/admin')"
>管理员列表
</a-button
>
>管理员列表
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch, nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {hasAnyRole, hasPermission, hasRole} from "@/utils/permission";
import { watch, nextTick } from 'vue';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { openUrl } from '@/utils/common';
import { hasAnyRole, hasPermission, hasRole } from '@/utils/permission';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
})
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
});
watch(
() => props.selection,
() => {
}
);
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -19,53 +19,53 @@
</template>
<script lang="ts" setup>
import {ref, computed} from 'vue';
import {message} from 'ant-design-vue/es';
import {listRoles} from '@/api/system/role';
import type {Role} from '@/api/system/role/model';
import { ref, computed } from 'vue';
import { message } from 'ant-design-vue/es';
import { listRoles } from '@/api/system/role';
import type { Role } from '@/api/system/role/model';
const emit = defineEmits<{
(e: 'update:value', value: Role[]): void;
(e: 'blur'): void;
}>();
const emit = defineEmits<{
(e: 'update:value', value: Role[]): void;
(e: 'blur'): void;
}>();
const props = withDefaults(
defineProps<{
// 选中的角色
value?: Role[];
//
placeholder?: string;
}>(),
{
placeholder: '请选择角色'
}
);
// 选中的角色id
const roleIds = computed(() => props.value?.map((d) => d.roleId as number));
// 角色数据
const data = ref<Role[]>([]);
/* 更新选中数据 */
const updateValue = (value: number[]) => {
emit(
'update:value',
value.map((v) => ({roleId: v}))
const props = withDefaults(
defineProps<{
// 选中的角色
value?: Role[];
//
placeholder?: string;
}>(),
{
placeholder: '请选择角色'
}
);
};
/* 获取角色数据 */
listRoles()
.then((list) => {
data.value = list;
})
.catch((e) => {
message.error(e.message);
});
// 选中的角色id
const roleIds = computed(() => props.value?.map((d) => d.roleId as number));
/* 失去焦点 */
const onBlur = () => {
emit('blur');
};
// 角色数据
const data = ref<Role[]>([]);
/* 更新选中数据 */
const updateValue = (value: number[]) => {
emit(
'update:value',
value.map((v) => ({ roleId: v }))
);
};
/* 获取角色数据 */
listRoles()
.then((list) => {
data.value = list;
})
.catch((e) => {
message.error(e.message);
});
/* 失去焦点 */
const onBlur = () => {
emit('blur');
};
</script>

View File

@@ -154,7 +154,7 @@
// import { getDictionaryOptions } from '@/utils/common';
import { Organization } from '@/api/system/organization/model';
import { Grade } from '@/api/user/grade/model';
import {TEMPLATE_ID} from "@/config/setting";
import { TEMPLATE_ID } from '@/config/setting';
// 是否开启响应式布局
const themeStore = useThemeStore();

View File

@@ -49,7 +49,9 @@
v-bind="styleResponsive ? { md: 12, sm: 24, xs: 24 } : { span: 12 }"
>
<a-form-item label="可用余额">
<span class="ele-text-success">{{ formatNumber(user.balance) }}</span>
<span class="ele-text-success"
>{{ formatNumber(user.balance) }}</span
>
</a-form-item>
<a-form-item label="可用积分">
<span class="ele-text">{{ user.points }}</span>

View File

@@ -97,11 +97,7 @@
/>
</a-form-item>
<a-form-item label="" name="idcard">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.idcard"
/>
<a-input allow-clear placeholder="请输入" v-model:value="form.idcard" />
</a-form-item>
<a-form-item label="" name="truename">
<a-input
@@ -254,12 +250,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<UserOauthEdit v-model:visible="showEdit" :data="current" @done="reload" />
<UserOauthEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -61,7 +65,11 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserOauthEdit from './components/userOauthEdit.vue';
import { pageUserOauth, removeUserOauth, removeBatchUserOauth } from '@/api/system/userOauth';
import {
pageUserOauth,
removeUserOauth,
removeBatchUserOauth
} from '@/api/system/userOauth';
import type { UserOauth, UserOauthParam } from '@/api/system/userOauth/model';
// 表格实例
@@ -104,25 +112,25 @@
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '渠道',
dataIndex: 'oauthType',
key: 'oauthType',
align: 'center',
align: 'center'
},
{
title: 'oauthId',
dataIndex: 'oauthId',
key: 'oauthId',
align: 'center',
align: 'center'
},
{
title: 'unionid',
dataIndex: 'unionid',
key: 'unionid',
align: 'center',
align: 'center'
},
{
title: '操作',

View File

@@ -1,12 +1,12 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -20,9 +20,9 @@
<script lang="ts" setup>
// import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import useSearch from "@/utils/use-search";
import {UserVerifyParam} from "@/api/system/userVerify/model";
import {push} from "@/utils/common";
import useSearch from '@/utils/use-search';
import { UserVerifyParam } from '@/api/system/userVerify/model';
import { push } from '@/utils/common';
const props = withDefaults(
defineProps<{
@@ -40,7 +40,7 @@
}>();
// 表单数据
const {where} = useSearch<UserVerifyParam>({
const { where } = useSearch<UserVerifyParam>({
id: undefined,
type: undefined,
keywords: '',
@@ -54,7 +54,7 @@
const reload = () => {
emit('search', where);
}
};
watch(
() => props.selection,

View File

@@ -21,7 +21,9 @@
>
<a-form-item label="类型" name="type">
<a-tag v-if="form.type === 0">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{
['个人', '企业'][form.type]
}}</a-tag>
</a-form-item>
<a-form-item label="真实姓名" name="realName">
<a-input
@@ -40,7 +42,12 @@
/>
</a-form-item>
<a-form-item label="身份证(正面)" name="sfz1">
<a-image :src="form.sfz1" :width="80" :height="80" v-if="form.status == 1" />
<a-image
:src="form.sfz1"
:width="80"
:height="80"
v-if="form.status == 1"
/>
<SelectFile
v-else
:placeholder="`请选择图片`"
@@ -51,7 +58,12 @@
/>
</a-form-item>
<a-form-item label="身份证(反面)" name="sfz2">
<a-image :src="form.sfz2" :width="80" :height="80" v-if="form.status == 1" />
<a-image
:src="form.sfz2"
:width="80"
:height="80"
v-if="form.status == 1"
/>
<SelectFile
v-else
:placeholder="`请选择图片`"
@@ -80,221 +92,220 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addUserVerify, updateUserVerify} from '@/api/system/userVerify';
import {UserVerify} from '@/api/system/userVerify/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
import {FileRecord} from '@/api/system/file/model';
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addUserVerify, updateUserVerify } from '@/api/system/userVerify';
import { UserVerify } from '@/api/system/userVerify/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
})
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
} else {
resetFields();
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
});
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -21,18 +21,20 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
<div class="text-orange-500 py-1" v-if="record.status == 2"
>原因{{ record.comments }}</div
>
</template>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -46,225 +48,232 @@
</a-card>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {pageUserVerify, removeUserVerify, removeBatchUserVerify} from '@/api/system/userVerify';
import type {UserVerify, UserVerifyParam} from '@/api/system/userVerify/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {
pageUserVerify,
removeUserVerify,
removeBatchUserVerify
} from '@/api/system/userVerify';
import type {
UserVerify,
UserVerifyParam
} from '@/api/system/userVerify/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/system/user/components/Extra.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 0;
return pageUserVerify({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
customRender: ({text}) => ['个人', '企业'][text]
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center',
},
{
title: '证件号码',
dataIndex: 'idCard',
key: 'idCard',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
},
// {
// title: '身份证',
// dataIndex: 'sfz1',
// key: 'sfz1',
// align: 'center',
// },
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
// {
// title: '驳回',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 0;
return pageUserVerify({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
customRender: ({ text }) => ['个人', '企业'][text]
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '证件号码',
dataIndex: 'idCard',
key: 'idCard',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
// {
// title: '身份证',
// dataIndex: 'sfz1',
// key: 'sfz1',
// align: 'center',
// },
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center'
},
// {
// title: '驳回',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'UserVerify'
};
export default {
name: 'UserVerify'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,15 +1,19 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-radio-group v-model:value="where.type">
<a-radio-button :value="0" @click="push(`/system/user-verify`)">个人</a-radio-button>
<a-radio-button :value="1" @click="push(`/system/user-verify2`)">企业</a-radio-button>
<a-radio-button :value="0" @click="push(`/system/user-verify`)"
>个人</a-radio-button
>
<a-radio-button :value="1" @click="push(`/system/user-verify2`)"
>企业</a-radio-button
>
</a-radio-group>
<a-input-search
allow-clear
@@ -24,9 +28,9 @@
<script lang="ts" setup>
// import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import useSearch from "@/utils/use-search";
import {UserVerifyParam} from "@/api/system/userVerify/model";
import {push} from "@/utils/common";
import useSearch from '@/utils/use-search';
import { UserVerifyParam } from '@/api/system/userVerify/model';
import { push } from '@/utils/common';
const props = withDefaults(
defineProps<{
@@ -44,7 +48,7 @@
}>();
// 表单数据
const {where} = useSearch<UserVerifyParam>({
const { where } = useSearch<UserVerifyParam>({
id: undefined,
type: undefined,
keywords: '',
@@ -58,7 +62,7 @@
const reload = () => {
emit('search', where);
}
};
watch(
() => props.selection,

View File

@@ -21,7 +21,9 @@
>
<a-form-item label="类型" name="type">
<a-tag v-if="form.type === 0">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{
['个人', '企业'][form.type]
}}</a-tag>
</a-form-item>
<a-form-item label="主体名称" name="name">
<a-input
@@ -40,7 +42,12 @@
/>
</a-form-item>
<a-form-item label="营业执照" name="zzImg">
<a-image :src="form.zzImg" :width="80" :height="80" v-if="form.status == 1" />
<a-image
:src="form.zzImg"
:width="80"
:height="80"
v-if="form.status == 1"
/>
<SelectFile
v-else
:placeholder="`请上传营业执照`"
@@ -50,44 +57,44 @@
@del="onDeleteYzImg"
/>
</a-form-item>
<!-- <a-form-item label="真实姓名" name="realName">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入真实姓名"-->
<!-- v-model:value="form.realName"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="证件号码" name="idCard">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入证件号码"-->
<!-- v-model:value="form.idCard"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(正面)" name="sfz1">-->
<!-- <a-image :src="form.sfz1" :width="80" :height="80" v-if="form.status == 1" />-->
<!-- <SelectFile-->
<!-- v-else-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz1"-->
<!-- @done="chooseSfz1"-->
<!-- @del="onDeleteSfz1"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(反面)" name="sfz2">-->
<!-- <a-image :src="form.sfz2" :width="80" :height="80" v-if="form.status == 1" />-->
<!-- <SelectFile-->
<!-- v-else-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz2"-->
<!-- @done="chooseSfz2"-->
<!-- @del="onDeleteSfz2"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="真实姓名" name="realName">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入真实姓名"-->
<!-- v-model:value="form.realName"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="证件号码" name="idCard">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入证件号码"-->
<!-- v-model:value="form.idCard"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(正面)" name="sfz1">-->
<!-- <a-image :src="form.sfz1" :width="80" :height="80" v-if="form.status == 1" />-->
<!-- <SelectFile-->
<!-- v-else-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz1"-->
<!-- @done="chooseSfz1"-->
<!-- @del="onDeleteSfz1"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(反面)" name="sfz2">-->
<!-- <a-image :src="form.sfz2" :width="80" :height="80" v-if="form.status == 1" />-->
<!-- <SelectFile-->
<!-- v-else-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz2"-->
<!-- @done="chooseSfz2"-->
<!-- @del="onDeleteSfz2"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="1">审核通过</a-radio>
@@ -107,270 +114,269 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addUserVerify, updateUserVerify} from '@/api/system/userVerify';
import {UserVerify} from '@/api/system/userVerify/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
import {FileRecord} from '@/api/system/file/model';
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addUserVerify, updateUserVerify } from '@/api/system/userVerify';
import { UserVerify } from '@/api/system/userVerify/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
const zzImg = ref<ItemType[]>([]);
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
const zzImg = ref<ItemType[]>([]);
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
zzCode: undefined,
zzImg: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
],
name: [
{
required: true,
type: 'string',
message: '请填写实名认证名称',
trigger: 'blur'
}
],
zzCode: [
{
required: true,
type: 'string',
message: '请填写营业执照号码',
trigger: 'blur'
}
],
zzImg: [
{
required: true,
type: 'string',
message: '请上传营业执照',
trigger: 'blur'
}
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
zzCode: undefined,
zzImg: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const chooseYzImg = (data: FileRecord) => {
zzImg.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.zzImg = data.path;
};
const onDeleteYzImg = (index: number) => {
zzImg.value.splice(index, 1);
form.zzImg = '';
}
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
zzImg.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
})
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
})
}
if (props.data.zzImg) {
zzImg.value.push({
uid: uuid(),
url: props.data.zzImg,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
} else {
resetFields();
],
name: [
{
required: true,
type: 'string',
message: '请填写实名认证名称',
trigger: 'blur'
}
],
zzCode: [
{
required: true,
type: 'string',
message: '请填写营业执照号码',
trigger: 'blur'
}
],
zzImg: [
{
required: true,
type: 'string',
message: '请上传营业执照',
trigger: 'blur'
}
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const chooseYzImg = (data: FileRecord) => {
zzImg.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.zzImg = data.path;
};
const onDeleteYzImg = (index: number) => {
zzImg.value.splice(index, 1);
form.zzImg = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
zzImg.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
});
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
});
}
if (props.data.zzImg) {
zzImg.value.push({
uid: uuid(),
url: props.data.zzImg,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -24,18 +24,20 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
<div class="text-orange-500 py-1" v-if="record.status == 2"
>原因{{ record.comments }}</div
>
</template>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -49,225 +51,232 @@
</a-card>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {pageUserVerify, removeUserVerify, removeBatchUserVerify} from '@/api/system/userVerify';
import type {UserVerify, UserVerifyParam} from '@/api/system/userVerify/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {
pageUserVerify,
removeUserVerify,
removeBatchUserVerify
} from '@/api/system/userVerify';
import type {
UserVerify,
UserVerifyParam
} from '@/api/system/userVerify/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/system/user/components/Extra.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 1;
return pageUserVerify({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
customRender: ({text}) => ['个人', '企业'][text]
},
{
title: '主体名称',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '证件号码',
dataIndex: 'zzCode',
key: 'zzCode',
align: 'center',
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center',
},
{
title: '联系电话',
dataIndex: 'phone',
key: 'phone',
align: 'center',
},
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
// {
// title: '备注',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 1;
return pageUserVerify({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
customRender: ({ text }) => ['个人', '企业'][text]
},
{
title: '主体名称',
dataIndex: 'name',
key: 'name',
align: 'center'
},
{
title: '证件号码',
dataIndex: 'zzCode',
key: 'zzCode',
align: 'center'
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '联系电话',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
// {
// title: '备注',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center'
},
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'UserVerify'
};
export default {
name: 'UserVerify'
};
</script>
<style lang="less" scoped></style>