├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo.png └── pages │ ├── console.json │ ├── crud-advance.json │ ├── crud-edit.json │ ├── crud-list.json │ ├── crud-new.json │ ├── crud-view.json │ ├── editor.json │ ├── form-basic.json │ ├── site.json │ └── wizard.json └── src ├── App.vue ├── assets └── logo.png ├── components ├── amis-demo │ └── AmisDemo.vue └── amis │ └── AMisRenderer.vue └── main.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # amis-admin-demo-vue 2 | 3 | 基于 [amis](https://github.com/baidu/amis) 渲染器,快速搭建自己的管理系统。 4 | 这是基于官方应用模板[amis-admin](https://github.com/aisuda/amis-admin)的vue实现版本。 5 | 6 | ## Project setup 7 | ``` 8 | npm install 9 | ``` 10 | 11 | ### Compiles and hot-reloads for development 12 | ``` 13 | npm run serve 14 | ``` 15 | 16 | ### Compiles and minifies for production 17 | ``` 18 | npm run build 19 | ``` 20 | 21 | ### Lints and fixes files 22 | ``` 23 | npm run lint 24 | ``` 25 | 26 | ### Customize configuration 27 | See [Configuration Reference](https://cli.vuejs.org/config/). 28 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amis-admin-demo-vue", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.6.5", 12 | "vue": "^2.6.11", 13 | "amis": "^1.0.15-beta.9", 14 | "vuera": "^0.2.7", 15 | "axios": "^0.19.2", 16 | "copy-to-clipboard": "3.0.8", 17 | "qs": "6.5.1", 18 | "bootstrap": "^3.4.1" 19 | }, 20 | "devDependencies": { 21 | "@vue/cli-plugin-babel": "~4.5.0", 22 | "@vue/cli-plugin-eslint": "~4.5.0", 23 | "@vue/cli-service": "~4.5.0", 24 | "babel-eslint": "^10.1.0", 25 | "eslint": "^6.7.2", 26 | "eslint-plugin-vue": "^6.2.2", 27 | "vue-template-compiler": "^2.6.11", 28 | "less": "^3.0.4", 29 | "less-loader": "^4.1.0" 30 | }, 31 | "eslintConfig": { 32 | "root": true, 33 | "env": { 34 | "node": true 35 | }, 36 | "extends": [ 37 | "plugin:vue/essential", 38 | "eslint:recommended" 39 | ], 40 | "parserOptions": { 41 | "parser": "babel-eslint" 42 | }, 43 | "rules": {} 44 | }, 45 | "browserslist": [ 46 | "> 1%", 47 | "last 2 versions", 48 | "not dead" 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softice70/amis-admin-demo-vue/e4373643522c8bf0ca0f761d36c03e5273d811b5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softice70/amis-admin-demo-vue/e4373643522c8bf0ca0f761d36c03e5273d811b5/public/logo.png -------------------------------------------------------------------------------- /public/pages/console.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "Dashboard", 4 | "body": "body..." 5 | } 6 | -------------------------------------------------------------------------------- /public/pages/crud-advance.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "复杂表单", 4 | "subTitle": "展示表格编辑、联动等等", 5 | "body": [ 6 | { 7 | "type": "form", 8 | "mode": "horizontal", 9 | "title": "", 10 | "affixFooter": true, 11 | "api": "/api/form/save", 12 | "actions": [ 13 | { 14 | "label": "保存", 15 | "type": "submit", 16 | "level": "success" 17 | } 18 | ], 19 | "controls": [ 20 | { 21 | "type": "fieldSet", 22 | "title": "基本配置", 23 | "controls": [ 24 | { 25 | "type": "text", 26 | "label": "任务名称", 27 | "name": "title", 28 | "size": "md", 29 | "required": true 30 | }, 31 | 32 | { 33 | "type": "textarea", 34 | "label": "任务描述", 35 | "name": "description", 36 | "size": "md" 37 | }, 38 | 39 | { 40 | "label": "任务频率", 41 | "type": "radios", 42 | "name": "repeat", 43 | "inline": true, 44 | "value": "none", 45 | "required": true, 46 | "options": [ 47 | { 48 | "label": "不重复", 49 | "value": "none" 50 | }, 51 | 52 | { 53 | "label": "每天", 54 | "value": "day" 55 | }, 56 | 57 | { 58 | "label": "每周", 59 | "value": "week" 60 | }, 61 | 62 | { 63 | "label": "每月", 64 | "value": "month" 65 | } 66 | ] 67 | }, 68 | 69 | { 70 | "label": "每天几点", 71 | "type": "select", 72 | "name": "time", 73 | "multiple": true, 74 | "required": true, 75 | "extractValue": true, 76 | "visibleOn": "this.repeat == \"day\"", 77 | "inline": true, 78 | "options": [ 79 | { "value": 0, "label": "0:00" }, 80 | { "value": 1, "label": "1:00" }, 81 | { "value": 2, "label": "2:00" }, 82 | { "value": 3, "label": "3:00" }, 83 | { "value": 4, "label": "4:00" }, 84 | { "value": 5, "label": "5:00" }, 85 | { "value": 6, "label": "6:00" }, 86 | { "value": 7, "label": "7:00" }, 87 | { "value": 8, "label": "8:00" }, 88 | { "value": 9, "label": "9:00" }, 89 | { "value": 10, "label": "10:00" }, 90 | { "value": 11, "label": "11:00" }, 91 | { "value": 12, "label": "12:00" }, 92 | { "value": 13, "label": "13:00" }, 93 | { "value": 14, "label": "14:00" }, 94 | { "value": 15, "label": "15:00" }, 95 | { "value": 16, "label": "16:00" }, 96 | { "value": 17, "label": "17:00" }, 97 | { "value": 18, "label": "18:00" }, 98 | { "value": 19, "label": "19:00" }, 99 | { "value": 20, "label": "20:00" }, 100 | { "value": 21, "label": "21:00" }, 101 | { "value": 22, "label": "22:00" }, 102 | { "value": 23, "label": "23:00" } 103 | ] 104 | }, 105 | 106 | { 107 | "label": "每周几执行", 108 | "type": "button-group", 109 | "name": "weekdays", 110 | "size": "md", 111 | "visibleOn": "this.repeat == \"week\"", 112 | "clearable": true, 113 | "multiple": true, 114 | "required": true, 115 | "extractValue": true, 116 | "maxLength": 7, 117 | "options": [ 118 | { 119 | "label": "周一", 120 | "value": "0" 121 | }, 122 | 123 | { 124 | "label": "周二", 125 | "value": "1" 126 | }, 127 | 128 | { 129 | "label": "周三", 130 | "value": "2" 131 | }, 132 | 133 | { 134 | "label": "周四", 135 | "value": "3" 136 | }, 137 | 138 | { 139 | "label": "周五", 140 | "value": "4" 141 | }, 142 | 143 | { 144 | "label": "周六", 145 | "value": "5" 146 | }, 147 | 148 | { 149 | "label": "周日", 150 | "value": "6" 151 | } 152 | ] 153 | }, 154 | 155 | { 156 | "label": "每月几号执行", 157 | "type": "list", 158 | "name": "monthday", 159 | "size": "md", 160 | "visibleOn": "this.repeat == \"month\"", 161 | "required": true, 162 | "maxLength": 31, 163 | "clearable": true, 164 | "multiple": true, 165 | "extractValue": true, 166 | "options": [ 167 | { "value": 0, "label": "01" }, 168 | { "value": 1, "label": "02" }, 169 | { "value": 2, "label": "03" }, 170 | { "value": 3, "label": "04" }, 171 | { "value": 4, "label": "05" }, 172 | { "value": 5, "label": "06" }, 173 | { "value": 6, "label": "07" }, 174 | { "value": 7, "label": "08" }, 175 | { "value": 8, "label": "09" }, 176 | { "value": 9, "label": "10" }, 177 | { "value": 10, "label": "11" }, 178 | { "value": 11, "label": "12" }, 179 | { "value": 12, "label": "13" }, 180 | { "value": 13, "label": "14" }, 181 | { "value": 14, "label": "15" }, 182 | { "value": 15, "label": "16" }, 183 | { "value": 16, "label": "17" }, 184 | { "value": 17, "label": "18" }, 185 | { "value": 18, "label": "19" }, 186 | { "value": 19, "label": "20" }, 187 | { "value": 20, "label": "21" }, 188 | { "value": 21, "label": "22" }, 189 | { "value": 22, "label": "23" }, 190 | { "value": 23, "label": "24" }, 191 | { "value": 24, "label": "25" }, 192 | { "value": 25, "label": "26" }, 193 | { "value": 26, "label": "27" }, 194 | { "value": 27, "label": "28" }, 195 | { "value": 28, "label": "29" }, 196 | { "value": 29, "label": "30" }, 197 | { "value": 30, "label": "31" } 198 | ] 199 | } 200 | ] 201 | }, 202 | 203 | { 204 | "type": "fieldSet", 205 | "title": "其他信息", 206 | "collapsable": true, 207 | "controls": [ 208 | { 209 | "type": "combo", 210 | "name": "admins", 211 | "label": "用户列表", 212 | "value": [""], 213 | "description": "请输入用户信息,不要重复。", 214 | "multiple": true, 215 | "inline": true, 216 | "controls": [ 217 | { 218 | "type": "text", 219 | "name": "name", 220 | "unique": true 221 | }, 222 | 223 | { 224 | "type": "select", 225 | "name": "perm", 226 | "value": "read", 227 | "options": [ 228 | { 229 | "label": "可读", 230 | "value": "read" 231 | }, 232 | 233 | { 234 | "label": "可写", 235 | "value": "write" 236 | } 237 | ] 238 | } 239 | ] 240 | }, 241 | { 242 | "label": "新增一行", 243 | "type": "button", 244 | "actionType": "add", 245 | "target": "thetable", 246 | "level": "info" 247 | }, 248 | { 249 | "name": "thetable", 250 | "type": "table", 251 | "label": "任务参数", 252 | "editable": true, 253 | "addable": true, 254 | "removable": true, 255 | "columns": [ 256 | { 257 | "label": "参数名", 258 | "name": "key", 259 | "quickEdit": true 260 | }, 261 | 262 | { 263 | "label": "参数值", 264 | "name": "value", 265 | "quickEdit": true 266 | } 267 | ] 268 | } 269 | ] 270 | } 271 | ] 272 | } 273 | ] 274 | } 275 | -------------------------------------------------------------------------------- /public/pages/crud-edit.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "修改 ${params.id}", 4 | "remark": null, 5 | "toolbar": [ 6 | { 7 | "type": "button", 8 | "actionType": "link", 9 | "link": "/crud/list", 10 | "label": "返回列表" 11 | } 12 | ], 13 | "body": [ 14 | { 15 | "type": "form", 16 | "initApi": "/api/sample/${params.id}", 17 | "api": "/api/sample/$id", 18 | "redirect": "/crud/list", 19 | "controls": [ 20 | { 21 | "type": "text", 22 | "name": "engine", 23 | "label": "Engine", 24 | "required": true 25 | }, 26 | { 27 | "type": "divider" 28 | }, 29 | { 30 | "type": "text", 31 | "name": "browser", 32 | "label": "Browser", 33 | "required": true 34 | }, 35 | { 36 | "type": "divider" 37 | }, 38 | { 39 | "type": "text", 40 | "name": "platform", 41 | "label": "Platform(s)", 42 | "required": true 43 | }, 44 | { 45 | "type": "divider" 46 | }, 47 | { 48 | "type": "text", 49 | "name": "version", 50 | "label": "Engine version" 51 | }, 52 | { 53 | "type": "divider" 54 | }, 55 | { 56 | "type": "select", 57 | "name": "grade", 58 | "label": "CSS grade", 59 | "options": ["A", "B", "C", "D", "X"] 60 | } 61 | ] 62 | } 63 | ] 64 | } 65 | -------------------------------------------------------------------------------- /public/pages/crud-list.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "列表", 4 | "remark": null, 5 | "name": "page-demo", 6 | "toolbar": [ 7 | { 8 | "type": "button", 9 | "actionType": "link", 10 | "link": "/crud/new", 11 | "label": "新增", 12 | "primary": true 13 | } 14 | ], 15 | "body": [ 16 | { 17 | "type": "crud", 18 | "name": "sample", 19 | "api": "/api/sample", 20 | "filter": { 21 | "title": "", 22 | "mode": "inline", 23 | "wrapWithPanel": false, 24 | "submitText": "", 25 | "controls": [ 26 | { 27 | "type": "text", 28 | "name": "keywords", 29 | "placeholder": "通过关键字搜索", 30 | "addOn": { 31 | "label": "搜索", 32 | "type": "submit", 33 | "className": "btn-success" 34 | }, 35 | "clearable": true 36 | } 37 | ], 38 | "className": "m-b-sm" 39 | }, 40 | "bulkActions": [ 41 | { 42 | "label": "批量修改", 43 | "type": "button", 44 | "actionType": "dialog", 45 | "level": "primary", 46 | "dialog": { 47 | "title": "批量编辑", 48 | "name": "sample-bulk-edit", 49 | "body": { 50 | "type": "form", 51 | "api": "/api/sample/bulkUpdate2", 52 | "controls": [ 53 | { 54 | "type": "text", 55 | "name": "engine", 56 | "label": "Engine" 57 | } 58 | ] 59 | } 60 | } 61 | }, 62 | { 63 | "label": "批量删除", 64 | "type": "button", 65 | "level": "danger", 66 | "actionType": "ajax", 67 | "api": "delete:/api/sample/$ids", 68 | "confirmText": "确定要批量删除?" 69 | } 70 | ], 71 | "columns": [ 72 | { 73 | "name": "engine", 74 | "label": "Rendering engine", 75 | "sortable": true 76 | }, 77 | { 78 | "name": "id", 79 | "label": "ID", 80 | "width": 20, 81 | "sortable": true 82 | }, 83 | { 84 | "name": "browser", 85 | "label": "Browser", 86 | "sortable": true 87 | }, 88 | { 89 | "name": "platform", 90 | "label": "Platform(s)", 91 | "sortable": true 92 | }, 93 | { 94 | "name": "version", 95 | "label": "Engine version" 96 | }, 97 | { 98 | "name": "grade", 99 | "label": "CSS grade" 100 | }, 101 | { 102 | "type": "operation", 103 | "label": "操作", 104 | "width": "", 105 | "buttons": [ 106 | { 107 | "type": "button-group", 108 | "buttons": [ 109 | { 110 | "type": "button", 111 | "label": "查看", 112 | "level": "primary", 113 | "actionType": "link", 114 | "link": "/crud/${id}" 115 | }, 116 | { 117 | "type": "button", 118 | "label": "修改", 119 | "level": "info", 120 | "actionType": "link", 121 | "link": "/crud/${id}/edit" 122 | }, 123 | { 124 | "type": "button", 125 | "label": "删除", 126 | "level": "danger", 127 | "actionType": "ajax", 128 | "confirmText": "您确认要删除?", 129 | "api": "delete:/api/sample/$id" 130 | } 131 | ] 132 | } 133 | ], 134 | "placeholder": "-", 135 | "fixed": "right" 136 | } 137 | ], 138 | "affixHeader": true, 139 | "columnsTogglable": "auto", 140 | "placeholder": "暂无数据", 141 | "tableClassName": "table-db table-striped", 142 | "headerClassName": "crud-table-header", 143 | "footerClassName": "crud-table-footer", 144 | "toolbarClassName": "crud-table-toolbar", 145 | "combineNum": 0, 146 | "bodyClassName": "panel-default" 147 | } 148 | ] 149 | } 150 | -------------------------------------------------------------------------------- /public/pages/crud-new.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "新增", 4 | "remark": null, 5 | "toolbar": [ 6 | { 7 | "type": "button", 8 | "actionType": "link", 9 | "link": "/crud/list", 10 | "label": "返回列表" 11 | } 12 | ], 13 | "body": [ 14 | { 15 | "title": "", 16 | "type": "form", 17 | "redirect": "/crud/list", 18 | "name": "sample-edit-form", 19 | "api": "/api/sample", 20 | "controls": [ 21 | { 22 | "type": "text", 23 | "name": "engine", 24 | "label": "Engine", 25 | "required": true, 26 | "inline": false, 27 | "description": "", 28 | "descriptionClassName": "help-block", 29 | "placeholder": "", 30 | "addOn": null 31 | }, 32 | { 33 | "type": "divider" 34 | }, 35 | { 36 | "type": "text", 37 | "name": "browser", 38 | "label": "Browser", 39 | "required": true 40 | }, 41 | { 42 | "type": "divider" 43 | }, 44 | { 45 | "type": "text", 46 | "name": "platform", 47 | "label": "Platform(s)", 48 | "required": true 49 | }, 50 | { 51 | "type": "divider" 52 | }, 53 | { 54 | "type": "text", 55 | "name": "version", 56 | "label": "Engine version" 57 | }, 58 | { 59 | "type": "divider" 60 | }, 61 | { 62 | "type": "text", 63 | "name": "grade", 64 | "label": "CSS grade" 65 | } 66 | ] 67 | } 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /public/pages/crud-view.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "查看详情 ${params.id}", 4 | "remark": null, 5 | "toolbar": [ 6 | { 7 | "type": "button", 8 | "actionType": "link", 9 | "link": "/crud/list", 10 | "label": "返回列表" 11 | } 12 | ], 13 | "body": [ 14 | { 15 | "type": "form", 16 | "initApi": "/api/sample/${params.id}", 17 | "controls": [ 18 | { 19 | "type": "static", 20 | "name": "engine", 21 | "label": "Engine" 22 | }, 23 | { 24 | "type": "divider" 25 | }, 26 | { 27 | "type": "static", 28 | "name": "browser", 29 | "label": "Browser" 30 | }, 31 | { 32 | "type": "divider" 33 | }, 34 | { 35 | "type": "static", 36 | "name": "platform", 37 | "label": "Platform(s)" 38 | }, 39 | { 40 | "type": "divider" 41 | }, 42 | { 43 | "type": "static", 44 | "name": "version", 45 | "label": "Engine version" 46 | }, 47 | { 48 | "type": "divider" 49 | }, 50 | { 51 | "type": "static", 52 | "name": "grade", 53 | "label": "CSS grade" 54 | }, 55 | { 56 | "type": "divider" 57 | }, 58 | { 59 | "type": "html", 60 | "html": "

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

