Giter VIP home page Giter VIP logo

devcloudfe / ng-devui-admin Goto Github PK

View Code? Open in Web Editor NEW
280.0 13.0 50.0 3.7 MB

Customizable admin dashboard template based on Angular and DevUI

Home Page: https://devui.design/admin-page/home

License: MIT License

JavaScript 0.46% TypeScript 83.18% HTML 11.74% SCSS 4.62%
angular admin-template admin-dashboard angular-admin devui-admin devui ng-devui-admin enterprise ng-admin angular-admin-template

ng-devui-admin's People

Contributors

greatzpp avatar huaweidevcloud avatar ricenoddle avatar wangyaju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-devui-admin's Issues

[BUG] ENOENT: no such file or directory, open 'xxxxxx/node_modules/tsconfig.json'

Angular CLI: 15.2.7
Node: 16.15.0
Package Manager: npm 8.5.5
OS: darwin arm64
macOS Monterey, MacBook Air M1

Package Version

@angular-devkit/architect 0.1502.7
@angular-devkit/build-angular 15.2.7
@angular-devkit/core 15.2.7
@angular-devkit/schematics 15.2.7
@angular/cli 15.2.7
@schematics/angular 15.2.7
rxjs 7.5.7
typescript 4.9.5

  1. 在新建项目下执行ng add ng-devui-admin
    The package [email protected] will be installed and executed.
    Would you like to proceed? Yes
    ✔ Packages successfully installed.
    ? Please choose the default language you want to use: 简体中文 (zh-ch)
    ? Would you like to add lint files for your project? (default: Y) Yes
    ? Would you like to add mock module? (default: Y) Yes
    ? Would you like to add i18n? (default: Y) Yes
    Cannot read properties of undefined (reading 'sourceRoot')

  2. angular.json文件添加defaultProject属性,解决步骤1的sourceRoot问题,再次执行ng add ng-devui-admin
    Skipping installation: Package already installed
    ? Please choose the default language you want to use: 简体中文 (zh-ch)
    ? Would you like to add lint files for your project? (default: Y) Yes
    ? Would you like to add mock module? (default: Y) Yes
    ? Would you like to add i18n? (default: Y) Yes
    ENOENT: no such file or directory, open 'xxxxxx/node_modules/tsconfig.json'
    (xxxxxx是项目的文件路径)

[BUG] 使用区块报错

Describe the bug
按照文档使用区块的时候报错

➜  server-list git:(master) ✗ ng g ng-devui-admin:blocks --block-name BasicForm
? How would you like to add blocks:  Insert Module (We will add block module then import it)
Cannot find block node_modules/ng-devui-materials/basic-form/package.json, please download first.

To Reproduce
Steps to reproduce the behavior:
按照文档来的

environments (please complete the following information):

  • Angular CLI: 12.0.5
  • Node: 14.16.1
  • Package Manager: npm 7.22.0
  • OS: darwin x64

想同步使用 DevUI 16.2.0 版本,Angular 版本可以适配一下吗

$ npm i ng-devui
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR! @angular/animations@"^16.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"^15.0.0" from [email protected]
npm ERR! node_modules/ng-devui
npm ERR! ng-devui@"^15.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/zl/.npm/_logs/2024-01-18T03_39_17_659Z-eresolve-report.txt

DevUI Admin:0行代码搭建后台管理系统

本文将手把手教你使用 DevUI Admin 快速搭建一个美观大气的后台管理系统,0代码,纯命令行操作。

最终效果如下:
image

前提条件:在你的电脑安装nodejs

步骤:

  1. 全局安装 Angular 15:npm i -g @angular/cli@15
  2. 创建 Angular 工程:ng new your-project && cd your-project
  3. 添加 DevUI Admin:ng add ng-devui-admin
  4. 安装 DevUI 物料库:npm i ng-devui-materials
  5. 生成页面和区块:cd src/app/pages/getting-started && ng g ng-devui-admin:views

Step 1:全局安装 Angular 15

DevUI Admin是基于Angular框架的,因此需要先全局安装Angular CLI,主要需要安装 Angular 15版本。

npm i -g @angular/cli@15

Step 2:创建 Angular 工程

有了Angular CLI,就可以创建一个NG工程啦。

ng new your-project && cd your-project

Step 3:添加 DevUI Admin

在一个NG工程中添加DevUI Admin只需要一个命令:

