Compare commits

...

1 Commits

Author SHA1 Message Date
yz-yu 9a12bf3c2f
AI plugins (#418)
* init project

Match-id-61778b743a9dc8d8df471dcb285fb229931648a6

* fix: fix build error (#1)

* fix: fix build error

* fix: fix server dependence

* fix: add logo and fix readme (#5)

* update readme (#6)

* fix: add logo and fix readme

* fix: update readme

* feat: add pnpm to project

* fix(bundle): fix env variable can not be bundle (#16)

* docs: add pr and bug template (#18)

* fix(bindEvents): fix bind Events can not delete (#22)

* feat: 修复当画布没有内容时控制台报错 (#26)

* fix:按钮组数据编辑后显示出错 (#24)

* fix:走马灯属性配置清空标签页后添加标签页显示出错 (#23)

* fix:走马灯属性配置清空标签页后添加标签页显示出错

* fix: 优化走马灯删除标签页问题修复方案

* fix(design-core): build error with monaco-editor (#57)

* fix(page-lock):页面解锁按钮图标修复 (#43)

* fix: 修复无页面时页面内容显示错误问题 (#31)

* fix: 修复不切换页面点击页面设置时表单校验错误问题 (#32)

* fix(block-list-icon):区块管理面板去掉列表图标 (#33)

* fix:区块管理面板去掉列表图标

* fix(block-list-icon):区块管理面板去掉列表图标

* feat(docs): add Milestones (#46)

* feat(chore): update package info (#53)

* feat(chore): update package info

* feat(docs-package): add homepage url

* fix(toolbars): disable toolbar btn when page is empty (#70)

* fix(toolbars): disable toolbar btn when page is empty

* fix(toolbar): disable preview when page is empty

* feat(doc): add doc link to readme (#54)

* fix(style): adjust style detail (#67)

* fix(canvas): change canvas menu item hiding to disabed (#75)

* fix(canvas): fix del key error when nothing is selected (#69)

* feat(chore): add setup script setup environment before serving (#80)

* fix(pluginMaterial): fix block list can't scroll when visible in canvas (#77)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。 (#66)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。

* feat: 方法名修改更加符合语义

* fix:修复属性面板-插槽开关切换schema不正确 (#85)

* fix:时间线步骤条编辑数据,步骤条会消失 (#84)

* fix: 时间线步骤条编辑data,时间线会消失

* Revert "fix: 时间线步骤条编辑data,时间线会消失"

This reverts commit b24f8ba60d.

* fix:时间线步骤条编辑数据,时间线会消失

* fix(pagePlugin): 删除文件夹添加节流,避免多次出现无法删除弹窗 (#74)

* fix(pagePlugin): 删除文件夹添加防抖,避免多次出现无法删除弹窗

* fix(pagePlugin): use throttle by review comment

* fix:loading can't be closed when state is saved (#87)

* fix:loading can't be closed when state is saved

* fix: remove global loading

* fix(metaComponent): fix #79 metaListItems dragging not working (#86)

* fix(pagePlugin): clear some state when delte current page (#72)

* fix(pagePlugin): clear some state when delte current page

* fix(pagePlugin): del unnecessary optional chaining operator

* fix(chore): add code readablity

* fix(chore): optimize code by review comment

* fix: 数据源面板中,点击新建字段报错 (#37)

* fix:修复组件属性绑定工具类函数,出码预览未定义 (#90)

* fix(insert-footer-button):设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一直;大纲书导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见;提示框样式修改 (#94)

* fix(insert-footer-button):
设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一致;
大纲树导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见;
提示框样式修改

* fix(styles-import): 解决tree组件选中样式背景色为黑色的问题 (#102)

* feat(builtin): builtinComponent 组件独立包抽离 (#52)

* feat(builtin): builtinComponent 组件独立包抽离

* 添加eslint&自动化构建 (#101)

* fix:组件属性绑定工具类utils,修改预览出码实现 (#93)

* fix: 修复空页面执行右键删除和右键复制时控制台报错的问题 (#103)

* fix: 修复空页面执行右键删除和右键复制时控制台报错的问题

* fix: 修复空页面执行右建操作时控制台报错的问题

* refactor: 简化operations空判断代码

* fix: verify operations copy  id

* fix: verify operations copy  id

* fix: verify operations copy  id

* fix: copyNode function verify  params

* fix: 不可操作的菜单项disabled

* fix: 点击disabled菜单项 不关闭菜单

* fix:修复自定义属性新增功能 (#108)

* fix:修复自定义属性新增功能

* fix: 修复MetaHtmlText组件控制台警告

* fix:调整透传Attributes警告解决方案

* fix:调整透传Attributes警告解决方案

* fix:调整透传Attributes警告解决方案

* fix(canvasShortCutPanel): add click event to quick insert component in… (#81)

* fix(canvasShotCutPanel): add click event to quick insert component in shortcutpanel

* fix(canvasShortPanel): add deepclone utils

* feat(utils): add deepClone method

* feat(unit-test): add unit test for deepclone function

* fix: code check (#112)

* fix: code check (#117)

* fix: 变量修改后保存页面,再次修改变量失败 (#110)

* fix:修复国际化参数配置 (#106)

* feat(style): stylePanel add style selector, write css to global styles (#41)

* feat(style): stylePanel add style selector, write css to global styles

* feat(style): classNameSelector support edit and delete

* fix(build): fix setting-style plugin build error

* fix(chore): fix review comment

* fix: 修复DSL出码报错 (#139)

* fix(plugin-script): js plugin code format when save (#138)

* fix: 手动更新画布key导致表格渲染出错 (#129)

* fix(dataSources): 解决collection添加表格时预览报错 #118 (#151)

* feat(block2webcomponent): add block2webcomponent package (#146)

* feat(block2webcomponent): add block2webcomponent package

* fix(build): fix build config uncorrect

* fix(build): change cdn link to npmmirror

* fix:删除lowcodeWrap多余参数 (#119)

* fix(chore): replace unpkg with npmmirror (#149)

* fix(chore): replace unpkg with npmmirror

* fix(dev): dev environment use node_moduels

* fix(chore): sync version

* fix(preview): use npmmirror link

* fix(preview): devtoolapi use unpkg link

* fix(preview): import map add esm cdn

* fix(version): fix tiny-vue version

* fix(version): fix tiny-vue version

* fix(version): fix tiny-vue version

* fix(blockBuild): change packageName to block build (#160)

* fix: 画布中右键弹框,修复添加父级-弹出框功能 (#60)

* fix: 画布中右键弹框,修复添加父级-弹出框功能

* fix: schema缺少children

* fix: 按检视意见修改

* fix: 修复画布宽度设置问题 (#128)

* fix: 修复画布宽度设置问题

* fix: 修复复制静态文件时接口报错 (#175)

* feat:引入第三方组件库element-plus部分组件示例 (#105)

* feat: 引入第三方组件库element-plus示例

* fix:修复格式错误

* feat:表格列配置组件

* feat:增加表格列配置组件

* fix:build error

* fix:修复scheme2code接口报错

* fix:修改import顺序

* fix: 使用import动态导入有cdn的工具类 (#133)

* fix: 使用import动态导入有cdn的工具类

* fix(preview): upgrade vue repl version (#170)

* fix(preview): upgrade vue repl version

* fix(preview): optimized by review comment

* fix:添加style变量赋值 (#154)

* fix: 修复unpkg依赖 (#188)

* fix: 修复unpkg依赖

* fix:固定opentiny/vue的次版本号

* fix:升级devtools-api版本

* fix:CDN域名提取环境变量

* fix:升级opentiny/vue版本

* fix:修改主题样式文件版本

* fix:修复codeCheck

* feat:设计器增加帮助文档说明 (#100)

* fix: 修复多个全局变量下载代码出错 (#197)

* fix: 修复多个全局变量下载代码出错

* fix: 精简应用发布时commit消息的校验规则 (#205)

* feat: 开放区块管理相关功能 (#206)

* feat: add materials script (#195)

增加拆分物料与构建物料脚本

* doc:README添加物料同步脚本说明 (#207)

* feat(generate-vue): change generate vue code location (#201)

* feat(generate-vue): change generate vue code location

* fix(generate-vue): fix generate route did not export

* feat(docs): 增加跟本地后端直连的方案 (#208)

* docs(readme): 增加后端的启动描述

* feat(chore): change dependencies type to workspace:* (#216)

* chore: add code review action (#215)

* chore(release): publish (#219)

* chore(release): publish

 - @opentiny/tiny-engine-mock@1.0.1
 - @opentiny/tiny-engine-block-build@1.0.0
 - @opentiny/tiny-engine-builtin-component@1.0.0
 - @opentiny/tiny-engine-canvas@1.0.1
 - @opentiny/tiny-engine-common@1.0.1
 - @opentiny/tiny-engine-controller@1.0.1
 - @opentiny/tiny-engine@1.0.0-beta.2
 - @opentiny/tiny-engine-http@1.0.1
 - @opentiny/tiny-engine-i18n-host@1.0.1
 - @opentiny/tiny-engine-plugin-block@1.0.2
 - @opentiny/tiny-engine-plugin-bridge@1.0.2
 - @opentiny/tiny-engine-plugin-data@1.0.2
 - @opentiny/tiny-engine-plugin-datasource@1.0.2
 - @opentiny/tiny-engine-plugin-help@1.0.2
 - @opentiny/tiny-engine-plugin-i18n@1.0.2
 - @opentiny/tiny-engine-plugin-materials@1.0.2
 - @opentiny/tiny-engine-plugin-page@1.0.2
 - @opentiny/tiny-engine-plugin-robot@1.0.2
 - @opentiny/tiny-engine-plugin-schema@1.0.2
 - @opentiny/tiny-engine-plugin-script@1.0.2
 - @opentiny/tiny-engine-plugin-tree@1.0.2
 - @opentiny/tiny-engine-plugin-tutorial@1.0.2
 - @opentiny/tiny-engine-setting-design@1.0.2
 - @opentiny/tiny-engine-setting-events@1.0.2
 - @opentiny/tiny-engine-setting-props@1.0.2
 - @opentiny/tiny-engine-setting-styles@1.0.2
 - @opentiny/tiny-engine-svgs@1.0.2
 - @opentiny/tiny-engine-theme-dark@1.0.2
 - @opentiny/tiny-engine-theme-light@1.0.3
 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2
 - @opentiny/tiny-engine-toolbar-clean@1.0.2
 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2
 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2
 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2
 - @opentiny/tiny-engine-toolbar-lang@1.0.2
 - @opentiny/tiny-engine-toolbar-layout@1.0.2
 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2
 - @opentiny/tiny-engine-toolbar-logo@1.0.2
 - @opentiny/tiny-engine-toolbar-logout@1.0.2
 - @opentiny/tiny-engine-toolbar-media@1.0.2
 - @opentiny/tiny-engine-toolbar-preview@1.0.2
 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2
 - @opentiny/tiny-engine-toolbar-refresh@1.0.2
 - @opentiny/tiny-engine-toolbar-save@1.0.2
 - @opentiny/tiny-engine-toolbar-setting@1.0.2
 - @opentiny/tiny-engine-utils@1.0.2
 - @opentiny/tiny-engine-dsl-vue@1.0.2
 - @opentiny/tiny-engine-webcomponent-core@1.0.2

* chore(release): publish

 - @opentiny/tiny-engine-mock@1.0.2
 - @opentiny/tiny-engine-block-build@1.0.1
 - @opentiny/tiny-engine-builtin-component@1.0.0
 - @opentiny/tiny-engine-canvas@1.0.2
 - @opentiny/tiny-engine-common@1.0.1
 - @opentiny/tiny-engine-controller@1.0.2
 - @opentiny/tiny-engine@1.0.0-beta.3
 - @opentiny/tiny-engine-http@1.0.1
 - @opentiny/tiny-engine-i18n-host@1.0.2
 - @opentiny/tiny-engine-plugin-block@1.0.2
 - @opentiny/tiny-engine-plugin-bridge@1.0.2
 - @opentiny/tiny-engine-plugin-data@1.0.2
 - @opentiny/tiny-engine-plugin-datasource@1.0.2
 - @opentiny/tiny-engine-plugin-help@1.0.2
 - @opentiny/tiny-engine-plugin-i18n@1.0.2
 - @opentiny/tiny-engine-plugin-materials@1.0.2
 - @opentiny/tiny-engine-plugin-page@1.0.2
 - @opentiny/tiny-engine-plugin-robot@1.0.2
 - @opentiny/tiny-engine-plugin-schema@1.0.2
 - @opentiny/tiny-engine-plugin-script@1.0.2
 - @opentiny/tiny-engine-plugin-tree@1.0.2
 - @opentiny/tiny-engine-plugin-tutorial@1.0.2
 - @opentiny/tiny-engine-setting-design@1.0.2
 - @opentiny/tiny-engine-setting-events@1.0.2
 - @opentiny/tiny-engine-setting-props@1.0.2
 - @opentiny/tiny-engine-setting-styles@1.0.2
 - @opentiny/tiny-engine-svgs@1.0.3
 - @opentiny/tiny-engine-theme-dark@1.0.3
 - @opentiny/tiny-engine-theme-light@1.0.4
 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2
 - @opentiny/tiny-engine-toolbar-clean@1.0.2
 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2
 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2
 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2
 - @opentiny/tiny-engine-toolbar-lang@1.0.3
 - @opentiny/tiny-engine-toolbar-layout@1.0.3
 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2
 - @opentiny/tiny-engine-toolbar-logo@1.0.2
 - @opentiny/tiny-engine-toolbar-logout@1.0.3
 - @opentiny/tiny-engine-toolbar-media@1.0.2
 - @opentiny/tiny-engine-toolbar-preview@1.0.2
 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2
 - @opentiny/tiny-engine-toolbar-refresh@1.0.2
 - @opentiny/tiny-engine-toolbar-save@1.0.2
 - @opentiny/tiny-engine-toolbar-setting@1.0.2
 - @opentiny/tiny-engine-utils@1.0.3
 - @opentiny/tiny-engine-dsl-vue@1.0.2
 - @opentiny/tiny-engine-webcomponent-core@1.0.3

* fix: 修复数据源mock数据不一致 (#211)

* fix: 修复数据源mock数据不一致

* fix:修复构建物料资产包重复组件

* fix:修改css文件cdn域名 (#228)

* fix:修改css文件cdn地址

* fix default img can't change width and height (#189)

* fix:插件面板固定后画布未自适应 (#234)

* fix: 修复数据源mock数据不一致

* fix:插件面板固定后画布未自适应

* fix:插件面板固定后画布未自适应

* fix:修复eslint报错

* [plugin-data] Fix state use jsfunction issue (#237)

* feat(monaco-editor-completion): 隔离不同代码编辑器自动补全的注册,变量声明增加自动补全去掉js函数和state变量的自动补全提示

* feat(state): 状态管理使用JS表达式创建变量的时候提示不可使用其他变量以及JS函数

* fix:materials sql (#231)

* fix: 修复数据源mock数据不一致

* fix:新增组件写入sql数据问题

* fix:修复资源管理工具类型切换 (#239)

* fix:修复资源管理工具类型切换

* fix: 左右两侧面板宽度固定为280px (#230)

* fix(styles-spacing): 增大物料设置内外边距时点击区域 #134 (#184)

* fix(styles-spacing): 增大物料设置内外边距时点击区域 #134

* fix:预览引入builtin组件依赖,built组件样式文件注入js (#251)

* add config (#262)

* add config

* update config

* fix: 修复由于物料边框引起的左侧面板样式问题 (#247)

* fix: 设计器构建后使用vue runtime prod build(本地开发保持development, preview预览保持development) (#254)

* fix(canvas-renderer): 修复 isNative component 判断失效的 bug (#241)

* feat: js panel add jsx support  (#253)

* feat: JS面板支持JSX语法

* fix: 画布解析JS表达式时支持JSX语法

* fix: 修复画布解析JSX表达式时会返回undefined

* feat: 添加Tree和Tooltip的自定义渲染函数属性

* fix: 修改变量名

* fix(toolbar-save): 修复保存时红色 icon 相对位置丢失的 bug (#250)

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互 (#238)

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化

* fix(settingPanel-style): 样式面板新交互细节调整

* fix(setting-stylePanel): 修复样式选择器颜色不对的 bug

* fix(setting-stylePanel): 样式选择器间距调整

* fix(setting-stylePanel): 调整样式选择器距离顶部距离与下拉列表滚动条颜色

* feat(setting-style): add help link button

* fix(setting-style): delete empty row by code review

* fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题 (#280)

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 更新图片地址

* docs(readme): 更新图片地址

* fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题

* fix:组件sql语句字段校验、提示优化 (#275)

* fix:修复新增组件sql语句字段校验

* fix:优化脚本提示

* fix:函数名优化

* fix:修复更新的sql问题

* fix:TinyTabItem、TinyBreadcrumbItem组件配置有误 (#272)

* fix:TinyTabItem、TinyBreadcrumbItem组件配置有误

* fix:修复tiny-vue组件导出名称有误

* fix: 修复robot plugin不存在时发生的白屏错误 (#271)

* fix: 修复robot plugin不存在时发生的白屏错误

* styled: 修改代码风格

* fix: 修改监视意见

* fix: 修复画布选中框的显示层级不正确的问题 (#246)

* fix: 修复画布选中框的显示层级不正确的问题

* fix: 修正错误注释

* fix: 选中节点后支持横向滚动到节点

* fix: 根据垂直滚动条调整工具操作条位置

* fix: 删除冗余代码

* fix: 代码优化

* fix: 修改变量名称

* fix: 调整函数顺序,消除eslint错误

* feat: 移除前端解锁前判断权限的逻辑,适配后台解锁接口 (#276)

* 修复画布没有根元素,与vue出码、预览不一致 (#259)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。

* feat: 方法名修改更加符合语义

* fix: 1. 给画布添加根元素(与出码、预览保持一致)。2. 选中画布相当于选中根节点,右侧面板会出现可以添加属性的节点。3. 可以支持给根节点添加类名,id、ref,并修改样式。 4. 支持给根元素添加事件,循环等

* fix: 意见修复

* fix: 修复较低的分辨率下画布初始缩放不正确的问题 (#274)

* fix(common): fix lifecycle unmount completionProvider null state caught error (#281)

* fix: 修改远程字段发送请求无效 (#278)

* fix:修复修改远程字段发送请求无效

* fix:修复请求参数处理函数未生效

* fix:修复数据源表单校验提前退出

* fix:修改提示语

* fix:按review添加注释

* Fix mockServer block group deleted bug (#279)

* fix:修复第三方组件无法渲染 (#288)

* fix:修复第三方组件无法渲染

* fix:区分环境加载prod

* fix(chore): sync vue version (#285)

* fix(chore): sync vue version

* fix(chore): sync vue-i18n version

* fix(chore): change vue and vue-i18n to peerdependencies

* fix(chore): update block build dependencies

* fix(chore): change vue-generator dependencies to update

* fix(upload-button)修复下载按钮弹出没有遮罩 (#300)

* fix: 修复新建区块的表单确定时未校验的问题 (#302)

* fix: 修复代码编辑器全屏时的样式问题 (#303)

* fix: 修复属性面板中设置空字符串的问题 (#307)

* fix(setting-stylePanel): 只允许有一个 id,样式选择器只能添加一个 id (#295)

* fix(plugin-page): setting home should not close settingPanel (#308)

* feat(setting-advanced): addcustomEvent popover change to dialog (#297)

* feat(setting-advanced): addcustomEvent popover change to dialog

* fix(setting-advanced): add custom event align left with modal title

* fix(style): delete selected symbol on select component (#306)

* fix(style): delete selected symbol on select component

* fix(style): delete space after delete selectedSymbol

* fix(http): 优化 http 接口报错 ui, 接口详情不展示在 title (#293)

* fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错 (#245)

* fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错

* feat(design-core/preview): 预览增加调试按钮来打开vue-repl编辑模式,并实现编辑器懒加载

* fix(design-core/preview): 修复repl-patch引入脚本路径模块化不支持importScripts问题

* fix: 数据源远程字段表单验证样式修改 (#309)

* fix: 数据源远程字段表单验证样式修改

* fix:资源管理工具类型文字字色与设计稿不一致 (#319)

* fix:资源管理工具类型文字字色与设计稿不一致

* fix:调整资源工具类型字体

* bundle.json and tiny-vue.css is 404 in prod mode (#315)

* chore(release): publish (#320)

- @opentiny/tiny-engine-mock: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-block-build: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-builtin-component: 1.0.0 => 1.0.1
- @opentiny/tiny-engine-canvas: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-common: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-controller: 1.0.2 => 1.0.3
- @opentiny/tiny-engine: 1.0.0-beta.3 => 1.0.0-beta.4
- @opentiny/tiny-engine-http: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-i18n-host: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-block: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-bridge: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-data: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-datasource: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-help: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-i18n: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-materials: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-page: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-robot: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-schema: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-script: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-tree: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-tutorial: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-design: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-events: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-props: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-styles: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-svgs: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-theme-dark: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-theme-light: 1.0.4 => 1.0.5
- @opentiny/tiny-engine-toolbar-breadcrumb: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-clean: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-collaboration: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-fullscreen: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-generate-vue: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-lang: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-layout: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-checkinout: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-logo: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-logout: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-media: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-preview: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-redoundo: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-refresh: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-save: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-setting: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-utils: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-dsl-vue: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-webcomponent-core: 1.0.3 => 1.0.4

* refactor: 解决子包循环依赖问题 (#313)

* refactor: move common/js to controller/js

* refactor: replace common/js

* refactor: replace ../js

* refactor: update package.json

* refactor: resolve canvas rely on common

* refactor: remove controller deps in http

* refactor: add canvas renderer state

* refactor: remove useless file ext

* refactor: modify controller deps path

* refactor: fix eslint

* refactor: resolve http env

* fix: switch page error (#331)

* fix: drag block into canvas error (#336)

* fix: canvas api error (#338)

* fix(datasource): data type icon invisible #312 (#332)

* fix(datasource): data type icon invisible

* fix(common): #325 reduce unnecessary network requests.

* style(datasource): remove unnecessary comment

---------

Co-authored-by: zeyong.cai <zeyong.cai@xquant.com>

* fix(build): 修复构建设计器产物 ref 值未转化的 bug (#347)

* fix(preview): fix preview vue-repl unsupport jsx bug (#343)

* docs: add project name to issue template (#335)

* feat: 状态管理代码编辑UI优化 (#318)

* feat: 状态管理代码编辑UI优化

* fix(material): elTable formatter should be function type (#355)

* fix(readme-build): 添加Readme中构建产物所在文件夹信息 (#367)

* fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug (#340)

* fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug

* fix(scrollbar): change by review comment

* fix(theme-scrollbar): change by review comment

* fix(theme-base): apply default scrollbar style to body * children

* docs: 文件名称CHANGELOG拼写错误,修改文件名称 (#389)

* fix(errorMonitor): add config for errormonitor (#381)

* fix(controller-environment): preserve import.meta.env variable when build controller lib (#380)

* fix(settings): fix text wrap of bind condition (#391)

Fixes #370

* feat:增加物料:TinyDatePicker和TinyNumeric (#399)

* 增加物料:TinyDatePicker和TinyNumeric

* 修改disabled使用MetaSwitch

* Fix:编辑器设置dark主题后预览页header文字颜色不正确 (#403)

* fix:编辑器设置dark主题后预览页header文字颜色不正确

* fix:调整主题

* port 000037 engine-ai-plugins

* setup live component

* improve live component

* add component mode to AI plugin

* update design doc

---------

Co-authored-by: OpenTiny <opentiny@sina.com>
Co-authored-by: ajaxzheng <894103554@qq.com>
Co-authored-by: chilingling <26962197+chilingling@users.noreply.github.com>
Co-authored-by: wenmine <wwmmail@foxmail.com>
Co-authored-by: lhuans <145339349+lhuans@users.noreply.github.com>
Co-authored-by: yaoyun8 <142570291+yaoyun8@users.noreply.github.com>
Co-authored-by: Hexqi <wu_12556@126.com>
Co-authored-by: tianxin <146069396+ianxinnew@users.noreply.github.com>
Co-authored-by: gargameljyh <58694428+gargameljyh@users.noreply.github.com>
Co-authored-by: lichunn <46984087+lichunn@users.noreply.github.com>
Co-authored-by: Xppp0217 <82315158+Xppp0217@users.noreply.github.com>
Co-authored-by: lizhijie429 <632163606@qq.com>
Co-authored-by: Gene <Pacify.98@gmail.com>
Co-authored-by: rhlin <r.h.lin@live.cn>
Co-authored-by: Lu17301156525 <128358973+Lu17301156525@users.noreply.github.com>
Co-authored-by: rhlin <r.h.lin@163.com>
Co-authored-by: GaoNeng <31283122+GaoNeng-wWw@users.noreply.github.com>
Co-authored-by: abin <luocongqiu@gmail.com>
Co-authored-by: zeyong tsai <tsai.zeyong@icloud.com>
Co-authored-by: zeyong.cai <zeyong.cai@xquant.com>
Co-authored-by: Kagol <kagol@sina.com>
Co-authored-by: yuhki <128052955+yuhkikele@users.noreply.github.com>
Co-authored-by: Xie Jay <xiejay97@gmail.com>
Co-authored-by: fox ouyang <stwflyfox@163.com>
2024-05-11 17:48:00 +08:00
1525 changed files with 216048 additions and 1 deletions

14
.build_config/build.sh Normal file
View File

@ -0,0 +1,14 @@
if [ ! $version ];
then npm version 0.1.0-`date "+%Y%m%d%H%M%S"`;
else npm version $version;
fi
npm install
if [ $? -ne 0 ]
then
echo "[ERROR] build falid!"
exit 1
fi
echo '[INFO] build completed'

View File

@ -0,0 +1,23 @@
version: 1.0
name: tiny-engine
language: nodejs
# 构建工具
dependencies:
base:
nodejs: best
# 构建机器
machine:
standard:
euler:
- default
# 构建脚本
scripts:
- sh ./.build_config/build.sh
# 构建产物
artifacts:
npm_deploy:
- config_path: ./package.json

11
.codecheck/check.yml Normal file
View File

@ -0,0 +1,11 @@
version: 2.0
steps:
pre_codecheck:
- checkout
tool_params:
secsolar:
source_dir: ./
cmetrics:
exclude: vite.config.js|package.json|index.js|mockServer/assets

5
.env.local Normal file
View File

@ -0,0 +1,5 @@
SQL_HOST=localhost
SQL_PORT=3306
SQL_USER=root
SQL_PASSWORD=admin
SQL_DATABASE=tiny_engine

9
.eslintignore Normal file
View File

@ -0,0 +1,9 @@
.vscode
dist
public
package-lock.json
**/node_modules/**
tmp
temp
mockServer
packages/vue-generator/**/output/**

31
.eslintrc.js Normal file
View File

@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es2015: true,
worker: true,
node: true,
jest: true
},
extends: ['eslint:recommended', 'plugin:vue/vue3-essential'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
parserOpts: {
plugins: ['jsx']
}
}
},
plugins: ['vue'],
rules: {
'no-console': 'error',
'no-debugger': 'error',
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'no-use-before-define': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }]
}
}

81
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@ -0,0 +1,81 @@
name: '🐛 Bug report'
description: Create a report to help us improve Tiny Engine
title: '🐛 [Bug]: '
labels: ['🐛 bug']
body:
- type: markdown
attributes:
value: |
Please fill out the following carefully in order to better fix the problem.
- type: input
id: Environment
attributes:
label: Environment
description: |
**Depending on your browser and operating system, websites may behave differently from one environment to another. Make sure your developers know your technical environment.**
placeholder: Please browser information.
validations:
required: true
- type: input
id: node-version
attributes:
label: Version
description: |
### **Check if the issue is reproducible with the latest stable version.**
You can use the command `node -v` to view it
placeholder: latest
validations:
required: true
- type: input
id: tiny-vue-version
attributes:
label: Version
description: |
### **Check if the issue is reproducible with the latest stable version.**
You can use the command `npm ls @opentiny/vue` to view it
placeholder: latest
validations:
required: true
- type: textarea
id: minimal-repo
attributes:
label: Link to minimal reproduction
description: |
**Provide a streamlined CodePen / CodeSandbox or GitHub repository link as much as possible. Please don't fill in a link randomly, it will only close your issue directly.**
placeholder: Please Input
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Step to reproduce
description: |
**After the replay is turned on, what actions do we need to perform to make the bug appear? Simple and clear steps can help us locate the problem more quickly. Please clearly describe the steps of reproducing the issue. Issues without clear reproducing steps will not be repaired. If the issue marked with 'need reproduction' does not provide relevant steps within 7 days, it will be closed directly.**
placeholder: Please Input
validations:
required: true
- type: textarea
id: expected
attributes:
label: What is expected
placeholder: Please Input
- type: textarea
id: actually
attributes:
label: What is actually happening
placeholder: Please Input
- type: input
id: project-name
attributes:
label: What is your project name
description: We also welcome you to fill in more detailed project information in the following issue [#334](https://github.com/opentiny/tiny-engine/issues/334).
placeholder: Please Input
validations:
required: true
- type: textarea
id: additional-comments
attributes:
label: Any additional comments (optional)
description: |
**Some background / context of how you ran into this bug.**
placeholder: Please Input

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Questions or need help
url: https://github.com/opentiny/tiny-engine/discussions
about: Add this WeChat(opentiny-official), we will invite you to the WeChat discussion group later.

View File

@ -0,0 +1,31 @@
name: ✨ Feature Request
description: Propose new features to @opentiny/tiny-engine to improve it.
title: '✨ [Feature]: '
labels: ['✨ feature']
body:
- type: textarea
id: feature-solve
attributes:
label: What problem does this feature solve
description: |
Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature?
placeholder: Please Input
validations:
required: true
- type: textarea
id: feature-api
attributes:
label: What does the proposed API look like
description: |
Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use Markdown to format your code blocks.
placeholder: Please Input
validations:
required: true
- type: input
id: project-name
attributes:
label: What is your project name
description: We also welcome you to fill in more detailed project information in the following issue [#334](https://github.com/opentiny/tiny-engine/issues/334).
placeholder: Please Input
validations:
required: true

52
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,52 @@
English | [简体中文](https://github.com/opentiny/tiny-engine/blob/develop/.github/PULL_REQUEST_TEMPLATE/PULL_REQUEST_TEMPLATE.zh-CN.md)
# PR
## PR Checklist
Please check if your PR fulfills the following requirements:
- [ ] The commit message follows our [Commit Message Guidelines](https://github.com/opentiny/tiny-engine/blob/develop/CONTRIBUTING.md)
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] Built its own designer, fully self-validated
## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:
## Background and solution
<!--
1. Describe the problem and the scenario.
2. New features need to be described and attached with renderings.
3. Screenshots or GIFs involving UI/Interaction changes/Bugfix before and after modification are required.
-->
### What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
Issue Number: N/A
### What is the new behavior?
## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
## Other information

View File

@ -0,0 +1,52 @@
[English](https://github.com/opentiny/tiny-engine/blob/develop/.github/PULL_REQUEST_TEMPLATE.md) | 简体中文
# PR
## PR Checklist
请检查您的 PR 是否满足以下要求:
- [ ] commit message遵循我们的[提交贡献指南](https://github.com/opentiny/tiny-engine/blob/develop/CONTRIBUTING.md)
- [ ] 添加了更改内容的测试用例用于bugfix/功能)
- [ ] 文档已添加/更新用于bugfix/功能)
- [ ] 是否构建了自己的设计器,经过了充分的自验证
## PR 类型
这个PR的类型是
- [ ] 日常 bug 修复
- [ ] 新特性支持
- [ ] 代码风格优化
- [ ] 重构
- [ ] 构建优化
- [ ] 测试用例
- [ ] 文档更新
- [ ] 分支合并
- [ ] 其他改动(请补充)
## 需求背景和解决方案
<!--
1. 要解决的具体问题。
2. 新增特性,需要进行功能描述,并附上效果图。
3. 涉及UI/交互变动/Bugfix需要有修改前&修改后截图或 GIF。
-->
Issue Number: N/A
### 修改前
### 修改后
## 此PR是否含有 breaking change?
- [ ] 是
- [ ] 否
<!-- 如果此 PR 包含breaking change请在下面从用户角度描述具体变化和其他风险。-->
## Other information

26
.github/release.yml vendored Normal file
View File

@ -0,0 +1,26 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- allcontributors[bot]
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: Exciting New Features 🎉
labels:
- Semver-Minor
- feature
- enhancement
- title: Bug Fixes 🐛
labels:
- Semver-Patch
- bug
- title: Other Changes
labels:
- documentation
- refactoring
- unit-test
- ci

23
.github/workflows/ai-code-review.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: AI Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-3.5-turbo
MAX_TOKENS: 4096
MAX_PATCH_LENGTH: 10000

18
.github/workflows/issue-translator.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: 'issue-translator'
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/issues-translate-action@v2.7
with:
IS_MODIFY_TITLE: false
# 非必须决定是否需要修改issue标题内容
# 若是true则机器人账户@Issues-translate-bot必须拥有修改此仓库issue权限。可以通过邀请@Issues-translate-bot加入仓库协作者实现。
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.
# 非必须,自定义机器人翻译的前缀开始内容。

36
.github/workflows/push-check.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Push And Create PR Check
on:
push:
branches: []
pull_request:
branches: [develop,main]
jobs:
push-check:
runs-on: ubuntu-latest # windows-latest || macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install pnpm
run: npm i -g pnpm
- name: Install dependencies
run: pnpm i
- name: Get changed files
id: get_changed_files
uses: tj-actions/changed-files@v40
with:
files: |
**.js
**.vue
**.jsx
- name: Run ESLint
run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}}
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha

28
.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
.DS_Store
node_modules
dist/
package-lock.json
yarn.lock
pnpm-lock.yaml
lerna-debug.log
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
tmp
temp

6
.husky/pre-commit Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# npm run lint
npx lint-staged -q

23
.npmignore Normal file
View File

@ -0,0 +1,23 @@
.build_config
.cid
.codecheck
.husky
.vscode
# 只忽略根目录的 dist 文件夹
/dist
test
node_modules
.editorconfig
.eslintignore
.eslintrc.js
.prettierignore
.prettierrc
jsconfig.json
package-lock.json
# 忽略可能存在的其它编辑器文件夹
.idea
/packages/design-core/public/mock/*
**/**/tmp
**/**/temp

3
.prettierignore Normal file
View File

@ -0,0 +1,3 @@
dist
package-lock.json
**/node_modules/**

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
semi: false
singleQuote: true
printWidth: 120
trailingComma: 'none'
endOfLine: 'auto'

17
CHANGELOG.md Normal file
View File

@ -0,0 +1,17 @@
# 更新日志
## v1.0.0-alpha.0
`2023/09/25`
### 📢 破坏性变更
### ✨ 新特性
- 首个版本提交
### 🐞 缺陷修复

80
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,80 @@
# Contributing
We are glad that you are willing to contribute to the TinyEngine open source project. There are many forms of contribution. You can choose one or more of them based on your strengths and interests:
- Report [new defect](https://github.com/opentiny/tiny-engine/issues/new?template=bug-report.yml).
- Provide more detailed information for the [existing defects](https://github.com/opentiny/tiny-engine/labels/bug), such as supplementary screenshots, more detailed reproduction steps, minimum reproducible demo links, etc.
- Submit Pull requests to fix typos in the document or make the document clearer and better.
- Add the official assistant WeChat `opentiny-official` and join the technical exchange group to participate in the discussion.
When you personally use the TinyEngine component library and participate in many of the above contributions, as you become familiar with TinyEngine , you can try to do something more challenging, such as:
- Fix the defect. You can start with [Good-first issue](https://github.com/opentiny/tiny-engine/labels/good%20first%20issue).
- Implementation of new features
- Complete unit tests.
- Translate documents
- Participate in code review.
## Bug Reports
If you encounter problems in the process of using TinyEngine components, you are welcome to submit Issue to us. Before submitting Issue, please read the relevant [official documentation](https://opentiny.design/tiny-engine) carefully to confirm whether this is a defect or an unimplemented function.
If it is a defect, select [Bug report](https://github.com/opentiny/tiny-engine/issues/new?template=bug-report.yml) template when creating a new Issue. The title follows the format of `[toolkitName/pluginName/EngineCore] defect description`. For example: `[tiny-engine-toolbar-refresh] The refresh function cannot be used`.
Issue that reports defects mainly needs to fill in the following information:
- Version numbers of `tiny-engine` and `node`.
- The performance of the defect can be illustrated by screenshot, and if there is an error, the error message can be posted.
- Defect reproduction step, preferably with a minimum reproducible demo link.
If it is a new feature, select [Feature request](https://github.com/opentiny/tiny-engine/issues/new?template=feature-request.yml) template. The title follows the format of `[toolkitName/pluginName/EngineCore] new feature description`. For example: `[tiny-engine-theme] New Blue Theme`.
The following information is required for the Issue of the new feature:
- What problems does this feature mainly solve for users?
- What is the api of this feature?
## Pull Requests
Before submitting pull request, please make sure that your submission is in line with the overall plan of TinyEngine. Generally, issues that marked as [bug](https://github.com/opentiny/tiny-engine/labels/bug) are encouraged to submit pull requests. If you are not sure, you can create a [Discussion](https://github.com/opentiny/tiny-engine/discussions) for discussion.
Local startup steps:
- Click the Fork button in the upper right corner of the [TinyEngine](https://github.com/opentiny/tiny-engine) code repository to fork the upstream warehouse to the personal warehouse.
- Clone personal warehouse to local
- Run `npm install` under the TinyEngine root directory to install node dependencies.
- Run `npm install` under the TinyEngine mockServer to install node dependencies
- Run `npm run serve` under the TinyEngine root directory, and then `run npm run dev` in the mockServer directory to start local development.
```shell
# username indicates the user name. Replace it before running the command.
git clone git@github.com:username/tiny-engine.git
cd tiny-engine
git remote add upstream git@github.com:opentiny/tiny-engine.git
pnpm i
# Start the project.
$ pnpm dev
```
To submit a PR:
- Create a new branch `git checkout -b username/feature1`. The name of the branch should be `username/feat-xxx` / `username/fix-xxx`.
- Local coding.
- Submit according to [Commit Message Format](https://www.conventionalcommits.org/zh-hans/v1.0.0/) specification. PR that do not conform to the submission specification will not be merged.
- Submit to remote repository: `git push origin branchName`.
- (Optional) Synchronize upstream repository dev branch latest code: `git pull upstream develop`.
- Open the [Pull requests](https://github.com/opentiny/tiny-engine/pulls) link of the TinyEngine code repository and click the New pull request button to submit the PR.
- Project Committer conducts Code Review and makes comments.
- The PR author adjusts the code according to the opinion. Please note that when a branch initiates PR, the subsequent commit will be synchronized automatically, and there is no need to resubmit the PR.
- Project administrator merges PR.
The contribution process is over, thank you for your contribution!
## Join the open source community
If you are interested in our open source projects, please join our open source community in the following ways.
- Add the official assistant WeChat: opentiny-official, join our technical exchange group
- Join the mailing list: opentiny@googlegroups.com

79
CONTRIBUTING.zh-CN.md Normal file
View File

@ -0,0 +1,79 @@
# 贡献指南
很高兴你有意愿参与 TinyEngine 开源项目的贡献,参与贡献的形式有很多种,你可以根据自己的特长和兴趣选择其中的一个或多个:
- 报告[新缺陷](https://github.com/opentiny/tiny-engine/issues/new?template=bug-report.yml)
- 为[已有缺陷](https://github.com/opentiny/tiny-engine/labels/bug)提供更详细的信息,比如补充截图、提供更详细的复现步骤、提供最小可复现 demo 链接等
- 提交 Pull requests 修复文档中的错别字或让文档更清晰和完善
- 添加官方小助手微信 opentiny-official加入技术交流群参与讨论
当你亲自使用 TinyEngine 组件库,并参与多次以上形式的贡献,对 TinyEngine 逐渐熟悉之后,可以尝试做一些更有挑战的事情,比如:
- 修复缺陷,可以先从 [Good-first issue](https://github.com/opentiny/tiny-engine/labels/good%20first%20issue) 开始
- 实现新特性
- 完善单元测试
- 翻译文档
- 参与代码检视
## 提交 Issue
如果你在使用 TinyEngine 组件过程中遇到问题,欢迎给我们提交 Issue提交 Issue 之前,请先仔细阅读相关的[官方文档](https://opentiny.design/tiny-engine),确认这是一个缺陷还是尚未实现的功能。
如果是一个缺陷,创建新 Issue 时选择 [Bug report](https://github.com/opentiny/tiny-engine/issues/new?template=bug-report.yml) 模板,标题遵循 `[toolkitName/pluginName/EngineCore]缺陷简述` 的格式,比如:`[tiny-engine-toolbar-refresh] 刷新功能无法使用`。
报告缺陷的 Issue 主要需要填写以下信息:
- tiny-engine 和 node 的版本号
- 缺陷的表现,可截图辅助说明,如果有报错可贴上报错信息
- 缺陷的复现步骤,最好能提供一个最小可复现 demo 链接
如果是一个新特性,则选择 [Feature request](https://github.com/opentiny/tiny-engine/issues/new?template=feature-request.yml) 模板,标题遵循 `[toolkitName/pluginName/EngineCore]新特性简述` 的格式,比如:`[tiny-engine-theme] 新增蓝色主题`。
新特性的 Issue 主要需要填写以下信息:
- 该特性主要解决用户的什么问题
- 该特性的 api 是什么样的
## 提交 PR
提交 PR 之前,请先确保你提交的内容是符合 TinyEngine 整体规划的,一般已经标记为 [bug](https://github.com/opentiny/tiny-engine/labels/bug) 的 Issue 是鼓励提交 PR 的,如果你不是很确定,可以创建一个 [Discussion](https://github.com/opentiny/tiny-engine/discussions) 进行讨论。
本地启动步骤:
- 点击 [TinyEngine](https://github.com/opentiny/tiny-engine) 代码仓库右上角的 Fork 按钮,将上游仓库 Fork 到个人仓库
- Clone 个人仓库到本地
- 在 TinyEngine 根目录下运行 `pnpm i`, 安装依赖
- 在 TinyEngine 根目录下运行 `pnpm dev`,启动本地开发
```shell
# username 为用户名,执行前请替换
git clone git@github.com:username/tiny-engine.git
cd tiny-engine
git remote add upstream git@github.com:opentiny/tiny-engine.git
pnpm i
# 启动项目
$ pnpm dev
```
提交 PR 的步骤:
- 创建新分支 `git checkout -b username/feature1`,分支名字建议为 `username/feat-xxx` / `username/fix-xxx`
- 本地编码
- 遵循 Commit Message Format 规范进行提交,不符合提交规范的 PR 将不会被合并
- 提交到远程仓库git push origin branchName
- (可选)同步上游仓库 develop 分支最新代码git pull upstream develop
- 打开 TinyEngine 代码仓库的 [Pull requests](https://github.com/opentiny/tiny-engine/pulls) 链接,点击 New pull request 按钮提交 PR
- 项目 Committer 进行 Code Review并提出意见
- PR 作者根据意见调整代码,请注意一个分支发起了 PR 后,后续的 commit 会自动同步,无需重新提交 PR
- 项目管理员合并 PR
贡献流程结束,感谢你的贡献!
## 加入开源社区
如果你对我们的开源项目感兴趣,欢迎通过以下方式加入我们的开源社区。
- 添加官方小助手微信opentiny-official加入我们的技术交流群
- 加入邮件列表opentiny@googlegroups.com

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2023 - present TinyEngine Authors.
Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

108
README.md
View File

@ -1,2 +1,108 @@
# lowcode-design-core
<p align="center">
<a href="https://opentiny.design/tiny-engine" target="_blank" rel="noopener noreferrer">
<img alt="OpenTiny Logo" src="logo.svg" height="100" style="max-width:100%;">
</a>
</p>
<p align="center">TinyEngine enables developers to customize low-code platforms, build low-bit platforms online in real time, and support secondary development or integration of low-bit platform capabilities.</p>
English | [简体中文](README.zh-CN.md)
🌈 Features:
- Cross-end cross-frame front-end components
- Supports online real-time construction, secondary development, or being integrated.
- Directly generate deployable source code without engine support.
- Allows access to third-party components and customized extension plug-ins.
- Supports high-code and low-code, and hybrid development and deployment of applications.
- The platform accesses AI big model capabilities to help developers build applications.
## Documentation
- introhttps://opentiny.design/tiny-engine#/home
- tutorialhttps://opentiny.design/tiny-engine#/help-center/course/engine
- playgroundhttps://opentiny.design/tiny-engine#/tiny-engine-editor
## Development
### Dependencies required for installation
```sh
$ pnpm install
```
### Local development: Start the local mock server and use the mock data of the local mock server.
```sh
$ pnpm dev
```
## Local development, directly connected to the local tiny-engine-webservice server
1. Start <a href="https://github.com/opentiny/tiny-engine-data-center/blob/main/README.md" target="_blank">tiny-engine-data-center</a>
2. Start <a href="https://github.com/opentiny/tiny-engine-webservice/blob/main/README.md" target="_blank">tiny-engine-webservice</a>
3. Modify the origin value in `vite.config.js` in the `packages/design-core/` directory of the tiny-engine project to be the address port of your local webService project (the webService port defaults to 7011), such as:
<img alt="Modify port" src="https://res.hc-cdn.com/lowcode-portal/1.1.55/img/docimg/backend_deploy_5.png">
### Materials Synchronization [Solution](https://opentiny.design/tiny-engine#/help-center/course/engine/56)
```sh
$ pnpm splitMaterials
```
```sh
$ pnpm buildMaterials
```
Open a browser: `http://localhost:8080/?type=app&id=918&tenant=1&pageid=NTJ4MjvqoVj8OVsc`
`url search` Parameters:
- `type=app` Application type
- `id=xxx` Application ID
- `tenant=xxx` Organization ID
- `pageid=xxx` Page ID
## Build
```sh
# Build all plug-ins first
pnpm build:plugin
# Build Designer
pnpm build:alpha or build:prod
```
The folder where the product is located after building
```
tiny-engine/packages/design-core/dist/
```
## Milestones
```mermaid
gantt
dateFormat YYYY-MM-DD
axisFormat %Y-%m-%d
1.0.0-beta.x version :active,2023-09-25, 2024-03-31
1.0.0-rc version : 2024-04-01, 2024-06-30
1.0.0 version : 2024-07-01, 2024-07-31
```
## 🤝 Participation and Contribution
If you are interested in our open source project, please join us! 🎉
Please read the [Contribution Guide](CONTRIBUTING.md) before participating in the contribution.
- Add official assistant WeChat opentiny-official and join the technical exchange group
- Join the mailing list opentiny@googlegroups.com
## License
[MIT](LICENSE)

108
README.zh-CN.md Normal file
View File

@ -0,0 +1,108 @@
<p align="center">
<a href="https://opentiny.design/tiny-engine" target="_blank" rel="noopener noreferrer">
<img alt="OpenTiny Logo" src="logo.svg" height="100" style="max-width:100%;">
</a>
</p>
<p align="center">TinyEngine低代码引擎使能开发者定制低代码平台支持在线实时构建低码平台支持二次开发或集成低码平台能力</p>
[English](README.md) | 简体中文
🌈 特性:
- 跨端跨框架前端组件
- 支持在线实时构建、支持二次开发或被集成
- 直接生成可部署的源码,运行时无需引擎支撑
- 允许接入第三方组件、允许定制扩展插件
- 支持高代码与低代码,混合开发部署应用
- 平台接入 AI 大模型能力,辅助开发者构建应用
## 文档
- 介绍https://opentiny.design/tiny-engine#/home
- 使用文档https://opentiny.design/tiny-engine#/help-center/course/engine
- 演示应用https://opentiny.design/tiny-engine#/tiny-engine-editor
## 开发
### 安装所需的依赖
```sh
$ pnpm install
```
### 本地开发,启动本地 mock 服务器,使用本地 mock 服务器的 mock 数据
```sh
$ pnpm dev
```
### 本地开发直连本地的tiny-engine-webservice服务端
1. 启动 <a href="https://github.com/opentiny/tiny-engine-data-center/blob/main/README.md" target="_blank">tiny-engine-data-center</a>
2. 启动 <a href="https://github.com/opentiny/tiny-engine-webservice/blob/main/README.md" target="_blank">tiny-engine-webservice</a>
3. 修改 tiny-engine 项目 `packages/design-core/` 目录下 `vite.config.js` 中origin的值为自己本地webService项目的地址端口webService端口默认为7011
<img alt="修改端口" src="https://res.hc-cdn.com/lowcode-portal/1.1.55/img/docimg/backend_deploy_5.png">
### 物料同步[方案](https://opentiny.design/tiny-engine#/help-center/course/engine/56)
```sh
$ pnpm splitMaterials
```
```sh
$ pnpm buildMaterials
```
浏览器打开:`http://localhost:8080/?type=app&id=918&tenant=1&pageid=NTJ4MjvqoVj8OVsc`
`url search`参数:
- `type=app` 应用类型
- `id=xxx` 应用 ID
- `tenant=xxx` 组织 ID
- `pageid=xxx` 页面 ID
## 构建
```sh
# 先构建所有插件
pnpm run build:plugin
# 构建设计器
pnpm run build:alpha 或 build:prod
```
构建后产物所在文件夹
```
tiny-engine/packages/design-core/dist/
```
## 里程碑
```mermaid
gantt
dateFormat YYYY-MM-DD
axisFormat %Y-%m-%d
1.0.0-beta.x version :active,2023-09-25, 2024-03-31
1.0.0-rc version : 2024-04-01, 2024-06-30
1.0.0 version : 2024-07-01, 2024-07-31
```
## 🤝 参与贡献
如果你对我们的开源项目感兴趣,欢迎加入我们!🎉
参与贡献之前请先阅读[贡献指南](CONTRIBUTING.zh-CN.md)。
- 添加官方小助手微信 opentiny-official加入技术交流群
- 加入邮件列表 opentiny@googlegroups.com
## 开源协议
[MIT](LICENSE)

73
jsconfig.json Normal file
View File

@ -0,0 +1,73 @@
{
"compilerOptions": {
"baseUrl": "./",
"jsx": "react",
"paths": {
"@/*": ["packages/*"],
"@opentiny/tiny-engine-canvas": ["packages/canvas/src/index.js"],
"@opentiny/tiny-engine-controller": ["packages/controller/src/index"],
"@opentiny/tiny-engine-plugin-materials": ["packages/plugins/materials/index"],
"@opentiny/tiny-engine-plugin-data": ["packages/plugins/data/index"],
"@opentiny/tiny-engine-plugin-script": ["packages/plugins/script/index"],
"@opentiny/tiny-engine-plugin-tree": ["packages/plugins/tree/index"],
"@opentiny/tiny-engine-plugin-help": ["packages/plugins/help/index"],
"@opentiny/tiny-engine-plugin-schema": ["packages/plugins/schema/index"],
"@opentiny/tiny-engine-plugin-page": ["packages/plugins/page/index"],
"@opentiny/tiny-engine-plugin-i18n": ["packages/plugins/i18n/index"],
"@opentiny/tiny-engine-plugin-bridge": ["packages/plugins/bridge/index"],
"@opentiny/tiny-engine-setting-events": ["packages/settings/events/index"],
"@opentiny/tiny-engine-setting-props": ["packages/settings/props/index"],
"@opentiny/tiny-engine-common": ["packages/common/index"],
"@opentiny/tiny-engine-setting-styles": ["packages/settings/styles/index"],
"@opentiny/tiny-engine-toolbar-breadcrumb": ["packages/toolbars/breadcrumb/index"],
"@opentiny/tiny-engine-toolbar-fullscreen": ["packages/toolbars/fullscreen/index"],
"@opentiny/tiny-engine-toolbar-lang": ["packages/toolbars/lang/index"],
"@opentiny/tiny-engine-toolbar-layout": ["packages/toolbars/layout/index"],
"@opentiny/tiny-engine-toolbar-checkinout": ["packages/toolbars/lock/index"],
"@opentiny/tiny-engine-toolbar-logo": ["packages/toolbars/logo/index"],
"@opentiny/tiny-engine-toolbar-media": ["packages/toolbars/media/index"],
"@opentiny/tiny-engine-toolbar-preview": ["packages/toolbars/preview/index"],
"@opentiny/tiny-engine-toolbar-generate-vue": ["packages/toolbars/generate-vue/index"],
"@opentiny/tiny-engine-toolbar-clean": ["packages/toolbars/clean/index"],
"@opentiny/tiny-engine-toolbar-save": ["packages/toolbars/save/index"],
"tiny-engine-canvas": ["packages/canvas/index"],
"@opentiny/tiny-engine-theme-dark": ["packages/theme/dark/index.less"],
"@opentiny/tiny-engine-theme-light": ["packages/theme/light/index.less"],
"@opentiny/tiny-engine-svgs": ["packages/svgs/index"],
"@opentiny/tiny-engine-http": ["packages/http/index"],
"@opentiny/tiny-engine-controller/*": ["packages/controller/src/*"],
"@opentiny/tiny-engine-plugin-materials/*": ["packages/plugins/materials/*"],
"@opentiny/tiny-engine-plugin-data/*": ["packages/plugins/data/*"],
"@opentiny/tiny-engine-plugin-script/*": ["packages/plugins/script/*"],
"@opentiny/tiny-engine-plugin-tree/*": ["packages/plugins/tree/*"],
"@opentiny/tiny-engine-plugin-help/*": ["packages/plugins/help/*"],
"@opentiny/tiny-engine-plugin-schema/*": ["packages/plugins/schema/*"],
"@opentiny/tiny-engine-plugin-page/*": ["packages/plugins/page/*"],
"@opentiny/tiny-engine-plugin-i18n/*": ["packages/plugins/i18n/*"],
"@opentiny/tiny-engine-plugin-bridge/*": ["packages/plugins/bridge/*"],
"@opentiny/tiny-engine-setting-events/*": ["packages/settings/events/*"],
"@opentiny/tiny-engine-setting-props/*": ["packages/settings/props/*"],
"@opentiny/tiny-engine-common/*": ["packages/common/*"],
"@opentiny/tiny-engine-setting-styles/*": ["packages/settings/styles/*"],
"@opentiny/tiny-engine-toolbar-breadcrumb/*": ["packages/toolbars/breadcrumb/*"],
"@opentiny/tiny-engine-toolbar-fullscreen/*": ["packages/toolbars/fullscreen/*"],
"@opentiny/tiny-engine-toolbar-lang/*": ["packages/toolbars/lang/*"],
"@opentiny/tiny-engine-toolbar-layout/*": ["packages/toolbars/layout/*"],
"@opentiny/tiny-engine-toolbar-checkinout/*": ["packages/toolbars/lock/*"],
"@opentiny/tiny-engine-toolbar-logo/*": ["packages/toolbars/logo/*"],
"@opentiny/tiny-engine-toolbar-media/*": ["packages/toolbars/media/*"],
"@opentiny/tiny-engine-toolbar-preview/*": ["packages/toolbars/preview/*"],
"@opentiny/tiny-engine-toolbar-clean/*": ["packages/toolbars/clean/*"],
"@opentiny/tiny-engine-toolbar-save/*": ["packages/toolbars/save/*"],
"@opentiny/tiny-engine-theme-dark/*": ["packages/theme/dark/*"],
"@opentiny/tiny-engine-theme-light/*": ["packages/theme/light/*"],
"@opentiny/tiny-engine-svgs/*": ["packages/svgs/*"],
"@opentiny/tiny-engine-http/*": ["packages/http/*"],
"@opentiny/tiny-engine-utils": ["packages/utils/src/index.js"],
"@opentiny/tiny-engine-webcomponent-core": ["packages/webcomponent/src/lib"],
"@opentiny/tiny-engine-i18n-host": ["packages/i18n/src/lib"]
}
},
"include": ["packages/**/*"],
"exclude": ["node_modules", "dist"]
}

15
lerna.json Normal file
View File

@ -0,0 +1,15 @@
{
"command": {
"version": {
"message": "chore(release): publish"
}
},
"useNx": false,
"version": "independent",
"npmClient": "pnpm",
"publish": {
"npmClient": "pnpm"
},
"ignoreChanges": ["**/*.md", "**/test/**", ".npmrc"],
"granularPathspec": false
}

4
lint-staged.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
'./packages/**/**.{js,vue,jsx}': 'eslint',
'./packages/**/**.{vue,js,ts,html,json,less}': 'prettier --write'
}

44
logo.svg Normal file
View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="189px" height="38px" viewBox="0 0 189 38" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>logo-top</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#FFCC00" offset="0%"></stop>
<stop stop-color="#FF9D00" offset="100%"></stop>
</linearGradient>
<linearGradient x1="41.5583977%" y1="684.931472%" x2="57.6489702%" y2="214.83809%" id="linearGradient-2">
<stop stop-color="#5073E5" offset="0%"></stop>
<stop stop-color="#5E7CE0" offset="100%"></stop>
</linearGradient>
<linearGradient x1="44.74774%" y1="89.3284133%" x2="67.1281333%" y2="0%" id="linearGradient-3">
<stop stop-color="#5073E5" offset="0%"></stop>
<stop stop-color="#5E7CE0" offset="100%"></stop>
</linearGradient>
<linearGradient x1="42.185134%" y1="684.931472%" x2="57.0810819%" y2="214.83809%" id="linearGradient-4">
<stop stop-color="#5073E5" offset="0%"></stop>
<stop stop-color="#5E7CE0" offset="100%"></stop>
</linearGradient>
<linearGradient x1="24.3954947%" y1="56.7227863%" x2="68.844278%" y2="32.8834171%" id="linearGradient-5">
<stop stop-color="#FFFFFF" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#566DB8" offset="100%"></stop>
</linearGradient>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Tiny-Design-首页" transform="translate(-106.000000, -20.000000)">
<g id="导航" transform="translate(0.000000, 1.000000)">
<g id="logo-top" transform="translate(106.000000, 19.000000)">
<text id="OpenTiny" font-family="HiraginoSans-W7, Hiragino Sans" font-size="21" font-weight="bold" fill="#242424">
<tspan x="76.2305" y="24">OpenTiny</tspan>
</text>
<g id="编组-21">
<polygon id="路径" fill="url(#linearGradient-1)" points="61 1.99723278 44.8967008 0 20.1759284 1.37793579 32.933574 3.7061054"></polygon>
<polygon id="路径" fill="url(#linearGradient-2)" points="50.0936029 6.53938911 50.0817739 30.0300979 61 27.7599874 60.9645128 5.58721999"></polygon>
<polygon id="路径" fill="url(#linearGradient-3)" points="32.9710327 33.587185 45.3264901 31.154509 45.3304331 6.99805594 32.9197734 7.92893672"></polygon>
<polygon id="路径" fill="url(#linearGradient-4)" points="20.1759284 4.76471618 20.2212732 25.8982258 32.4801266 33.3936547 32.4584399 7.93"></polygon>
<polygon id="路径" fill="url(#linearGradient-5)" points="20.1759284 25.9101141 9.22524348e-13 29.863332 11.645719 38 32.9710327 33.587185"></polygon>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

21
mockServer/.babelrc Normal file
View File

@ -0,0 +1,21 @@
{
"presets": [
["@babel/preset-env", {
"targets": {
"node": "current"
}
}]
],
"env": {
"test": {
"presets": [
["@babel/preset-env", {
"targets": {
"node": "current"
}
}]
]
}
},
"plugins": ["@babel/plugin-transform-runtime"]
}

9
mockServer/.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

3
mockServer/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
build/*.js
assets/*.js
test/**/*.js

36
mockServer/.eslintrc.js Normal file
View File

@ -0,0 +1,36 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2017, //指定ECMAScript支持的版本6为ES6这里为了兼容async和await设置为2017
sourceType: 'module'
},
extends: 'standard',
plugins: ['html', 'promise'],
env: {
node: true
},
rules: {
// allow console
'no-console': 0,
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': 0,
camelcase: 'off'
}
}

9
mockServer/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
.DS_Store
node_modules/
dist/
npm-debug.log
test/unit/coverage
test/e2e/reports
selenium-debug.log
.idea/
package-lock.json

11
mockServer/.jsbeautifyrc Normal file
View File

@ -0,0 +1,11 @@
{
"indent_size": 2,
"indent_char": " ",
"other": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": true,
"indent_handlebars": true
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,95 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import { defineCustomElement } from '@opentiny/tiny-engine-webcomponent-core'
import * as vue from 'vue'
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, toDisplayString } from 'vue'
import { I18nInjectionKey } from 'vue-i18n'
import { IconChevronLeft } from '@opentiny/vue-icon'
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null)
return (str) => {
const hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
}
return target
}
const _sfc_main = {
components: {
TinyIconChevronLeft: IconChevronLeft()
},
props: {
blockName: { type: String, default: 'MT0526-React 1.0' }
},
setup(props, context) {
const { t, lowcodeWrap } = vue.inject(I18nInjectionKey).lowcode()
const wrap = lowcodeWrap(props, context, t)
const state = vue.reactive({})
const attrs = wrap({
state
})
return attrs
}
}
const _hoisted_1 = {
style: { 'font-size': '18px', height: '40px', 'border-bottom': '1px solid rgb(223, 225, 230)', 'margin-top': '20px' }
}
const _hoisted_2 = /* @__PURE__ */ createElementVNode(
'span',
{ style: { 'margin-left': '10px', 'font-weight': 'bold' } },
'\u7F16\u8F91\u7269\u6599\u8D44\u4EA7\u5305 | ',
-1
)
const _hoisted_3 = { style: { 'margin-left': '10px', 'font-weight': 'bold' } }
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_tiny_icon_chevron_left = resolveComponent('tiny-icon-chevron-left')
return (
openBlock(),
createElementBlock('div', null, [
createElementVNode('div', _hoisted_1, [
createVNode(_component_tiny_icon_chevron_left),
_hoisted_2,
createElementVNode('span', _hoisted_3, toDisplayString($props.blockName), 1)
])
])
)
}
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['__file', 'D:/tmp/buildground/buildground_1673597935715/src/block/generated/components/PortalBlock.vue']
])
window.TinyLowcodeResource = window.TinyLowcodeResource || {}
const blockName = hyphenate('PortalBlock')
block.blockId = 1005
block.blockVersion = '1.0.0'
if (customElements.get(blockName)) {
if (window.TinyLowcodeResource[blockName]) {
Object.assign(window.TinyLowcodeResource[blockName], block)
}
} else {
block.links = {
VUE_APP_UI_LIB_FULL_STYLE_FILE_URL: ['//localhost:9090/assets/css/0.1.20/index.css']
}.VUE_APP_UI_LIB_FULL_STYLE_FILE_URL
window.TinyLowcodeResource[blockName] = block
customElements.define(blockName, defineCustomElement(block))
}
export { block as default }

View File

@ -0,0 +1,137 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
;(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core'),
require('vue'),
require('vue-i18n'),
require('@opentiny/vue-icon')
)
} else if (typeof define === 'function' && define.amd) {
define(['@opentiny/tiny-engine-webcomponent-core', 'vue', 'vue-i18n', '@opentiny/vue-icon'], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyVueBlock = factory(global.TinyWebcomponentCore, global.Vue, global.VueI18n, global.TinyVueIcon))
}
})(this, (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon) => {
function _interopNamespace(e) {
if (e && e.__esModule) return e
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } })
if (e) {
Object.keys(e).forEach((k) => {
if (k !== 'default') {
const d = Object.getOwnPropertyDescriptor(e, k)
Object.defineProperty(
n,
k,
d.get
? d
: {
enumerable: true,
get: function () {
return e[k]
}
}
)
}
})
}
n.default = e
return Object.freeze(n)
}
const vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null)
return (str) => {
const hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
}
return target
}
const _sfc_main = {
components: {
TinyIconChevronLeft: tinyVue3Icon.IconChevronLeft()
},
props: {
blockName: { type: String, default: 'MT0526-React 1.0' }
},
setup(props, context) {
const { t, lowcodeWrap } = vue__namespace.inject(vueI18n.I18nInjectionKey).lowcode()
const wrap = lowcodeWrap(props, context, t)
const state = vue__namespace.reactive({})
const attrs = wrap({
state
})
return attrs
}
}
const _hoisted_1 = {
style: {
'font-size': '18px',
height: '40px',
'border-bottom': '1px solid rgb(223, 225, 230)',
'margin-top': '20px'
}
}
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode(
'span',
{ style: { 'margin-left': '10px', 'font-weight': 'bold' } },
'\u7F16\u8F91\u7269\u6599\u8D44\u4EA7\u5305 | ',
-1
)
const _hoisted_3 = { style: { 'margin-left': '10px', 'font-weight': 'bold' } }
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_tiny_icon_chevron_left = vue.resolveComponent('tiny-icon-chevron-left')
return (
vue.openBlock(),
vue.createElementBlock('div', null, [
vue.createElementVNode('div', _hoisted_1, [
vue.createVNode(_component_tiny_icon_chevron_left),
_hoisted_2,
vue.createElementVNode('span', _hoisted_3, vue.toDisplayString($props.blockName), 1)
])
])
)
}
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['__file', 'D:/tmp/buildground/buildground_1673597935715/src/block/generated/components/PortalBlock.vue']
])
window.TinyLowcodeResource = window.TinyLowcodeResource || {}
const blockName = hyphenate('PortalBlock')
block.blockId = 1005
block.blockVersion = '1.0.0'
if (customElements.get(blockName)) {
if (window.TinyLowcodeResource[blockName]) {
Object.assign(window.TinyLowcodeResource[blockName], block)
}
} else {
block.links = {
VUE_APP_UI_LIB_FULL_STYLE_FILE_URL: ['//localhost:9090/assets/css/0.1.20/index.css']
}.VUE_APP_UI_LIB_FULL_STYLE_FILE_URL
window.TinyLowcodeResource[blockName] = block
customElements.define(blockName, tinyWebcomponentCore.defineCustomElement(block))
}
return block
})

View File

@ -0,0 +1,81 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import {
CarouselItem,
CheckboxButton,
Tree,
Popover,
Tooltip,
Col,
DropdownItem,
Pager,
Search,
Row,
FormItem,
Alert,
Input,
Tabs,
DropdownMenu,
DialogBox,
Switch,
TimeLine,
TabItem,
Radio,
Form,
Grid,
Numeric,
CheckboxGroup,
Select,
ButtonGroup,
Carousel,
Popeditor,
DatePicker,
Dropdown,
ChartHistogram
} from '@opentiny/vue'
const Mapper = {
TinyCarouselItem: CarouselItem,
TinyCheckboxButton: CheckboxButton,
TinyTree: Tree,
TinyPopover: Popover,
TinyTooltip: Tooltip,
TinyCol: Col,
TinyDropdownItem: DropdownItem,
TinyPager: Pager,
TinySearch: Search,
TinyRow: Row,
TinyFormItem: FormItem,
TinyAlert: Alert,
TinyInput: Input,
TinyTabs: Tabs,
TinyDropdownMenu: DropdownMenu,
TinyDialogBox: DialogBox,
TinySwitch: Switch,
TinyTimeLine: TimeLine,
TinyTabItem: TabItem,
TinyRadio: Radio,
TinyForm: Form,
TinyGrid: Grid,
TinyNumeric: Numeric,
TinyCheckboxGroup: CheckboxGroup,
TinySelect: Select,
TinyButtonGroup: ButtonGroup,
TinyCarousel: Carousel,
TinyPopeditor: Popeditor,
TinyDatePicker: DatePicker,
TinyDropdown: Dropdown,
TinyChartHistogram: ChartHistogram
}
Mapper.TinyTabs.isGroup = true
Mapper.TinyGrid.isGroup = true
export { Mapper as default }

View File

@ -0,0 +1,60 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
;(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(require('@opentiny/vue'))
} else if (typeof define === 'function' && define.amd) {
define(['@opentiny/vue'], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyLowcodeComponent = factory(global.TinyVue))
}
})(this, (tinyVue3) => {
'use strict'
const Mapper = {
TinyCarouselItem: tinyVue3.CarouselItem,
TinyCheckboxButton: tinyVue3.CheckboxButton,
TinyTree: tinyVue3.Tree,
TinyPopover: tinyVue3.Popover,
TinyTooltip: tinyVue3.Tooltip,
TinyCol: tinyVue3.Col,
TinyDropdownItem: tinyVue3.DropdownItem,
TinyPager: tinyVue3.Pager,
TinySearch: tinyVue3.Search,
TinyRow: tinyVue3.Row,
TinyFormItem: tinyVue3.FormItem,
TinyAlert: tinyVue3.Alert,
TinyInput: tinyVue3.Input,
TinyTabs: tinyVue3.Tabs,
TinyDropdownMenu: tinyVue3.DropdownMenu,
TinyDialogBox: tinyVue3.DialogBox,
TinySwitch: tinyVue3.Switch,
TinyTimeLine: tinyVue3.TimeLine,
TinyTabItem: tinyVue3.TabItem,
TinyRadio: tinyVue3.Radio,
TinyForm: tinyVue3.Form,
TinyGrid: tinyVue3.Grid,
TinyNumeric: tinyVue3.Numeric,
TinyCheckboxGroup: tinyVue3.CheckboxGroup,
TinySelect: tinyVue3.Select,
TinyButtonGroup: tinyVue3.ButtonGroup,
TinyCarousel: tinyVue3.Carousel,
TinyPopeditor: tinyVue3.Popeditor,
TinyDatePicker: tinyVue3.DatePicker,
TinyDropdown: tinyVue3.Dropdown,
TinyChartHistogram: tinyVue3.ChartHistogram
}
Mapper.TinyTabs.isGroup = true
Mapper.TinyGrid.isGroup = true
return Mapper
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,664 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import { defineCustomElement } from '@opentiny/tiny-engine-webcomponent-core'
import * as vue from 'vue'
import {
resolveComponent,
openBlock,
createElementBlock,
createElementVNode,
Fragment,
renderList,
toDisplayString,
normalizeClass,
createVNode,
withCtx,
createBlock,
createCommentVNode,
pushScopeId,
popScopeId
} from 'vue'
import { I18nInjectionKey } from 'vue-i18n'
import { IconCheckOut, IconDeltaDown, IconGroup, IconHelpQuery, IconSetting, IconYes } from '@opentiny/vue-icon'
import { Popover, Tooltip } from '@opentiny/vue'
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null)
return (str) => {
const hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
const _style_0 =
'\n.team-list-item.active[data-v-b66e3972] {\r\n border: 1px solid #38acff;\n}\n.toolbars-item[data-v-b66e3972]:hover {\r\n cursor: pointer;\r\n background-color: #f1f2f3;\n}\n.toolbars-item.active[data-v-b66e3972] {\r\n background-color: #e5e6e8;\n}\n'
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
}
return target
}
const _sfc_main = {
components: {
TinyIconCheckOut: IconCheckOut(),
TinyIconDeltaDown: IconDeltaDown(),
TinyIconGroup: IconGroup(),
TinyIconHelpQuery: IconHelpQuery(),
TinyIconSetting: IconSetting(),
TinyIconYes: IconYes(),
TinyPopover: Popover,
TinyTooltip: Tooltip
},
props: {
tenant: { type: Object, default: () => "{tenant_id: 'public'}" }
},
emits: ['handle-route'],
setup(props, context) {
const { t, lowcodeWrap } = vue.inject(I18nInjectionKey).lowcode()
const wrap = lowcodeWrap(props, context, t)
const state = vue.reactive({
menuData: [
{
label: '\u9996\u9875',
url: '/home'
},
{
label: '\u6211\u7684\u5E94\u7528',
url: '/home'
},
{
label: '\u5E94\u7528\u4E2D\u5FC3',
url: '/home'
},
{
label: '\u6211\u7684\u5E73\u53F0',
url: '/home'
},
{
label: '\u5E73\u53F0\u4E2D\u5FC3',
url: '/home'
},
{
label: '\u6211\u7684\u7269\u6599',
url: '/home'
},
{
label: '\u751F\u6001\u4E2D\u5FC3',
url: '/home'
},
{
label: '\u76D1\u63A7\u4E2D\u5FC3',
url: '/home'
}
],
tenants: [
{
id: 1,
tenant_id: 'public',
name_cn: '\u516C\u5171\u79DF\u6237',
name_en: 'Public Tenant',
description: 'Default tenant for new user to explore.',
published_at: '2021-12-28T11:39:10.000Z',
created_by: null,
updated_by: null,
created_at: '2021-12-28T11:39:10.000Z',
updated_at: '2022-06-27T03:52:15.000Z',
createdBy: null
},
{
id: 2,
tenant_id: 'crm',
name_cn: '\u5BA2\u6237\u5173\u7CFB\u7BA1\u7406\u7CFB\u7EDF',
name_en: 'Cloud CRM',
description: null,
published_at: '2021-12-30T07:39:19.000Z',
created_by: null,
created_at: '2021-12-30T14:41:57.000Z',
updated_at: '2022-06-14T06:28:08.000Z',
createdBy: null
},
{
id: 3,
tenant_id: 'tinyMock',
name_cn: 'mock\u5E73\u53F0',
name_en: null,
description: null,
published_at: '2022-05-26T07:13:28.000Z',
created_by: null,
updated_by: null,
created_at: '2022-05-26T07:13:29.000Z',
updated_at: '2022-05-26T07:13:29.000Z',
createdBy: null,
updatedBy: null
},
{
id: 4,
tenant_id: 'tinyStage',
name_cn: '\u5F00\u53D1\u5DE5\u5177\u96C6',
name_en: 'toolkits',
description: null,
published_at: '2022-05-18T07:56:55.000Z',
created_by: null,
updated_by: null,
created_at: '2022-05-18T07:56:55.000Z',
updated_at: '2022-05-18T07:56:55.000Z'
},
{
id: 5,
tenant_id: 'tinyUI',
name_cn: 'UI\u7EC4\u4EF6',
name_en: 'components',
description: null,
published_at: '2022-05-18T08:29:32.000Z',
created_by: null,
updated_by: null,
created_at: '2022-05-18T08:29:32.000Z',
updated_at: '2022-05-18T08:29:33.000Z'
},
{
id: 6,
tenant_id: 'tinyGate',
name_cn: '\u95E8\u7981\u7CFB\u7EDF',
name_en: 'gate',
description: null,
published_at: '2022-06-23T10:15:42.000Z',
created_by: null,
updated_by: null,
created_at: '2022-05-23T10:40:14.000Z',
updated_at: '2022-05-23T10:40:14.000Z',
createdBy: null,
updatedBy: null
},
{
id: 7,
tenant_id: 'guestGroup',
name_cn: '\u6E38\u5BA2\u56E2\u961F',
name_en: 'guest',
description: null,
published_at: '2022-06-23T10:15:38.000Z',
created_by: null,
updated_by: null,
created_at: '2022-06-22T14:58:22.000Z',
updated_at: '2022-06-22T14:58:22.000Z'
},
{
id: 265,
tenant_id: 'myteam',
name_cn: null,
name_en: null,
description: null,
published_at: '2022-06-14T06:49:58.000Z',
created_by: null,
updated_by: null,
created_at: '2022-06-14T06:49:58.000Z',
updated_at: '2022-06-14T06:49:58.000Z'
},
{
id: 267,
tenant_id: 'test',
name_cn: null,
name_en: null,
description: null,
published_at: '2022-06-15T03:35:14.000Z',
created_by: null,
updated_by: null,
created_at: '2022-06-15T03:35:14.000Z',
updated_at: '2022-06-15T03:35:14.000Z'
},
{
id: 268,
tenant_id: 'zzcTest',
name_cn: null,
name_en: null,
description: null,
published_at: '2022-06-17T08:47:17.000Z',
created_by: null,
updated_by: null,
created_at: '2022-06-17T08:47:17.000Z',
updated_at: '2022-06-17T08:47:17.000Z'
}
]
})
const openHomePage = wrap(function openHomePage2(event) {
this.router.push('/team-home')
})
const gotoRouter = wrap(function gotoRouter2(event) {
this.emit('handle-route', event)
})
const attrs = wrap({
state,
openHomePage,
gotoRouter
})
return attrs
}
}
const _withScopeId = (n) => (pushScopeId('data-v-b66e3972'), (n = n()), popScopeId(), n)
const _hoisted_1 = {
style: {
display: 'flex',
'justify-content': 'space-between',
'align-items': 'center',
height: '50px',
'border-radius': '0px'
}
}
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode(
'img',
{
src: 'http://localhost:9090/assets/images/bbb35cd0-db30-11ec-a1c4-7b3b3de0a1d8.png',
style: { display: 'block', width: '48px', height: 'auto', 'margin-left': '10px' }
},
null,
-1
)
)
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode('span', { style: { 'font-weight': 'bolder', color: '#000000' } }, 'TinyEngine', -1)
)
const _hoisted_4 = [_hoisted_2, _hoisted_3]
const _hoisted_5 = {
style: {
width: '230px',
height: '50px',
display: 'flex',
'justify-content': 'space-around',
'align-items': 'center',
'margin-right': '10px',
'border-radius': '0px'
},
class: 'toolbars'
}
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode('div', { placeholder: '\u89E6\u53D1\u6E90' }, null, -1)
)
const _hoisted_7 = {
style: {
'padding-top': '6px',
'padding-left': '6px',
'padding-right': '6px',
'padding-bottom': '6px',
'margin-left': '8px',
'border-radius': '6px'
}
}
const _hoisted_8 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode('div', { placeholder: '\u89E6\u53D1\u6E90' }, null, -1)
)
const _hoisted_9 = {
style: {
'padding-top': '6px',
'padding-left': '6px',
'padding-right': '6px',
'padding-bottom': '6px',
'margin-left': '8px',
'border-radius': '6px'
}
}
const _hoisted_10 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode('div', { placeholder: '\u89E6\u53D1\u6E90' }, null, -1)
)
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode(
'span',
{
class: 'split',
style: { margin: '0 8px', 'font-size': '16px', 'border-radius': '0px', color: '#e5e6e8' }
},
'|',
-1
)
)
const _hoisted_12 = { placeholder: '\u89E6\u53D1\u6E90' }
const _hoisted_13 = {
class: 'toolbars-item',
style: { padding: '6px', 'border-radius': '6px', display: 'flex', 'align-items': 'center' }
}
const _hoisted_14 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode('span', { style: { 'border-radius': '0px' } }, 'public', -1)
)
const _hoisted_15 = {
placeholder: '\u63D0\u793A\u5185\u5BB9',
style: { 'border-radius': '0px' }
}
const _hoisted_16 = {
style: { 'border-radius': '0px' },
class: 'team-list'
}
const _hoisted_17 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode(
'div',
{
class: 'team-list-title',
style: {
'font-size': '16px',
'line-height': '22px',
'font-weight': '500',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
overflow: 'hidden'
}
},
[/* @__PURE__ */ createElementVNode('span', null, '\u7EC4\u7EC7/\u56E2\u961F')],
-1
)
)
const _hoisted_18 = {
class: 'team-list-group',
style: { height: 'auto', 'max-height': '335px', overflow: 'auto', 'margin-top': '16px', 'border-radius': '0px' }
}
const _hoisted_19 = {
class: 'team-list-item-logo',
style: {
height: '28px',
width: '28px',
'border-radius': '8px',
'font-size': '16px',
color: '#fff',
background: '#38acff',
'margin-right': '12px',
display: 'flex',
'align-items': 'center',
'justify-content': 'center'
}
}
const _hoisted_20 = {
style: {
height: '22px',
'font-size': '14px',
'line-height': '22px',
color: 'rgba(0, 0, 0, 0.8)',
flex: '1',
'margin-right': '5px',
overflow: 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
'border-radius': '0px'
}
}
const _hoisted_21 = {
style: { 'border-radius': '0px' },
class: 'team-list-item-icon'
}
const _hoisted_22 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ createElementVNode(
'img',
{
style: { width: '40px', height: 'auto', 'border-radius': '50px' },
src: 'https://localhost:9090/assets/images/120'
},
null,
-1
)
)
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
let _a
const _component_tiny_icon_setting = resolveComponent('tiny-icon-setting')
const _component_tiny_tooltip = resolveComponent('tiny-tooltip')
const _component_tiny_icon_check_out = resolveComponent('tiny-icon-check-out')
const _component_tiny_icon_help_query = resolveComponent('tiny-icon-help-query')
const _component_tiny_icon_delta_down = resolveComponent('tiny-icon-delta-down')
const _component_tiny_icon_group = resolveComponent('tiny-icon-group')
const _component_tiny_icon_yes = resolveComponent('tiny-icon-yes')
const _component_tiny_popover = resolveComponent('tiny-popover')
return (
openBlock(),
createElementBlock('div', null, [
createElementVNode('div', _hoisted_1, [
createElementVNode(
'div',
{
style: { display: 'flex', 'align-items': 'center', 'border-radius': '0px' },
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.openHomePage(_ctx.event))
},
_hoisted_4
),
createElementVNode('div', null, [
(openBlock(true),
createElementBlock(
Fragment,
null,
renderList(_ctx.state.menuData, (item, index) => {
return (
openBlock(),
createElementBlock(
'span',
{
key: index,
style: { 'font-size': '16px', 'margin-left': '10px', 'margin-right': '10px', color: '#747677' },
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.gotoRouter(_ctx.event))
},
toDisplayString(item.label),
1
)
)
}),
128
))
]),
createElementVNode('div', _hoisted_5, [
createElementVNode(
'div',
{
class: normalizeClass({
'toolbars-item': true,
active: ((_a = _ctx.route.path) == null ? void 0 : _a.indexOf('/permission-setting')) > -1
}),
style: {
'padding-top': '6px',
'padding-left': '6px',
'padding-right': '6px',
'padding-bottom': '6px',
'margin-left': '8px',
'border-radius': '6px'
},
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.openPermission(_ctx.event))
},
[
createVNode(
_component_tiny_tooltip,
{
content: '\u8BBE\u7F6E\u4E2D\u5FC3',
placement: 'top',
manual: false,
modelValue: true,
style: { color: '#878f95' }
},
{
default: withCtx(() => [_hoisted_6, createVNode(_component_tiny_icon_setting)]),
_: 1
}
)
],
2
),
createElementVNode('div', _hoisted_7, [
createVNode(
_component_tiny_tooltip,
{
content: '\u534F\u8BAE\u89C4\u8303',
placement: 'top',
manual: false,
modelValue: true,
style: { 'border-radius': '0px' }
},
{
default: withCtx(() => [
_hoisted_8,
createVNode(_component_tiny_icon_check_out, { style: { color: '#878f95' } })
]),
_: 1
}
)
]),
createElementVNode('div', _hoisted_9, [
createVNode(
_component_tiny_tooltip,
{
content: '\u5E2E\u52A9\u4E2D\u5FC3',
placement: 'top',
manual: false,
modelValue: true,
class: 'tip-icon',
style: { fill: '#878f95', 'border-radius': '0px' }
},
{
default: withCtx(() => [
_hoisted_10,
createVNode(_component_tiny_icon_help_query, { style: { color: '#ffffff' } })
]),
_: 1
}
)
]),
_hoisted_11,
createVNode(
_component_tiny_popover,
{
width: 308,
title: '\u5F39\u6846\u6807\u9898',
trigger: 'manual',
modelValue: true,
placement: 'bottom-end',
'popper-class': 'team-list-pop',
style: { 'border-radius': '0px' }
},
{
reference: withCtx(() => [
createElementVNode('div', _hoisted_12, [
createElementVNode('div', _hoisted_13, [
_hoisted_14,
createVNode(_component_tiny_icon_delta_down, {
style: { 'font-size': '12px', 'border-radius': '0px', color: '#878f95' }
})
])
])
]),
default: withCtx(() => [
createElementVNode('div', _hoisted_15, [
createElementVNode('div', _hoisted_16, [
_hoisted_17,
createElementVNode('div', _hoisted_18, [
(openBlock(true),
createElementBlock(
Fragment,
null,
renderList(_ctx.state.tenants, (item, index) => {
return (
openBlock(),
createElementBlock(
'div',
{
class: normalizeClass(['team-list-item', { active: item.id === $props.tenant.id }]),
key: item.id,
style: {
display: 'flex',
'align-items': 'center',
height: '56px',
'border-radius': '6px',
'background-color': '#fff',
cursor: 'pointer',
padding: '8px 12px',
'box-sizing': 'border-box'
}
},
[
createElementVNode('div', _hoisted_19, [
createVNode(_component_tiny_icon_group, { style: { 'border-radius': '0px' } })
]),
createElementVNode('span', _hoisted_20, toDisplayString(item.tenant_id), 1),
createElementVNode('div', _hoisted_21, [
item.id === 1
? (openBlock(),
createBlock(_component_tiny_icon_yes, {
key: 0,
style: { 'font-size': '20px', color: '#38acff' }
}))
: createCommentVNode('v-if', true)
])
],
2
)
)
}),
128
))
])
])
])
]),
_: 1
}
),
createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898',
trigger: 'manual',
modelValue: false,
'append-to-body': false
}),
createVNode(_component_tiny_popover, {
width: 308,
title: '\u5F39\u6846\u6807\u9898',
trigger: 'click',
modelValue: false,
placement: 'bottom-end',
'append-to-body': false,
'visible-arrow': false,
'popper-class': 'team-list-pop'
}),
_hoisted_22
])
]),
createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898',
trigger: 'manual',
modelValue: true
}),
createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898',
trigger: 'manual',
modelValue: false,
'visible-arrow': true
})
])
)
}
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['styles', [_style_0]],
['__scopeId', 'data-v-b66e3972'],
['__file', 'D:/tmp/buildground/buildground_1673597845904/src/block/generated/components/PortalHeader.vue']
])
window.TinyLowcodeResource = window.TinyLowcodeResource || {}
const blockName = hyphenate('PortalHeader')
block.blockId = 998
block.blockVersion = '1.0.0'
if (customElements.get(blockName)) {
if (window.TinyLowcodeResource[blockName]) {
Object.assign(window.TinyLowcodeResource[blockName], block)
}
} else {
block.links = {
VUE_APP_UI_LIB_FULL_STYLE_FILE_URL: ['//localhost:9090/assets/css/0.1.20/index.css']
}.VUE_APP_UI_LIB_FULL_STYLE_FILE_URL
window.TinyLowcodeResource[blockName] = block
customElements.define(blockName, defineCustomElement(block))
}
export { block as default }

View File

@ -0,0 +1,718 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
;(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core'),
require('vue'),
require('vue-i18n'),
require('@opentiny/vue-icon'),
require('@opentiny/vue')
)
} else if (typeof define === 'function ' && define.amd) {
define([
'@opentiny/tiny-engine-webcomponent-core',
'vue',
'vue-i18n',
'@opentiny/vue-icon',
'@opentiny/vue'
], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyVueBlock = factory(
global.TinyWebcomponentCore,
global.Vue,
global.VueI18n,
global.TinyVueIcon,
global.TinyVue
))
}
})(this, (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon, tinyVue3) => {
'use strict '
function _interopNamespace(e) {
if (e && e.__esModule) return e
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module ' } })
if (e) {
Object.keys(e).forEach((k) => {
if (k !== 'default ') {
const d = Object.getOwnPropertyDescriptor(e, k)
Object.defineProperty(
n,
k,
d.get
? d
: {
enumerable: true,
get: function () {
return e[k]
}
}
)
}
})
}
n['default '] = e
return Object.freeze(n)
}
const vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null)
return (str) => {
const hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1 ').toLowerCase())
const _style_0 =
'\n.team-list-item.active[data-v-b66e3972] {\r\n border: 1px solid #38acff;\n}\n.toolbars-item[data-v-b66e3972]:hover {\r\n cursor: pointer;\r\n background-color: #f1f2f3;\n}\n.toolbars-item.active[data-v-b66e3972] {\r\n background-color: #e5e6e8;\n}\n '
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
}
return target
}
const _sfc_main = {
components: {
TinyIconCheckOut: tinyVue3Icon.IconCheckOut(),
TinyIconDeltaDown: tinyVue3Icon.IconDeltaDown(),
TinyIconGroup: tinyVue3Icon.IconGroup(),
TinyIconHelpQuery: tinyVue3Icon.IconHelpQuery(),
TinyIconSetting: tinyVue3Icon.IconSetting(),
TinyIconYes: tinyVue3Icon.IconYes(),
TinyPopover: tinyVue3.Popover,
TinyTooltip: tinyVue3.Tooltip
},
props: {
tenant: { type: Object, default: () => "{tenant_id: 'public'} " }
},
emits: ['handle-route '],
setup(props, context) {
const { t, lowcodeWrap } = vue__namespace.inject(vueI18n.I18nInjectionKey).lowcode()
const wrap = lowcodeWrap(props, context, t)
const state = vue__namespace.reactive({
'menuData ': [
{
'label ': '\u9996\u9875 ',
'url ': '/home '
},
{
'label ': '\u6211\u7684\u5E94\u7528 ',
'url ': '/home '
},
{
'label ': '\u5E94\u7528\u4E2D\u5FC3 ',
'url ': '/home '
},
{
'label ': '\u6211\u7684\u5E73\u53F0 ',
'url ': '/home '
},
{
'label ': '\u5E73\u53F0\u4E2D\u5FC3 ',
'url ': '/home '
},
{
'label ': '\u6211\u7684\u7269\u6599 ',
'url ': '/home '
},
{
'label ': '\u751F\u6001\u4E2D\u5FC3 ',
'url ': '/home '
},
{
'label ': '\u76D1\u63A7\u4E2D\u5FC3 ',
'url ': '/home '
}
],
'tenants ': [
{
'id ': 1,
'tenant_id ': 'public ',
'name_cn ': '\u516C\u5171\u79DF\u6237 ',
'name_en ': 'Public Tenant ',
'description ': 'Default tenant for new user to explore. ',
'published_at ': '2021-12-28T11:39:10.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2021-12-28T11:39:10.000Z ',
'updated_at ': '2022-06-27T03:52:15.000Z ',
'createdBy ': null
},
{
'id ': 2,
'tenant_id ': 'crm ',
'name_cn ': '\u5BA2\u6237\u5173\u7CFB\u7BA1\u7406\u7CFB\u7EDF ',
'name_en ': 'Cloud CRM ',
'description ': null,
'published_at ': '2021-12-30T07:39:19.000Z ',
'created_by ': null,
'created_at ': '2021-12-30T14:41:57.000Z ',
'updated_at ': '2022-06-14T06:28:08.000Z ',
'createdBy ': null
},
{
'id ': 3,
'tenant_id ': 'tinyMock ',
'name_cn ': 'mock\u5E73\u53F0 ',
'name_en ': null,
'description ': null,
'published_at ': '2022-05-26T07:13:28.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-05-26T07:13:29.000Z ',
'updated_at ': '2022-05-26T07:13:29.000Z ',
'createdBy ': null,
'updatedBy ': null
},
{
'id ': 4,
'tenant_id ': 'tinyStage ',
'name_cn ': '\u5F00\u53D1\u5DE5\u5177\u96C6 ',
'name_en ': 'toolkits ',
'description ': null,
'published_at ': '2022-05-18T07:56:55.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-05-18T07:56:55.000Z ',
'updated_at ': '2022-05-18T07:56:55.000Z '
},
{
'id ': 5,
'tenant_id ': 'tinyUI ',
'name_cn ': 'UI\u7EC4\u4EF6 ',
'name_en ': 'components ',
'description ': null,
'published_at ': '2022-05-18T08:29:32.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-05-18T08:29:32.000Z ',
'updated_at ': '2022-05-18T08:29:33.000Z '
},
{
'id ': 6,
'tenant_id ': 'tinyGate ',
'name_cn ': '\u95E8\u7981\u7CFB\u7EDF ',
'name_en ': 'gate ',
'description ': null,
'published_at ': '2022-06-23T10:15:42.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-05-23T10:40:14.000Z ',
'updated_at ': '2022-05-23T10:40:14.000Z ',
'createdBy ': null,
'updatedBy ': null
},
{
'id ': 7,
'tenant_id ': 'guestGroup ',
'name_cn ': '\u6E38\u5BA2\u56E2\u961F ',
'name_en ': 'guest ',
'description ': null,
'published_at ': '2022-06-23T10:15:38.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-06-22T14:58:22.000Z ',
'updated_at ': '2022-06-22T14:58:22.000Z '
},
{
'id ': 265,
'tenant_id ': 'myteam ',
'name_cn ': null,
'name_en ': null,
'description ': null,
'published_at ': '2022-06-14T06:49:58.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-06-14T06:49:58.000Z ',
'updated_at ': '2022-06-14T06:49:58.000Z '
},
{
'id ': 267,
'tenant_id ': 'test ',
'name_cn ': null,
'name_en ': null,
'description ': null,
'published_at ': '2022-06-15T03:35:14.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-06-15T03:35:14.000Z ',
'updated_at ': '2022-06-15T03:35:14.000Z '
},
{
'id ': 268,
'tenant_id ': 'zzcTest ',
'name_cn ': null,
'name_en ': null,
'description ': null,
'published_at ': '2022-06-17T08:47:17.000Z ',
'created_by ': null,
'updated_by ': null,
'created_at ': '2022-06-17T08:47:17.000Z ',
'updated_at ': '2022-06-17T08:47:17.000Z '
}
]
})
const openHomePage = wrap(function openHomePage2(event) {
this.router.push('/team-home ')
})
const gotoRouter = wrap(function gotoRouter2(event) {
this.emit('handle-route ', event)
})
const attrs = wrap({
state,
openHomePage,
gotoRouter
})
return attrs
}
}
const _withScopeId = (n) => (vue.pushScopeId('data-v-b66e3972 '), (n = n()), vue.popScopeId(), n)
const _hoisted_1 = {
style: {
'display ': 'flex ',
'justify-content ': 'space-between ',
'align-items ': 'center ',
'height ': '50px ',
'border-radius ': '0px '
}
}
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode(
'img ',
{
src: 'http://localhost:9090/assets/images/bbb35cd0-db30-11ec-a1c4-7b3b3de0a1d8.png ',
style: { 'display ': 'block ', 'width ': '48px ', 'height ': 'auto ', 'margin-left ': '10px ' }
},
null,
-1
)
)
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode(
'span ',
{ style: { 'font-weight ': 'bolder ', 'color ': '#000000 ' } },
'TinyEngine ',
-1
)
)
const _hoisted_4 = [_hoisted_2, _hoisted_3]
const _hoisted_5 = {
style: {
'width ': '230px ',
'height ': '50px ',
'display ': 'flex ',
'justify-content ': 'space-around ',
'align-items ': 'center ',
'margin-right ': '10px ',
'border-radius ': '0px '
},
class: 'toolbars '
}
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode('div ', { placeholder: '\u89E6\u53D1\u6E90 ' }, null, -1)
)
const _hoisted_7 = {
style: {
'padding-top ': '6px ',
'padding-left ': '6px ',
'padding-right ': '6px ',
'padding-bottom ': '6px ',
'margin-left ': '8px ',
'border-radius ': '6px '
}
}
const _hoisted_8 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode('div ', { placeholder: '\u89E6\u53D1\u6E90 ' }, null, -1)
)
const _hoisted_9 = {
style: {
'padding-top ': '6px ',
'padding-left ': '6px ',
'padding-right ': '6px ',
'padding-bottom ': '6px ',
'margin-left ': '8px ',
'border-radius ': '6px '
}
}
const _hoisted_10 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode('div ', { placeholder: '\u89E6\u53D1\u6E90 ' }, null, -1)
)
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode(
'span ',
{
class: 'split ',
style: { 'margin ': '0 8px ', 'font-size ': '16px ', 'border-radius ': '0px ', 'color ': '#e5e6e8 ' }
},
'| ',
-1
)
)
const _hoisted_12 = { placeholder: '\u89E6\u53D1\u6E90 ' }
const _hoisted_13 = {
class: 'toolbars-item ',
style: { 'padding ': '6px ', 'border-radius ': '6px ', 'display ': 'flex ', 'align-items ': 'center ' }
}
const _hoisted_14 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode('span ', { style: { 'border-radius ': '0px ' } }, 'public ', -1)
)
const _hoisted_15 = {
placeholder: '\u63D0\u793A\u5185\u5BB9 ',
style: { 'border-radius ': '0px ' }
}
const _hoisted_16 = {
style: { 'border-radius ': '0px ' },
class: 'team-list '
}
const _hoisted_17 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode(
'div ',
{
class: 'team-list-title ',
style: {
'font-size ': '16px ',
'line-height ': '22px ',
'font-weight ': '500 ',
'text-overflow ': 'ellipsis ',
'white-space ': 'nowrap ',
'overflow ': 'hidden '
}
},
[/* @__PURE__ */ vue.createElementVNode('span ', null, '\u7EC4\u7EC7/\u56E2\u961F ')],
-1
)
)
const _hoisted_18 = {
class: 'team-list-group ',
style: {
'height ': 'auto ',
'max-height ': '335px ',
'overflow ': 'auto ',
'margin-top ': '16px ',
'border-radius ': '0px '
}
}
const _hoisted_19 = {
class: 'team-list-item-logo ',
style: {
'height ': '28px ',
'width ': '28px ',
'border-radius ': '8px ',
'font-size ': '16px ',
'color ': '#fff ',
'background ': '#38acff ',
'margin-right ': '12px ',
'display ': 'flex ',
'align-items ': 'center ',
'justify-content ': 'center '
}
}
const _hoisted_20 = {
style: {
'height ': '22px ',
'font-size ': '14px ',
'line-height ': '22px ',
'color ': 'rgba(0, 0, 0, 0.8) ',
'flex ': '1 ',
'margin-right ': '5px ',
'overflow ': 'hidden ',
'text-overflow ': 'ellipsis ',
'white-space ': 'nowrap ',
'border-radius ': '0px '
}
}
const _hoisted_21 = {
style: { 'border-radius ': '0px ' },
class: 'team-list-item-icon '
}
const _hoisted_22 = /* @__PURE__ */ _withScopeId(() =>
/* @__PURE__ */ vue.createElementVNode(
'img ',
{
style: { 'width ': '40px ', 'height ': 'auto ', 'border-radius ': '50px ' },
src: 'http://localhost:9090/assets/images/120 '
},
null,
-1
)
)
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
let _a
const _component_tiny_icon_setting = vue.resolveComponent('tiny-icon-setting ')
const _component_tiny_tooltip = vue.resolveComponent('tiny-tooltip ')
const _component_tiny_icon_check_out = vue.resolveComponent('tiny-icon-check-out ')
const _component_tiny_icon_help_query = vue.resolveComponent('tiny-icon-help-query ')
const _component_tiny_icon_delta_down = vue.resolveComponent('tiny-icon-delta-down ')
const _component_tiny_icon_group = vue.resolveComponent('tiny-icon-group ')
const _component_tiny_icon_yes = vue.resolveComponent('tiny-icon-yes ')
const _component_tiny_popover = vue.resolveComponent('tiny-popover ')
return (
vue.openBlock(),
vue.createElementBlock('div ', null, [
vue.createElementVNode('div ', _hoisted_1, [
vue.createElementVNode(
'div ',
{
style: { 'display ': 'flex ', 'align-items ': 'center ', 'border-radius ': '0px ' },
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.openHomePage(_ctx.event))
},
_hoisted_4
),
vue.createElementVNode('div ', null, [
(vue.openBlock(true),
vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(_ctx.state.menuData, (item, index) => {
return (
vue.openBlock(),
vue.createElementBlock(
'span ',
{
key: index,
style: {
'font-size ': '16px ',
'margin-left ': '10px ',
'margin-right ': '10px ',
'color ': '#747677 '
},
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.gotoRouter(_ctx.event))
},
vue.toDisplayString(item.label),
1
)
)
}),
128
))
]),
vue.createElementVNode('div ', _hoisted_5, [
vue.createElementVNode(
'div ',
{
class: vue.normalizeClass({
'toolbars-item ': true,
active: ((_a = _ctx.route.path) == null ? void 0 : _a.indexOf('/permission-setting ')) > -1
}),
style: {
'padding-top ': '6px ',
'padding-left ': '6px ',
'padding-right ': '6px ',
'padding-bottom ': '6px ',
'margin-left ': '8px ',
'border-radius ': '6px '
},
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.openPermission(_ctx.event))
},
[
vue.createVNode(
_component_tiny_tooltip,
{
content: '\u8BBE\u7F6E\u4E2D\u5FC3 ',
placement: 'top ',
manual: false,
modelValue: true,
style: { 'color ': '#878f95 ' }
},
{
default: vue.withCtx(() => [_hoisted_6, vue.createVNode(_component_tiny_icon_setting)]),
_: 1
}
)
],
2
),
vue.createElementVNode('div ', _hoisted_7, [
vue.createVNode(
_component_tiny_tooltip,
{
content: '\u534F\u8BAE\u89C4\u8303 ',
placement: 'top ',
manual: false,
modelValue: true,
style: { 'border-radius ': '0px ' }
},
{
default: vue.withCtx(() => [
_hoisted_8,
vue.createVNode(_component_tiny_icon_check_out, { style: { 'color ': '#878f95 ' } })
]),
_: 1
}
)
]),
vue.createElementVNode('div ', _hoisted_9, [
vue.createVNode(
_component_tiny_tooltip,
{
content: '\u5E2E\u52A9\u4E2D\u5FC3 ',
placement: 'top ',
manual: false,
modelValue: true,
class: 'tip-icon ',
style: { 'fill ': '#878f95 ', 'border-radius ': '0px ' }
},
{
default: vue.withCtx(() => [
_hoisted_10,
vue.createVNode(_component_tiny_icon_help_query, { style: { 'color ': '#ffffff ' } })
]),
_: 1
}
)
]),
_hoisted_11,
vue.createVNode(
_component_tiny_popover,
{
width: 308,
title: '\u5F39\u6846\u6807\u9898 ',
trigger: 'manual ',
modelValue: true,
placement: 'bottom-end ',
'popper-class ': 'team-list-pop ',
style: { 'border-radius ': '0px ' }
},
{
reference: vue.withCtx(() => [
vue.createElementVNode('div ', _hoisted_12, [
vue.createElementVNode('div ', _hoisted_13, [
_hoisted_14,
vue.createVNode(_component_tiny_icon_delta_down, {
style: { 'font-size ': '12px ', 'border-radius ': '0px ', 'color ': '#878f95 ' }
})
])
])
]),
default: vue.withCtx(() => [
vue.createElementVNode('div ', _hoisted_15, [
vue.createElementVNode('div ', _hoisted_16, [
_hoisted_17,
vue.createElementVNode('div ', _hoisted_18, [
(vue.openBlock(true),
vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(_ctx.state.tenants, (item, index) => {
return (
vue.openBlock(),
vue.createElementBlock(
'div ',
{
class: vue.normalizeClass([
'team-list-item ',
{ active: item.id === $props.tenant.id }
]),
key: item.id,
style: {
'display ': 'flex ',
'align-items ': 'center ',
'height ': '56px ',
'border-radius ': '6px ',
'background-color ': '#fff ',
'cursor ': 'pointer ',
'padding ': '8px 12px ',
'box-sizing ': 'border-box '
}
},
[
vue.createElementVNode('div ', _hoisted_19, [
vue.createVNode(_component_tiny_icon_group, { style: { 'border-radius ': '0px ' } })
]),
vue.createElementVNode('span ', _hoisted_20, vue.toDisplayString(item.tenant_id), 1),
vue.createElementVNode('div ', _hoisted_21, [
item.id === 1
? (vue.openBlock(),
vue.createBlock(_component_tiny_icon_yes, {
key: 0,
style: { 'font-size ': '20px ', 'color ': '#38acff ' }
}))
: vue.createCommentVNode('v-if ', true)
])
],
2
)
)
}),
128
))
])
])
])
]),
_: 1
}
),
vue.createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898 ',
trigger: 'manual ',
modelValue: false,
'append-to-body ': false
}),
vue.createVNode(_component_tiny_popover, {
width: 308,
title: '\u5F39\u6846\u6807\u9898 ',
trigger: 'click ',
modelValue: false,
placement: 'bottom-end ',
'append-to-body ': false,
'visible-arrow ': false,
'popper-class ': 'team-list-pop '
}),
_hoisted_22
])
]),
vue.createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898 ',
trigger: 'manual ',
modelValue: true
}),
vue.createVNode(_component_tiny_popover, {
width: 200,
title: '\u5F39\u6846\u6807\u9898 ',
trigger: 'manual ',
modelValue: false,
'visible-arrow ': true
})
])
)
}
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render ', _sfc_render],
['styles ', [_style_0]],
['__scopeId ', 'data-v-b66e3972 '],
['__file ', 'D:/tmp/buildground/buildground_1673597845904/src/block/generated/components/PortalHeader.vue ']
])
window.TinyLowcodeResource = window.TinyLowcodeResource || {}
const blockName = hyphenate('PortalHeader ')
block.blockId = 998
block.blockVersion = '1.0.0 '
if (customElements.get(blockName)) {
if (window.TinyLowcodeResource[blockName]) {
Object.assign(window.TinyLowcodeResource[blockName], block)
}
} else {
block.links = {
'VUE_APP_UI_LIB_FULL_STYLE_FILE_URL ': ['//localhost:9090/assets/css/0.1.20/index.css ']
}.VUE_APP_UI_LIB_FULL_STYLE_FILE_URL
window.TinyLowcodeResource[blockName] = block
customElements.define(blockName, tinyWebcomponentCore.defineCustomElement(block))
}
return block
})

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,14 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
require('@babel/register')
require('../src/app')

View File

@ -0,0 +1,16 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
module.exports = {
port: process.env.MOCK_PORT || 9090,
env: process.env.NODE_ENV || 'development' // Current mode
}

109
mockServer/gulpfile.js Normal file
View File

@ -0,0 +1,109 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
const gulp = require('gulp')
const eslint = require('gulp-eslint')
const nodemon = require('gulp-nodemon')
const friendlyFormatter = require('eslint-friendly-formatter')
let jsScript = 'node'
if (process.env.npm_config_argv !== undefined && process.env.npm_config_argv.indexOf('debug') > 0) {
jsScript = 'node debug'
}
function lintOne(aims) {
return gulp
.src(aims)
.pipe(eslint({ configFile: './.eslintrc.js' }))
.pipe(eslint.format(friendlyFormatter))
.pipe(
eslint.results((results) => {
// Called once for all ESLint results.
})
)
}
gulp.task('ESlint', () => {
return gulp
.src(['src/**/*.js', '!node_modules/**'])
.pipe(eslint({ configFile: './.eslintrc.js' }))
.pipe(eslint.format(friendlyFormatter))
.pipe(eslint.results((results) => {}))
})
gulp.task(
'ESlint_nodemon',
gulp.series('ESlint', () => {
const stream = nodemon({
script: 'build/dev-server.js',
execMap: {
js: jsScript
},
tasks: function (changedFiles) {
lintOne(changedFiles)
return []
},
verbose: true,
ignore: ['build/*.js', 'dist/*.js', 'nodemon.json', '.git', 'node_modules/**/node_modules', 'gulpfile.js'],
env: {
NODE_ENV: 'development'
},
ext: 'js json'
})
return stream
.on('restart', () => {
// 重启项目
})
.on('crash', () => {
// 重启工程restart the server in 20 secondsstream.emit('restart', 20)
})
})
)
gulp.task('nodemon', () => {
return nodemon({
script: 'build/dev-server.js',
execMap: {
js: jsScript
},
verbose: true,
ignore: ['build/*.js', 'dist/*.js', 'nodemon.json', '.git', 'node_modules/**/node_modules', 'gulpfile.js'],
env: {
NODE_ENV: 'development'
},
ext: 'js json'
})
})
gulp.task('default', () => {
const stream = nodemon({
script: 'build/dev-server.js',
execMap: {
js: jsScript
},
verbose: true,
ignore: ['build/*.js', 'dist/*.js', 'nodemon.json', '.git', 'node_modules/**/node_modules', 'gulpfile.js'],
env: {
NODE_ENV: 'development'
},
ext: 'js json'
})
return stream
.on('restart', () => {
// 重启项目
})
.on('crash', () => {
// 重启工程restart the server in 20 secondsstream.emit('restart', 20)
})
})

1
mockServer/logs/out.log Normal file
View File

@ -0,0 +1 @@
ok

69
mockServer/package.json Normal file
View File

@ -0,0 +1,69 @@
{
"name": "@opentiny/tiny-engine-mock",
"version": "1.0.3",
"publishConfig": {
"access": "public"
},
"description": "mock服务",
"repository": {
"type": "git",
"url": "https://github.com/opentiny/tiny-engine",
"directory": "mockServer"
},
"bugs": {
"url": "https://github.com/opentiny/tiny-engine/issues"
},
"author": "OpenTiny Team",
"license": "MIT",
"homepage": "https://opentiny.design/tiny-engine",
"scripts": {
"start": "gulp nodemon",
"dev": "gulp",
"build": "babel src -d dist",
"production": "node dist/app.js",
"test": "jest",
"lint": "eslint --fix ."
},
"dependencies": {
"@opentiny/tiny-engine-dsl-vue": "^1.0.3",
"@seald-io/nedb": "^4.0.2",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"koa": "^2.11.0",
"koa-body": "^4.1.1",
"koa-compose": "^4.1.0",
"koa-jwt": "^3.6.0",
"koa-router": "^8.0.8",
"koa-static2": "^0.1.8"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/plugin-external-helpers": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/register": "^7.9.0",
"@babel/runtime": "^7.9.2",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.3.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-html": "^6.0.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-nodemon": "^2.5.0",
"jest": "^25.3.0",
"koa-logger": "^3.2.1"
},
"engines": {
"node": ">= 7.8.0",
"npm": ">= 4.2.0"
}
}

31
mockServer/pm2.js Normal file
View File

@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
module.exports = {
apps: [
{
name: 'RESRful API Server',
script: './dist/app.js',
watch: false, // 默认关闭watch 可替换为 ['src']
ignoreWatch: ['node_modules', 'build', 'logs'],
outFile: '/logs/out.log', // 日志输出
errorFile: '/logs/error.log', // 错误日志
maxMemoryRestart: '2G', // 超过多大内存自动重启,仅防止内存泄露有意义,需要根据自己的业务设置
env: {
NODE_ENV: 'production'
},
execMode: 'cluster', // 开启多线程模式,用于负载均衡
instances: 'max', // 启用多少个实例,可用于负载均衡
autorestart: true // 程序崩溃后自动重启
}
]
}

61
mockServer/src/app.js Normal file
View File

@ -0,0 +1,61 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import Koa2 from 'koa'
import KoaBody from 'koa-body'
import KoaStatic from 'koa-static2'
import path from 'path'
import { env, port } from '../config/config'
import ErrorRoutesCatch from './middleware/ErrorRoutesCatch'
import ErrorRoutes from './routes/error-routes'
import MainRoutes from './routes/main-routes'
const app = new Koa2()
app
.use((ctx, next) => {
ctx.set('Access-Control-Allow-Origin', '*')
ctx.set('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
ctx.set('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS')
ctx.set('Access-Control-Allow-Credentials', true) // 允许带上 cookie
return next()
})
.use(ErrorRoutesCatch())
.use(KoaStatic('assets', path.resolve(__dirname, '../assets'))) // Static resource
.use(
KoaBody({
multipart: true,
parsedMethods: ['POST', 'PUT', 'PATCH', 'GET', 'HEAD', 'DELETE'], // parse GET, HEAD, DELETE requests
formidable: {
uploadDir: path.join(__dirname, '../assets/uploads/tmp')
},
jsonLimit: '50mb',
formLimit: '50mb',
textLimit: '50mb'
})
) // Processing request
.use(MainRoutes.routes())
.use(MainRoutes.allowedMethods())
.use(ErrorRoutes())
if (env === 'development') {
// logger
app.use((ctx, next) => {
const start = new Date()
return next().then(() => {
const ms = new Date() - start
})
})
}
app.listen(port)
export default app

View File

@ -0,0 +1,3 @@
{"id":"L0fyFYECrNiRZMiX","app":{"id":918,"name":"portal-app","app_website":null,"platform":{"id":897,"name":"portal-platform"},"obs_url":"","created_by":null,"updated_by":null,"created_at":"2022-06-08T07:19:01.000Z","updated_at":"2023-09-04T08:55:40.000Z","state":null,"published":false,"createdBy":86,"updatedBy":564,"tenant":1,"home_page":"NTJ4MjvqoVj8OVsc","css":null,"config":{},"git_group":"","project_name":"","constants":null,"data_handler":{"type":"JSFunction","value":"function dataHanlder(res){\n return res;\n}"},"description":"demo应用","latest":22,"platform_history":null,"editor_url":"","branch":"develop","visit_url":null,"is_demo":null,"image_url":"","is_default":true,"template_type":null,"set_template_time":null,"set_template_by":null,"set_default_by":169,"framework":"Vue","global_state":[],"default_lang":null,"extend_config":{"business":{"serviceName":"","endpointName":"cce","endpointId":"ee","serviceId":"ee","router":"ee"},"env":{"alpha":{"regions":[{"name":"","baseUrl":"","isDefault":false}],"isDefault":true}},"type":"console"},"assets_url":"","data_hash":"ae128e37f6bc378f1b9c21d75bd05551","can_associate":true,"data_source_global":{"dataHandler":{"type":"JSFunction","value":"function dataHanlder(res){\n return res;\n}"}}},"name":"我的分类","desc":"","blocks":["ALvDb0JD8atzd3nA"],"category_id":"qukuaifenlei","_id":"L0fyFYECrNiRZMiX"}
{"$$indexCreated":{"fieldName":"name","unique":true,"sparse":false}}
{"$$indexCreated":{"fieldName":"name","unique":true}}

View File

@ -0,0 +1,3 @@
{"id":"b57MCCORYPGjgL23","app":{"id":918,"name":"portal-app","app_website":null,"platform":{"id":897,"name":"portal-platform"},"obs_url":"","created_by":null,"updated_by":null,"created_at":"2022-06-08T07:19:01.000Z","updated_at":"2023-09-04T08:55:40.000Z","state":null,"published":false,"createdBy":86,"updatedBy":564,"tenant":1,"home_page":"NTJ4MjvqoVj8OVsc","css":null,"config":{},"git_group":"","project_name":"","constants":null,"data_handler":{"type":"JSFunction","value":"function dataHanlder(res){\n return res;\n}"},"description":"demo应用","latest":22,"platform_history":null,"editor_url":"","branch":"develop","visit_url":null,"is_demo":null,"image_url":"","is_default":true,"template_type":null,"set_template_time":null,"set_template_by":null,"set_default_by":169,"framework":"Vue","global_state":[],"default_lang":null,"extend_config":{"business":{"serviceName":"","endpointName":"cce","endpointId":"ee","serviceId":"ee","router":"ee"},"env":{"alpha":{"regions":[{"name":"","baseUrl":"","isDefault":false}],"isDefault":true}},"type":"console"},"assets_url":"","data_hash":"ae128e37f6bc378f1b9c21d75bd05551","can_associate":true,"data_source_global":{"dataHandler":{"type":"JSFunction","value":"function dataHanlder(res){\n return res;\n}"}}},"name":"我的区块","desc":"","blocks":["ALvDb0JD8atzd3nA"],"_id":"b57MCCORYPGjgL23"}
{"$$indexCreated":{"fieldName":"name","unique":true,"sparse":false}}
{"$$indexCreated":{"fieldName":"name","unique":true}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
const { getResponseData } = require('../tool/Common')
module.exports = function () {
return function (ctx, next) {
return next().catch((err) => {
ctx.status = 200
ctx.body = getResponseData(null, err)
})
}
}

View File

@ -0,0 +1,78 @@
{
"data": {
"id": 918,
"name": "portal-app",
"app_website": null,
"platform": {
"id": 897,
"name": "portal-platform"
},
"obs_url": "",
"created_by": null,
"updated_by": null,
"created_at": "2022-06-08T07:19:01.000Z",
"updated_at": "2023-09-04T08:55:40.000Z",
"state": null,
"published": false,
"createdBy": 86,
"updatedBy": 564,
"tenant": 1,
"home_page": "NTJ4MjvqoVj8OVsc",
"css": null,
"config": {},
"git_group": "",
"project_name": "",
"constants": null,
"data_handler": {
"type": "JSFunction",
"value": "function dataHanlder(res){\n return res;\n}"
},
"description": "demo应用",
"latest": 22,
"platform_history": null,
"editor_url": "",
"branch": "develop",
"visit_url": null,
"is_demo": null,
"image_url": "",
"is_default": true,
"template_type": null,
"set_template_time": null,
"set_template_by": null,
"set_default_by": 169,
"framework": "Vue",
"global_state": [],
"default_lang": null,
"extend_config": {
"business": {
"serviceName": "",
"endpointName": "cce",
"endpointId": "ee",
"serviceId": "ee",
"router": "ee"
},
"env": {
"alpha": {
"regions": [
{
"name": "",
"baseUrl": "",
"isDefault": false
}
],
"isDefault": true
}
},
"type": "console"
},
"assets_url": "",
"data_hash": "ae128e37f6bc378f1b9c21d75bd05551",
"can_associate": true,
"data_source_global": {
"dataHandler": {
"type": "JSFunction",
"value": "function dataHanlder(res){\n return res;\n}"
}
}
}
}

View File

@ -0,0 +1,20 @@
{
"data": {
"id": 245824,
"name": "Input",
"type": "npm",
"content": {
"package": "@opentiny/vue",
"version": "",
"exportName": "Input",
"subName": "",
"destructuring": true,
"main": ""
},
"app": 918,
"category": "utils",
"created_at": "2023-09-04T08:32:38.000Z",
"updated_at": "2023-09-04T08:32:38.000Z"
},
"locale": "zh-cn"
}

View File

@ -0,0 +1,127 @@
{
"data": [
{
"id": 176,
"name": "axios",
"type": "npm",
"content": {
"type": "JSFunction",
"value": "",
"package": "axios",
"destructuring": false,
"exportName": "axios"
},
"app": 918,
"category": "utils",
"created_at": "2022-10-27T11:02:26.000Z",
"updated_at": "2022-10-27T11:02:26.000Z"
},
{
"id": 104,
"name": "Button",
"type": "npm",
"content": {
"package": "@opentiny/vue",
"version": "",
"exportName": "Button",
"subName": "",
"destructuring": true,
"main": ""
},
"app": 918,
"category": "utils",
"created_at": "2022-07-06T10:17:31.000Z",
"updated_at": "2022-07-06T10:17:31.000Z"
},
{
"id": 101,
"name": "Menu",
"type": "npm",
"content": {
"type": "JSFunction",
"value": "",
"package": "@opentiny/vue",
"exportName": "NavMenu",
"destructuring": true
},
"app": 918,
"category": "utils",
"created_at": "2022-06-24T06:40:52.000Z",
"updated_at": "2022-06-24T08:03:13.000Z"
},
{
"id": 103,
"name": "Modal ",
"type": "npm",
"content": {
"package": "@opentiny/vue",
"version": "",
"exportName": "Modal ",
"subName": "",
"destructuring": true,
"main": ""
},
"app": 918,
"category": "utils",
"created_at": "2022-07-01T03:21:19.000Z",
"updated_at": "2022-07-01T03:21:19.000Z"
},
{
"id": 146,
"name": "npm",
"type": "function",
"content": {
"type": "JSFunction",
"value": "''"
},
"app": 918,
"category": "utils",
"created_at": "2022-08-29T06:54:02.000Z",
"updated_at": "2023-01-05T01:00:52.000Z"
},
{
"id": 102,
"name": "Pager",
"type": "npm",
"content": {
"package": "@opentiny/vue",
"version": "",
"exportName": "Pager",
"subName": "",
"destructuring": true,
"main": ""
},
"app": 918,
"category": "utils",
"created_at": "2022-06-28T08:17:38.000Z",
"updated_at": "2023-03-21T12:13:04.000Z"
},
{
"id": 106,
"name": "test",
"type": "function",
"content": {
"type": "JSFunction",
"value": "function test() {\r\n return 'test'\r\n}"
},
"app": 918,
"category": "utils",
"created_at": "2022-07-06T10:21:02.000Z",
"updated_at": "2023-03-21T12:12:49.000Z"
},
{
"id": 97,
"name": "util",
"type": "function",
"content": {
"type": "JSFunction",
"value": "function util () {\r\n console.log(321)\r\n}"
},
"app": 918,
"category": "utils",
"created_at": "2022-06-23T11:13:07.000Z",
"updated_at": "2023-04-06T02:31:44.000Z"
}
],
"locale": "zh-cn"
}

View File

@ -0,0 +1,33 @@
{
"data": {
"locales": [
{
"lang": "en_US",
"label": "美式英文"
},
{
"lang": "zh_CN",
"label": "简体中文"
}
],
"messages": {
"en_US": {
"lowcode.c257d5e8": "search",
"lowcode.61c8ac8c": "testi18n",
"lowcode.f53187a0": "test",
"lowcode.97ad00dd": "createMaterial",
"common.index.fullName": "zhangsan",
"other.utileName": "getName"
},
"zh_CN": {
"lowcode.c257d5e8": "查询",
"lowcode.61c8ac8c": "地方",
"lowcode.f53187a0": "测试",
"lowcode.97ad00dd": "创建物料资产包",
"common.index.fullName": "张三",
"other.utileName": "获取名称"
}
}
},
"locale": "zh-cn"
}

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1,671 @@
{
"data": [
{
"id": 132,
"name": "getAllComponent",
"data": {
"data": [],
"type": "array"
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-06-28T06:26:26.000Z",
"updated_at": "2022-06-28T07:02:30.000Z"
},
{
"id": 133,
"name": "getAllList",
"data": {
"columns": [
{
"name": "test",
"title": "测试",
"field": "test",
"type": "string",
"format": {}
},
{
"name": "test1",
"title": "测试1",
"field": "test1",
"type": "string",
"format": {}
}
],
"type": "array",
"data": [
{
"test": "test1",
"test1": "test1",
"_id": "341efc48"
},
{
"test": "test2",
"test1": "test1",
"_id": "b86b516c"
},
{
"test": "test3",
"test1": "test1",
"_id": "f680cd78"
}
],
"options": {
"uri": "",
"method": "GET"
},
"dataHandler": {
"type": "JSFunction",
"value": "function dataHandler(data) { \n return data \n}"
},
"willFetch": {
"type": "JSFunction",
"value": "function willFetch(option) {\n return option \n}"
},
"shouldFetch": {
"type": "JSFunction",
"value": "function shouldFetch(option) {\n return true \n}"
},
"errorHandler": {
"type": "JSFunction",
"value": "function errorHandler(err) {}"
}
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-06-28T07:32:16.000Z",
"updated_at": "2023-01-19T03:29:11.000Z"
},
{
"id": 135,
"name": "getAllMaterialList",
"data": {
"columns": [
{
"name": "id",
"title": "id",
"field": "id",
"type": "string",
"format": {}
},
{
"name": "name",
"title": "name",
"field": "name",
"type": "string",
"format": {}
},
{
"name": "framework",
"title": "framework",
"field": "framework",
"type": "string",
"format": {
"required": true
}
},
{
"name": "components",
"title": "components",
"field": "components",
"type": "string",
"format": {}
},
{
"name": "content",
"title": "content",
"field": "content",
"type": "string",
"format": {}
},
{
"name": "url",
"title": "url",
"field": "url",
"type": "string",
"format": {}
},
{
"name": "published_at",
"title": "published_at",
"field": "published_at",
"type": "string",
"format": {}
},
{
"name": "created_at",
"title": "created_at",
"field": "created_at",
"type": "string",
"format": {}
},
{
"name": "updated_at",
"title": "updated_at",
"field": "updated_at",
"type": "string",
"format": {}
},
{
"name": "published",
"title": "published",
"field": "published",
"type": "string",
"format": {}
},
{
"name": "last_build_info",
"title": "last_build_info",
"field": "last_build_info",
"type": "string",
"format": {}
},
{
"name": "tenant",
"title": "tenant",
"field": "tenant",
"type": "string",
"format": {}
},
{
"name": "version",
"title": "version",
"field": "version",
"type": "string",
"format": {}
},
{
"name": "description",
"title": "description",
"field": "description",
"type": "string",
"format": {}
}
],
"type": "array",
"data": [
{
"id": "f37123ec",
"url": "",
"name": "ng-material",
"tenant": "",
"content": "",
"version": "1.0.0",
"framework": "Angular",
"published": "",
"components": "",
"created_at": "2021-11-02T11:32:22.000Z",
"updated_at": "2021-11-02T11:32:22.000Z",
"description": "angular组件库物料",
"published_at": "2021-11-02T11:32:22.000Z",
"last_build_info": "",
"_id": "2a23e653"
},
{
"id": "f37123ec",
"url": "",
"name": "ng-material",
"tenant": "",
"content": "",
"version": "1.0.0",
"framework": "Angular",
"published": "",
"components": "",
"created_at": "2021-11-02T11:32:22.000Z",
"updated_at": "2021-11-02T11:32:22.000Z",
"description": "angular组件库物料",
"published_at": "2021-11-02T11:32:22.000Z",
"last_build_info": "",
"_id": "06b253be"
},
{
"id": "f37123ec",
"url": "",
"name": "ng-material",
"tenant": "",
"content": "",
"version": "1.0.0",
"framework": "Angular",
"published": "",
"components": "",
"created_at": "2021-11-02T11:32:22.000Z",
"updated_at": "2021-11-02T11:32:22.000Z",
"description": "angular组件库物料",
"published_at": "2021-11-02T11:32:22.000Z",
"last_build_info": "",
"_id": "c55a41ed"
},
{
"id": "f37123ec",
"url": "",
"name": "ng-material",
"tenant": "",
"content": "",
"version": "1.0.0",
"framework": "Angular",
"published": "",
"components": "",
"created_at": "2021-11-02T11:32:22.000Z",
"updated_at": "2021-11-02T11:32:22.000Z",
"description": "angular组件库物料",
"published_at": "2021-11-02T11:32:22.000Z",
"last_build_info": "",
"_id": "f37123ec"
},
{
"id": "7a63c1a2",
"url": "",
"name": "tiny-vue",
"tenant": "",
"content": "Tiny Vue物料",
"version": "1.0.0",
"framework": "Vue",
"published": "",
"components": "",
"created_at": "",
"updated_at": "",
"description": "Tiny Vue物料",
"published_at": "",
"last_build_info": "",
"_id": "7a63c1a2"
}
],
"options": {
"uri": "",
"method": "GET"
},
"willFetch": {
"type": "JSFunction",
"value": "function willFetch(option) {\n return option \n}"
},
"dataHandler": {
"type": "JSFunction",
"value": "function dataHandler(data) { \n return data \n}"
},
"shouldFetch": {
"type": "JSFunction",
"value": "function shouldFetch(option) {\n return true \n}"
},
"errorHandler": {
"type": "JSFunction",
"value": "function errorHandler(err) {}"
}
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-06-29T00:57:50.000Z",
"updated_at": "2023-05-15T02:37:12.000Z"
},
{
"id": 139,
"name": "treedata",
"data": {
"data": [
{
"label": "level111",
"value": "111",
"id": "f6609643",
"pid": "",
"_RID": "row_4"
},
{
"label": "level1-son",
"value": "111-1",
"id": "af1f937f",
"pid": "f6609643",
"_RID": "row_5"
},
{
"label": "level222",
"value": "222",
"id": "28e3709c",
"pid": "",
"_RID": "row_6"
},
{
"label": "level2-son",
"value": "222-1",
"id": "6b571bef",
"pid": "28e3709c",
"_RID": "row_5"
},
{
"id": "6317c2cc",
"pid": "fdfa",
"label": "fsdfaa",
"value": "fsadf",
"_RID": "row_6"
},
{
"id": "9cce369f",
"pid": "test",
"label": "test1",
"value": "001"
}
],
"type": "tree"
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-06-30T06:13:57.000Z",
"updated_at": "2022-07-29T03:14:55.000Z"
},
{
"id": 150,
"name": "componentList",
"data": {
"data": [
{
"_RID": "row_1",
"name": "表单",
"isSelected": "true",
"description": "由按钮、输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据"
},
{
"name": "按钮",
"isSelected": "false",
"description": "常用的操作按钮,提供包括默认按钮、图标按钮、图片按钮、下拉按钮等类型"
},
{
"id": "490f8a00",
"_RID": "row_3",
"name": "表单项",
"framework": "",
"materials": "",
"description": "Form 组件下的 FormItem 配置"
},
{
"id": "c259b8b3",
"_RID": "row_4",
"name": "开关",
"framework": "",
"materials": "",
"description": "关闭或打开"
},
{
"id": "083ed9c7",
"_RID": "row_5",
"name": "互斥按钮组",
"framework": "",
"materials": "",
"description": "以按钮组的方式出现,常用于多项类似操作"
},
{
"id": "09136cea",
"_RID": "row_6",
"name": "提示框",
"framework": "",
"materials": "",
"description": "Popover可通过对一个触发源操作触发弹出框,支持自定义弹出内容,延迟触发和渐变动画"
},
{
"id": "a63b57d5",
"_RID": "row_7",
"name": "文字提示框",
"framework": "",
"materials": "",
"description": "动态显示提示信息,一般通过鼠标事件进行响应;提供 warning、error、info、success 四种类型显示不同类别的信"
},
{
"id": "a0f6e8a3",
"_RID": "row_8",
"name": "树",
"framework": "",
"materials": "",
"description": "可进行展示有父子层级的数据,支持选择,异步加载等功能。但不推荐用它来展示菜单,展示菜单推荐使用树菜单"
},
{
"id": "d1aa18fc",
"_RID": "row_9",
"name": "分页",
"framework": "",
"materials": "",
"description": "当数据量过多时,使用分页分解数据,常用于 Grid 和 Repeater 组件"
},
{
"id": "ca49cc52",
"_RID": "row_10",
"name": "表格",
"framework": "",
"materials": "",
"description": "提供了非常强大数据表格功能,可以展示数据列表,可以对数据列表进行选择、编辑等"
},
{
"id": "4e20ecc9",
"name": "搜索框",
"framework": "",
"materials": "",
"description": "指定条件对象进行搜索数据"
},
{
"id": "6b093ee5",
"name": "折叠面板",
"framework": "",
"materials": "",
"description": "内容区可指定动态页面或自定义 html 等,支持展开收起操作"
},
{
"id": "0a09abc0",
"name": "对话框",
"framework": "",
"materials": "",
"description": "模态对话框,在浮层中显示,引导用户进行相关操作"
},
{
"id": "f814b901",
"name": "标签页签项",
"framework": "",
"materials": "",
"description": "tab页签"
},
{
"id": "c5ae797c",
"name": "单选",
"framework": "",
"materials": "",
"description": "用于配置不同场景的选项,在一组备选项中进行单选"
},
{
"id": "33d0c590",
"_RID": "row_13",
"name": "弹出编辑",
"framework": "",
"materials": "",
"description": "该组件只能在弹出的面板中选择数据,不能手动输入数据;弹出面板中显示为 Tree 组件或者 Grid 组件"
},
{
"id": "16711dfa",
"_RID": "row_14",
"name": "下拉框",
"framework": "",
"materials": "",
"description": "Select 选择器是一种通过点击弹出下拉列表展示数据并进行选择的 UI 组件"
},
{
"id": "a9fd190a",
"_RID": "row_15",
"name": "折叠面板项",
"framework": "",
"materials": "",
"description": "内容区可指定动态页面或自定义 html 等,支持展开收起操作"
},
{
"id": "a7dfa9ec",
"_RID": "row_16",
"name": "复选框",
"framework": "",
"materials": "",
"description": "用于配置不同场景的选项,提供用户可在一组选项中进行多选"
},
{
"id": "d4bb8330",
"name": "输入框",
"framework": "",
"materials": "",
"description": "通过鼠标或键盘输入字符"
},
{
"id": "ced3dc83",
"name": "时间线",
"framework": "",
"materials": "",
"description": "时间线"
}
],
"type": "array",
"columns": [
{
"name": "name",
"type": "string",
"field": "name",
"title": "name",
"format": {
"max": 0,
"min": 0,
"dateTime": false,
"required": false,
"stringType": ""
}
},
{
"name": "description",
"type": "string",
"field": "description",
"title": "description",
"format": {
"max": 0,
"min": 0,
"dateTime": false,
"required": false,
"stringType": ""
}
},
{
"name": "isSelected",
"type": "string",
"field": "isSelected",
"title": "isSelected",
"format": {
"max": 0,
"min": 0,
"dateTime": false,
"required": false,
"stringType": ""
}
}
],
"options": {
"uri": "http://localhost:9090/assets/json/bundle.json",
"method": "GET"
},
"willFetch": {
"type": "JSFunction",
"value": "function willFetch(option) {\n return option \n}"
},
"dataHandler": {
"type": "JSFunction",
"value": "function dataHandler(data) { \n return data \n}"
},
"shouldFetch": {
"type": "JSFunction",
"value": "function shouldFetch(option) {\n return true \n}"
},
"errorHandler": {
"type": "JSFunction",
"value": "function errorHandler(err) {}"
}
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-07-04T02:20:07.000Z",
"updated_at": "2022-07-04T06:25:29.000Z"
},
{
"id": 151,
"name": "selectedComponents",
"data": {
"columns": [
{
"name": "name",
"title": "name",
"field": "name",
"type": "string",
"format": {
"required": false,
"stringType": "",
"min": 0,
"max": 0,
"dateTime": false
}
},
{
"name": "description",
"title": "description",
"field": "description",
"type": "string",
"format": {
"required": false,
"stringType": "",
"min": 0,
"max": 0,
"dateTime": false
}
},
{
"name": "isSelected",
"title": "isSelected",
"field": "isSelected",
"type": "string",
"format": {
"required": false,
"stringType": "",
"min": 0,
"max": 0,
"dateTime": false
}
}
],
"type": "array",
"data": [
{
"name": "标签页",
"description": "分隔内容上有关联但属于不同类别的数据集合",
"isSelected": "true",
"_RID": "row_2"
},
{
"name": "布局列",
"description": "列配置信息",
"isSelected": "true",
"id": "76a7080a",
"_RID": "row_4"
},
{
"name": "日期选择器",
"description": "用于设置/选择日期,包括年月/年月日/年月日时分/年月日时分秒日期格式",
"isSelected": "true",
"id": "76b20d73",
"_RID": "row_1"
},
{
"name": "走马灯",
"description": "常用于一组图片或卡片轮播,当内容空间不足时,可以用走马灯的形式进行收纳,进行轮播展现",
"isSelected": "true",
"id": "4c884c3d"
}
]
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-07-04T03:04:05.000Z",
"updated_at": "2022-07-04T03:43:40.000Z"
}
],
"locale": "zh-cn"
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,148 @@
{
"data": [
{
"id": 37,
"createdBy": {
"id": 86,
"username": "开发者",
"email": "developer@lowcode.com",
"resetPasswordToken": "developer",
"blocked": null,
"created_at": "2022-05-27T16:50:44.000Z",
"updated_at": "2022-05-27T16:50:44.000Z",
"block": null,
"is_admin": true,
"is_public": null
},
"updatedBy": {
"id": 86,
"username": "开发者",
"email": "developer@lowcode.com",
"resetPasswordToken": "developer",
"blocked": null,
"created_at": "2022-05-27T16:50:44.000Z",
"updated_at": "2022-05-27T16:50:44.000Z",
"block": null,
"is_admin": true,
"is_public": null
},
"created_at": "2023-08-17T02:40:06.000Z",
"updated_at": "2023-08-17T02:40:21.000Z",
"category": "appDev",
"name": "ai生成简单页面教程",
"desc": "",
"poster": "http://localhost:9090/assets/images/0055f57e0a38d45ced54e1b2b566cb29_308x180.jpg",
"type": "advanced",
"tags": "",
"variety": "solution",
"videos": [],
"progress": 0
},
{
"id": 34,
"createdBy": {
"id": 108,
"username": "张三",
"email": "xyz@email.com",
"resetPasswordToken": "工号xxxxxx",
"blocked": null,
"created_at": "2022-06-22T08:20:55.000Z",
"updated_at": "2022-12-08T07:29:41.000Z",
"block": null,
"is_admin": false,
"is_public": null
},
"updatedBy": {
"id": 108,
"username": "张三",
"email": "xyz@email.com",
"resetPasswordToken": "工号xxxxxx",
"blocked": null,
"created_at": "2022-06-22T08:20:55.000Z",
"updated_at": "2022-12-08T07:29:41.000Z",
"block": null,
"is_admin": false,
"is_public": null
},
"created_at": "2022-08-27T07:29:49.000Z",
"updated_at": "2022-08-27T07:29:49.000Z",
"category": "appDev",
"name": "如何加入组织",
"desc": "讲解如何加入已有组织,如何创建自己的组织",
"poster": "http://localhost:9090/assets/images/627366463067fa2f1a59d7db4ac55885_308x100.jpg",
"type": "introductory",
"tags": ["入门", "最新"],
"variety": "manual",
"videos": [
{
"id": 72,
"courseId": 34,
"title": "申请加入组织",
"video": "http://localhost:9090/assets/videos/tiny-engine.mp4",
"docs": "TinyEngine简介",
"created_at": "2022-08-27T07:29:49.000Z",
"updated_at": "2022-08-27T07:29:49.000Z"
},
{
"id": 73,
"courseId": 34,
"title": "创建平台",
"video": "http://localhost:9090/assets/videos/tiny-engine.mp4",
"docs": "fdsa",
"created_at": "2022-08-27T07:29:49.000Z",
"updated_at": "2022-08-27T07:29:49.000Z"
}
],
"progress": 0
},
{
"id": 28,
"createdBy": {
"id": 169,
"username": "张三",
"email": "xyz@email.com",
"resetPasswordToken": "工号xxxxxx",
"blocked": null,
"created_at": "2022-07-04T07:25:53.000Z",
"updated_at": "2022-09-27T11:48:34.000Z",
"block": null,
"is_admin": true,
"is_public": true
},
"updatedBy": {
"id": 169,
"username": "张三",
"email": "xyz@email.com",
"resetPasswordToken": "工号xxxxxx",
"blocked": null,
"created_at": "2022-07-04T07:25:53.000Z",
"updated_at": "2022-09-27T11:48:34.000Z",
"block": null,
"is_admin": true,
"is_public": true
},
"created_at": "2022-08-10T08:38:06.000Z",
"updated_at": "2022-08-11T03:44:28.000Z",
"category": "appDev",
"name": "实战课程",
"desc": "实战课程",
"poster": "http://localhost:9090/assets/images/777aad0c570f653f0a95b48b898c7b4b_308x180.jpg",
"type": "practical",
"tags": "",
"variety": "manual",
"videos": [
{
"id": 66,
"courseId": 28,
"title": "从零搭建一个页面",
"video": "http://localhost:9090/assets/videos/in-action.mp4",
"docs": "",
"created_at": "2022-08-10T08:38:06.000Z",
"updated_at": "2022-08-10T08:38:06.000Z"
}
],
"progress": 0
}
],
"locale": "zh-cn"
}

View File

@ -0,0 +1,57 @@
{
"data": {
"id": 86,
"username": "开发者",
"email": "developer@lowcode.com",
"provider": null,
"password": null,
"resetPasswordToken": "developer",
"confirmationToken": "uuid~dfafasdfasdfa",
"confirmed": true,
"blocked": null,
"role": null,
"created_by": null,
"updated_by": null,
"created_at": "2021-11-11T13:52:21.000Z",
"updated_at": "2022-11-01T01:39:30.000Z",
"block": null,
"is_admin": true,
"is_public": null,
"tenant": {
"id": "1"
},
"auths": [
{
"id": 265,
"unit": {
"type": "tenant",
"id": 1,
"name": "public"
},
"auth_type": null,
"expired_time": null,
"role": {
"name": "Tinybuilder_Tenant_Admin",
"id": 6,
"description": "组织管理员"
}
}
],
"tenants": [
{
"id": 1,
"tenant_id": "public",
"name_cn": "公共租户",
"name_en": "Public Tenant",
"description": "Default tenant for new user to explore.",
"created_by": null,
"updated_by": null,
"created_at": "2021-12-28T11:39:10.000Z",
"updated_at": "2023-02-09T08:23:00.000Z",
"createdBy": null,
"updatedBy": 86
}
]
},
"locale": "zh-cn"
}

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1 @@
{ "data": [], "locale": "zh-cn" }

View File

@ -0,0 +1,69 @@
{
"data": {
"id": 133,
"name": "getAllList",
"data": {
"columns": [
{
"name": "test",
"title": "测试",
"field": "test",
"type": "string",
"format": {}
},
{
"name": "test1",
"title": "测试1",
"field": "test1",
"type": "string",
"format": {}
}
],
"type": "array",
"data": [
{
"test": "test1",
"test1": "test1",
"_id": "341efc48"
},
{
"test": "test2",
"test1": "test1",
"_id": "b86b516c"
},
{
"test": "test3",
"test1": "test1",
"_id": "f680cd78"
}
],
"options": {
"uri": "/app-center/api/sources/list/918",
"isSync": true,
"method": "GET"
},
"dataHandler": {
"type": "JSFunction",
"value": "function dataHandler(data) { \n return data \n}"
},
"willFetch": {
"type": "JSFunction",
"value": "function willFetch(option) {\n return option \n}"
},
"shouldFetch": {
"type": "JSFunction",
"value": "function shouldFetch(option) {\n return true \n}"
},
"errorHandler": {
"type": "JSFunction",
"value": "function errorHandler(err) {}"
}
},
"tpl": null,
"app": "918",
"desc": null,
"created_at": "2022-06-28T07:32:16.000Z",
"updated_at": "2023-01-19T03:29:11.000Z"
},
"locale": "zh-cn"
}

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
module.exports = function () {
return function (ctx, next) {
switch (ctx.status) {
case 404:
ctx.body = '没有找到内容 - 404'
break
default:
break
}
return next()
}
}

View File

@ -0,0 +1,227 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import fs from 'fs-extra'
import * as glob from 'glob'
import KoaRouter from 'koa-router'
import path from 'path'
import MockService from '../services/mockService'
import { getResponseData } from '../tool/Common'
const router = new KoaRouter()
export const mockService = new MockService()
const getJsonPathData = (jpath, method = 'get') => {
const usefulPath = jpath.split(`${method}${path.sep}`)[1]
const apipath = usefulPath.split(path.sep)
const lastSegment = apipath[apipath.length - 1]
const lastdirname = lastSegment.split('.')[0]
apipath[apipath.length - 1] = lastdirname
const [center, version, ...routes] = apipath
let api = ''
if (version === 'v1') {
api = `/${center}/${version}/api/${routes.join('/')}`
} else {
api = `/${center}/api/${version}/${routes.join('/')}`
}
const data = fs.readJSONSync(path.resolve(__dirname, path.relative(__dirname, jpath)))
return {
api,
data
}
}
const mockPath = path.resolve(__dirname, '../mock')
// 注册路由
glob.globSync(`${mockPath}/get/**/*.json`).forEach((jpath) => {
const { api, data } = getJsonPathData(jpath)
router.get(api, (ctx, next) => {
ctx.body = data
})
})
glob.globSync(`${mockPath}/post/**/*.json`).forEach((jpath) => {
const { api, data } = getJsonPathData(jpath, 'post')
router.post(api, (ctx, next) => {
ctx.body = data
})
})
router.get('/app-center/api/apps/canvas/lock', async (ctx) => {
ctx.body = await mockService.appService.lock(ctx.request.query)
})
router.post('/app-center/api/schema2code', (ctx) => {
const { pageInfo } = ctx.request.body
ctx.body = mockService.schema2codeService.schema2code(pageInfo)
})
router.get('/app-center/api/preview/metadata', (ctx) => {
ctx.body = mockService.appService.getAppPreviewMetaData()
})
router.post('/app-center/api/pages/create', async (ctx) => {
ctx.body = await mockService.pageService.create(ctx.request.body)
})
router.post('/app-center/api/pages/update/:id', async (ctx) => {
const { id } = ctx.params
const { body } = ctx.request
ctx.body = await mockService.pageService.update(id, body)
})
router.get('/app-center/api/pages/list/:appId', async (ctx) => {
const { appId } = ctx.params
ctx.body = await mockService.pageService.list(appId)
})
router.get('/app-center/api/pages/detail/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.pageService.detail(id)
})
router.get('/app-center/api/pages/delete/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.pageService.delete(id)
})
router.get('/material-center/api/block/detail/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.blockService.detail(id)
})
router.get('/material-center/api/blocks', async (ctx) => {
const { appId } = ctx.params
ctx.body = await mockService.blockService.list(appId)
})
router.post('/material-center/api/block/create', async (ctx) => {
const result = mockService.blockService.create(ctx.request.body)
const categoriesId = ctx.request.body.categories[0]
const _id = result.id
await mockService.blockCategoryService.update(categoriesId, { _id })
ctx.body = getResponseData(result)
})
router.post('/material-center/api/block/update/:id', async (ctx) => {
const { id } = ctx.params
const { body } = ctx.request
ctx.body = await mockService.blockService.update(id, body)
})
router.get('/material-center/api/block/delete/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.blockService.delete(id)
})
router.post('/material-center/api/block-groups/create', async (ctx) => {
ctx.body = await mockService.blockGroupService.create(ctx.request.body)
})
router.post('/material-center/api/block-groups/update/:id', async (ctx) => {
const { id } = ctx.params
const { body } = ctx.request
ctx.body = await mockService.blockGroupService.update(id, body)
})
router.get('/material-center/api/block-groups/delete/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.blockGroupService.delete(id)
})
router.get('/material-center/api/block-groups', async (ctx) => {
const result = await mockService.blockGroupService.find(ctx.query)
let blockGroup
if (result.data.length === 0) {
ctx.body = result
} else if (result.data.length > 1) {
blockGroup = await Promise.all(
result.data.map(async (group) => {
group.blocks = await Promise.all(
group.blocks.map(async (block) => {
const blockData = await mockService.blockService.detail(block.id)
return blockData
})
)
return group
})
)
ctx.body = getResponseData(blockGroup)
} else if (result.data.length === 1) {
blockGroup = result.data[0]
const blocks = await Promise.all(
blockGroup.blocks.map(async (item) => {
const blockData = await mockService.blockService.detail(item)
return blockData
})
)
blockGroup.blocks = blocks
ctx.body = getResponseData([blockGroup])
}
})
router.post('/material-center/api/block-categories', async (ctx) => {
ctx.body = await mockService.blockCategoryService.create(ctx.request.body)
})
router.put('/material-center/api/block-categories/:id', async (ctx) => {
const { id } = ctx.params
const { body } = ctx.request
ctx.body = await mockService.blockCategoryService.update(id, body)
})
router.delete('/material-center/api/block-categories/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.blockCategoryService.delete(id)
})
router.get('/material-center/api/block-categories', async (ctx) => {
const result = await mockService.blockCategoryService.find(ctx.query)
const blockCategories = await Promise.all(
result.data.map(async (group) => {
const blocks = await Promise.all(
group.blocks.map(async (block) => {
const blockData = await mockService.blockService.detail(block)
return blockData
})
)
group.blocks = blocks
return group
})
)
ctx.body = getResponseData(blockCategories)
})
router.get('/app-center/api/sources/detail/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.sourceService.detail(id)
})
router.post('/material-center/api/block/deploy', async (ctx) => {
ctx.body = await mockService.blockBuildService.build(ctx.request.body)
})
router.get('/material-center/api/tasks/:id', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.taskService.detail(id)
})
router.get('/block-history', async (ctx) => {
const { id } = ctx.params
ctx.body = await mockService.blockHistoryService.find(id)
})
router.post('block-history/create', async (ctx) => {
ctx.body = await mockService.blockHistoryService.create(ctx.request.body)
})
export default router

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,73 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import { pageService } from '../routes/main-routes'
import { getResponseData } from '../tool/Common'
export default class AppService {
async lock(query) {
const { id, state } = query
const occupier = state === 'occupy' ? pageService.userInfo : null
await pageService.update(id, { occupier })
return getResponseData({
operate: 'success',
occupier
})
}
// 获取应用预览数据
getAppPreviewMetaData() {
const appMetaData = require('./appinfo.json')
const { i18n: i18nEntries, source = [], extension = [], app } = appMetaData
// 拼装数据源
const dataSource = {
list: source,
dataHandler: app.data_handler
}
// 拼装工具类
const utils = []
extension.forEach((item) => {
const { name, type, content, category } = item
const data = { name, type, content }
if (category === 'utils') {
utils.push(data)
}
})
// 拼装国际化词条
const entriesData = getResponseData(i18nEntries)
const i18n = this.formatI18nEntrites(entriesData)
return getResponseData({
dataSource,
globalState: app.global_state,
utils,
i18n
})
}
formatI18nEntrites(entriesData) {
const entries = entriesData.data
// 中文和英文作为全局国际化语言,并没有和应用/区块建立关联关系
const defaultLang = [{ lang: 'en_US' }, { lang: 'zh_CN' }]
const res = {}
entries.forEach((entry) => {
const {
key,
lang: { lang },
content
} = entry
res[lang] = res[lang] || {}
res[lang][key] = content
})
return res
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,93 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import path from 'path'
import DateStore from '@seald-io/nedb'
import { getResponseData } from '../tool/Common'
export default class BlockService {
constructor() {
this.db = new DateStore({
filename: path.resolve(__dirname, '../database/blocks.db'),
autoload: true
})
this.db.ensureIndex({
fieldName: 'label',
unique: true
})
this.userInfo = {
id: 86,
username: '开发者',
email: 'developer@lowcode.com',
resetPasswordToken: 'developer',
confirmationToken: 'dfb2c162-351f-4f44-ad5f-8998',
is_admin: true
}
this.blockModel = {
id: '',
label: '',
name_cn: '',
framework: [],
content: {},
description: '',
path: '',
screenshot: '',
created_app: '',
tags: '',
categories: [],
occupier: {
id: 86,
username: '开发者',
resetPasswordToken: 'developer'
},
isDefault: null,
isOfficial: null
}
}
async create(params) {
const blockData = { ...this.blockModel, ...params }
const result = await this.db.insertAsync(blockData)
const { _id } = result
await this.db.updateAsync({ _id }, { $set: { id: _id } })
result.id = result._id
return result
}
async update(id, params) {
await this.db.updateAsync({ _id: id }, { $set: params })
const result = await this.db.findOneAsync({ _id: id })
return getResponseData(result)
}
async detail(blockId) {
const result = await this.db.findOneAsync({ _id: blockId })
return result
}
async delete(blockId) {
const result = await this.db.findOneAsync({ _id: blockId })
await this.db.removeAsync({ _id: blockId })
return getResponseData(result)
}
async list(appId) {
const result = await this.db.findAsync()
return getResponseData(result)
}
async find(params) {
const result = await this.db.findAsync(params)
return result
}
}

View File

@ -0,0 +1,76 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import path from 'path'
import DateStore from '@seald-io/nedb'
import { getResponseData } from '../tool/Common'
import appinfo from './appinfo.json'
export default class BlockCategoryService {
constructor() {
this.db = new DateStore({
filename: path.resolve(__dirname, '../database/blockCategories.db'),
autoload: true
})
this.db.ensureIndex({
fieldName: 'name',
unique: true
})
this.blockCategoriesModel = {
id: '',
app: '',
name: '',
desc: '',
blocks: []
}
}
async create(params) {
const blockCategoriesData = { ...this.blockCategoriesModel, ...params }
blockCategoriesData.app = appinfo.app
const result = await this.db.insertAsync(blockCategoriesData)
const { _id } = result
await this.db.updateAsync({ _id }, { $set: { id: _id } })
result.id = result._id
return getResponseData(result)
}
async update(id, params) {
if (params?._id) {
const categories = await this.db.findOneAsync({ _id: id })
categories.blocks.push(params._id)
await this.db.updateAsync({ _id: id }, { $set: categories })
return getResponseData(categories)
}
params.app = appinfo.app
await this.db.updateAsync({ _id: id }, { $set: params })
const result = await this.db.findOneAsync({ _id: id })
return getResponseData(result)
}
async find(params) {
const result = await this.db.findAsync()
return getResponseData(result)
}
async delete(id) {
const result = await this.db.findOneAsync({ _id: id })
await this.db.removeAsync({ _id: id })
return getResponseData(result)
}
async list(appId) {
const result = await this.db.findAsync()
return getResponseData(result)
}
}

View File

@ -0,0 +1,75 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import path from 'path'
import DateStore from '@seald-io/nedb'
import { getResponseData } from '../tool/Common'
import appinfo from './appinfo.json'
export default class BlockGroupService {
constructor() {
this.db = new DateStore({
filename: path.resolve(__dirname, '../database/blockGroups.db'),
autoload: true
})
this.db.ensureIndex({
fieldName: 'name',
unique: true
})
this.blockGroupModel = {
id: '',
app: '',
name: '',
desc: '',
blocks: []
}
}
async create(params) {
const blockGroupData = { ...this.blockGroupModel, ...params }
blockGroupData.app = appinfo.app
const result = await this.db.insertAsync(blockGroupData)
const { _id } = result
await this.db.updateAsync({ _id }, { $set: { id: _id } })
result.id = result._id
return getResponseData(result)
}
async update(id, params) {
params.app = appinfo.app
await this.db.updateAsync({ _id: id }, { $set: params })
const result = await this.db.findOneAsync({ _id: id })
return getResponseData(result)
}
async find(params) {
if (params?.app || !params?.id) {
const result = await this.db.findAsync()
return getResponseData(result)
}
const { id } = params
const blockGroup = await this.db.findOneAsync({ _id: id })
return getResponseData([blockGroup])
}
async delete(blockGroupId) {
const result = await this.db.findOneAsync({ _id: blockGroupId })
await this.db.removeAsync({ _id: blockGroupId })
return getResponseData(result)
}
async list(appId) {
const result = await this.db.findAsync()
return getResponseData(result)
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,37 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import PageService from './pages'
import AppService from './app'
import BlockService from './block'
import SourceService from './source'
import BlockGroupService from './blockGroup'
import BlockCategoryService from './blockCategory'
import Schema2CodeServcice from './schema2code'
export default class MockService {
schema2codeService
pageService
appService
blockService
sourceService
blockGroupService
blockCategoryService
constructor() {
this.schema2codeService = new Schema2CodeServcice()
this.pageService = new PageService()
this.appService = new AppService()
this.blockService = new BlockService()
this.sourceService = new SourceService()
this.blockGroupService = new BlockGroupService()
this.blockCategoryService = new BlockCategoryService()
}
}

View File

@ -0,0 +1,178 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import { E_SchemaFormatFunc } from './utils'
import { getResponseData } from '../tool/Common'
const config = {
pageMeta: {
convert: {
page_desc: 'description',
route: 'router',
isBody: 'rootElement',
createdBy: 'creator',
created_at: 'gmt_create',
updated_at: 'gmt_modified'
},
include: [
'id',
'title',
'page_desc',
'createdBy',
'parentId',
'created_at',
'updated_at',
'isHome',
'isBody',
'group',
'route',
'occupier'
],
format: {
created_at: E_SchemaFormatFunc.ToLocalTimestamp,
updated_at: E_SchemaFormatFunc.ToLocalTimestamp,
isBody: E_SchemaFormatFunc.ToRootElement,
group: E_SchemaFormatFunc.ToGroupName,
createdBy: E_SchemaFormatFunc.ToCreatorName
}
},
pageContent: {
include: ['fileName', 'componentName', 'props', 'css', 'children', 'methods', 'state', 'lifeCycles']
},
folder: {
convert: {
name: 'folderName',
route: 'router',
created_at: 'gmt_create',
updated_at: 'gmt_modified'
},
include: ['name', 'route', 'created_at', 'updated_at', 'id', 'parentId', 'depth'],
format: {
created_at: E_SchemaFormatFunc.ToLocalTimestamp,
updated_at: E_SchemaFormatFunc.ToLocalTimestamp
}
}
}
export default class PageSchemaService {
constructor() {
this.config = config
}
assembleFields(originalData, type) {
let dataCopy = JSON.parse(JSON.stringify(originalData.data))
const conf = this.config[type]
if (conf.include || conf.exclude) {
dataCopy = this.filterFields(dataCopy, conf)
}
if (conf.format) {
dataCopy = this.formatFields(dataCopy, conf)
}
if (conf.convert) {
dataCopy = this.convertFields(dataCopy, conf)
}
return getResponseData(dataCopy)
}
// 转换数据表字段为schema中的字段命名
convertFields(data, conf) {
const convertConf = conf.convert || {}
Object.keys(convertConf).forEach((key) => {
data[convertConf[key]] = data[key]
delete data[key]
})
return data
}
// 筛选数据
filterFields(data, conf) {
const excludeConf = conf.exclude || []
const includeConf = conf.include || []
let res = {}
// include 优先级高于 exclude
if (includeConf.length) {
for (const key in data) {
if (includeConf.includes(key)) {
res[key] = data[key]
}
}
} else if (excludeConf.length) {
for (const key in data) {
if (!excludeConf.includes(key)) {
res[key] = data[key]
}
}
} else {
res = data
}
return res
}
// 格式化数据
formatFields(data, conf) {
const { format = {} } = conf
Object.keys(format).forEach((key) => {
const funcName = format[key]
const func = this[funcName]
if (func) {
data[key] = func(data[key])
}
})
return data
}
// 获取页面元数据
getSchemaMeta(pageData) {
return this.assembleFields(pageData, 'pageMeta')
}
// 提取page_schema
getSchemaBase(pageData) {
const pageMate = JSON.parse(JSON.stringify(pageData.data))
const pageContent = pageMate.page_content || {}
pageContent.fileName = pageMate.name
return this.assembleFields(
{
data: pageContent
},
'pageContent'
)
}
// 获取folder schema数据 todo
getFolderSchema(param) {
const schema = this.assembleFields(
{
data: param
},
'folder'
)
schema.data.componentName = 'Folder'
return schema
}
// 获取页面的schema
getSchema(pageInfo) {
const pageInfoData = {
data: pageInfo
}
if (!pageInfo.isPage) {
return this.getFolderSchema(pageInfo)
}
const schema = this.getSchemaBase(pageInfoData).data
// 从page_schema中获取基本字段
schema.meta = this.getSchemaMeta(pageInfoData).data
return getResponseData(schema)
}
}

View File

@ -0,0 +1,102 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import path from 'path'
import DateStore from '@seald-io/nedb'
import { getResponseData } from '../tool/Common'
export default class PageService {
constructor() {
this.db = new DateStore({
filename: path.resolve(__dirname, '../database/pages.db'),
autoload: true
})
this.db.ensureIndex({
fieldName: 'route',
unique: true
})
this.userInfo = {
id: 86,
username: '开发者',
email: 'developer@lowcode.com',
resetPasswordToken: 'developer',
confirmationToken: 'dfb2c162-351f-4f44-ad5f-8998',
is_admin: true
}
this.pageModel = {
name: '',
id: '',
app: '918',
route: '',
page_content: {},
tenant: 1,
isBody: true,
parentId: '',
depth: 0,
isPage: true,
isDefault: false,
group: 'staticPages',
occupier: {
id: 86,
username: '开发者',
email: 'developer@lowcode.com',
resetPasswordToken: 'developer',
confirmationToken: 'dfb2c162-351f-4f44-ad5f-8998',
is_admin: true
}
}
this.folderModel = {
parentId: '0',
route: 'test',
name: 'test',
app: '918',
isPage: false,
group: 'staticPages'
}
}
async create(params) {
const model = params.isPage ? this.pageModel : this.folderModel
const pageData = { ...model, ...params }
const result = await this.db.insertAsync(pageData)
const { _id } = result
await this.db.updateAsync({ _id }, { $set: { id: _id } })
result.id = result._id
return getResponseData(result)
}
async update(id, params) {
await this.db.updateAsync({ _id: id }, { $set: params })
const result = await this.db.findOneAsync({ _id: id })
return getResponseData(result)
}
async list(appId) {
const result = await this.db.findAsync({ app: appId.toString() })
return getResponseData(result)
}
async detail(pageId) {
const result = await this.db.findOneAsync({ _id: pageId })
return getResponseData(result)
}
async delete(pageId) {
const result = await this.db.findOneAsync({ _id: pageId })
await this.db.removeAsync({ _id: pageId })
return getResponseData(result)
}
}

Some files were not shown because too many files have changed in this diff Show More