From fde7c064445713c9db732771a2c3faa22143256c Mon Sep 17 00:00:00 2001 From: 3y Date: Sat, 22 Jan 2022 14:19:37 +0800 Subject: [PATCH] git init --- .gitignore | 120 +----------------- .prettierrc | 12 ++ README.en.md | 36 ------ README.md | 42 ++---- index.html | 198 +++++++++++++++++++++++++++++ nodemon.json | 4 + package.json | 27 ++++ pages/console.json | 5 + pages/crud-advance.json | 274 ++++++++++++++++++++++++++++++++++++++++ pages/crud-edit.json | 64 ++++++++++ pages/crud-list.json | 149 ++++++++++++++++++++++ pages/crud-new.json | 69 ++++++++++ pages/crud-view.json | 65 ++++++++++ pages/editor.json | 18 +++ pages/form-basic.json | 241 +++++++++++++++++++++++++++++++++++ pages/jsonp.js | 12 ++ pages/site.json | 127 +++++++++++++++++++ pages/wizard.json | 105 +++++++++++++++ public/logo.png | Bin 0 -> 6242 bytes server.js | 40 ++++++ 20 files changed, 1426 insertions(+), 182 deletions(-) create mode 100644 .prettierrc delete mode 100644 README.en.md create mode 100644 index.html create mode 100644 nodemon.json create mode 100644 package.json create mode 100644 pages/console.json create mode 100644 pages/crud-advance.json create mode 100644 pages/crud-edit.json create mode 100644 pages/crud-list.json create mode 100644 pages/crud-new.json create mode 100644 pages/crud-view.json create mode 100644 pages/editor.json create mode 100644 pages/form-basic.json create mode 100644 pages/jsonp.js create mode 100644 pages/site.json create mode 100644 pages/wizard.json create mode 100644 public/logo.png create mode 100644 server.js diff --git a/.gitignore b/.gitignore index 1f22b9c..5c5d33b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,116 +1,4 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +/node_modules +/package-lock.json +/gh-pages +/.idea diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..2ada450 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "semi": true, + "trailingComma": "none", + "bracketSpacing": false, + "quoteProps": "consistent", + "arrowParens": "avoid", + "jsxBracketSameLine": false +} diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 67346e1..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# austin-admin - -#### Description -austin项目前端,依赖amis - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index f979eff..a911db2 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,19 @@ -# austin-admin +# amis admin 模板 -#### 介绍 -austin项目前端,依赖amis +基于 [amis](https://github.com/baidu/amis) 渲染器,快速搭建自己的管理系统。 -#### 软件架构 -软件架构说明 +## 快速开始 +其实这个项目直接双击 `index.html` 都能看大部分效果,不过为了更完整体验,请运行下面的命令: -#### 安装教程 +```bash -1. xxxx -2. xxxx -3. xxxx +# 安装依赖 +npm i +# 打开服务 +npm start +``` -#### 使用说明 +## 部署上线 -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +这个例子中的 amis 等依赖使用外部 cdn,为了稳定请在自己部署的时候将文件下载到本地。 \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..59ee0fa --- /dev/null +++ b/index.html @@ -0,0 +1,198 @@ + + + + + amis admin + + + + + + + + + + + +
+ + + diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..367a505 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,4 @@ +{ + "verbose": true, + "ignore": ["node_modules/*"] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d25caa2 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "amis-boilerplate", + "version": "1.0.0", + "description": "基于 amis 的项目模板", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js", + "gh-pages": "rm -rf gh-pages && fis3 release gh-pages -c", + "deploy-gh-pages": "git subtree push --prefix gh-pages origin gh-pages" + }, + "keywords": [ + "amis", + "boilerplate", + "admin", + "react" + ], + "author": "fex", + "license": "MIT", + "devDependencies": { + "body-parser": "^1.19.0", + "express": "^4.17.1", + "morgan": "^1.10.0", + "nodemon": "^2.0.7", + "reload": "^3.1.1" + } +} diff --git a/pages/console.json b/pages/console.json new file mode 100644 index 0000000..cb7a8a9 --- /dev/null +++ b/pages/console.json @@ -0,0 +1,5 @@ +{ + "type": "page", + "title": "Dashboard", + "body": "body..." +} diff --git a/pages/crud-advance.json b/pages/crud-advance.json new file mode 100644 index 0000000..cd94597 --- /dev/null +++ b/pages/crud-advance.json @@ -0,0 +1,274 @@ +{ + "type": "page", + "title": "复杂表单", + "subTitle": "展示表格编辑、联动等等", + "body": [ + { + "type": "form", + "mode": "horizontal", + "title": "", + "affixFooter": true, + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/form/save", + "actions": [ + { + "label": "保存", + "type": "submit", + "level": "success" + } + ], + "controls": [ + { + "type": "fieldSet", + "title": "基本配置", + "controls": [ + { + "type": "text", + "label": "任务名称", + "name": "title", + "size": "md", + "required": true + }, + + { + "type": "textarea", + "label": "任务描述", + "name": "description", + "size": "md" + }, + + { + "label": "任务频率", + "type": "radios", + "name": "repeat", + "inline": true, + "value": "none", + "required": true, + "options": [ + { + "label": "不重复", + "value": "none" + }, + + { + "label": "每天", + "value": "day" + }, + + { + "label": "每周", + "value": "week" + }, + + { + "label": "每月", + "value": "month" + } + ] + }, + + { + "label": "每天几点", + "type": "select", + "name": "time", + "multiple": true, + "required": true, + "extractValue": true, + "visibleOn": "this.repeat == \"day\"", + "inline": true, + "options": [ + {"value": 0, "label": "0:00"}, + {"value": 1, "label": "1:00"}, + {"value": 2, "label": "2:00"}, + {"value": 3, "label": "3:00"}, + {"value": 4, "label": "4:00"}, + {"value": 5, "label": "5:00"}, + {"value": 6, "label": "6:00"}, + {"value": 7, "label": "7:00"}, + {"value": 8, "label": "8:00"}, + {"value": 9, "label": "9:00"}, + {"value": 10, "label": "10:00"}, + {"value": 11, "label": "11:00"}, + {"value": 12, "label": "12:00"}, + {"value": 13, "label": "13:00"}, + {"value": 14, "label": "14:00"}, + {"value": 15, "label": "15:00"}, + {"value": 16, "label": "16:00"}, + {"value": 17, "label": "17:00"}, + {"value": 18, "label": "18:00"}, + {"value": 19, "label": "19:00"}, + {"value": 20, "label": "20:00"}, + {"value": 21, "label": "21:00"}, + {"value": 22, "label": "22:00"}, + {"value": 23, "label": "23:00"} + ] + }, + + { + "label": "每周几执行", + "type": "button-group", + "name": "weekdays", + "size": "md", + "visibleOn": "this.repeat == \"week\"", + "clearable": true, + "multiple": true, + "required": true, + "extractValue": true, + "maxLength": 7, + "options": [ + { + "label": "周一", + "value": "0" + }, + + { + "label": "周二", + "value": "1" + }, + + { + "label": "周三", + "value": "2" + }, + + { + "label": "周四", + "value": "3" + }, + + { + "label": "周五", + "value": "4" + }, + + { + "label": "周六", + "value": "5" + }, + + { + "label": "周日", + "value": "6" + } + ] + }, + + { + "label": "每月几号执行", + "type": "list", + "name": "monthday", + "size": "md", + "visibleOn": "this.repeat == \"month\"", + "required": true, + "maxLength": 31, + "clearable": true, + "multiple": true, + "extractValue": true, + "options": [ + {"value": 0, "label": "01"}, + {"value": 1, "label": "02"}, + {"value": 2, "label": "03"}, + {"value": 3, "label": "04"}, + {"value": 4, "label": "05"}, + {"value": 5, "label": "06"}, + {"value": 6, "label": "07"}, + {"value": 7, "label": "08"}, + {"value": 8, "label": "09"}, + {"value": 9, "label": "10"}, + {"value": 10, "label": "11"}, + {"value": 11, "label": "12"}, + {"value": 12, "label": "13"}, + {"value": 13, "label": "14"}, + {"value": 14, "label": "15"}, + {"value": 15, "label": "16"}, + {"value": 16, "label": "17"}, + {"value": 17, "label": "18"}, + {"value": 18, "label": "19"}, + {"value": 19, "label": "20"}, + {"value": 20, "label": "21"}, + {"value": 21, "label": "22"}, + {"value": 22, "label": "23"}, + {"value": 23, "label": "24"}, + {"value": 24, "label": "25"}, + {"value": 25, "label": "26"}, + {"value": 26, "label": "27"}, + {"value": 27, "label": "28"}, + {"value": 28, "label": "29"}, + {"value": 29, "label": "30"}, + {"value": 30, "label": "31"} + ] + } + ] + }, + + { + "type": "fieldSet", + "title": "其他信息", + "collapsable": true, + "controls": [ + { + "type": "combo", + "name": "admins", + "label": "用户列表", + "value": [""], + "description": "请输入用户信息,不要重复。", + "multiple": true, + "inline": true, + "controls": [ + { + "type": "text", + "name": "name", + "unique": true + }, + + { + "type": "select", + "name": "perm", + "value": "read", + "options": [ + { + "label": "可读", + "value": "read" + }, + + { + "label": "可写", + "value": "write" + } + ] + } + ] + }, + { + "label": "新增一行", + "type": "button", + "actionType": "add", + "target": "thetable", + "level": "info" + }, + { + "name": "thetable", + "type": "table", + "label": "任务参数", + "editable": true, + "addable": true, + "removable": true, + "columns": [ + { + "label": "参数名", + "name": "key", + "quickEdit": true + }, + + { + "label": "参数值", + "name": "value", + "quickEdit": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/pages/crud-edit.json b/pages/crud-edit.json new file mode 100644 index 0000000..c5144b0 --- /dev/null +++ b/pages/crud-edit.json @@ -0,0 +1,64 @@ +{ + "type": "page", + "title": "修改 ${params.id}", + "remark": null, + "toolbar": [ + { + "type": "button", + "actionType": "link", + "link": "/crud/list", + "label": "返回列表" + } + ], + "body": [ + { + "type": "form", + "initApi": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/${params.id}", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/$id", + "redirect": "/crud/list", + "controls": [ + { + "type": "text", + "name": "engine", + "label": "Engine", + "required": true + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "browser", + "label": "Browser", + "required": true + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "platform", + "label": "Platform(s)", + "required": true + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "version", + "label": "Engine version" + }, + { + "type": "divider" + }, + { + "type": "select", + "name": "grade", + "label": "CSS grade", + "options": ["A", "B", "C", "D", "X"] + } + ] + } + ] +} diff --git a/pages/crud-list.json b/pages/crud-list.json new file mode 100644 index 0000000..765f088 --- /dev/null +++ b/pages/crud-list.json @@ -0,0 +1,149 @@ +{ + "type": "page", + "title": "列表.", + "remark": null, + "name": "page-demo", + "toolbar": [ + { + "type": "button", + "actionType": "link", + "link": "/crud/new", + "label": "新增", + "primary": true + } + ], + "body": [ + { + "type": "crud", + "name": "sample", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", + "filter": { + "title": "", + "mode": "inline", + "wrapWithPanel": false, + "submitText": "", + "controls": [ + { + "type": "text", + "name": "keywords", + "placeholder": "通过关键字搜索", + "addOn": { + "label": "搜索", + "type": "submit", + "className": "btn-success" + }, + "clearable": true + } + ], + "className": "m-b-sm" + }, + "bulkActions": [ + { + "label": "批量修改", + "type": "button", + "actionType": "dialog", + "level": "primary", + "dialog": { + "title": "批量编辑", + "name": "sample-bulk-edit", + "body": { + "type": "form", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/bulkUpdate2", + "controls": [ + { + "type": "text", + "name": "engine", + "label": "Engine" + } + ] + } + } + }, + { + "label": "批量删除", + "type": "button", + "level": "danger", + "actionType": "ajax", + "api": "delete:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/$ids", + "confirmText": "确定要批量删除?" + } + ], + "columns": [ + { + "name": "engine", + "label": "Rendering engine", + "sortable": true + }, + { + "name": "id", + "label": "ID", + "width": 20, + "sortable": true + }, + { + "name": "browser", + "label": "Browser", + "sortable": true + }, + { + "name": "platform", + "label": "Platform(s)", + "sortable": true + }, + { + "name": "version", + "label": "Engine version" + }, + { + "name": "grade", + "label": "CSS grade" + }, + { + "type": "operation", + "label": "操作", + "width": "", + "buttons": [ + { + "type": "button-group", + "buttons": [ + { + "type": "button", + "label": "查看", + "level": "primary", + "actionType": "link", + "link": "/crud/${id}" + }, + { + "type": "button", + "label": "修改", + "level": "info", + "actionType": "link", + "link": "/crud/${id}/edit" + }, + { + "type": "button", + "label": "删除", + "level": "danger", + "actionType": "ajax", + "confirmText": "您确认要删除?", + "api": "delete:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/$id" + } + ] + } + ], + "placeholder": "-", + "fixed": "right" + } + ], + "affixHeader": true, + "columnsTogglable": "auto", + "placeholder": "暂无数据", + "tableClassName": "table-db table-striped", + "headerClassName": "crud-table-header", + "footerClassName": "crud-table-footer", + "toolbarClassName": "crud-table-toolbar", + "combineNum": 0, + "bodyClassName": "panel-default" + } + ] +} diff --git a/pages/crud-new.json b/pages/crud-new.json new file mode 100644 index 0000000..49bf000 --- /dev/null +++ b/pages/crud-new.json @@ -0,0 +1,69 @@ +{ + "type": "page", + "title": "新增", + "remark": null, + "toolbar": [ + { + "type": "button", + "actionType": "link", + "link": "/crud/list", + "label": "返回列表" + } + ], + "body": [ + { + "title": "", + "type": "form", + "redirect": "/crud/list", + "name": "sample-edit-form", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample", + "controls": [ + { + "type": "text", + "name": "engine", + "label": "Engine", + "required": true, + "inline": false, + "description": "", + "descriptionClassName": "help-block", + "placeholder": "", + "addOn": null + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "browser", + "label": "Browser", + "required": true + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "platform", + "label": "Platform(s)", + "required": true + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "version", + "label": "Engine version" + }, + { + "type": "divider" + }, + { + "type": "text", + "name": "grade", + "label": "CSS grade" + } + ] + } + ] +} diff --git a/pages/crud-view.json b/pages/crud-view.json new file mode 100644 index 0000000..3469520 --- /dev/null +++ b/pages/crud-view.json @@ -0,0 +1,65 @@ +{ + "type": "page", + "title": "查看详情 ${params.id}", + "remark": null, + "toolbar": [ + { + "type": "button", + "actionType": "link", + "link": "/crud/list", + "label": "返回列表" + } + ], + "body": [ + { + "type": "form", + "initApi": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample/${params.id}", + "controls": [ + { + "type": "static", + "name": "engine", + "label": "Engine" + }, + { + "type": "divider" + }, + { + "type": "static", + "name": "browser", + "label": "Browser" + }, + { + "type": "divider" + }, + { + "type": "static", + "name": "platform", + "label": "Platform(s)" + }, + { + "type": "divider" + }, + { + "type": "static", + "name": "version", + "label": "Engine version" + }, + { + "type": "divider" + }, + { + "type": "static", + "name": "grade", + "label": "CSS grade" + }, + { + "type": "divider" + }, + { + "type": "html", + "html": "

添加其他 Html 片段 需要支持变量替换(todo).

" + } + ] + } + ] +} diff --git a/pages/editor.json b/pages/editor.json new file mode 100644 index 0000000..a6bb29c --- /dev/null +++ b/pages/editor.json @@ -0,0 +1,18 @@ +{ + "type": "page", + "title": "代码编辑器", + "subTitle": "使用的monaco-editor,用到了 worker, 如果控制台没有报错,说明一起正常。", + "body": [ + { + "type": "form", + "controls": [ + { + "type": "editor", + "name": "js", + "label": "Javascript", + "size": "md" + } + ] + } + ] +} diff --git a/pages/form-basic.json b/pages/form-basic.json new file mode 100644 index 0000000..7040b9c --- /dev/null +++ b/pages/form-basic.json @@ -0,0 +1,241 @@ +{ + "type": "page", + "title": "基础表单", + "subTitle": "展示一些常规的表单,包括验证、提示等等", + "body": [ + { + "type": "form", + "mode": "horizontal", + "title": "常规表单示例", + "affixFooter": true, + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/form/save", + "actions": [ + { + "label": "保存", + "type": "submit", + "level": "success" + } + ], + "controls": [ + { + "label": " 标题", + "type": "text", + "placeholder": "请输入标题", + "description": "请输入一个能吸引眼球的标题", + "name": "title", + "size": "md" + }, + + { + "label": "编号", + "required": true, + "type": "text", + "placeholder": "请输入编号", + "name": "b", + "size": "md", + "validations": { + "matchRegexp": "/^\\w{4}-\\w{4}-\\w{4}$/" + }, + "validationErrors": { + "matchRegexp": "您输入的内容格式不对,请按提示输入!" + }, + "hint": "输入范例:xxxx-xxxx-xxxx" + }, + + { + "label": "置顶", + "type": "switch", + "name": "c", + "inline": true, + "labelRemark": "开启后将置顶这条数据!" + }, + + { + "label": "活动时间", + "type": "date-range", + "name": "range", + "size": "md", + "remark": "这是一个字段时间范围" + }, + + { + "label": "日期范围", + "type": "group", + "controls": [ + { + "type": "date", + "size": "md", + "name": "start", + "mode": "inline", + "maxDate": "${end}" + }, + + { + "label": "到", + "type": "date", + "size": "md", + "name": "end", + "inputClassName": "m-l-sm", + "mode": "inline", + "minDate": "${start}", + "remark": "这是两个字段的时间范围" + } + ] + }, + + { + "label": "浏览器", + "type": "button-group", + "name": "browser", + "value": "chrome", + "options": [ + { + "label": "Chrome", + "value": "chrome" + }, + + { + "label": "火狐", + "value": "firefox" + }, + + { + "label": "IE", + "value": "ie" + } + ] + }, + + { + "type": "list", + "name": "taocan", + "label": "套餐选择", + "options": [ + { + "value": 1, + "body": "
套餐:C01
CPU:2核
内存:1GB
SSD盘:10GB
" + }, + { + "value": 2, + "body": "
套餐:C02
CPU:4核
内存:4GB
SSD盘:20GB
" + }, + { + "value": 3, + "disabled": true, + "body": "
套餐:C03
CPU:8核
内存:8GB
SSD盘:50GB
" + } + ] + }, + + { + "label": "最爱周几", + "type": "select", + "name": "select", + "size": "md", + "clearable": true, + "options": [ + { + "label": "周一", + "value": "0" + }, + + { + "label": "周二", + "value": "1" + }, + + { + "label": "周三", + "value": "2" + }, + + { + "label": "周四", + "value": "3" + }, + + { + "label": "周五", + "value": "4" + }, + + { + "label": "周六", + "value": "5" + }, + + { + "label": "周日", + "value": "6" + } + ] + }, + + { + "label": "休息日", + "type": "list", + "name": "freeday", + "value": ["5", "6"], + "multiple": true, + "extractValue": true, + "options": [ + { + "label": "周一", + "value": "0" + }, + + { + "label": "周二", + "value": "1" + }, + + { + "label": "周三", + "value": "2" + }, + + { + "label": "周四", + "value": "3" + }, + + { + "label": "周五", + "value": "4" + }, + + { + "label": "周六", + "value": "5" + }, + + { + "label": "周日", + "value": "6" + } + ] + }, + + { + "label": "人数", + "type": "number", + "name": "num", + "size": "md", + "value": 10 + }, + + { + "label": "比率", + "type": "range", + "name": "percent" + }, + + { + "label": "简介", + "type": "textarea", + "name": "textarea" + } + ] + } + ] +} diff --git a/pages/jsonp.js b/pages/jsonp.js new file mode 100644 index 0000000..9612fb8 --- /dev/null +++ b/pages/jsonp.js @@ -0,0 +1,12 @@ +(function() { + const response = { + data: { + type: "page", + title: "标题", + body: "this result is from jsonp" + }, + status: 0 + } + + window.jsonpCallback && window.jsonpCallback(response); +})(); diff --git a/pages/site.json b/pages/site.json new file mode 100644 index 0000000..f710212 --- /dev/null +++ b/pages/site.json @@ -0,0 +1,127 @@ +{ + "status": 0, + "msg": "", + "data": { + "pages": [ + { + "label": "Home", + "url": "/", + "redirect": "/index/1" + }, + { + "label": "示例", + "children": [ + { + "label": "页面A", + "url": "index", + "schema": { + "type": "page", + "title": "页面A", + "body": "页面A" + }, + "children": [ + { + "label": "页面A-1", + "url": "1", + "schema": { + "type": "page", + "title": "页面A-1", + "body": "页面A-1" + } + }, + { + "label": "页面A-2", + "url": "2", + "schema": { + "type": "page", + "title": "页面A-2", + "body": "页面A-2" + } + }, + { + "label": "页面A-3", + "url": "3", + "schema": { + "type": "page", + "title": "页面A-3", + "body": "页面A-3" + } + } + ] + }, + { + "label": "页面B", + "schema": { + "type": "page", + "title": "页面B", + "body": "页面B" + } + }, + { + "label": "页面C", + "schema": { + "type": "page", + "title": "页面C", + "body": "页面C" + } + }, + { + "label": "列表示例", + "url": "/crud", + "rewrite": "/crud/list", + "icon": "fa fa-cube", + "children": [ + { + "label": "列表", + "url": "/crud/list", + "icon": "fa fa-list", + "schemaApi": "get:/pages/crud-list.json" + }, + { + "label": "新增", + "url": "/crud/new", + "icon": "fa fa-plus", + "schemaApi": "get:/pages/crud-new.json" + }, + { + "label": "查看", + "url": "/crud/:id", + "schemaApi": "get:/pages/crud-view.json" + }, + { + "label": "修改", + "url": "/crud/:id/edit", + "schemaApi": "get:/pages/crud-edit.json" + } + ] + } + ] + }, + { + "label": "分组2", + "children": [ + { + "label": "用户管理", + "schema": { + "type": "page", + "title": "用户管理", + "body": "页面C" + } + }, + { + "label": "外部链接", + "link": "http://baidu.gitee.io/amis" + }, + { + "label": "部门管理", + "schemaApi": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/service/form?tpl=tpl3" + }, + { + "label": "jsonp 返回示例", + "schemaApi": "jsonp:/pages/jsonp.js?callback=jsonpCallback" + } + ] + } + ] + } +} diff --git a/pages/wizard.json b/pages/wizard.json new file mode 100644 index 0000000..11ed771 --- /dev/null +++ b/pages/wizard.json @@ -0,0 +1,105 @@ +{ + "type": "page", + "title": "表单向导", + "subTitle": "可以通过表单向导,将一个超长的表单页面拆分成多个步骤,一步一步指引用户完成。", + "body": [ + { + "type": "wizard", + "actionFinishLabel": "确认", + "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/saveWizard", + "steps": [ + { + "title": "填写活动信息", + "controls": [ + { + "type": "text", + "name": "title", + "label": "活动标题", + "required": true, + "size": "md" + }, + + { + "type": "date", + "name": "date", + "label": "举办时间", + "size": "md" + }, + + { + "type": "number", + "name": "num", + "label": "参与人数", + "value": 10, + "size": "md" + } + ] + }, + + { + "title": "填写赞助商信息", + "controls": [ + { + "type": "text", + "name": "company", + "label": "公司名称", + "required": true, + "size": "md" + }, + + { + "type": "text", + "name": "money", + "label": "赞助金额", + "addOn": { + "type": "text", + "label": "¥" + }, + "size": "md" + } + ] + }, + + { + "title": "确认", + "mode": "horizontal", + "horizontal": { + "leftFixed": "sm" + }, + "controls": [ + { + "type": "static", + "name": "company", + "label": "活动标题", + "labelClassName": "text-muted" + }, + { + "type": "static-date", + "name": "date", + "label": "举办时间", + "labelClassName": "text-muted" + }, + { + "type": "static", + "name": "num", + "label": "参与人数", + "labelClassName": "text-muted" + }, + { + "type": "static", + "name": "company", + "label": "公司名称", + "labelClassName": "text-muted" + }, + { + "type": "static", + "name": "money", + "label": "赞助金额", + "labelClassName": "text-muted" + } + ] + } + ] + } + ] +} diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c9ea77efc0fa29c8b19473270cbc35858c0e0e82 GIT binary patch literal 6242 zcmZ`-Wmr^e*WNS&64H#Mbj^@McPfo^#}Lv(r=+xm#LyA~5+W@Pf;b=@(jbkLC?E|V zdd_>!`Ofve`?~gi)?Vwr*S*$$)}Q@EYp5yS#i7Ch0N}2&lAPAs?q>Zoq&63fpPmzXQia23IKl001zAw0Oz-^;4J{~gaE*{IRJ_l``;{exIOIlv;3m{rSebTzwsJ&E*>toTLibaQg-%$!Ea0all>pT|Bd)Zu3vqN zXxRI}9QEbwonX$tyA%=@1OL~+zlpLgjxKO*R|_lHubO{T{^9yJ`nQb1|C0Gf;7_6$ z_}3KtV=Dd_x!>N~nUlZ~1OGL@5;&?hFS-GMBvx5Y`mqnno{4`7wR}d^cDpw-B;f)P z9*lX18+bRNvvtg z@TSE!!o*i84fw>aoT6yse3FAj&)3-U^W->3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