From ff0570abd2e34dc9bfa7854b88112d559fc6f4bd Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Tue, 15 Aug 2023 13:42:26 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90add=E3=80=91readme=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 206 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 150 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 99958562..e17bde2f 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,186 @@ # laws_sinotruk_client +框架继承注意要点 +==== +1. 中国重汽法规也有手机端,手机端单独开发部署,不与PC端混在一起 +2. 升级最新版本的PDF.js +3. word文件预览暂定方案为KKFile(也可能要求转化,待定) +4. 在现有框架下解决初始加载慢的问题(即初始不加载全部组件,采用懒加载) +5. 加入ESLint配置(参考最新框架),对新开发页面进行代码规范处理 +6. 从蔚来拉取页面,绘制首页(后续修改)、文档管理-文档库、文档工具-文档拆分、文档工具-文档对比、业务支持-对外报告管理(改名为资料中心)、 + 信息中心-文档动态、信息中心-我的消息、个人中心-我的收藏、日志中心-操作日志、系统管理(全部)、开发工具全部(仅给开发用) +7. 分析结果由项目二组提供excel说明项目框架各部分范围(高嵩负责) + +laws-sinotruk-web +==== + +当前最新版本: 2.5.1 + +Overview +---- + +基于 [Ant Design of Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/) 实现的 Ant Design Pro Vue 版 +laws-sinotruk 的前端UI框架,采用前后端分离方案,提供强大代码生成器的快速开发平台。 -## Getting started -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +#### 前端技术 -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +- 基础框架:[ant-design-vue](https://github.com/vueComponent/ant-design-vue) - Ant Design Of Vue 实现 +- JavaScript框架:Vue +- Webpack +- node +- yarn +- eslint +- @vue/cli 3.2.1 +- [vue-cropper](https://github.com/xyxiao001/vue-cropper) - 头像裁剪组件 +- [@antv/g2](https://antv.alipay.com/zh-cn/index.html) - Alipay AntV 数据可视化图表 +- [Viser-vue](https://viserjs.github.io/docs.html#/viser/guide/installation) - antv/g2 封装实现 -## Add your files +#### 代码规范 +- 代码迁移需要注意 -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: + 不重复的代码文件,直接拷贝到对应的目录下;重复文件(主要是配置文件),对比代码后copy/修改代码。 + +- 代码引入组件相关事项 + + +- 代码规范 + + 1.命名要有含义,变量命名使用驼峰命名; + + 2.每写一个功能需要加上注释; + + 3.代码优化,尽量共用 + + +- 新增功能文件创建规范 + + 1.命名要有含义 + + 2.新增组件写在components文件里面 + +项目下载和运行 +---- + +- 安装依赖 ``` -cd existing_repo -git remote add origin http://10.10.10.43:9090/laws-sinotruk/laws_sinotruk_client.git -git branch -M main -git push -uf origin main +yarn install ``` -## Integrate with your tools +- 开发模式运行 +``` +yarn run serve +``` -- [ ] [Set up project integrations](http://10.10.10.43:9090/laws-sinotruk/laws_sinotruk_client/-/settings/integrations) +- 编译项目 +``` +yarn run build +``` -## Collaborate with your team +- Lints and fixes files +``` +yarn run lint +``` -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) -## Test and Deploy -Use the built-in continuous integration in GitLab. +其他说明 +---- -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +- 项目使用的 [vue-cli3](https://cli.vuejs.org/guide/), 请更新您的 cli -*** +- 关闭 Eslint (不推荐) 移除 `package.json` 中 `eslintConfig` 整个节点代码 -# Editing this README +- 修改 Ant Design 配色,在文件 `vue.config.js` 中,其他 less 变量覆盖参考 [ant design](https://ant.design/docs/react/customize-theme-cn) 官方说明 +```ecmascript 6 + css: { + loaderOptions: { + less: { + modifyVars: { + /* less 变量覆盖,用于自定义 ant design 主题 */ -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. + 'primary-color': '#F5222D', + 'link-color': '#F5222D', + 'border-radius-base': '4px', + }, + javascriptEnabled: true, + } + } + } +``` -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +附属文档 +---- +- [Ant Design Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn) -## Name -Choose a self-explaining name for your project. +- [报表 viser-vue](https://viserjs.github.io/demo.html#/viser/bar/basic-bar) -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +- [Vue](https://cn.vuejs.org/v2/guide) -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +- [路由/菜单说明](https://github.com/zhangdaiscott/laws-sinotruk/tree/master/ant-design-jeecg-vue/src/router/README.md) -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. +- [ANTD 默认配置项](https://github.com/zhangdaiscott/laws-sinotruk/tree/master/ant-design-jeecg-vue/src/defaultSettings.js) -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. +- 其他待补充... -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. +备注 +---- -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +> @vue/cli 升级后,eslint 规则更新了。由于影响到全部 .vue 文件,需要逐个验证。既暂时关闭部分原本不验证的规则,后期维护时,在逐步修正这些 rules -## Contributing -State if you are open to contributions and what your requirements are for accepting them. -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. +#### 编码排重使用示例 -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +重复校验效果: +![输入图片说明](https://static.oschina.net/uploads/img/201904/19191836_eGkQ.png "在这里输入图片标题") -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +1.引入排重接口,代码如下: -## License -For open source projects, say how it is licensed. +``` +import { duplicateCheck } from '@/api/api' + ``` +2.找到编码必填校验规则的前端代码,代码如下: -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +``` + + +code: { + rules: [ + { required: true, message: '请输入编码!' }, + {validator: this.validateCode} + ] + }, + ``` +3.找到rules里validator对应的方法在哪里,然后使用第一步中引入的排重校验接口. +以用户online表单编码为示例,其中四个必传的参数有: + +``` + {tableName:表名,fieldName:字段名,fieldVal:字段值,dataId:表的主键}, + ``` +具体使用代码如下: + +``` + validateCode(rule, value, callback){ + let pattern = /^[a-z|A-Z][a-z|A-Z|\d|_|-]{0,}$/; + if(!pattern.test(value)){ + callback('编码必须以字母开头,可包含数字、下划线、横杠'); + } else { + var params = { + tableName: "onl_cgreport_head", + fieldName: "code", + fieldVal: value, + dataId: this.model.id + }; + duplicateCheck(params).then((res)=>{ + if(res.success){ + callback(); + }else{ + callback(res.message); + } + }) + } + }, +``` \ No newline at end of file