|
@@ -54,6 +54,7 @@ export class InitService {
|
|
|
const datas: any = [
|
|
|
{
|
|
|
name: '首页',
|
|
|
+ icon: 'House',
|
|
|
order_num: 1,
|
|
|
path: '/',
|
|
|
component: '/home/index',
|
|
@@ -67,6 +68,7 @@ export class InitService {
|
|
|
{
|
|
|
_id: smId,
|
|
|
name: '系统设置',
|
|
|
+ icon: 'Setting',
|
|
|
path: '/system',
|
|
|
order_num: 2,
|
|
|
type: '0',
|
|
@@ -75,6 +77,7 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
name: '菜单设置',
|
|
|
+ icon: 'Setting',
|
|
|
parent_id: smId.toString(),
|
|
|
order_num: 1,
|
|
|
path: '/system/menus',
|
|
@@ -88,7 +91,7 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
zh: '修改',
|
|
|
- code: 'update',
|
|
|
+ code: 'edit',
|
|
|
},
|
|
|
{
|
|
|
zh: '添加下一级',
|
|
@@ -103,6 +106,7 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
name: '角色管理',
|
|
|
+ icon: 'Setting',
|
|
|
parent_id: smId.toString(),
|
|
|
order_num: 2,
|
|
|
path: '/system/role',
|
|
@@ -117,7 +121,7 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
zh: '修改',
|
|
|
- code: 'update',
|
|
|
+ code: 'edit',
|
|
|
},
|
|
|
{
|
|
|
zh: '使用',
|
|
@@ -135,6 +139,7 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
name: '字典管理',
|
|
|
+ icon: 'Setting',
|
|
|
parent_id: smId.toString(),
|
|
|
order_num: 3,
|
|
|
path: '/system/dict',
|
|
@@ -142,9 +147,28 @@ export class InitService {
|
|
|
type: '1',
|
|
|
route_name: 'system_dict',
|
|
|
is_default: '0',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '字典数据',
|
|
|
+ code: 'dict',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
name: '字典数据',
|
|
|
+ icon: 'Setting',
|
|
|
parent_id: smId.toString(),
|
|
|
order_num: 4,
|
|
|
path: '/system/dictData',
|
|
@@ -152,6 +176,45 @@ export class InitService {
|
|
|
type: '2',
|
|
|
route_name: 'system_dict_data',
|
|
|
is_default: '0',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '组织管理',
|
|
|
+ icon: 'Setting',
|
|
|
+ parent_id: smId.toString(),
|
|
|
+ order_num: 3,
|
|
|
+ path: '/system/organization',
|
|
|
+ component: '/system/organization/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'system_organization',
|
|
|
+ is_default: '0',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
];
|
|
|
// 用户管理
|
|
@@ -160,6 +223,7 @@ export class InitService {
|
|
|
{
|
|
|
_id: umId,
|
|
|
name: '用户管理',
|
|
|
+ icon: 'User',
|
|
|
order_num: 3,
|
|
|
path: '/user',
|
|
|
type: '0',
|
|
@@ -168,16 +232,283 @@ export class InitService {
|
|
|
},
|
|
|
{
|
|
|
name: '管理员用户',
|
|
|
+ icon: 'User',
|
|
|
parent_id: umId.toString(),
|
|
|
order_num: 1,
|
|
|
path: '/user/admin',
|
|
|
component: '/user/admin/index',
|
|
|
type: '1',
|
|
|
route_name: 'user_admin',
|
|
|
- }
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '重置密码',
|
|
|
+ code: 'rp',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '使用/禁用',
|
|
|
+ code: 'changeUse',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ // 作业管理
|
|
|
+ const jmId = new ObjectId();
|
|
|
+ const jobMenus = [
|
|
|
+ {
|
|
|
+ _id: jmId,
|
|
|
+ name: '作业管理',
|
|
|
+ icon: 'TakeawayBox',
|
|
|
+ order_num: 4,
|
|
|
+ path: '/job',
|
|
|
+ type: '0',
|
|
|
+ route_name: 'job',
|
|
|
+ is_default: '1',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '实时作业',
|
|
|
+ icon: 'TakeawayBox',
|
|
|
+ parent_id: jmId.toString(),
|
|
|
+ order_num: 1,
|
|
|
+ path: '/job/realtime',
|
|
|
+ component: '/job/realtime/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'job_realtime',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '历史作业',
|
|
|
+ icon: 'TakeawayBox',
|
|
|
+ parent_id: jmId.toString(),
|
|
|
+ order_num: 2,
|
|
|
+ path: '/job/history',
|
|
|
+ component: '/job/history/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'job_history',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '监控作业',
|
|
|
+ icon: 'TakeawayBox',
|
|
|
+ parent_id: jmId.toString(),
|
|
|
+ order_num: 3,
|
|
|
+ path: '/job/monitor',
|
|
|
+ component: '/job/monitor/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'job_monitor',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ // 集群管理
|
|
|
+ const colonymId = new ObjectId();
|
|
|
+ const colonyMenus = [
|
|
|
+ {
|
|
|
+ _id: colonymId,
|
|
|
+ name: '集群管理',
|
|
|
+ icon: 'Histogram',
|
|
|
+ order_num: 5,
|
|
|
+ path: '/colony',
|
|
|
+ type: '0',
|
|
|
+ route_name: 'colony',
|
|
|
+ is_default: '1',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '分区管理',
|
|
|
+ icon: 'Histogram',
|
|
|
+ parent_id: colonymId.toString(),
|
|
|
+ order_num: 1,
|
|
|
+ path: '/colony/partition',
|
|
|
+ component: '/colony/partition/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'colony_partition',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '节点管理',
|
|
|
+ icon: 'Histogram',
|
|
|
+ parent_id: colonymId.toString(),
|
|
|
+ order_num: 2,
|
|
|
+ path: '/colony/node',
|
|
|
+ component: '/colony/node/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'colony_node',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ // 监控管理
|
|
|
+ const controlmId = new ObjectId();
|
|
|
+ const controlMenus = [
|
|
|
+ {
|
|
|
+ _id: controlmId,
|
|
|
+ icon: 'DataLine',
|
|
|
+ name: '监控管理',
|
|
|
+ order_num: 6,
|
|
|
+ path: '/control',
|
|
|
+ type: '0',
|
|
|
+ route_name: 'control',
|
|
|
+ is_default: '1',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '资源管理',
|
|
|
+ icon: 'DataLine',
|
|
|
+ parent_id: controlmId.toString(),
|
|
|
+ order_num: 1,
|
|
|
+ path: '/control/resource',
|
|
|
+ component: '/control/resource/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'control_resource',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '性能管理',
|
|
|
+ icon: 'DataLine',
|
|
|
+ parent_id: controlmId.toString(),
|
|
|
+ order_num: 2,
|
|
|
+ path: '/control/performance',
|
|
|
+ component: '/control/performance/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'control_performance',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '报表管理',
|
|
|
+ icon: 'DataLine',
|
|
|
+ parent_id: controlmId.toString(),
|
|
|
+ order_num: 3,
|
|
|
+ path: '/control/statement',
|
|
|
+ component: '/control/statement/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'control_statement',
|
|
|
+ config: [
|
|
|
+ {
|
|
|
+ zh: '添加',
|
|
|
+ code: 'add',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '修改',
|
|
|
+ code: 'edit',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ zh: '删除',
|
|
|
+ code: 'delete',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
];
|
|
|
+ const operate = {
|
|
|
+ name: '操作日志',
|
|
|
+ icon: 'Compass',
|
|
|
+ order_num: 7,
|
|
|
+ path: '/operate',
|
|
|
+ component: '/operate/index',
|
|
|
+ type: '1',
|
|
|
+ route_name: 'operate',
|
|
|
+ };
|
|
|
const password = {
|
|
|
name: '修改密码',
|
|
|
+ icon: 'Unlock',
|
|
|
order_num: 999,
|
|
|
path: '/acccount',
|
|
|
component: '/acccount/index',
|
|
@@ -187,7 +518,7 @@ export class InitService {
|
|
|
|
|
|
datas.push(...systemMenus, ...userMenus, password);
|
|
|
// 项目业务菜单
|
|
|
- const busMenus = [];
|
|
|
+ const busMenus = [...jobMenus, ...colonyMenus, ...controlMenus, operate];
|
|
|
datas.push(...busMenus);
|
|
|
await this.menusModel.insertMany(datas);
|
|
|
}
|
|
@@ -196,10 +527,57 @@ export class InitService {
|
|
|
async initDict() {
|
|
|
const num = await this.dictTypeModel.count();
|
|
|
if (num > 0) return;
|
|
|
- const isUseType = [{ title: '是否使用', code: 'isUse', is_use: '0' }];
|
|
|
+ const isUseType = [
|
|
|
+ { title: '是否使用', code: 'isUse', is_use: '0' },
|
|
|
+ { title: '图标', code: 'icon', is_use: '0' },
|
|
|
+ ];
|
|
|
const isUseData = [
|
|
|
{ code: 'isUse', label: '使用', value: '0', sort: 1, is_use: '0' },
|
|
|
{ code: 'isUse', label: '禁用', value: '1', sort: 2, is_use: '0' },
|
|
|
+ { code: 'icon', label: 'House', value: 'House', sort: 1, is_use: '0' },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'Setting',
|
|
|
+ value: 'Setting',
|
|
|
+ sort: 2,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
+ { code: 'icon', label: 'User', value: 'User', sort: 3, is_use: '0' },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'Compass',
|
|
|
+ value: 'Compass',
|
|
|
+ sort: 4,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'Histogram',
|
|
|
+ value: 'Histogram',
|
|
|
+ sort: 5,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'DataLine',
|
|
|
+ value: 'DataLine',
|
|
|
+ sort: 6,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'TakeawayBox',
|
|
|
+ value: 'TakeawayBox',
|
|
|
+ sort: 7,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'icon',
|
|
|
+ label: 'Unlock',
|
|
|
+ value: 'Unlock',
|
|
|
+ sort: 8,
|
|
|
+ is_use: '0',
|
|
|
+ },
|
|
|
];
|
|
|
await this.dictTypeModel.insertMany(isUseType);
|
|
|
await this.dictDataModel.insertMany(isUseData);
|