" 61 | } 62 | ] 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /public/pages/editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "代码编辑器", 4 | "subTitle": "使用的monaco-editor,用到了 worker, 如果控制台没有报错,说明一起正常。", 5 | "body": [ 6 | { 7 | "type": "form", 8 | "controls": [ 9 | { 10 | "type": "editor", 11 | "name": "js", 12 | "label": "Javascript", 13 | "size": "md" 14 | } 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /public/pages/form-basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "基础表单", 4 | "subTitle": "展示一些常规的表单,包括验证、提示等等", 5 | "body": [ 6 | { 7 | "type": "form", 8 | "mode": "horizontal", 9 | "title": "常规表单示例", 10 | "affixFooter": true, 11 | "api": "/api/form/save", 12 | "actions": [ 13 | { 14 | "label": "保存", 15 | "type": "submit", 16 | "level": "success" 17 | } 18 | ], 19 | "controls": [ 20 | { 21 | "label": " 标题", 22 | "type": "text", 23 | "placeholder": "请输入标题", 24 | "description": "请输入一个能吸引眼球的标题", 25 | "name": "title", 26 | "size": "md" 27 | }, 28 | 29 | { 30 | "label": "编号", 31 | "required": true, 32 | "type": "text", 33 | "placeholder": "请输入编号", 34 | "name": "b", 35 | "size": "md", 36 | "validations": { 37 | "matchRegexp": "/^\\w{4}-\\w{4}-\\w{4}$/" 38 | }, 39 | "validationErrors": { 40 | "matchRegexp": "您输入的内容格式不对,请按提示输入!" 41 | }, 42 | "hint": "输入范例:xxxx-xxxx-xxxx" 43 | }, 44 | 45 | { 46 | "label": "置顶", 47 | "type": "switch", 48 | "name": "c", 49 | "inline": true, 50 | "labelRemark": "开启后将置顶这条数据!" 51 | }, 52 | 53 | { 54 | "label": "活动时间", 55 | "type": "date-range", 56 | "name": "range", 57 | "size": "md", 58 | "remark": "这是一个字段时间范围" 59 | }, 60 | 61 | { 62 | "label": "日期范围", 63 | "type": "group", 64 | "controls": [ 65 | { 66 | "type": "date", 67 | "size": "md", 68 | "name": "start", 69 | "mode": "inline", 70 | "maxDate": "${end}" 71 | }, 72 | 73 | { 74 | "label": "到", 75 | "type": "date", 76 | "size": "md", 77 | "name": "end", 78 | "inputClassName": "m-l-sm", 79 | "mode": "inline", 80 | "minDate": "${start}", 81 | "remark": "这是两个字段的时间范围" 82 | } 83 | ] 84 | }, 85 | 86 | { 87 | "label": "浏览器", 88 | "type": "button-group", 89 | "name": "browser", 90 | "value": "chrome", 91 | "options": [ 92 | { 93 | "label": "Chrome", 94 | "value": "chrome" 95 | }, 96 | 97 | { 98 | "label": "火狐", 99 | "value": "firefox" 100 | }, 101 | 102 | { 103 | "label": "IE", 104 | "value": "ie" 105 | } 106 | ] 107 | }, 108 | 109 | { 110 | "type": "list", 111 | "name": "taocan", 112 | "label": "套餐选择", 113 | "options": [ 114 | { 115 | "value": 1, 116 | "body": "
套餐:C01
CPU:2核
内存:1GB
SSD盘:10GB
" 117 | }, 118 | { 119 | "value": 2, 120 | "body": "
套餐:C02
CPU:4核
内存:4GB
SSD盘:20GB
" 121 | }, 122 | { 123 | "value": 3, 124 | "disabled": true, 125 | "body": "
套餐:C03
CPU:8核
内存:8GB
SSD盘:50GB
" 126 | } 127 | ] 128 | }, 129 | 130 | { 131 | "label": "最爱周几", 132 | "type": "select", 133 | "name": "select", 134 | "size": "md", 135 | "clearable": true, 136 | "options": [ 137 | { 138 | "label": "周一", 139 | "value": "0" 140 | }, 141 | 142 | { 143 | "label": "周二", 144 | "value": "1" 145 | }, 146 | 147 | { 148 | "label": "周三", 149 | "value": "2" 150 | }, 151 | 152 | { 153 | "label": "周四", 154 | "value": "3" 155 | }, 156 | 157 | { 158 | "label": "周五", 159 | "value": "4" 160 | }, 161 | 162 | { 163 | "label": "周六", 164 | "value": "5" 165 | }, 166 | 167 | { 168 | "label": "周日", 169 | "value": "6" 170 | } 171 | ] 172 | }, 173 | 174 | { 175 | "label": "休息日", 176 | "type": "list", 177 | "name": "freeday", 178 | "value": ["5", "6"], 179 | "multiple": true, 180 | "extractValue": true, 181 | "options": [ 182 | { 183 | "label": "周一", 184 | "value": "0" 185 | }, 186 | 187 | { 188 | "label": "周二", 189 | "value": "1" 190 | }, 191 | 192 | { 193 | "label": "周三", 194 | "value": "2" 195 | }, 196 | 197 | { 198 | "label": "周四", 199 | "value": "3" 200 | }, 201 | 202 | { 203 | "label": "周五", 204 | "value": "4" 205 | }, 206 | 207 | { 208 | "label": "周六", 209 | "value": "5" 210 | }, 211 | 212 | { 213 | "label": "周日", 214 | "value": "6" 215 | } 216 | ] 217 | }, 218 | 219 | { 220 | "label": "人数", 221 | "type": "number", 222 | "name": "num", 223 | "size": "md", 224 | "value": 10 225 | }, 226 | 227 | { 228 | "label": "比率", 229 | "type": "range", 230 | "name": "percent" 231 | }, 232 | 233 | { 234 | "label": "简介", 235 | "type": "textarea", 236 | "name": "textarea" 237 | } 238 | ] 239 | } 240 | ] 241 | } 242 | -------------------------------------------------------------------------------- /public/pages/site.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": 0, 3 | "msg": "", 4 | "data": { 5 | "pages": [ 6 | { 7 | "label": "Home", 8 | "url": "/", 9 | "redirect": "/index/1" 10 | }, 11 | { 12 | "label": "示例", 13 | "children": [ 14 | { 15 | "label": "页面A", 16 | "url": "index", 17 | "schema": { 18 | "type": "page", 19 | "title": "页面A", 20 | "body": "页面A" 21 | }, 22 | "children": [ 23 | { 24 | "label": "页面A-1", 25 | "url": "1", 26 | "schema": { 27 | "type": "page", 28 | "title": "页面A-1", 29 | "body": "页面A-1" 30 | } 31 | }, 32 | { 33 | "label": "页面A-2", 34 | "url": "2", 35 | "schema": { 36 | "type": "page", 37 | "title": "页面A-2", 38 | "body": "页面A-2" 39 | } 40 | }, 41 | { 42 | "label": "页面A-3", 43 | "url": "3", 44 | "schema": { 45 | "type": "page", 46 | "title": "页面A-3", 47 | "body": "页面A-3" 48 | } 49 | } 50 | ] 51 | }, 52 | { 53 | "label": "页面B", 54 | "schema": { 55 | "type": "page", 56 | "title": "页面B", 57 | "body": "页面B" 58 | } 59 | }, 60 | { 61 | "label": "页面C", 62 | "schema": { 63 | "type": "page", 64 | "title": "页面C", 65 | "body": "页面C" 66 | } 67 | }, 68 | { 69 | "label": "列表示例", 70 | "url": "/crud", 71 | "rewrite": "/crud/list", 72 | "icon": "fa fa-cube", 73 | "children": [ 74 | { 75 | "label": "列表", 76 | "url": "/crud/list", 77 | "icon": "fa fa-list", 78 | "schemaApi": "get:/pages/crud-list.json" 79 | }, 80 | { 81 | "label": "新增", 82 | "url": "/crud/new", 83 | "icon": "fa fa-plus", 84 | "schemaApi": "get:/pages/crud-new.json" 85 | }, 86 | { 87 | "label": "查看", 88 | "url": "/crud/:id", 89 | "schemaApi": "get:/pages/crud-view.json" 90 | }, 91 | { 92 | "label": "修改", 93 | "url": "/crud/:id/edit", 94 | "schemaApi": "get:/pages/crud-edit.json" 95 | } 96 | ] 97 | } 98 | ] 99 | }, 100 | { 101 | "label": "分组2", 102 | "children": [ 103 | { 104 | "label": "用户管理", 105 | "schema": { 106 | "type": "page", 107 | "title": "用户管理", 108 | "body": "页面C" 109 | } 110 | }, 111 | { 112 | "label": "外部链接", 113 | "link": "http://baidu.gitee.io/amis" 114 | }, 115 | { 116 | "label": "部门管理", 117 | "schemaApi": "/api/mock2/service/form?tpl=tpl3" 118 | } 119 | ] 120 | } 121 | ] 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /public/pages/wizard.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "page", 3 | "title": "表单向导", 4 | "subTitle": "可以通过表单向导,将一个超长的表单页面拆分成多个步骤,一步一步指引用户完成。", 5 | "body": [ 6 | { 7 | "type": "wizard", 8 | "actionFinishLabel": "确认", 9 | "api": "/api/saveWizard", 10 | "steps": [ 11 | { 12 | "title": "填写活动信息", 13 | "controls": [ 14 | { 15 | "type": "text", 16 | "name": "title", 17 | "label": "活动标题", 18 | "required": true, 19 | "size": "md" 20 | }, 21 | 22 | { 23 | "type": "date", 24 | "name": "date", 25 | "label": "举办时间", 26 | "size": "md" 27 | }, 28 | 29 | { 30 | "type": "number", 31 | "name": "num", 32 | "label": "参与人数", 33 | "value": 10, 34 | "size": "md" 35 | } 36 | ] 37 | }, 38 | 39 | { 40 | "title": "填写赞助商信息", 41 | "controls": [ 42 | { 43 | "type": "text", 44 | "name": "company", 45 | "label": "公司名称", 46 | "required": true, 47 | "size": "md" 48 | }, 49 | 50 | { 51 | "type": "text", 52 | "name": "money", 53 | "label": "赞助金额", 54 | "addOn": { 55 | "type": "text", 56 | "label": "¥" 57 | }, 58 | "size": "md" 59 | } 60 | ] 61 | }, 62 | 63 | { 64 | "title": "确认", 65 | "mode": "horizontal", 66 | "horizontal": { 67 | "leftFixed": "sm" 68 | }, 69 | "controls": [ 70 | { 71 | "type": "static", 72 | "name": "company", 73 | "label": "活动标题", 74 | "labelClassName": "text-muted" 75 | }, 76 | { 77 | "type": "static-date", 78 | "name": "date", 79 | "label": "举办时间", 80 | "labelClassName": "text-muted" 81 | }, 82 | { 83 | "type": "static", 84 | "name": "num", 85 | "label": "参与人数", 86 | "labelClassName": "text-muted" 87 | }, 88 | { 89 | "type": "static", 90 | "name": "company", 91 | "label": "公司名称", 92 | "labelClassName": "text-muted" 93 | }, 94 | { 95 | "type": "static", 96 | "name": "money", 97 | "label": "赞助金额", 98 | "labelClassName": "text-muted" 99 | } 100 | ] 101 | } 102 | ] 103 | } 104 | ] 105 | } 106 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 23 | 24 | 39 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softice70/amis-admin-demo-vue/e4373643522c8bf0ca0f761d36c03e5273d811b5/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/amis-demo/AmisDemo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 31 | -------------------------------------------------------------------------------- /src/components/amis/AMisRenderer.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 170 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import 'font-awesome/css/font-awesome.css'; 4 | import 'bootstrap/dist/css/bootstrap.css'; 5 | import 'amis/lib/themes/default.css'; 6 | import 'amis/lib/helper.css'; 7 | 8 | Vue.config.productionTip = false 9 | 10 | new Vue({ 11 | render: h => h(App), 12 | }).$mount('#app') 13 | --------------------------------------------------------------------------------