ng add ng-devui-admin

Step 4:安装 DevUI 物料库

DevUI Admin 包含4类19个区块,目前所有区块都在DevUI物料库中,这部分是可扩展的。

因此要使用Admin区块,需要先安装这个物料库:

npm i ng-devui-materials

Step 5:生成页面和区块

cd src/app/pages/getting-started && ng g ng-devui-admin:views

在浏览器地址栏访问:
http://localhost:4200/pages/getting-started/my-table

预览效果:
image

[BUG]npm start后出错见截图


安装
全局 Angular cli
npm i -g @angular/cli@11
创建 DevUI Admin 项目
创建一个新的项目

ng new your-project && cd your-project
添加 DevUI Admin 项目

ng add ng-devui-admin
运行
npm start
image

image

[BUG] 安装问题

Describe the bug
安装admin成功,但是ng serve时候报错

Step

  1. ng new xxx然后都是默认
  2. ng add ng-devui-admin
    UPDATE angular.json (3829 bytes)
    UPDATE package.json (1699 bytes)
    UPDATE src/favicon.ico (101332 bytes)
    UPDATE src/index.html (321 bytes)
    UPDATE src/main.ts (809 bytes)
    UPDATE src/app/app-routing.module.ts (803 bytes)
    UPDATE src/app/app.component.ts (534 bytes)
    UPDATE src/app/app.module.ts (1151 bytes)
    提示成功
  3. ng serve报错

Screenshots

image

环境
@angular-devkit/architect 0.1102.13 (cli-only)
@angular-devkit/core 11.2.13 (cli-only)
@angular-devkit/schematics 11.2.13 (cli-only)
@schematics/angular 11.2.13 (cli-only)
@schematics/update 0.1102.13 (cli-only)

[BUG]Error: Module not found: Error: Can't resolve '@angular/cdk/clipboard'

Describe the bug

./src/app/@shared/shared.module.ts:7:0-57 - Error: Module not found: Error: Can't resolve '@angular/cdk/clipboard' in 'src/app/@shared'

Error: src/app/@shared/components/footer/footer.component.html:33:53 - error NG8004: No pipe found with name 'translate'.

To Reproduce
Steps to reproduce the behavior:

  1. ng new xxx ; cd xxx
  2. ng add ng-devui-admin
  3. ng start
  4. See error

Expected behavior
应该启动4200, 看admin的页面啊

Screenshots

environments (please complete the following information):
Angular CLI: 12.2.1
Node: 14.17.4
Package Manager: npm 7.20.6
OS: linux x64

[BUG]ng add ng-devui-admin时报错

Describe the bug
Skipping installation: Package already installed
? Please choose the default language you want to use: 简体中文 (zh-ch)
? Would you like to add lint files for your project? (default: Y) Yes
? Would you like to add mock module? (default: Y) Yes
? Would you like to add i18n? (default: Y) Yes
Cannot read properties of undefined (reading 'sourceRoot')
"@angular/cli": "~15.2.1"

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

environments (please complete the following information):

  • Browser [e.g. chrome 80, safari]
  • component version [e.g. 8.0.0]
  • angular framework version [e.g. 8.0.0]

Additional context
Add any other context about the problem here.

[BUG]修改布局样式,刷新页面不生效,只有清除浏览器缓存才能生效

修改文件内容如下:

//文件目录 src\app\@shared\layouts\da-layout\default-layout.config.ts

import { DaLayoutConfig } from './da-layout.type';
import { WIDE_LAYOUT_CONFIG ,WATERFALL_LAYOUT_CONFIG,TOP_NAV_LAYOUT_CONFIG, COMMON_LAYOUT_CONFIG  } from './da-layout.config'

export const DEFAULT_LAYOUT_CONFIG: DaLayoutConfig = COMMON_LAYOUT_CONFIG;
//{
//   id: 'leftRight',
//   mode: 'sidebarTop',
//   header: {
//     fixed: true,
//     firHeader: {
//       height: 60
//     },
//     secHeader: {
//       hidden: true
//     },
//     hidden: false
//   },
//   sidebar: {
//     fixed: true,
//     firSidebar: {
//       width: 240
//     },
//     secSidebar: {
//       hidden: true
//     },
//     hidden: false
//   },
//   footer: {
//     hidden: false
//   },
//   hideLogo: false
// };

