Skip to content

devopsleague/neatlogic-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

中文 / English

关于

neatlogic-web是neatlogic平台前端代码,所有子模块的前端代码都在neatlogic-web中。

neatlogic-web基于vue2.7.16,UI框架在iView4.x源码基础上经过调整。

构建依赖

vue/cli 5.x,webpack 5.x 先全局安装vue/cli最新版

npm install -g @vue/cli

初始化依赖

npm install --registry=https://registry.npm.taobao.org

如果启动时发现大量不明报错,可能原因是npm install阶段加载的依赖包不完整导致,可以对npm进行降级再次install,目前测试v18的npm可以正常install。或者通过cnpm install加载依赖包也可以。cnpm版本也不能太高,建议使用v8.2.0。建议使用nvm管理多版本的node,使用v18.x版本的node会比较稳定。

sudo npm install -g cnpm@8.2.0 --registry=https://registry.npm.taobao.org

cnpm install

构建打包项目代码

cnpm run build

本地开发环境运行项目

需修改apiconfig.json配置文件,将tenantName的值修改为在用的租户(如果使用的是官方提供的用例数据,则租户就是demo),urlPrefix改成neatlogic后端tomcat服务的http://ip:port

通过cnpm启动项目

cnpm run serve

自动纠正文件里不符合eslint的语法

cnpm run lint

设置自动eslintrc

https://www.cnblogs.com/weilai-info/p/10988829.html

设置vscode的个人配置

为了统一代码风格,多人开发时不会出现格式错乱,进行二开时请使用相同的代码风格配置。

安装插件

EsLint、vetur、Prettier - Code formatter、i18nhelper(自动进行i18n键值替换和多语言翻译)

设置>命令面板>输入“setting”>选择“首选项:打开设置”>打开 settings.json

{
   "gitlens.views.repositories.files.layout": "list",
    "git.confirmSync": false,
    "gitlens.advanced.similarityThreshold": null,
    "editor.tabSize": 2,
    "vetur.validation.script": true,
    "vetur.validation.style": true,
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "editor.formatOnSave": false,
    "vetur.format.defaultFormatterOptions": {
      "js-beautify-html": {
        "wrap_attributes": "auto",
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false,
        "eol": "\n",
        "end_with_newline": true,
        "preserve_newlines": true,
        "max-preserve-newlines": 3,
        "indent-inner-html": true,
        "wrap_line_length": 120,
        "editorconfig": true
      }
    },
    "html.format.maxPreserveNewLines": 3,
    "html.format.enable": false,
    "[vue]": {
      "editor.defaultFormatter": "dbaeumer.vscode-eslint"
    },
    "[less]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "gitlens.advanced.blame.customArguments": [],
    "[javascript]": {
      "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "[css]": {
      "editor.defaultFormatter": "HookyQR.beautify"
    },
    "[html]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "javascript.updateImportsOnFileMove.enabled": "always",
  
      "[json]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[git-commit]": {
      "editor.rulers": [
        72
      ],
      "workbench.editor.restoreViewState": false
    },
    "gitlens.advanced.messages": {},  
    "gitlens.gitCommands.closeOnFocusOut": true,
    "workbench.startupEditor": "newUntitledFile",
    "npm.enableRunFromFolder": true,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "editor.autoClosingBrackets":"always",
    "security.workspace.trust.untrustedFiles": "newWindow",
    "workbench.editorAssociations": {
      "*.html": "default"
    },
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "diffEditor.ignoreTrimWhitespace": false,
    "eslint.alwaysShowStatus": true,
    "eslint.format.enable": true,
    "extensions.ignoreRecommendations": true,
    "npm.keybindingsChangedWarningShown": true,
    "settingsSync.ignoredSettings": [],
    "window.zoomLevel": 1,
    "typescript.disableAutomaticTypeAcquisition": true,
    "editor.suggest.snippetsPreventQuickSuggestions": false,
    "eslint.codeActionsOnSave.rules": null
} 

FAQ常见问题

npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired

npm config set strict-ssl false

其他

更新某个依赖

cnpm update 依赖包名字

eg:cnpm update neatlogic-ui

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 81.7%
  • JavaScript 13.6%
  • Less 1.9%
  • CSS 1.7%
  • HTML 1.1%
  • TypeScript 0.0%