{"id":21432214,"url":"https://github.com/notbucai/lowcode","last_synced_at":"2025-07-14T12:33:15.228Z","repository":{"id":118216823,"uuid":"306587827","full_name":"notbucai/lowcode","owner":"notbucai","description":"Vue + element ui 低代码平台","archived":false,"fork":false,"pushed_at":"2023-12-27T08:29:10.000Z","size":1035,"stargazers_count":35,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-12-27T09:29:38.934Z","etag":null,"topics":["element-ui","lowcode","vuejs"],"latest_commit_sha":null,"homepage":"http://lowcode.notbucai.com","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notbucai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-23T09:23:17.000Z","updated_at":"2023-12-27T08:29:14.000Z","dependencies_parsed_at":"2023-04-13T16:03:04.695Z","dependency_job_id":null,"html_url":"https://github.com/notbucai/lowcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Flowcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Flowcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Flowcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Flowcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notbucai","download_url":"https://codeload.github.com/notbucai/lowcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225976193,"owners_count":17554197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["element-ui","lowcode","vuejs"],"created_at":"2024-11-22T23:17:19.167Z","updated_at":"2024-11-22T23:17:19.890Z","avatar_url":"https://github.com/notbucai.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 又开一坑推荐跨iframe组件拖拽 [d2g](https://github.com/notbucai/d2g)\n\n# Low Code \n\n个人低代码（可能是伪低代码，毕竟不是很懂）的一个玩具\n\n![./docs-assets/framework.png](./docs-assets/framework.png)\n\n![./docs-assets/er.png](./docs-assets/er.png)\n\n\n## 项目依赖\n\n### Vuejs\n渐进式 JavaScript 框架\n\n### ElementUI\nElement，一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的桌面端组件库\n\n### Vue.Draggable\n基于 Sortable.js 的 Vue 拖放组件\n\n## 元素结构\n\u003e 使用JSON作为结构化的处理 是不是最终可以抛弃组件库的依赖 只需要做兼容性的 `代理组件`？\n\n```TypeScript\n// 分两种 用type作为区分\n// 1. 功能元素（组件）\n// 2. 容器元素（组件）\ntype Element = {\n  // 唯一ID便于操作 一切以 id 为主\n  id: string;\n  // (功能 / 容器) 名称\n  element: string;\n  // 字面意思\n  type: 'element' | 'container';\n  // props 这里放元素（组件）的 参数\n  props?: {\n    // 这里由于其他一些问题暂时这样写了\n    [key: string]: any;\n    [key: number]: any;\n  };\n  // 容器组件 存放的子元素\n  children?: LowElement[];\n  models: {\n    [key: string]: '[model_key].?[key].?[key]', // key 为自定义\n  },\n  // 动作，这一块比较复杂\n  // 原本设计为[key:value]，由于可能存在描述信息，所以目前改成{xxx}\n  actions: [\n    {\n      key: string, // 随机生成\n      // 事件名称 按组件动态创建\n      name: string,\n      // event: 'click' | 'change' | 'submit', // 对应的可能是 @[event]=\"\" 这个操作\n      event?: string, // 目前只有组件中才有意义\n      // 动作 目前按同步执行\n      handle: [\n        {\n          key: string, // 随机生成\n          name: string,\n          // location表示动作存在的位置 一般为element、global, type 表示类型 （如 fetch 发送请求）\n          // location 可能还有些复杂的设计 如元素可能绑定一个id，全局中是global_[namespace] 元素中可能是 element_[id]\n          // 例子: global_dialog.b2d12 | element_1e4sa.12342\n          link: '[location].[key]', // 关联 的触发动作 可能是发送请求 可能是 触发其他元素的动作\n          // 这个可用于接口方法和传输 以及 Open dialog\n          data?: {\n            // 参考 models\n            bind?: string, // 绑定的数据源 接口请求、打开dialog或者其他需要数据关联的操作\n            recv?: string, // 接受响应的数据源\n          }\n        },\n        // ... more\n      ]\n    },\n    // ... more\n  ]\n}\n```\n\n## 数据源结构\n\n\u003e 模型、类型 的值（默认值） 均为序列数据 需要反序列成对应类型数据\n\n```TypeScript\n/**\n* 数据类型\n*/\ntypes = [\n  {\n    type: 'string',\n    value: '\"\"',\n    label: \"字符串\"\n  },\n  {\n    type: 'number',\n    value: '0',\n    label: \"数字\"\n  },\n  {\n    type: 'boolean',\n    value: 'false',\n    label: \"布尔\"\n  },\n  {\n    type: 'array',\n    value: '[]',\n    label: \"数组\"\n  },\n];\n/**\n* 模型\n*/\nmodels = [\n  {\n    name: \"表单\", // 数据源名称\n    key: 'model_1a52926d55f3', // 绑定的字段 该字段创建的时候生成\n    // 实体\n    entities: [\n      {\n        key: 'username', // 绑定的字段 输入\n        name: \"用户名\", // 实体名称 输入\n        type: 'string', // 数据类型 选择\n        value: '\"\"', // 默认值 输入\n      },\n      {\n        key: 'password', // 绑定的字段 输入\n        name: \"密码\", // 实体名称 输入\n        type: 'string', // 数据类型 选择\n        value: '\"\"', // 默认值 输入\n      },\n      // ...more\n    ]\n  }\n]\n\n/**\n* 数据 通过该 模型生成的结构体\n*/\ndata = {\n  model_1a52926d55f3: {\n    username: '',\n    password: ''\n  }\n}\n\n/**\n* 全局动作\n* 用于定义如打开dialog, 发送请求\n*/\nactions = {\n  // namespace为命名空间 一般已经内置命名空间 如 dialog fetch 等\n  // 每个命名空间对应一个 解析/执行 器\n  [namespace: string]: {\n    name: string,\n    actions: [\n      {\n        key: string, // 随机生成\n        //  eventName 事件名称 按组件/自定义名称动态创建\n        name: string,\n        // event: 'click' | 'change' | 'submit', // 对应的可能是 @[event]=\"\" 这个操作\n        event?: string, // 目前只有组件中才有意义\n        // 动作 目前按同步执行\n        handle: [\n          // 需要根据解析器具体操作\n          // ... more\n        ],\n        data: {\n          bind: '',\n          recv: '', // 获取\n          replace: [], // 需要取代的值，目前用于数组中（项）的下标\n        }\n      }\n    ],\n    // ... more\n  }\n}\n```\n\n## 操作方面\n\n### FIRST 产生的一些问题/想法\n\n采用拖拽的方式，非容器组件不能存在其他组件，指定组件只能存在指定组件中？  \n点击元素进行一些数据关联、属性增删、事件监听？  \n\n突然发现嵌套关系应该有祖先关系的 比如 `el-form-item` 只要在 `el-form` 的子孙就行  \n\n固定画布元素避免匹配排序问题   \n\n拖动节点的时候带走子孙节点 间接导致出现的问题\n\n最终还是需要模版化才是最优的\n\n历史栈/快照  \n\n多Slot的情况  \n\n实际上从待定组件列表中拖动到画布中的时候有些待定组件的属性应该去除或者更改  \n\n必须有一个可以选择边距的元素才行  \n\n### NEXT 产生的问题/想法\n\n想这个的时候脑子爆栈了, 所以用笔辅助了一下，字很差，看个灵魂就好。\n![models](./docs-assets/models.jpg)  \n\n感觉操作逐渐复杂起来  \n\n感觉还得有个替换父级的功能  \n\n  \n需要做到职责分明  \n如果提交、重置应该放在表单  \n表格只需要绑定数据源剩下数据应该由其他相关事件获取（如分页操作、搜索、初始化）  \n\n所以表单完成后需要一些操作如清空表单、更新数据源     \n\n一个接口可以对应多个数据源  \n\n数据源添加/设置中模型可能会有点问题，\n\n数据源的序列数据 目前使用JSON进行序列还存在一些问题。\n\n页面管理基本完成\n\n### 动作\n\n一、类型  \n1. 组件创建进入获取初始化数据\n2. 增删改，分页\n3. 弹框 \n4. 表单提交    \n5. 页面跳转 可能带参数\n\n二、其他\n1. 时机   无非分为多个动作\n2. 动作   无非是（操作/提交）数据源 和 API调用\n\n## 进度\n\n### ✅ FIRST 生成前端代码\n\n目前正在做第一步，生成Vue代码。  \n预计 `十月底` 完成。\n\n\u003e 目前进度：   \n\u003e 1. 拖拽使用`Vue.Draggable`库基本功能完善  \n\u003e 2. 丰富 `代理组件` 便于以后解耦  \n\u003e 3. JSON 转换成Vue + element 组件代码\n\n### 🙆 NEXT ING\n\n预计`十一月中旬`动工 （有些个人的事情要处理）\n\n1. 数据源 （用于表单数据绑定）   \n2. 事件  \n3. 简单关联的接口\n4. 权限\n5. thinking\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbucai%2Flowcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotbucai%2Flowcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbucai%2Flowcode/lists"}