Unify effective roles via post-role bindings, remove dedicated OA role UI, and update OA assignee resolution plus related SQL/docs. Co-authored-by: Cursor <cursoragent@cursor.com>
112 lines
2.4 KiB
TypeScript
112 lines
2.4 KiB
TypeScript
/** FormCreate Designer DragRule:加班套件 */
|
||
|
||
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) +
|
||
'o'
|
||
)
|
||
}
|
||
|
||
function buildOvertimeKitChildren() {
|
||
const personField = uniqueId()
|
||
const startField = uniqueId()
|
||
const endField = uniqueId()
|
||
const durationField = uniqueId()
|
||
return {
|
||
personField,
|
||
startField,
|
||
endField,
|
||
durationField,
|
||
children: [
|
||
{
|
||
type: 'person',
|
||
field: personField,
|
||
title: '加班人',
|
||
info: '',
|
||
$required: true,
|
||
props: {
|
||
_fc_kit_field: 'overtimePerson',
|
||
multiple: true
|
||
}
|
||
},
|
||
{
|
||
type: 'datePicker',
|
||
field: startField,
|
||
title: '开始时间',
|
||
info: '',
|
||
$required: true,
|
||
props: {
|
||
_fc_kit_field: 'overtimeStart',
|
||
type: 'datetime',
|
||
format: 'YYYY-MM-DD HH:mm',
|
||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||
placeholder: '请选择开始时间'
|
||
}
|
||
},
|
||
{
|
||
type: 'datePicker',
|
||
field: endField,
|
||
title: '结束时间',
|
||
info: '',
|
||
$required: true,
|
||
props: {
|
||
_fc_kit_field: 'overtimeEnd',
|
||
type: 'datetime',
|
||
format: 'YYYY-MM-DD HH:mm',
|
||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||
placeholder: '请选择结束时间'
|
||
}
|
||
},
|
||
{
|
||
type: 'inputNumber',
|
||
field: durationField,
|
||
title: '时长(h)',
|
||
info: '请手动填写加班时长',
|
||
$required: true,
|
||
props: {
|
||
_fc_kit_field: 'overtimeDuration',
|
||
precision: 1,
|
||
min: 0,
|
||
controlsPosition: 'right',
|
||
align: 'left'
|
||
},
|
||
class: 'oa-overtime-duration'
|
||
}
|
||
]
|
||
}
|
||
}
|
||
|
||
/** FormCreate Designer DragRule:加班套件 */
|
||
export const overtimeKitDragRule = {
|
||
menu: 'kit' as const,
|
||
icon: 'icon-time',
|
||
label: '加班',
|
||
name: 'overtimeKit',
|
||
input: false,
|
||
drag: true,
|
||
dragBtn: true,
|
||
mask: false,
|
||
inside: true,
|
||
rule() {
|
||
const built = buildOvertimeKitChildren()
|
||
return {
|
||
type: 'overtimeKit',
|
||
props: {
|
||
personField: built.personField,
|
||
startField: built.startField,
|
||
endField: built.endField,
|
||
durationField: built.durationField
|
||
},
|
||
children: built.children
|
||
}
|
||
},
|
||
props() {
|
||
return []
|
||
}
|
||
}
|