@zion-form-create/designer
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
76 lines (73 loc) • 2.19 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import {localeOptions, localeProps} from '../../utils';
const label = '时间';
const name = 'timePicker';
export default {
menu: 'main',
icon: 'icon-time',
label,
name,
input: true,
event: ['change', 'blur', 'focus', 'visibleChange'],
rule({t}) {
return {
type: name,
field: uniqueId(),
title: t('com.timePicker.name'),
info: '',
$required: false,
props: {},
};
},
watch: {
isRange({rule}) {
rule.key = uniqueId();
}
},
props(_, {t}) {
return localeProps(t, name + '.props', [{type: 'switch', field: 'readonly'}, {
type: 'switch',
field: 'disabled'
}, {
type: 'switch',
field: 'isRange'
}, {
type: 'switch',
field: 'clearable',
value: true
}, {
type: 'Struct',
field: 'pickerOptions',
props: {defaultValue: {}}
}, {type: 'switch', field: 'editable', value: true}, {
type: 'input',
field: 'placeholder'
}, {
type: 'input',
field: 'startPlaceholder'
}, {type: 'input', field: 'endPlaceholder'}, {
type: 'switch',
field: 'arrowControl'
}, {
type: 'select',
field: 'align',
options: localeOptions(t, [{label: 'left', value: 'left'}, {label: 'center', value: 'center'}, {
label: 'right',
value: 'right'
}])
},{
type: 'switch',
field: 'ignore',
value: false,
title: '忽略',
warning: '忽略的字段数据将不会被提交',
},
{
type: 'Input',
field: 'displayCode',
value: '',
title: '显隐权限码',
warning: '设置时将检测登录用户是否被授权此权限码',
},]);
}
};