# neatlogic-web **Repository Path**: kevin_yan/neatlogic-web ## Basic Information - **Project Name**: neatlogic-web - **Description**: neatlogic所有模块的前端代码,基于vue2.6、iView、D3.js(v5) - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: develop3.0.0 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 41 - **Created**: 2023-10-07 - **Last Updated**: 2024-01-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 中文 / [English](README.en.md) ## 关于 neatlogic-web是neatlogic平台前端代码,所有子模块的前端代码都在neatlogic-web中。 neatlogic-web基于vue2.x,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 ``` ## 本地开发环境运行项目 >需修改apiconfig.json配置文件,将tenantName的值修改为在用的租户(如果使用的是官方提供的用例数据,则租户就是demo),urlPrefix改成neatlogic后端tomcat服务的http://ip:port ``` npm run serve ``` 异常: 如果启动时发现大量不明报错,可能原因是npm install阶段加载的依赖包不完整导致,可以对npm进行降级再次install,目前测试v14的npm可以正常install,v18+的npm有可能出现异常。或者通过cnpm install加载依赖包也可以。cnpm版本也不能太高,建议使用v8.2.0。建议使用nvm管理多版本的node,使用v16.x版本的node会比较稳定。 ``` sudo npm install -g cnpm@8.2.0 --registry=https://registry.npm.taobao.org ``` ## 打包项目代码 ``` npm run build ``` ## 更新某个依赖 ``` npm update 依赖包名字 eg:npm update neatlogic-ui ``` ## 自动纠正文件里不符合eslint的语法 ``` npm 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 } ```