看起来是项目启动后会把这部分配置吃到浏览器的 Local Storage,但是刷新页面并没有重新去reload 这个配置。

[BUG]ng add ng-devui-admin error

ng new devui_web
cd devui_web
ng add ng-devui-admin
Skipping installation: Package already installed
? Please choose the default language you want to use: 简体中文 (zh-ch)
? Would you like to add lint files for your project? (default: Y) Yes
? Would you like to add mock module? (default: Y) Yes
? Would you like to add i18n? (default: Y) Yes
Cannot read properties of undefined (reading 'sourceRoot')

windows10
npm v8.19.3
ng v14.2.9

[BUG]Cannot read properties of undefined (reading 'sourceRoot')

ng version
Angular CLI: 15.2.6
Node: 18.16.0
Package Manager: npm 9.5.1

ng add ng-devui-admin
The package [email protected] will be installed and executed.
Would you like to proceed? Yes
√ Packages successfully installed.
? Please choose the default language you want to use: 简体中文 (zh-ch)
? Would you like to add lint files for your project? (default: Y) Yes
? Would you like to add mock module? (default: Y) No
? Would you like to add i18n? (default: Y) No
Cannot read properties of undefined (reading 'sourceRoot')

[BUG]路由错误,导致新建的页面和区块访问不了

复现步骤

  1. src/app/pages目录下新建一个页面
ng g ng-devui-admin:views --view-name test-page-setting
  1. 交互式命令行中随便选择一个区块,比如CardList,并选择需要创建左侧导航
  2. 在页面中点击该导航,预期应该跳转新创建的卡片列表页面,实际跳转到示例页面,如下图:

输入图片说明

问题原因

怀疑是以下原因之一导致的:

  1. 左侧导航链接错误
  2. 路由配置错误

[BUG] add ng-devui-admin 在install 阶段报错

报错内容

------------------报错内容------------------
'Log files:
/Users/huangwangbo/.npm/_logs/2022-12-12T01_41_02_912Z-debug-0.log

npm resolution error report

While resolving: [email protected]
Found: @angular/[email protected]
node_modules/@angular/animations
@angular/animations@"^15.0.0" from the root project

Could not resolve dependency:
peer @angular/animations@"^13.0.0" from [email protected]
node_modules/ng-devui
ng-devui@"^13.0.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
------------------报错内容------------------

当前的ng版本是 15
使用的命令是
ng add ng-devui-admin --force 和 ng add ng-devui-admin --legacy-peer-deps

[BUG]根据文档操作无法运行,下列只是小部分错误,我是个后端。不太懂怎么修复,但是下载 克隆你们项目又没有问题

Error: src/app/@shared/layouts/da-layout/da-layout.component.ts:241:9 - error TS2532: Object is possibly 'undefined'.

241 if (this.config.header.hidden) {
~~~~~~~~~~~~~~~~~~

Error: src/app/@shared/layouts/da-layout/da-layout.component.ts:245:10 - error TS2532: Object is possibly 'undefined'.

245 if (!this.config.header.firHeader.hidden) {
~~~~~~~~~~~~~~~~~~

Error: src/app/@shared/layouts/da-layout/da-layout.component.ts:245:10 - error TS2532: Object is possibly 'undefined'.

245 if (!this.config.header.firHeader.hidden) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: src/app/@shared/layouts/da-layout/da-layout.component.ts:246:17 - error TS2532: Object is possibly 'undefined'.

246 height += this.config.header.firHeader.height;
~~~~~~~~~~~~~~~~~~

[BUG] DevUI Admin 表单布局中 多列表单 对应的roles 多选显示不正确

Describe the bug
表单布局中 多列表单 对应的roles 多选显示不正确

To Reproduce
Steps to reproduce the behavior:

  1. 点击进入 表单布局 -> 多列表单 找到 Roles
  2. 下拉框 三项多选择
  3. 取消 Developer, 然后再次选中
  4. 查看上面输入框显示内容

Expected behavior
Roles 输入框正确显示内容

Screenshots
截屏2023-10-24 13 21 25

environments (please complete the following information):

Additional context

error TS2339: Property 'devuiThemes'

Win10 + node v14.15.4

image

ERROR in src/app/pages/pages.component.ts:86:51 - error TS2339: Property 'devuiThemes' does not exist on type 'Window & typeof globalThis'.
86 const currentTheme = Object.values(window.devuiThemes).find((i: Theme) => {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.