diff --git a/components.d.ts b/components.d.ts index 01a36e5e..c6352220 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,10 +7,23 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { - ACard: typeof import('ant-design-vue/es')['Card'] + AButton: typeof import('ant-design-vue/es')['Button'] + ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] + ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] ACol: typeof import('ant-design-vue/es')['Col'] + ACollapse: typeof import('ant-design-vue/es')['Collapse'] + ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] + AForm: typeof import('ant-design-vue/es')['Form'] + AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AInput: typeof import('ant-design-vue/es')['Input'] + AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] + AModal: typeof import('ant-design-vue/es')['Modal'] ARow: typeof import('ant-design-vue/es')['Row'] + ASelect: typeof import('ant-design-vue/es')['Select'] + ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] + ASpin: typeof import('ant-design-vue/es')['Spin'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] + AUpload: typeof import('ant-design-vue/es')['Upload'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'] GeoComponent: typeof import('./src/components/GeoComponent/index.vue')['default'] diff --git a/public/images/init-home/mark.png b/public/images/init-home/mark.png new file mode 100644 index 00000000..f653fd50 Binary files /dev/null and b/public/images/init-home/mark.png differ diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 68b9fbaa..c775d864 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -28,3 +28,6 @@ export const StatusColorEnum = { 'warning': 'warning', 'default': 'default', } + + + diff --git a/src/views/init-home/data/RoleData.ts b/src/views/init-home/data/RoleData.ts new file mode 100644 index 00000000..41ca3184 --- /dev/null +++ b/src/views/init-home/data/RoleData.ts @@ -0,0 +1,845 @@ +/** + * 内置角色数据 + */ +export enum ROLEKEYS { + 'device' = 'device', + 'link' = 'link', + 'complex' = 'complex', +} + +export type roleKeysType = keyof typeof ROLEKEYS; + +export const RoleData = { + [ROLEKEYS.device]: { + name: '设备接入岗', + description: '该角色负责设备接入模块的维护管理', + state: { text: '正常', value: 'enabled' }, + }, + [ROLEKEYS.link]: { + name: '运维管理岗', + description: '该角色负责系统运维模块的维护管理', + state: { text: '正常', value: 'enabled' }, + }, + [ROLEKEYS.complex]: { + name: '综合管理岗', + description: '该角色负责系统运维和设备接入模块的维护管理', + state: { text: '正常', value: 'enabled' }, + }, +}; + +export default { + [ROLEKEYS.device]: [ + { + id: '1-3-2', + parentId: '1-3', + path: 'T4zX-b4q8-o7Jy', + sortIndex: 2, + level: 1, + name: '产品', + code: 'device/Product', + icon: 'icon-chanpin', + url: '/iot/device/Product', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'export', + name: '导出', + enabled: true, + granted: true, + }, + { id: 'import', name: '导入', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + accessSupport: { text: '支持', value: 'support' }, + assetType: 'product', + assetAccesses: [ + { + supportId: 'ignore', + name: '全部数据', + enabled: false, + granted: false, + }, + { supportId: 'creator', name: '自己创建的', enabled: false, granted: false }, + { + supportId: 'org', + name: '所在组织', + enabled: false, + granted: false, + }, + { + supportId: 'org-include-children', + name: '所在组织及下级组织', + enabled: false, + granted: false, + }, + ], + options: { switch: true }, + createTime: 1659344075524, + accessDescription: '此菜单支持数据权限控制', + granted: true, + }, + { + id: '1-3-3', + parentId: '1-3', + path: 'T4zX-b4q8-xYd0', + sortIndex: 3, + level: 1, + name: '设备', + code: 'device/Instance', + icon: 'icon-shebei', + url: '/iot/device/Instance', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'export', + name: '导出', + enabled: true, + granted: true, + }, + { id: 'import', name: '导入', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + accessSupport: { text: '支持', value: 'support' }, + assetType: 'device', + assetAccesses: [ + { + supportId: 'ignore', + name: '全部数据', + enabled: false, + granted: false, + }, + { supportId: 'creator', name: '自己创建的', enabled: false, granted: false }, + { + supportId: 'org', + name: '所在组织', + enabled: false, + granted: false, + }, + { + supportId: 'org-include-children', + name: '所在组织及下级组织', + enabled: false, + granted: false, + }, + ], + options: { switch: true }, + createTime: 1659344075524, + accessDescription: '此菜单支持数据权限控制', + granted: true, + }, + { + id: '1-3-4', + parentId: '1-3', + path: 'T4zX-b4q8-8ZFx', + sortIndex: 4, + level: 3, + name: '产品分类', + code: 'device/Category', + icon: 'icon-chanpinfenlei1', + url: '/iot/device/Category', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + assetAccesses: [], + options: { switch: true }, + createTime: 1659344075524, + granted: true, + }, + ], + [ROLEKEYS.link]: [ + { + id: '1-4-2', + parentId: '1-4', + path: 'T4zX-A0TC-UlSD', + sortIndex: 2, + level: 3, + name: '设备接入网关', + code: 'link/AccessConfig', + icon: 'icon-wangguanzishebei', + url: '/iot/link/accessConfig', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-3', + parentId: '1-4', + path: 'T4zX-A0TC-ctFm', + sortIndex: 3, + level: 3, + name: '协议管理', + code: 'link/Protocol', + icon: 'icon-tongzhiguanli', + url: '/iot/link/protocol', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-5', + parentId: '1-4', + path: 'T4zX-A0TC-fDic', + sortIndex: 5, + level: 3, + name: '网络组件', + code: 'link/Type', + icon: 'icon-wangluozujian', + url: '/iot/link/type', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-6', + parentId: '1-4', + path: 'T4zX-A0TC-bBs5', + sortIndex: 6, + level: 3, + name: '证书管理', + code: 'link/Certificate', + icon: 'icon-rizhifuwu', + url: '/iot/link/Certificate', + buttons: [ + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-7', + parentId: '1-4', + path: 'T4zX-A0TC-VilV', + sortIndex: 7, + level: 3, + name: '流媒体服务', + code: 'media/Stream', + icon: 'icon-xuanzetongdao1', + url: '/iot/link/Stream', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-8-1', + parentId: '1-4-8', + path: 'T4zX-A0TC-GIE8-3Op3', + sortIndex: 1, + level: 4, + name: 'OPC UA', + code: 'link/Channel/Opcua', + icon: 'icon-zhilianshebei', + url: '/iot/link/Channel/Opcua', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-8-2', + parentId: '1-4-8', + path: 'T4zX-A0TC-GIE8-79SB', + sortIndex: 2, + level: 4, + name: 'Modbus', + code: 'link/Channel/Modbus', + icon: 'icon-changjingliandong', + url: '/iot/link/Channel/Modbus', + buttons: [ + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-9', + parentId: '1-4', + path: 'T4zX-A0TC-BFum', + sortIndex: 9999, + level: 1, + name: '远程升级', + code: 'device/Firmware', + icon: 'icon-wangluozujian', + url: '/iot/link/firmware', + buttons: [ + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + accessSupport: { text: '不支持', value: 'unsupported' }, + assetAccesses: [], + options: {}, + createTime: 1659344075524, + accessDescription: '此菜单不支持数据权限控制', + granted: true, + }, + ], + [ROLEKEYS.complex]: [ + { + id: '1-3-2', + parentId: '1-3', + path: 'T4zX-b4q8-o7Jy', + sortIndex: 2, + level: 1, + name: '产品', + code: 'device/Product', + icon: 'icon-chanpin', + url: '/iot/device/Product', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'export', + name: '导出', + enabled: true, + granted: true, + }, + { id: 'import', name: '导入', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + accessSupport: { text: '支持', value: 'support' }, + assetType: 'product', + assetAccesses: [ + { + supportId: 'ignore', + name: '全部数据', + enabled: false, + granted: false, + }, + { supportId: 'creator', name: '自己创建的', enabled: false, granted: false }, + { + supportId: 'org', + name: '所在组织', + enabled: false, + granted: false, + }, + { + supportId: 'org-include-children', + name: '所在组织及下级组织', + enabled: false, + granted: false, + }, + ], + options: { switch: true }, + createTime: 1659344075524, + accessDescription: '此菜单支持数据权限控制', + granted: true, + }, + { + id: '1-3-3', + parentId: '1-3', + path: 'T4zX-b4q8-xYd0', + sortIndex: 3, + level: 1, + name: '设备', + code: 'device/Instance', + icon: 'icon-shebei', + url: '/iot/device/Instance', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'export', + name: '导出', + enabled: true, + granted: true, + }, + { id: 'import', name: '导入', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + accessSupport: { text: '支持', value: 'support' }, + assetType: 'device', + assetAccesses: [ + { + supportId: 'ignore', + name: '全部数据', + enabled: false, + granted: false, + }, + { supportId: 'creator', name: '自己创建的', enabled: false, granted: false }, + { + supportId: 'org', + name: '所在组织', + enabled: false, + granted: false, + }, + { + supportId: 'org-include-children', + name: '所在组织及下级组织', + enabled: false, + granted: false, + }, + ], + options: { switch: true }, + createTime: 1659344075524, + accessDescription: '此菜单支持数据权限控制', + granted: true, + }, + { + id: '1-3-4', + parentId: '1-3', + path: 'T4zX-b4q8-8ZFx', + sortIndex: 4, + level: 3, + name: '产品分类', + code: 'device/Category', + icon: 'icon-chanpinfenlei1', + url: '/iot/device/Category', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + assetAccesses: [], + options: { switch: true }, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-2', + parentId: '1-4', + path: 'T4zX-A0TC-UlSD', + sortIndex: 2, + level: 3, + name: '设备接入网关', + code: 'link/AccessConfig', + icon: 'icon-wangguanzishebei', + url: '/iot/link/accessConfig', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'action', name: '启/禁用', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-3', + parentId: '1-4', + path: 'T4zX-A0TC-ctFm', + sortIndex: 3, + level: 3, + name: '协议管理', + code: 'link/Protocol', + icon: 'icon-tongzhiguanli', + url: '/iot/link/protocol', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-5', + parentId: '1-4', + path: 'T4zX-A0TC-fDic', + sortIndex: 5, + level: 3, + name: '网络组件', + code: 'link/Type', + icon: 'icon-wangluozujian', + url: '/iot/link/type', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-6', + parentId: '1-4', + path: 'T4zX-A0TC-bBs5', + sortIndex: 6, + level: 3, + name: '证书管理', + code: 'link/Certificate', + icon: 'icon-rizhifuwu', + url: '/iot/link/Certificate', + buttons: [ + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'update', + name: '编辑', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-7', + parentId: '1-4', + path: 'T4zX-A0TC-VilV', + sortIndex: 7, + level: 3, + name: '流媒体服务', + code: 'media/Stream', + icon: 'icon-xuanzetongdao1', + url: '/iot/link/Stream', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-8-1', + parentId: '1-4-8', + path: 'T4zX-A0TC-GIE8-3Op3', + sortIndex: 1, + level: 4, + name: 'OPC UA', + code: 'link/Channel/Opcua', + icon: 'icon-zhilianshebei', + url: '/iot/link/Channel/Opcua', + buttons: [ + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-8-2', + parentId: '1-4-8', + path: 'T4zX-A0TC-GIE8-79SB', + sortIndex: 2, + level: 4, + name: 'Modbus', + code: 'link/Channel/Modbus', + icon: 'icon-changjingliandong', + url: '/iot/link/Channel/Modbus', + buttons: [ + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'view', name: '查看', enabled: true, granted: true }, + { + id: 'delete', + name: '删除', + enabled: true, + granted: true, + }, + { id: 'add', name: '新增', enabled: true, granted: true }, + ], + assetAccesses: [], + options: {}, + createTime: 1659344075524, + granted: true, + }, + { + id: '1-4-9', + parentId: '1-4', + path: 'T4zX-A0TC-BFum', + sortIndex: 9999, + level: 1, + name: '远程升级', + code: 'device/Firmware', + icon: 'icon-wangluozujian', + url: '/iot/link/firmware', + buttons: [ + { id: 'update', name: '编辑', enabled: true, granted: true }, + { + id: 'action', + name: '启/禁用', + enabled: true, + granted: true, + }, + { id: 'delete', name: '删除', enabled: true, granted: true }, + { + id: 'add', + name: '新增', + enabled: true, + granted: true, + }, + ], + accessSupport: { text: '不支持', value: 'unsupported' }, + assetAccesses: [], + options: {}, + createTime: 1659344075524, + accessDescription: '此菜单不支持数据权限控制', + granted: true, + }, + ], +}; diff --git a/src/views/init-home/data/interface.ts b/src/views/init-home/data/interface.ts new file mode 100644 index 00000000..bc5345c8 --- /dev/null +++ b/src/views/init-home/data/interface.ts @@ -0,0 +1,33 @@ +/** 初始化数据提交表单 */ +export interface modalState { + host: string; // 本地地址 + port: string; // 本地端口 + publicHost: string; // 公网地址 + publicPort: number | null; // 公网端口 + rules: Record; +} + +/**基本信息表单 */ +export interface formState { + title: string; // 系统名称 + headerTheme: string; // 主题色 + apikey: string; // 高德 API key + basePath: string; // 系统后台访问的URL + logo: string; // 系统logo + icon: string; // 浏览器页签 + rulesFrom: Record; +} + +/** + * logo上传表当 + */ +export interface logoState { + logoValue: string; + logoLoading: boolean; + inLogo: boolean; + inIcon: boolean; + inBackground: boolean; + iconValue: string; + backValue: string; + handleChangeLogo:(url: string) => void +} \ No newline at end of file diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue new file mode 100644 index 00000000..bfada546 --- /dev/null +++ b/src/views/init-home/index.vue @@ -0,0 +1,1117 @@ + + + +