# 表单日志 **Repository Path**: lxstm32/form-log ## Basic Information - **Project Name**: 表单日志 - **Description**: 用来记录表单操作日志。 其实这个完全可以由后端实现,但不是所有后端都这样,遇到的大多数后端都比较懒。 一般来说前端操作一下就调一下后端接口就行了。但后端觉得写比较太麻烦却让前端去做,很无耻!!! - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-08 - **Last Updated**: 2025-02-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: 表单 ## README # 表单日志 #### 介绍 用来记录表单操作日志。 其实这个完全可以由后端实现,但不是所有后端都这样,遇到的大多数后端都比较懒。 一般来说前端操作一下就调一下后端接口就行了。但后端觉得写比较太麻烦却让前端去做,很无耻!!! #### 软件架构 软件架构说明 #### 安装教程 如果你有 Node.js 环境,可以使用 http-server 模块: npm install -g http-server 然后在你的项目目录下运行: http-server 这会在 http://127.0.0.1:8080 启动一个本地服务器。 打开网页去调试中看效果 #### 使用说明 // 示例使用 const validFormOld = { name: 'tom', age: 18, hobby: ['ball', 'bat'], scores: [80, 85, 91, 100], friends: [ { name: 'jerry' }, { name: 'duck' } ], body: { weight: 50, height: 150 } }; const validFormNew = { name: 'tommy', age: 18, hobby: ['bat','ball1'], scores: [80, 85, 91, 100], friends: [ { name: 'goose' }, { name: 'rabbit' } , { name: 'jerry' } ], body: { weight: 55, height: 150 } }; const formMap = { name: '姓名', age: '年龄', hobby: '爱好', scores: '成绩', friends: {name:'伙伴名称'}, body: { weight: '体重', height: '身高' } }; compareForms(validFormOld, validFormNew, formMap); console.log(logStr) 预期结果: 姓名 由 tom 改为 tommy VM67:54 爱好 减少了: ball VM67:58 爱好 新增了: ball1 VM67:54 friends 减少了: duck VM67:58 friends 新增了: goose, rabbit VM67:68 在friends中, 伙伴名称 jerry 位置由 0 改变为 2 VM67:38 体重 由 50 改为 55 [ '姓名 由 tom 改为 tommy', '爱好 减少了: ball', '爱好 新增了: ball1', 'friends 减少了: duck', 'friends 新增了: goose, rabbit', '在friends中, 伙伴名称 jerry 位置由 0 改变为 2', '体重 由 50 改为 55' ] #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)