diff --git a/PasteForm.HttpApi.Host/wwwroot/page/lib/editor.md/README.md b/PasteForm.HttpApi.Host/wwwroot/page/lib/editor.md/README.md index 7c2030dea932b71f61d9299449ed8b586611937e..c5fc6637b5de6734536bac45b274eda52d0e55f2 100644 --- a/PasteForm.HttpApi.Host/wwwroot/page/lib/editor.md/README.md +++ b/PasteForm.HttpApi.Host/wwwroot/page/lib/editor.md/README.md @@ -1,119 +1,105 @@ -# Editor.md -![](https://pandao.github.io/editor.md/images/logos/editormd-logo-180x180.png) -![](https://img.shields.io/github/stars/pandao/editor.md.svg) -![](https://img.shields.io/github/forks/pandao/editor.md.svg) -![](https://img.shields.io/github/tag/pandao/editor.md.svg) -![](https://img.shields.io/github/release/pandao/editor.md.svg) -![](https://img.shields.io/github/issues/pandao/editor.md.svg) -![](https://img.shields.io/bower/v/editor.md.svg) - -**Editor.md** : The open source embeddable online markdown editor (component), based on CodeMirror & jQuery & Marked. - -### Features - -- Support Standard Markdown / CommonMark and GFM (GitHub Flavored Markdown); -- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...; -- Markdown Extras : Support [ToC (Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html), [Emoji](https://pandao.github.io/editor.md/examples/emoji.html), [Task lists](https://pandao.github.io/editor.md/examples/task-lists.html), [@Links](https://pandao.github.io/editor.md/examples/@links.html)...; -- Compatible with all major browsers (IE8+), compatible Zepto.js and iPad; -- Support [decode & fliter of the HTML tags & attributes](https://pandao.github.io/editor.md/examples/html-tags-decode.html); -- Support [TeX (LaTeX expressions, Based on KaTeX)](https://pandao.github.io/editor.md/examples/katex.html), [Flowchart](https://pandao.github.io/editor.md/examples/flowchart.html) and [Sequence Diagram](https://pandao.github.io/editor.md/examples/sequence-diagram.html) of Markdown extended syntax; -- Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins; - -[README & Examples (English)](https://pandao.github.io/editor.md/en.html) - - --------- - -**Editor.md** 是一款开源的、可嵌入的 Markdown 在线编辑器(组件),基于 CodeMirror、jQuery 和 Marked 构建。 - -![editormd-screenshot](https://pandao.github.io/editor.md/examples/images/editormd-screenshot.png "editormd-screenshot") - -#### 主要特性 - -- 支持通用 Markdown / CommonMark 和 GFM (GitHub Flavored Markdown) 风格的语法,也可[变身为代码编辑器](https://pandao.github.io/editor.md/examples/change-mode.html); -- 支持实时预览、图片(跨域)上传、预格式文本/代码/表格插入、代码折叠、跳转到行、搜索替换、只读模式、自定义样式主题和多语言语法高亮等功能; -- 支持 [ToC(Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html)、[Emoji表情](https://pandao.github.io/editor.md/examples/emoji.html)、[Task lists](https://pandao.github.io/editor.md/examples/task-lists.html)、[@链接](https://pandao.github.io/editor.md/examples/@links.html)等 Markdown 扩展语法; -- 支持 TeX 科学公式(基于 [KaTeX](https://pandao.github.io/editor.md/examples/katex.html))、流程图 [Flowchart](https://pandao.github.io/editor.md/examples/flowchart.html) 和 [时序图 Sequence Diagram](https://pandao.github.io/editor.md/examples/sequence-diagram.html); -- 支持[识别和解析 HTML 标签,并且支持自定义过滤标签及属性解析](https://pandao.github.io/editor.md/examples/html-tags-decode.html),具有可靠的安全性和几乎无限的扩展性; -- 支持 AMD / CMD 模块化加载(支持 [Require.js](https://pandao.github.io/editor.md/examples/use-requirejs.html) & [Sea.js](https://pandao.github.io/editor.md/examples/use-seajs.html)),并且支持[自定义扩展插件](https://pandao.github.io/editor.md/examples/define-plugin.html); -- 兼容主流的浏览器(IE8+)和 [Zepto.js](https://pandao.github.io/editor.md/examples/use-zepto.html),且支持 iPad 等平板设备; - -#### Examples - -[https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/editor.md/examples/index.html) - -#### Download & install - -[Github download](https://github.com/pandao/editor.md/archive/master.zip) - -Bower install : - -```shell -bower install editor.md +# PasteForm 项目 README + +## �ans简介 +PasteForm 是一个动态表单系统,能够基于 JSON 数据自动创建和渲染表单。该项目主要用于编辑数据,具有高度可定制和可扩展的特性。系统包括多个模块,支持动态字段、用户权限管理、角色分配、文章信息管理等功能。 + +## 主要特性 +- **动态表单**:根据 JSON 配置自动生成表单,支持多种数据类型和 UI 组件。 +- **用户权限系统**:基于角色的访问控制(RBAC),支持权限校验、角色绑定、用户等级管理等。 +- **字段配置**:支持字段类型定义,如字符串、整数、布尔值、日期、枚举等。 +- **数据模型**:包含多个数据模型,如用户信息(`UserInfo`)、文章(`ArticleInfo`)、动态表(`DynamicTable`)等。 +- **缓存支持**:支持 Redis 和内存缓存,提升系统响应速度。 +- **API 服务**:提供 RESTful API,支持增删改查操作。 +- **前端 UI**:使用 HTML、CSS 和 JavaScript 构建前端界面,集成图标字体和日历控件。 + +## 子项目结构 +- **PasteForm.Application**:包含业务逻辑层,如服务类(`DynamicFieldAppService`, `RoleInfoAppService`)。 +- **PasteForm.Application.Contracts**:包含 DTO(数据传输对象)模型和接口定义。 +- **PasteForm.Domain**:包含实体模型(`DynamicField`, `DynamicTable`)和仓储接口。 +- **PasteForm.EntityFrameworkCore**:包含数据库上下文(`PasteFormDbContext`)和 ORM 映射。 +- **PasteForm.HttpApi.Host**:包含 Web API 控制器(`UserController`, `DynamicFieldController`)和前端页面资源。 + +## 使用技术 +- **.NET 6**:使用 C# 构建后端服务。 +- **Entity Framework Core**:用于数据库操作和模型映射。 +- **Redis / MemoryCache**:缓存数据,提升系统性能。 +- **Avalonia UI / HTML + CSS + JavaScript**:前端使用 Web 技术构建,支持响应式设计。 +- **Serilog**:用于日志记录。 +- **Swashbuckle / OpenAPI**:提供 API 文档。 + +## 功能模块 +- **DynamicField**:动态字段管理,支持字段类型定义、属性设置。 +- **DynamicTable**:动态表管理,支持表结构定义和字段绑定。 +- **RoleInfo / GradeInfo**:角色和等级管理,支持权限控制。 +- **UserInfo / UserGrade**:用户信息管理,支持用户与角色/等级绑定。 +- **ArticleInfo**:文章管理,支持文章发布、更新和删除。 + +## 使用示例 +### 创建用户 +```csharp +var user = new UserInfo +{ + Email = "user@example.com", + PassWord = "password123", + UserName = "张三", + IsEnable = true +}; +_dbContext.UserInfo.Add(user); +_dbContext.SaveChanges(); ``` -#### Usages - -HTML: - -```html - -
- -
+### 查询用户角色 +```csharp +public async Task GetUserRole(int userId) +{ + var user = await _dbContext.UserInfo.FindAsync(userId); + var role = await _dbContext.RoleInfo.FindAsync(user.FatherId); + return ObjectMapper.Map(role); +} ``` -> Tip: Editor.md can auto append ` + + ``` -Using modular script loader : - -- [Using Require.js](https://github.com/pandao/editor.md/tree/master/examples/use-requirejs.html) -- [Using Sea.js](https://github.com/pandao/editor.md/tree/master/examples/use-seajs.html) +## 配置文件 +- `appsettings.json`:配置连接字符串、Redis、日志等。 +- `roles.json`:定义角色权限和访问控制。 +- `template.db`:数据库模板文件,用于初始化系统数据。 -#### Dependents +## 安装与部署 +1. 下载代码。 +2. 配置数据库连接(`PasteFormDbProperties`)。 +3. 安装依赖(使用 `dotnet restore`)。 +4. 构建并运行项目(`dotnet run`)。 +5. 通过浏览器访问 `/api/app/userinfo/readAddModel` 查看 API 输出。 -- [CodeMirror](http://codemirror.net/ "CodeMirror") -- [marked](https://github.com/chjj/marked "marked") -- [jQuery](http://jquery.com/ "jQuery") -- [FontAwesome](http://fontawesome.io/ "FontAwesome") -- [github-markdown.css](https://github.com/sindresorhus/github-markdown-css "github-markdown.css") -- [KaTeX](http://khan.github.io/KaTeX/ "KaTeX") -- [prettify.js](http://code.google.com/p/google-code-prettify/ "prettify.js") -- [Rephael.js](http://raphaeljs.com/ "Rephael.js") -- [flowchart.js](http://adrai.github.io/flowchart.js/ "flowchart.js") -- [sequence-diagram.js](http://bramp.github.io/js-sequence-diagrams/ "sequence-diagram.js") -- [Prefixes.scss](https://github.com/pandao/prefixes.scss "Prefixes.scss") +## 相关文档 +- [动态表单文档](/root/.cache/skyline-repo-cache/305d5e24ab918ce88626e279ce26c14956f11a23232ddfac412c70f97488fed8/PasteForm.HttpApi.Host/wwwroot/page/lib/editor.md/README.md) +- [图标库](/root/.cache/skyline-repo-cache/305d5e24ab918ce88626e279ce26c14956f11a23232ddfac412c70f97488fed8/PasteForm.HttpApi.Host/wwwroot/page/lib/Hui-iconfont/1.0.8/readme.md) +- [日期控件](/root/.cache/skyline-repo-cache/305d5e24ab918ce88626e279ce26c14956f11a23232ddfac412c70f97488fed8/PasteForm.HttpApi.Host/wwwroot/page/lib/My97DatePicker/4.8/README.md) -#### Changes +## 开源协议 +本项目采用 MIT 协议,详情请参见 [LICENSE](/root/.cache/skyline-repo-cache/305d5e24ab918ce88626e279ce26c14956f11a23232ddfac412c70f97488fed8/PasteForm.HttpApi.Host/LICENSE) -[Change logs](https://github.com/pandao/editor.md/blob/master/CHANGE.md) +## 问题与反馈 +- 如何处理字段的动态 UI 更新? +- 图片上传如何绑定用户头像? +- 如何扩展新的数据类型(如 `PasteForm.Application.Contracts` 中的 `PasteDate`, `PasteImage`)? -#### License +## 联系与贡献 +欢迎提交 Issue 和 Pull Request。如有疑问,请联系维护者。 -The MIT License. +## 鸣谢 +感谢 .NET 框架、Entity Framework Core、Redis、以及开源社区对本项目的支持。 -Copyright (c) 2015 Pandao +## 请喝咖啡 +如果你觉得这个项目对你有帮助,欢迎请我喝一杯咖啡 🧋。 \ No newline at end of file