From 2a85a2900bc21b121917f49eb70da8a691259f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E9=B2=81=E7=8F=AD?= Date: Fri, 3 Jan 2020 11:42:33 +0800 Subject: [PATCH 1/5] Update block.md --- docs/zh-CN/api/block.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/zh-CN/api/block.md b/docs/zh-CN/api/block.md index d862237c..bc5eecde 100644 --- a/docs/zh-CN/api/block.md +++ b/docs/zh-CN/api/block.md @@ -30,6 +30,12 @@ ams.block('formView', { 以上注册了 `formView` block ## 使用 block +> 注意:如果在 template 中使用 ``,需要先在 `main.js` 中安装 `ams`,引入 ams 中的区块和字段。文档参见[通过npm安装](https://vipshop.github.io/ams/api/#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F) + +```js +import ams from '@ams-team/ams'; +Vue.use(ams); // 类似 Vue.use(element-ui); +``` 每个block本质都是[Vue组件](https://cn.vuejs.org/v2/guide/components-registration.html),可以通过区块名 `name` 来引用:``,完整示例如下: From c0f4a2b8094b1f13465d06c6e38404e8c610df94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E9=B2=81=E7=8F=AD?= Date: Mon, 6 Jan 2020 13:40:40 +0800 Subject: [PATCH 2/5] docs: update table.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加关于固定列的补充说明 --- docs/zh-CN/block/table.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/zh-CN/block/table.md b/docs/zh-CN/block/table.md index 3ce54546..e90dc2fd 100644 --- a/docs/zh-CN/block/table.md +++ b/docs/zh-CN/block/table.md @@ -36,6 +36,7 @@ export interface FormBlock { ``` ### 配置 +> 补充:如果需要实现固定列需求,请参见:[设置固定列](https://github.com/vipshop/ams/issues/101) 可用配置项表 | 参数 | 类型 | 是否必填 | 说明 From 727d69214da5ae11ca364c24a232141da459dc03 Mon Sep 17 00:00:00 2001 From: "jun85.li" Date: Sat, 11 Jan 2020 00:06:33 +0800 Subject: [PATCH 3/5] feat: 0.24.0 --- .gitignore | 1 + README.md | 6 + .../.vuepress/components/api/icon/list.vue | 2 +- .../components/block/drawer/block.js | 4 + .../.vuepress/components/block/list/block.js | 10 +- .../components/block/router/block.js | 8 - .../components/block/router/demo.vue | 7 +- .../.vuepress/components/block/steps/block.js | 70 +++++ .../components/field/button/block.js | 9 +- .../.vuepress/components/field/html/block.js | 64 +++++ .../.vuepress/components/field/html/demo.vue | 40 +++ docs/zh-CN/.vuepress/config.js | 7 +- docs/zh-CN/api/README.md | 2 + docs/zh-CN/api/ams-ams.md | 23 +- docs/zh-CN/block/list.md | 2 +- docs/zh-CN/block/steps.md | 6 + docs/zh-CN/field/get-set-view.md | 12 + docs/zh-CN/field/html.md | 24 ++ examples/README.md | 5 - .../src/ams-config/cases-block/backtop.js | 4 +- .../src/ams-config/cases-block/carousel.js | 10 +- .../src/ams-config/cases-block/component.js | 4 +- .../src/ams-config/cases-block/dragimage.js | 2 +- .../src/ams-config/cases-block/drawer.js | 2 +- .../src/ams-config/cases-block/dropdown.js | 32 +-- .../form-edit.js => cases-block/form/edit.js} | 11 +- .../form-view.js => cases-block/form/view.js} | 6 +- .../router/src/ams-config/cases-block/grid.js | 248 +++++++++--------- .../cases-block/{ => imagelist}/imagelist.js | 8 +- .../cases-block/{ => imagelist}/imagelist2.js | 0 .../{form => cases-block/list}/list-drag.js | 31 ++- .../{form => cases-block/list}/list-edit.js | 102 +++---- .../{form => cases-block/list}/list-layout.js | 14 +- .../list}/list-operations.js | 0 .../list}/list-pagination.js | 20 +- .../{form => cases-block/list}/list.js | 10 +- .../src/ams-config/cases-block/popover.js | 24 +- .../src/ams-config/cases-block/steps.js | 16 +- .../ams-config/{form => cases-block}/table.js | 2 +- .../router/src/ams-config/cases-block/tabs.js | 44 ++-- .../src/ams-config/cases-field/arraylist.js | 26 +- .../src/ams-config/cases-field/cascader.js | 68 ++--- .../src/ams-config/cases-field/editor.js | 4 +- .../src/ams-config/cases-field/image.js | 8 +- .../src/ams-config/cases-field/input.js | 6 +- .../router/src/ams-config/cases-field/link.js | 6 +- .../src/ams-config/cases-field/originfile.js | 2 +- .../src/ams-config/cases-field/plan-date.js | 8 +- .../src/ams-config/cases-field/select.js | 9 - .../router/src/ams-config/cases-field/tree.js | 16 +- .../src/ams-config/cases-field/union.js | 6 +- .../src/ams-config/cases-field/unitselect.js | 4 +- .../src/ams-config/cases-sence/admin.js | 20 +- .../ams-config/cases-sence/array-object.js | 36 ++- .../{ => cases-sence}/cases-chart/demo1.js | 18 +- .../{ => cases-sence}/cases-chart/demo2.js | 0 .../ams-config/cases-sence/get-set-view.js | 14 +- .../src/ams-config/cases-sence/login-auth.js | 9 - .../ams-config/cases-sence/outside-website.js | 2 +- .../src/ams-config/cases-sence/remote-oa.js | 8 +- examples/router/src/ams-config/form/index.js | 25 +- examples/router/src/ams-config/index.js | 31 +-- examples/router/src/ams-config/login.js | 16 +- examples/router/src/ams-config/router.js | 56 +++- examples/router/src/utils/index.js | 1 + lib/AMS_CONFIG.js | 1 - lib/ams.common.js | 1 - lib/ams.js | 6 - lib/theme-default/iconfont.850af70.svg | 80 ------ lib/theme-vipshop/base.css | 1 - lib/theme-vipshop/fonts/element-icons.ttf | Bin 55956 -> 0 bytes lib/theme-vipshop/fonts/element-icons.woff | Bin 28200 -> 0 bytes lib/theme-vipshop/index.css | 1 - lib/theme-vipshop/router.css | 1 - package.json | 2 +- packages/ams-cli/package.json | 2 +- packages/ams-cli/template/dev/app.js | 4 +- packages/ams-cli/template/npm/src/main.js | 4 +- .../ams-cli/template/npmComplete/package.json | 1 - .../src/ams-config/resources/resource.js | 3 +- .../npmComplete/src/ams-config/router.js | 63 ++--- .../ams-cli/template/npmComplete/src/main.js | 6 +- .../src/ams-config/resources/resource.js | 3 +- .../template/npmFull/src/ams-config/router.js | 18 +- packages/ams-cli/template/npmFull/src/main.js | 4 +- src/ams/configs/field-get-set.js | 2 +- src/ams/mixins/block-mixin.js | 11 +- src/ams/mixins/field-view-mixin.js | 2 +- src/blocks/block/operations.vue | 4 +- src/blocks/list/list.vue | 9 +- src/blocks/steps/steps.vue | 20 +- src/components/field.vue | 18 +- src/fields/array/array-edit.vue | 1 + src/fields/html/__config__/ams.config.js | 15 ++ src/fields/html/__config__/default.example.js | 1 + src/fields/html/html.vue | 15 ++ src/fields/html/index.js | 9 + src/fields/image/image-edit.vue | 7 +- src/index.js | 4 +- src/theme-default/fonts/iconfont.css | 19 +- src/theme-default/fonts/iconfont.eot | Bin 6344 -> 7720 bytes src/theme-default/fonts/iconfont.svg | 21 ++ src/theme-default/fonts/iconfont.ttf | Bin 6164 -> 7540 bytes src/theme-default/fonts/iconfont.woff | Bin 4096 -> 5100 bytes src/theme-default/fonts/iconfont.woff2 | Bin 3420 -> 4268 bytes src/utils/index.js | 1 + src/utils/tools.js | 63 +++++ 107 files changed, 1035 insertions(+), 679 deletions(-) create mode 100644 docs/zh-CN/.vuepress/components/field/html/block.js create mode 100644 docs/zh-CN/.vuepress/components/field/html/demo.vue create mode 100644 docs/zh-CN/field/html.md rename examples/router/src/ams-config/{form/form-edit.js => cases-block/form/edit.js} (94%) rename examples/router/src/ams-config/{form/form-view.js => cases-block/form/view.js} (99%) rename examples/router/src/ams-config/cases-block/{ => imagelist}/imagelist.js (98%) rename examples/router/src/ams-config/cases-block/{ => imagelist}/imagelist2.js (100%) rename examples/router/src/ams-config/{form => cases-block/list}/list-drag.js (77%) rename examples/router/src/ams-config/{form => cases-block/list}/list-edit.js (74%) rename examples/router/src/ams-config/{form => cases-block/list}/list-layout.js (94%) rename examples/router/src/ams-config/{form => cases-block/list}/list-operations.js (100%) rename examples/router/src/ams-config/{form => cases-block/list}/list-pagination.js (89%) rename examples/router/src/ams-config/{form => cases-block/list}/list.js (98%) rename examples/router/src/ams-config/{form => cases-block}/table.js (100%) rename examples/router/src/ams-config/{ => cases-sence}/cases-chart/demo1.js (96%) rename examples/router/src/ams-config/{ => cases-sence}/cases-chart/demo2.js (100%) delete mode 100644 lib/AMS_CONFIG.js delete mode 100644 lib/ams.common.js delete mode 100644 lib/ams.js delete mode 100644 lib/theme-default/iconfont.850af70.svg delete mode 100644 lib/theme-vipshop/base.css delete mode 100644 lib/theme-vipshop/fonts/element-icons.ttf delete mode 100644 lib/theme-vipshop/fonts/element-icons.woff delete mode 100644 lib/theme-vipshop/index.css delete mode 100644 lib/theme-vipshop/router.css create mode 100644 src/fields/html/__config__/ams.config.js create mode 100644 src/fields/html/__config__/default.example.js create mode 100644 src/fields/html/html.vue create mode 100644 src/fields/html/index.js create mode 100644 src/utils/tools.js diff --git a/.gitignore b/.gitignore index 828bbc1f..cd210a03 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ package-lock.json *.sln /dist +/lib /docs/dist /packages/*/lib /material-list.json diff --git a/README.md b/README.md index 1fc10f91..96ac8a8e 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,12 @@ ams.render('demo') 尝试AMS的最简单的方式是使用[JSRUN上的官方入门Demo](http://jsrun.net/sehKp/edit?utm_source=website)。你可以在浏览器新标签页中打开它,跟着例子学习一些基础用法。 +### packages本地开发调试 + +``` +npm run dev +``` + ## 相关链接 - [文档与教程](https://vipshop.github.io/ams/) diff --git a/docs/zh-CN/.vuepress/components/api/icon/list.vue b/docs/zh-CN/.vuepress/components/api/icon/list.vue index 46f4bdb4..aa7a9638 100644 --- a/docs/zh-CN/.vuepress/components/api/icon/list.vue +++ b/docs/zh-CN/.vuepress/components/api/icon/list.vue @@ -14,7 +14,7 @@ export default { return { icons: [ 'user', 'woman', 'man', 'question', 'watcher', 'advocate', 'fold', 'crown', 'heart', 'brick', 'dashboard', - 'portrait', 'brand-equity', 'crowd-manage', 'account-sales', 'help-center', 'data-report', 'customer-operation' + 'portrait', 'brand-equity', 'crowd-manage', 'account-sales', 'help-center', 'data-report', 'customer-operation', 'code' ] } }, diff --git a/docs/zh-CN/.vuepress/components/block/drawer/block.js b/docs/zh-CN/.vuepress/components/block/drawer/block.js index 2f6c255d..8e063f60 100644 --- a/docs/zh-CN/.vuepress/components/block/drawer/block.js +++ b/docs/zh-CN/.vuepress/components/block/drawer/block.js @@ -15,6 +15,7 @@ export default { title: '我是标题' }, props: { + 'append-to-body': true, 'before-close': function(done){ this.$confirm('确认关闭?') .then(_ => { @@ -65,6 +66,9 @@ export default { blocks: { adminDrawer: { type: 'drawer', + props: { + 'append-to-body': true + }, data: { title: '添加' }, diff --git a/docs/zh-CN/.vuepress/components/block/list/block.js b/docs/zh-CN/.vuepress/components/block/list/block.js index 2817577c..7835e787 100644 --- a/docs/zh-CN/.vuepress/components/block/list/block.js +++ b/docs/zh-CN/.vuepress/components/block/list/block.js @@ -980,7 +980,11 @@ export default { }, testText: { type: "text", - label: "名称" + label: "名称", + props: { + // 实现名称字段拖拽 + 'class-name': 'drag-column' + } }, testTextarea: { type: "textarea", @@ -997,7 +1001,9 @@ export default { } }, options: { - drag: true + drag: true, + // 隐藏拖拽icon + // showDragIcon: false }, on: { 'drag-start': function({ oldIndex }) { diff --git a/docs/zh-CN/.vuepress/components/block/router/block.js b/docs/zh-CN/.vuepress/components/block/router/block.js index bbdf8082..8409dbbb 100644 --- a/docs/zh-CN/.vuepress/components/block/router/block.js +++ b/docs/zh-CN/.vuepress/components/block/router/block.js @@ -216,14 +216,6 @@ export default { }, slot: 'menuTop' }, - navRouterLeft: { - slot: 'nav-left', - type: 'component', - options: { - is: 'div', - text: '导航左侧插槽' - } - }, navRouterTitle: { "type": "component", "options": { diff --git a/docs/zh-CN/.vuepress/components/block/router/demo.vue b/docs/zh-CN/.vuepress/components/block/router/demo.vue index ea4f0188..6fad540f 100644 --- a/docs/zh-CN/.vuepress/components/block/router/demo.vue +++ b/docs/zh-CN/.vuepress/components/block/router/demo.vue @@ -1,5 +1,5 @@