Skip to content

Commit

Permalink
Merge pull request #118 from vipshop/develop
Browse files Browse the repository at this point in the history
feat: 0.25.17
  • Loading branch information
wuzebin authored Jun 11, 2020
2 parents 23a547a + 9985e51 commit 16e8387
Show file tree
Hide file tree
Showing 51 changed files with 1,924 additions and 117 deletions.
3 changes: 3 additions & 0 deletions build/bin/prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ let path = require('path');
// let readlineSync = require('readline-sync');
const { execSync } = require('child_process');

// 先拉远程更新
execSync('git pull');

let indexPath = path.resolve(__dirname, '../../src/index.js');
let indexFile = fs.readFileSync(indexPath, 'utf8');
let pkg = require('../../package.json');
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"private": true,
"dependencies": {
"@ams-team/ams": "^0.24.0",
"@ams-team/ams": "latest",
"@ams-team/block-ams-config": "latest",
"@ams-team/block-chart": "latest",
"@ams-team/json-stringify": "latest",
Expand Down
100 changes: 100 additions & 0 deletions docs/zh-CN/.vuepress/components/block/tree/block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
export default {
defaultTree: {
resources: {
tree: {
fields: {
tree: {
type: 'tree',
label: '树',
props: {
options: [{
value: 1,
label: '一级 1',
children: [{
value: 4,
label: '二级 1-1',
children: [{
value: 9,
label: '三级 1-1-1',
children: [{
value: 91,
label: '四级 1-1-1-1'
}, {
value: 92,
label: '四级 1-1-1-2'
}]
}, {
value: 10,
label: '三级 1-1-2'
}]
}]
}, {
value: 2,
label: '一级 2',
children: [{
value: 5,
label: '二级 2-1'
}, {
value: 6,
label: '二级 2-2'
}]
}, {
value: 3,
label: '一级 3',
children: [{
value: 7,
label: '二级 3-1'
}, {
value: 8,
label: '二级 3-2'
}]
}]
}
}
}
}
},
blocks: {
treeView: {
ctx: 'view',
type: 'form',
resource: 'tree',
fields: {
tree: {
label: '树预览'
}
},
data: {
tree: '91,7'
}
},
treeEdit: {
ctx: 'edit',
type: 'form',
resource: 'tree',
fields: {
tree: {
props: {
// 'default-expand-all': true,
'show-checkbox': true
},
on: {
'check-change'(data, checked, indeterminate) {
console.log('hhhhh', data, checked, indeterminate);
}
},
label: '树编辑'
}
},
data: {
tree: '91,7'
},
actions: {
fieldChange: function ({ value, path }) {
console.log('fieldChange', value, path);
}
}
},
}
}
}
40 changes: 40 additions & 0 deletions docs/zh-CN/.vuepress/components/block/tree/demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<el-card shadow="hover" class="demo demo-card">
<ams-block v-if="init" :name="blockName" class="demo-card-preview"/>
<div :class="`demo-card-config ${showConfig ? 'open': ''}`">
<highlight-code lang="javascript">
{{ configCode }}
</highlight-code>
</div>
<div class="demo-card-config-btn" @click="toggleDemoCofig">
<i :class="`el-icon-caret-${showConfig ? 'top': 'bottom'}`"></i>
{{ showConfig ? '隐藏' : '显示'}}配置
<el-link v-if="onlineDemo" :href="onlineDemo" target="_blank" type="success">在线运行</el-link>
</div>
</el-card>
</template>

<script>
import demoMixins from '../../demo/demo-mixin'
import block from './block'
import stringify from '@ams-team/json-stringify'
import beautify from 'js-beautify'
export default {
mixins: [demoMixins],
mounted(){
const stringConfig = stringify(block[this.blockName])
this.configCode = beautify(stringConfig, { indent_size: 2, space_in_empty_paren: true })
// 如果已经注册过则不再注册
if (ams && ams.blocks && ams.blocks[this.blockName]) {
this.init = true;
return;
}
ams.block(this.blockName, block[this.blockName])
this.init = true
}
}
</script>
79 changes: 79 additions & 0 deletions docs/zh-CN/.vuepress/components/changelog/logs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,84 @@
// 更新日志
export default [
{
version: '0.25.13',
date: '2020.06.05',
log: [
'feat: 内置的action支持配置path/method/successCode/transform',
'feat: resource增加method的配置',
'feat: table组件支持配置data.layout',
'feat: changeConfig增加第三个参数透传this',
'feat: router增加showTimeout配置',
'fix: 修复block-xlsx当code不等于0,msg不为array的情况',
'feat: [email protected],导入的request支持withCredentials、contentType、headers、successCode的配置',
'fix: list组件的列支持配置min-width',
'feat: text-view增加suffix-icon配置',
'fix: options选项多时的popover交互修改'
]
},
{
version: '0.24.22',
date: '2020.04.23',
log: [
'feat: 更新字体图标',
'feat: field-iamge的successCode支持porps配置',
'feat: 增加列表配置项enterkey-search,配置为true时阻止列表搜索栏的回车搜索事件。场景:某些field类型为textarea时,默认回车时会发起搜索',
'feat: block的配置增加水印功能',
'feat: 通过ams-cli初始化的项目默认使用vishop的主题',
'fixed: block-steps支持description和props',
'fixed: datetime和datetime选择1970年部分月份时,值置空问题',
'fixed: field-array的删除按钮层级问题,',
'feat: field.info支持object配置,可以配置icon类型;',
'feat: 默认的几个action增加成功回调逻辑',
'feat:列表区块,改变页妈和页数时,增加on事件',
'feat: block-title增加append的slot插槽;',
'feat: 增加block-popover文档',
'feat: field-audio、field-image、field-video支持成功回调(on-success)和失败回调(on-error)',
'feat:支持所有block调用@show@hide进行显隐操作',
'feat: field-audio、field-video和field-file支持通过props配置successCode',
'fix: SELECT_REMOTE里的remoteMethod,在判断successCode是否配置的bug',
'fix:补充field的默认参数的时候,不覆盖默认参数',
'fix: 修复block-list的hidden失效',
'fix:字段类型为select,对外使用的view钩子中,加上context的参数',
"fix: block-list的options.operationsWidth改成props['operations-width']",
'fix:checkbox等进行全选操作时,加上change回调',
'feat: [email protected]:模板增加打包配置css.extract,解决打包后样式覆盖问题;npmComplete模板,修复全局结果拦截器responseInterceptor的返回promise的bug',
'feat: block-form支持配置label加粗样式;field-file、field-audio、field-video的上传按钮支持disabled属性配置',
'feat: 给array字段增加sortable配置,默认为true',
'feat: 区块table增加索引配置',
'fix: 修复编辑态的列表block在前端分页情况下,path路径问题',
'fix: 修复parseTime中时间格式化异常'
]
},
{
version: '0.23.5',
date: '2020.01.08',
log: [
'feat: field增加html渲染字段',
'feat: 列表字段添加desc属性',
'fix: 修复导入获取rows的范围',
'feat: 文档增加自助仪表盘入口',
'feat: docs增加ams-helper介绍',
'fix: 修复datetime和datetime选择1970年部分月份时,值变空问题',
'feat: 更新字体图标,增加ams-icon-code',
'feat: block-steps支持description和props',
'fix: 修复field-array的删除按钮层级问题',
'feat: field-image的successCode支持props定义'
]
},
{
version: '0.22.9',
date: '2019.12.14',
log: [
'feat: text的view组件添加on事件',
'feat: theme-vipshop主题修改',
'feat: block-list的操作按钮context增加数据index',
'feat: block-imagelist增加显示角标信息',
'feat: 添加nav-left插槽',
'feat: 新增drawer抽屉block',
'feat: array-simple数据更换'
]
},
{
version: '0.21.6',
date: '2019.12.3',
Expand Down
3 changes: 2 additions & 1 deletion docs/zh-CN/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ module.exports = {
'steps',
'card',
'dropdown',
'popover'
'popover',
'tree'
]
},
{
Expand Down
4 changes: 0 additions & 4 deletions docs/zh-CN/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
npm i -g @ams-team/cli
```

安装成功后打印`ams`命令可以看到有以下几种使用方式

![install](../assets/cli-install.png)

## 创建一个ams项目
运行以下命令来创建一个新项目:

Expand Down
10 changes: 9 additions & 1 deletion docs/zh-CN/api/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ ams.resource('demo-resource', {
update: 'update',
read: 'read',
delete: 'delete',
list: 'list'
// list: 'list', 方法1
list: { // 方法2:可以给每个内置action单独配置path,method,successCode等
path: 'list',
method: 'post',
successCode: 1,
transform(data) { // 仅list和read有transform方法,用于在AMS赋值给区块前,转化接口返回数据
return data
}
}
},
fields: { // 字段
id: {
Expand Down
12 changes: 12 additions & 0 deletions docs/zh-CN/block/tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Tree: Tree 树形组件
---
# Tree 树形组件

### 基础用法

<ClientOnly>
<block-tree-demo blockName="defaultTree" onlineDemo="https://codepen.io/w3cmark/pen/pozZxKY"/>
</ClientOnly>

更多配置可以查看element-ui中的 [Attributes / props/ 方法 / Events](https://element.eleme.cn/#/zh-CN/component/tree)
4 changes: 4 additions & 0 deletions docs/zh-CN/field/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ title: Checkbox 多选框
<field-checkbox-demo blockName="checkboxField1" onlineDemo="https://codepen.io/w3cmark/pen/bGbjmGo"/>
</ClientOnly>

:::tip
checkbox配置的collapseLimit,是指超过多少项隐藏;跟text类型中的配置是指超过多少个字隐藏
:::

### 增加全选

设置props中的`select-all``true`
Expand Down
5 changes: 5 additions & 0 deletions docs/zh-CN/tools/conventer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 一键生成资源配置

<ClientOnly>
<utils-convert-convent />
</ClientOnly>
13 changes: 13 additions & 0 deletions examples/dev/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>

<style lang="scss">
#app {
// width: 1000px;
margin: auto;
padding: 20px;
}
</style>
Loading

0 comments on commit 16e8387

Please sign in to comment.