-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: v0.17.4
- Loading branch information
Showing
137 changed files
with
2,850 additions
and
257 deletions.
There are no files selected for viewing
246 changes: 246 additions & 0 deletions
246
docs/zh-CN/.vuepress/components/block/imagelist/block.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,246 @@ | ||
const fields = { | ||
text: { | ||
label: '文本', | ||
type: 'text' | ||
}, | ||
inputnumber: { | ||
type: 'inputnumber', | ||
label: '数字输入' | ||
}, | ||
select: { | ||
type: 'select', | ||
label: 'select多选', | ||
props: { | ||
options: { | ||
a: '黄金糕', | ||
b: '双皮奶', | ||
c: '蚵仔煎', | ||
d: '龙须面', | ||
e: '北京烤鸭' | ||
} | ||
} | ||
} | ||
} | ||
export default { | ||
imagelist1: { | ||
type: 'imagelist', | ||
ctx: 'view', | ||
resource: { | ||
api: { | ||
prefix: 'http://rap2api.taobao.org/app/mock/231578/ams/mock/', | ||
list: 'imagelist' | ||
}, | ||
fields: { | ||
id: { | ||
type: 'text' | ||
} | ||
} | ||
}, | ||
operations: { | ||
id: { | ||
slot: 'searchs', | ||
type: 'field', | ||
label: '文本' | ||
}, | ||
search: { | ||
slot: 'searchs', | ||
type: 'button', | ||
props: { | ||
type: 'primary' | ||
}, | ||
label: '搜索', | ||
event: 'list:1' | ||
}, | ||
rejectedItem: { | ||
type: 'text', | ||
props: { | ||
type: 'danger', | ||
size: 'mini', | ||
}, | ||
label: '驳回' | ||
}, | ||
rejectedItem1: { | ||
type: 'text', | ||
props: { | ||
size: 'mini', | ||
}, | ||
label: '通过(设计)' | ||
}, | ||
rejectedItem2: { | ||
type: 'text', | ||
props: { | ||
size: 'mini', | ||
}, | ||
label: '通过(协助)' | ||
}, | ||
deleteItem: { | ||
type: 'button', | ||
props: { | ||
type: 'text', | ||
size: 'mini', | ||
icon: 'el-icon-delete' | ||
} | ||
}, | ||
editItem: { | ||
type: 'icon', | ||
label: '编辑', | ||
icon: 'el-icon-edit' | ||
} | ||
}, | ||
pageSize: 10, | ||
props: { | ||
// shadow: 'always', // 阴影效果,可取值:hover(默认)| always | never | ||
// subtitle: 'always' // 子标题出现方式,可取值:hover(默认)| always | ||
// pagination: 'simulate' // 模拟分页 | ||
}, | ||
events: { | ||
init: '@list', | ||
}, | ||
actions: { | ||
rejectedItem() { | ||
alert('点击了驳回'); | ||
}, | ||
rejectedItem1() { | ||
alert('通过(设计)'); | ||
}, | ||
clickImageItem(args) { | ||
// 内置的action | ||
console.log(args); | ||
alert('点击图片'); | ||
}, | ||
editItem() { | ||
alert('点击了编辑'); | ||
} | ||
}, | ||
options: { | ||
// imageSrc: { | ||
// field: 'image' // 字段名 | ||
// }, | ||
title: { | ||
field: 'title', | ||
// 'prefix-icon': 'el-icon-search' | ||
'prefix-tag': { | ||
type: 'info', // success | info | warning | danger | ||
label(args) { | ||
return args.status; | ||
} | ||
} | ||
}, | ||
subtitle: { | ||
field: 'content' | ||
}, | ||
info: { | ||
field: 'info' | ||
} | ||
} | ||
}, | ||
imagelist2: { | ||
type: 'imagelist', | ||
ctx: 'view', | ||
resource: { | ||
api: { | ||
prefix: 'http://rap2api.taobao.org/app/mock/231578/ams/mock/', | ||
list: 'imagelist2' | ||
}, | ||
fields: { | ||
id: { | ||
type: 'text' | ||
} | ||
} | ||
}, | ||
operations: { | ||
id: { | ||
slot: 'searchs', | ||
type: 'field', | ||
label: '文本' | ||
}, | ||
search: { | ||
slot: 'searchs', | ||
type: 'button', | ||
props: { | ||
type: 'primary' | ||
}, | ||
label: '搜索', | ||
event: 'list:1' | ||
}, | ||
rejectedItem: { | ||
type: 'text', | ||
props: { | ||
type: 'danger', | ||
size: 'mini', | ||
}, | ||
label: '驳回' | ||
}, | ||
rejectedItem1: { | ||
type: 'text', | ||
props: { | ||
size: 'mini', | ||
}, | ||
label: '通过(设计)' | ||
}, | ||
rejectedItem2: { | ||
type: 'text', | ||
props: { | ||
size: 'mini', | ||
}, | ||
label: '通过(协助)' | ||
}, | ||
deleteItem: { | ||
type: 'button', | ||
props: { | ||
type: 'text', | ||
size: 'mini', | ||
icon: 'el-icon-delete' | ||
} | ||
}, | ||
editItem: { | ||
type: 'icon', | ||
label: '编辑', | ||
icon: 'el-icon-edit' | ||
} | ||
}, | ||
pageSize: 10, | ||
props: { | ||
// shadow: 'always', // 阴影效果,可取值:hover(默认)| always | never | ||
subtitle: 'always' // 子标题出现方式,可取值:hover(默认)| always | ||
// pagination: 'simulate' // 模拟分页 | ||
}, | ||
events: { | ||
init: '@list', | ||
}, | ||
actions: { | ||
rejectedItem() { | ||
alert('点击了驳回'); | ||
}, | ||
rejectedItem1() { | ||
alert('通过(设计)'); | ||
}, | ||
clickImageItem(args) { | ||
// 内置的action | ||
console.log(args); | ||
alert('点击图片'); | ||
}, | ||
editItem() { | ||
alert('点击了编辑'); | ||
} | ||
}, | ||
options: { | ||
title: { | ||
field: 'title', | ||
// 'prefix-icon': 'el-icon-search' | ||
'prefix-tag': { | ||
type: 'info', // success | info | warning | danger | ||
label(args) { | ||
return args.status; | ||
} | ||
} | ||
}, | ||
subtitle: { | ||
field: 'content' | ||
}, | ||
info: { | ||
field: 'info' | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.