提交
This commit is contained in:
1 parent
f7d1004e6b
commit
310b2efe8a
91 files changed
+14420
-10840
No files matched your search
@@ -0,0 +1,60 @@
|
||||
/** 与 FormCreate 官方 unique 同类:生成不重复 field */
|
||||
let _uidSeq = 0
|
||||
function uniqueId() {
|
||||
const num = 370 + ++_uidSeq
|
||||
return (
|
||||
'F' +
|
||||
Math.random().toString(36).slice(3, 6) +
|
||||
Number(`${Date.now()}`).toString(36) +
|
||||
num.toString(36) +
|
||||
't'
|
||||
)
|
||||
}
|
||||
|
||||
/** FormCreate Designer DragRule:职位选择 */
|
||||
export const postSelectDragRule = {
|
||||
menu: 'main' as const,
|
||||
icon: 'icon-input',
|
||||
label: '职位',
|
||||
name: 'post',
|
||||
input: true,
|
||||
mask: true,
|
||||
validate: ['string', 'array', 'object'],
|
||||
event: ['change'],
|
||||
rule() {
|
||||
return {
|
||||
type: 'post',
|
||||
field: uniqueId(),
|
||||
title: '职位',
|
||||
info: '',
|
||||
$required: false,
|
||||
props: {
|
||||
multiple: true,
|
||||
max: undefined as number | undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
props() {
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
field: 'multiple',
|
||||
title: '允许多选',
|
||||
value: true,
|
||||
props: { activeText: '是', inactiveText: '否' }
|
||||
},
|
||||
{
|
||||
type: 'inputNumber',
|
||||
field: 'max',
|
||||
title: '最大可选数',
|
||||
value: undefined,
|
||||
props: { min: 1, precision: 0, placeholder: '不填则不限制' }
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'formCreateInfo',
|
||||
title: '提示信息'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user