amis/examples/components/Form/Static.jsx
liaoxuezhi c591ab4381
chore: 开发环境切成 vite (#5677)
* 尝试使用 vite 跑开发环境

* 尝试使用 vite 跑开发环境

* 尝试使用 vite 跑开发环境

* 尝试使用 vite 跑开发环境

* 样式文档调整

* 修复有多个 __inline 时的报错

* scirpt 调整

* feat:chart接入事件动作 (#5669)

* chore: input-group 没有 name 不应该报 warning (#5667)

* chore: 处理编译TS Warning,调整TableStore中label解析的顺序 (#5670)

* feat: timeline时间轴支持自定义图标 (#5668)

* fix:折叠器Collapse自定义图标&inputNumber对含后缀生效

* 修改

* 正则修改

* 正则修改

* 正则修改

* feat:将默认px替换为rem 2px===0.125rem

* feat:timeline时间轴支持自定义图标

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* fix: 调整echarts-stat使用方式,兼容vite打包异步非esm模块 (#5672)

* feat: chart 支持配置加载 geojson 及百度地图 (#5674)

* feat: chart 支持配置 geoURL 及 geoName

* 增加百度地图配置

* chore: 修复 coverage 运行报错 (#5678)

* chore: coverage 执行换成 v8 解决内存问题 (#5679)

* 尝试使用 vite 跑开发环境

* amis-formula 也添加 esm 模块

* 代码合并有问题,做些调整

Co-authored-by: hsm-lv <80095014+hsm-lv@users.noreply.github.com>
Co-authored-by: 吴多益 <wuduoyi@baidu.com>
Co-authored-by: RUNZE LU <36724300+lurunze1226@users.noreply.github.com>
Co-authored-by: 徐佳豪 <1440054388@qq.com>
Co-authored-by: xujiahao01 <xujiahao01@baidu.com>
Co-authored-by: 刘丹 <365533093@qq.com>
2022-11-02 22:45:12 +08:00

188 lines
4.2 KiB
JavaScript

export default {
title: '所有 Form 元素列举',
data: {
id: 1,
image: __uri('../../static/photo/3893101144.jpg'),
images: [
{
image: __uri('../../static/photo/4f3cb4202335.jpg'),
src: __uri('../../static/photo/4f3cb4202335.jpg')
},
{
image: __uri('../../static/photo/d8e4992057f9.jpg'),
src: __uri('../../static/photo/d8e4992057f9.jpg')
},
{
image: __uri('../../static/photo/1314a2a3d3f6.jpg'),
src: __uri('../../static/photo/1314a2a3d3f6.jpg')
},
{
image: __uri('../../static/photo/8f2e79f82be0.jpg'),
src: __uri('../../static/photo/8f2e79f82be0.jpg')
},
{
image: __uri('../../static/photo/552b175ef11d.jpg'),
src: __uri('../../static/photo/552b175ef11d.jpg')
}
]
},
body: [
{
type: 'form',
api: '/api/mock2/saveForm?waitSeconds=2',
title: '表单项静态展示',
mode: 'horizontal',
body: [
{
type: 'static',
label: '文本',
value: '文本'
},
{
type: 'divider'
},
{
type: 'static',
label: '模板',
tpl: '自己拼接 HTML 取变量 \\${id}: ${id}'
},
{
type: 'divider'
},
{
type: 'static-date',
label: '日期',
value: Math.round(Date.now() / 1000)
},
{
type: 'divider'
},
{
type: 'static-datetime',
label: '日期时间',
value: Math.round(Date.now() / 1000)
},
{
type: 'divider'
},
{
type: 'control',
label: '映射',
body: {
type: 'mapping',
value: Math.floor(Math.random() * 5),
map: {
'*': "<span class='label label-default'>-</span>",
'0': "<span class='label label-info'>一</span>",
'1': "<span class='label label-success'>二</span>",
'2': "<span class='label label-danger'>三</span>",
'3': "<span class='label label-warning'>四</span>",
'4': "<span class='label label-primary'>五</span>"
}
}
},
{
type: 'divider'
},
{
type: 'control',
label: '进度',
body: {
type: 'progress',
value: 66.66
}
},
{
type: 'divider'
},
{
type: 'static-image',
label: '图片',
name: 'image',
thumbMode: 'cover',
thumbRatio: '4:3',
title: '233',
imageCaption: 'jfe fjkda fejfkda fejk fdajf dajfe jfkda',
popOver: {
title: '查看大图',
body: '<div class="w-xxl"><img class="w-full" src="${image}"/></div>'
}
},
{
type: 'divider'
},
{
type: 'static-image',
label: '图片自带放大',
name: 'image',
thumbMode: 'cover',
thumbRatio: '4:3',
title: '233',
imageCaption: 'jfe fjkda fejfkda fejk fdajf dajfe jfkda',
enlargeAble: true,
originalSrc: '${image}'
},
{
type: 'static-images',
label: '图片集',
name: 'images',
thumbMode: 'cover',
thumbRatio: '4:3',
enlargeAble: true,
originalSrc: '${src}' // 注意这个取变量是想对数组成员取的。
},
{
type: 'divider'
},
{
type: 'static-json',
label: 'JSON',
value: {a: 1, b: 2, c: {d: 3}}
},
{
type: 'divider'
},
{
type: 'static',
label: '可复制',
value: '文本',
copyable: {
content: '内容,支持变量 ${id}'
}
},
{
type: 'divider'
},
{
type: 'static',
name: 'text',
label: '可快速编辑',
value: '文本',
quickEdit: true
}
]
}
]
};