Commit e5648c33 authored by baiyinhao's avatar baiyinhao

通知中心和审计日志界面补充假数据

parent fa68f4e8
...@@ -26,26 +26,40 @@ export const columns: BasicColumn[] = [ ...@@ -26,26 +26,40 @@ export const columns: BasicColumn[] = [
title: '对象名称', title: '对象名称',
dataIndex: 'ObjectName', dataIndex: 'ObjectName',
width: 200, width: 200,
customRender: ({ record }) => { customRender: ({ record }) => {
const router = useRouter(); // 获取路由实例
return h( return h(
'a', // 使用 <a> 标签实现点击跳转 'a',
{ {
style: { color: '#1890ff', cursor: 'pointer' }, // 设置样式 style: { color: '#1890ff', cursor: 'pointer' },
onClick: () => {
router.push({
path: '/dict/type/data', //改为要跳转的路径
query: {
dictType: record.dictType, //改为要转递的参数
},
});
},
}, },
record.dictType, record.ObjectName,
); );
}, },
}, },
// {
// title: '对象名称',
// dataIndex: 'ObjectName',
// width: 200,
// customRender: ({ record }) => {
// const router = useRouter(); // 获取路由实例
// return h(
// 'a', // 使用 <a> 标签实现点击跳转
// {
// style: { color: '#1890ff', cursor: 'pointer' }, // 设置样式
// onClick: () => {
// router.push({
// path: '/dict/type/data', //改为要跳转的路径
// query: {
// dictType: record.dictType, //改为要转递的参数
// },
// });
// },
// },
// record.dictType,
// );
// },
// },
{ {
title: '路径', title: '路径',
dataIndex: 'url', dataIndex: 'url',
...@@ -88,24 +102,38 @@ export const columnstab2: BasicColumn[] = [ ...@@ -88,24 +102,38 @@ export const columnstab2: BasicColumn[] = [
dataIndex: 'dataSourceName', dataIndex: 'dataSourceName',
width: 100, width: 100,
customRender: ({ record }) => { customRender: ({ record }) => {
const router = useRouter(); // 获取路由实例
return h( return h(
'a', // 使用 <a> 标签实现点击跳转 'a',
{ {
style: { color: '#1890ff', cursor: 'pointer' }, // 设置样式 style: { color: '#1890ff', cursor: 'pointer' },
onClick: () => {
router.push({
path: '/dict/type/data', //改为要跳转的路径
query: {
dictType: record.dictType, //改为要转递的参数
},
});
},
}, },
record.dictType, record.dataSourceName,
); );
}, },
}, },
// {
// title: '数据源名称',
// dataIndex: 'dataSourceName',
// width: 100,
// customRender: ({ record }) => {
// const router = useRouter(); // 获取路由实例
// return h(
// 'a', // 使用 <a> 标签实现点击跳转
// {
// style: { color: '#1890ff', cursor: 'pointer' }, // 设置样式
// onClick: () => {
// router.push({
// path: '/dict/type/data', //改为要跳转的路径
// query: {
// dictType: record.dictType, //改为要转递的参数
// },
// });
// },
// },
// record.dictType,
// );
// },
// },
{ {
title: '数据源类型', title: '数据源类型',
dataIndex: 'dataSourceType', dataIndex: 'dataSourceType',
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { getMenuListByPage } from '@/api/system/menu/menu'; import { getMenuListByPage } from '@/api/system/menu/menu';
import { Tabs, Descriptions, Alert } from 'ant-design-vue'; import { Tabs, Descriptions, Alert } from 'ant-design-vue';
import { tableListtab1, tableListtab2 } from './mock';
defineOptions({ name: 'RoleManagement' }); defineOptions({ name: 'RoleManagement' });
const filterStore = useFilterStore(); const filterStore = useFilterStore();
...@@ -95,7 +96,19 @@ ...@@ -95,7 +96,19 @@
const [registerModalEmail, { openModal: openModalEmail }] = useModal(); const [registerModalEmail, { openModal: openModalEmail }] = useModal();
const [registerTable, { reload, getForm }] = useTable({ const [registerTable, { reload, getForm }] = useTable({
title: '审计日志', title: '审计日志',
api: getRoleListByPage, api: async (params) => {
console.log('params', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableListtab1.length,
code: '',
message: '',
data: tableListtab1,
};
return { ...response };
},
columns, columns,
// rowSelection: { // rowSelection: {
// type: 'checkbox', // type: 'checkbox',
...@@ -118,7 +131,19 @@ ...@@ -118,7 +131,19 @@
}); });
const [registerTable2, { reload: reload2, getForm: getForm2 }] = useTable({ const [registerTable2, { reload: reload2, getForm: getForm2 }] = useTable({
title: '通知规则名称', title: '通知规则名称',
api: getRoleListByPage, api: async (params) => {
console.log('params', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableListtab2.length,
code: '',
message: '',
data: tableListtab2,
};
return { ...response };
},
columns: columnstab2, columns: columnstab2,
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
......
export const tableListtab1: any[] = [
{
createDate: '2024-10-24 10:04:05',
managerName: '操作人1',
manageType: '操作类型1',
ObjectName: '对象名称1',
url: '触发方式1',
objectType: '元数据变更',
result: '成功',
},
{
createDate: '2024-10-24 10:04:06',
managerName: '操作人1',
manageType: '操作类型1',
ObjectName: '对象名称2',
url: '触发方式1',
objectType: '元数据变更',
result: '成功',
},
{
createDate: '2024-10-24 10:04:07',
managerName: '操作人2',
manageType: '操作类型1',
ObjectName: '对象名称3',
url: '触发方式1',
objectType: '元数据变更',
result: '成功',
},
{
createDate: '2024-10-24 10:04:08',
managerName: '操作人1',
manageType: '操作类型1',
ObjectName: '对象名称4',
url: '触发方式1',
objectType: '元数据变更',
result: '成功',
},
{
createDate: '2024-10-24 10:04:09',
managerName: '操作人2',
manageType: '操作类型1',
ObjectName: '对象名称5',
url: '触发方式1',
objectType: '元数据变更',
result: '成功',
},
];
export const tableListtab2: any[] = [
{
createDate: '2024-10-25 10:04:05',
accessUser: '访问用户1',
accessType: '访问途径1',
serverIp: '主机IP1',
dataSourceName: '数据源1',
dataSourceType: '数据源类型1',
sql: '关联SQL语句1',
endTime: '执行结束时间1',
costTime: '执行耗时1',
result: '成功',
},
{
createDate: '2024-10-25 10:04:05',
accessUser: '访问用户1',
accessType: '访问途径1',
serverIp: '主机IP1',
dataSourceName: '数据源1',
dataSourceType: '数据源类型1',
sql: '关联SQL语句1',
endTime: '执行结束时间1',
costTime: '执行耗时1',
result: '成功',
},
{
createDate: '2024-10-25 10:04:05',
accessUser: '访问用户1',
accessType: '访问途径1',
serverIp: '主机IP1',
dataSourceName: '数据源1',
dataSourceType: '数据源类型1',
sql: '关联SQL语句1',
endTime: '执行结束时间1',
costTime: '执行耗时1',
result: '成功',
},
{
createDate: '2024-10-25 10:04:05',
accessUser: '访问用户1',
accessType: '访问途径1',
serverIp: '主机IP1',
dataSourceName: '数据源1',
dataSourceType: '数据源类型1',
sql: '关联SQL语句1',
endTime: '执行结束时间1',
costTime: '执行耗时1',
result: '成功',
},
{
createDate: '2024-10-25 10:04:05',
accessUser: '访问用户1',
accessType: '访问途径1',
serverIp: '主机IP1',
dataSourceName: '数据源1',
dataSourceType: '数据源类型1',
sql: '关联SQL语句1',
endTime: '执行结束时间1',
costTime: '执行耗时1',
result: '成功',
},
];
import { getAllRoleList } from '@/api/system/role/role';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Tag, Switch } from 'ant-design-vue';
import { useMessage } from '@/hooks/web/useMessage';
import { changeFlagApi } from '@/api/system/user/user';
// 引入开关组件
type CheckedType = boolean | string | number;
export const TreeData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 100,
institutionName: '机构管理',
parentId: 0,
'code:': '001',
ancestors: '0',
orderNum: 0,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 101,
institutionName: '数据平台治理部',
parentId: 100,
'code:': '002',
ancestors: '0,100',
orderNum: 1,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 107,
institutionName: '数据资源管理部',
parentId: 100,
'code:': '003',
ancestors: '0,100',
orderNum: 2,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 102,
institutionName: '研发部门',
parentId: 101,
'code:': '004',
ancestors: '0,100,101',
orderNum: 1,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 103,
institutionName: '市场部门',
parentId: 101,
'code:': '005',
ancestors: '0,100,101',
orderNum: 2,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 104,
institutionName: '测试部门',
parentId: 101,
'code:': '006',
ancestors: '0,100,101',
orderNum: 3,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 105,
institutionName: '财务部门',
parentId: 101,
'code:': '007',
ancestors: '0,100,101',
orderNum: 4,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 106,
institutionName: '运维部门',
parentId: 101,
'code:': '008',
ancestors: '0,100,101',
orderNum: 5,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '1',
businessId: 202,
institutionName: '数据部门',
parentId: 107,
'code:': '009',
ancestors: '0,100,107',
orderNum: 1,
children: [],
selectType: null,
},
{
delFlag: '0',
flag: '0',
businessId: 203,
institutionName: '检查部门',
parentId: 107,
'code:': '010',
ancestors: '0,100,107',
orderNum: 2,
children: [],
selectType: null,
},
];
export const userData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 309,
username: 'yonghu1',
nickName: '测试用户1',
userType: '1',
name: '测试用户1',
createDate: '2024-10-24 10:04:04',
institutionId: 105,
institutionName: '财务部门',
code: '123f',
identity: '1',
roleIds: null,
roleNames: '三级用户',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 310,
username: 'yonghu2',
nickName: '测试用户2',
userType: '1',
name: '测试用户2',
createDate: '2024-10-25 10:05:05',
sex: '0',
institutionId: 105,
institutionName: '财务部门',
code: '123a',
identity: '1',
roleIds: null,
roleNames: null,
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 317,
username: 'yonghu3',
nickName: '测试用户3',
userType: '1',
name: '测试用户3',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123c',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 318,
username: 'yonghu4',
nickName: '测试用户4',
userType: '1',
name: '测试用户4',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123b',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 319,
username: 'yonghu5',
nickName: '测试用户5',
userType: '1',
name: '测试用户5',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: 102,
institutionName: '研发部门',
code: '123x',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
];
export const addUserData: any[] = [
{
delFlag: '0',
flag: '1',
businessId: 400,
username: 'tianjia1',
nickName: '添加用户1',
userType: '1',
name: '添加用户1',
roleName: '工作区访客',
createDate: '2024-10-24 10:04:04',
institutionId: null,
institutionName: '',
code: '123f',
identity: '1',
roleIds: null,
roleNames: '三级用户',
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 402,
username: 'tianjia2',
nickName: '添加用户2',
userType: '1',
name: '添加用户2',
roleName: '工作区访客',
createDate: '2024-10-25 10:05:05',
sex: '0',
institutionId: null,
institutionName: '',
code: '123a',
identity: '1',
roleIds: null,
roleNames: null,
roleList: null,
menuList: [],
},
{
delFlag: '0',
flag: '1',
businessId: 403,
username: 'tianjia3',
nickName: '添加用户3',
userType: '1',
name: '添加用户3',
roleName: '工作区访客',
createDate: '2024-10-26 10:06:06',
sex: '1',
institutionId: null,
institutionName: '',
code: '123c',
identity: '1',
roleIds: null,
roleNames: '超级管理员',
roleList: null,
menuList: [],
},
];
export const accountFormSchema: any[] = [];
...@@ -90,6 +90,8 @@ ...@@ -90,6 +90,8 @@
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { getMenuListByPage } from '@/api/system/menu/menu'; import { getMenuListByPage } from '@/api/system/menu/menu';
import { Tabs, Descriptions, Alert } from 'ant-design-vue'; import { Tabs, Descriptions, Alert } from 'ant-design-vue';
import { tableListtab1, tableListtab2 } from './mock';
import page from '@/router/routes/modules/demo/page';
defineOptions({ name: 'RoleManagement' }); defineOptions({ name: 'RoleManagement' });
const filterStore = useFilterStore(); const filterStore = useFilterStore();
...@@ -100,7 +102,19 @@ ...@@ -100,7 +102,19 @@
const [registerModalEmail, { openModal: openModalEmail }] = useModal(); const [registerModalEmail, { openModal: openModalEmail }] = useModal();
const [registerTable, { reload, getForm }] = useTable({ const [registerTable, { reload, getForm }] = useTable({
title: '通知列表', title: '通知列表',
api: getRoleListByPage, api: async (params) => {
console.log('params', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableListtab1.length,
code: '',
message: '',
data: tableListtab1,
};
return { ...response };
},
columns, columns,
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
...@@ -123,7 +137,19 @@ ...@@ -123,7 +137,19 @@
}); });
const [registerTable2, { reload: reload2, getForm: getForm2 }] = useTable({ const [registerTable2, { reload: reload2, getForm: getForm2 }] = useTable({
title: '通知规则名称', title: '通知规则名称',
api: getRoleListByPage, api: async (params) => {
console.log('params', params);
const response = {
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableListtab2.length,
code: '',
message: '',
data: tableListtab2,
};
return { ...response };
},
columns: columnstab2, columns: columnstab2,
rowSelection: { rowSelection: {
type: 'checkbox', type: 'checkbox',
......
export const tableListtab1: any[] = [
{
createDate: '2024-10-24 10:04:04',
alarmRule: '元数据变更',
alarmLevel: '紧急',
resourceType: '资源类型1',
triggerType: '触发方式1',
},
{
createDate: '2024-10-24 10:04:04',
alarmRule: '元数据变更',
alarmLevel: '紧急',
resourceType: '资源类型1',
triggerType: '触发方式1',
},
{
createDate: '2024-10-24 10:04:04',
alarmRule: '元数据变更',
alarmLevel: '紧急',
resourceType: '资源类型2',
triggerType: '触发方式1',
},
{
createDate: '2024-10-24 10:04:04',
alarmRule: '元数据变更',
alarmLevel: '紧急',
resourceType: '资源类型2',
triggerType: '触发方式1',
},
{
createDate: '2024-10-24 10:04:04',
alarmRule: '元数据变更',
alarmLevel: '紧急',
resourceType: '资源类型1',
triggerType: '触发方式3',
},
];
export const tableListtab2: any[] = [
{
alarmRuleName: '元数据变更',
resourceType: '资源类型1',
alarmLevel: '紧急',
status: '状态1',
},
{
alarmRuleName: '元数据变更',
resourceType: '资源类型1',
alarmLevel: '紧急',
status: '状态2',
},
{
alarmRuleName: '元数据变更',
resourceType: '资源类型1',
alarmLevel: '紧急',
status: '状态3',
},
{
alarmRuleName: '元数据变更',
resourceType: '资源类型1',
alarmLevel: '紧急',
status: '状态4',
},
{
alarmRuleName: '元数据变更',
resourceType: '资源类型1',
alarmLevel: '紧急',
status: '状态5',
},
];
...@@ -83,8 +83,8 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -83,8 +83,8 @@ export const searchFormSchema: FormSchema[] = [
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{ label: '元数据变更', value: '1' }, { label: '元数据变更', value: '元数据变更' },
{ label: '元数据处理', value: '2' }, { label: '元数据处理', value: '元数据处理' },
], ],
placeholder: '请选择通知规则', placeholder: '请选择通知规则',
}, },
...@@ -109,8 +109,8 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -109,8 +109,8 @@ export const searchFormSchema: FormSchema[] = [
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{ label: '元数据变更', value: '1' }, { label: '紧急', value: '紧急' },
{ label: '元数据处理', value: '2' }, { label: '不紧急', value: '不紧急' },
], ],
placeholder: '请选择紧急程度', placeholder: '请选择紧急程度',
}, },
...@@ -133,8 +133,8 @@ export const searchFormSchematab2: FormSchema[] = [ ...@@ -133,8 +133,8 @@ export const searchFormSchematab2: FormSchema[] = [
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{ label: '元数据变更', value: '1' }, { label: '元数据变更', value: '元数据变更' },
{ label: '元数据处理', value: '2' }, { label: '元数据处理', value: '元数据处理' },
], ],
placeholder: '请选择通知规则', placeholder: '请选择通知规则',
}, },
...@@ -146,8 +146,8 @@ export const searchFormSchematab2: FormSchema[] = [ ...@@ -146,8 +146,8 @@ export const searchFormSchematab2: FormSchema[] = [
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{ label: '资源类型1', value: '1' }, { label: '资源类型1', value: '资源类型1' },
{ label: '资源类型2', value: '2' }, { label: '资源类型2', value: '资源类型2' },
], ],
placeholder: '请选择资源类型', placeholder: '请选择资源类型',
}, },
...@@ -159,8 +159,8 @@ export const searchFormSchematab2: FormSchema[] = [ ...@@ -159,8 +159,8 @@ export const searchFormSchematab2: FormSchema[] = [
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
{ label: '元数据变更', value: '1' }, { label: '紧急', value: '紧急' },
{ label: '元数据处理', value: '2' }, { label: '不紧急', value: '不紧急' },
], ],
placeholder: '请选择紧急程度', placeholder: '请选择紧急程度',
}, },
......
...@@ -250,26 +250,32 @@ ...@@ -250,26 +250,32 @@
/**确认按钮*/ /**确认按钮*/
async function handleSubmit() { async function handleSubmit() {
try { const values = await validate();
const values = await validate();
const values2 = await validate2(); console.log('values:', values);
console.log('values:', values);
setModalProps({ confirmLoading: true }); closeModal();
formData.value.code = values.dataScope; reload();
formData.value.menuIds = values.menuIds; // try {
formData.value.deptIdList = ''; // const values = await validate();
formData.value.roleId = ''; // const values2 = await validate2();
addDataScopeApi(formData.value).then((res) => { // console.log('values:', values);
if (res.code === 200) { // setModalProps({ confirmLoading: true });
createMessage.success('新增成功'); // formData.value.code = values.dataScope;
closeModal(); // formData.value.menuIds = values.menuIds;
emit('success', { isUpdate: unref(isPermiss), values: { ...values } }); // formData.value.deptIdList = '';
} // formData.value.roleId = '';
}); // addDataScopeApi(formData.value).then((res) => {
reload(); // if (res.code === 200) {
} finally { // createMessage.success('新增成功');
setModalProps({ confirmLoading: false }); // closeModal();
} // emit('success', { isUpdate: unref(isPermiss), values: { ...values } });
// }
// });
// reload();
// } finally {
// setModalProps({ confirmLoading: false });
// }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment