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>
154 lines
3.6 KiB
TypeScript
154 lines
3.6 KiB
TypeScript
/** FormCreate Designer DragRule:出差套件 */
|
|
|
|
import { emptyTripLeg } from '@/utils/oa-trip-days'
|
|
|
|
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'
|
|
)
|
|
}
|
|
|
|
export const DEFAULT_TRANSPORT_OPTIONS = [
|
|
{ label: '飞机', value: '飞机' },
|
|
{ label: '火车', value: '火车' },
|
|
{ label: '汽车', value: '汽车' },
|
|
{ label: '其他', value: '其他' }
|
|
]
|
|
|
|
export const DEFAULT_TRIP_TYPE_OPTIONS = [
|
|
{ label: '单程', value: '单程' },
|
|
{ label: '往返', value: '往返' }
|
|
]
|
|
|
|
function buildTripKitChildren() {
|
|
const tripReasonField = uniqueId()
|
|
const tripListField = uniqueId()
|
|
const tripDaysField = uniqueId()
|
|
const tripRemarkField = uniqueId()
|
|
const tripCompanionsField = uniqueId()
|
|
const tripExternalField = uniqueId()
|
|
return {
|
|
tripReasonField,
|
|
tripListField,
|
|
tripDaysField,
|
|
tripRemarkField,
|
|
tripCompanionsField,
|
|
tripExternalField,
|
|
children: [
|
|
{
|
|
type: 'input',
|
|
field: tripReasonField,
|
|
title: '出差事由',
|
|
info: '',
|
|
$required: true,
|
|
props: {
|
|
type: 'textarea',
|
|
_fc_kit_field: 'tripReason',
|
|
rows: 3,
|
|
placeholder: '请输入出差事由'
|
|
}
|
|
},
|
|
{
|
|
type: 'tripItinerary',
|
|
field: tripListField,
|
|
title: '行程',
|
|
info: '',
|
|
$required: true,
|
|
value: [emptyTripLeg()],
|
|
props: {
|
|
_fc_kit_field: 'tripList',
|
|
transportOptions: DEFAULT_TRANSPORT_OPTIONS.map((o) => ({ ...o })),
|
|
tripTypeOptions: DEFAULT_TRIP_TYPE_OPTIONS.map((o) => ({ ...o }))
|
|
}
|
|
},
|
|
{
|
|
type: 'inputNumber',
|
|
field: tripDaysField,
|
|
title: '出差天数',
|
|
info: '',
|
|
$required: true,
|
|
props: {
|
|
_fc_kit_field: 'tripDays',
|
|
precision: 1,
|
|
step: 0.5,
|
|
min: 0,
|
|
controlsPosition: 'right',
|
|
align: 'left'
|
|
}
|
|
},
|
|
{
|
|
type: 'input',
|
|
field: tripRemarkField,
|
|
title: '出差备注',
|
|
info: '',
|
|
$required: false,
|
|
props: {
|
|
type: 'textarea',
|
|
_fc_kit_field: 'tripRemark',
|
|
rows: 2,
|
|
placeholder: '请输入出差备注'
|
|
}
|
|
},
|
|
{
|
|
type: 'person',
|
|
field: tripCompanionsField,
|
|
title: '同行人',
|
|
info: '',
|
|
$required: false,
|
|
props: {
|
|
_fc_kit_field: 'tripCompanions',
|
|
multiple: true
|
|
}
|
|
},
|
|
{
|
|
type: 'input',
|
|
field: tripExternalField,
|
|
title: '外部人员',
|
|
info: '',
|
|
$required: false,
|
|
props: {
|
|
_fc_kit_field: 'tripExternal',
|
|
placeholder: '请输入外部人员'
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
/** FormCreate Designer DragRule:出差套件 */
|
|
export const tripKitDragRule = {
|
|
menu: 'kit' as const,
|
|
icon: 'icon-businesstrip',
|
|
label: '出差',
|
|
name: 'tripKit',
|
|
input: false,
|
|
drag: true,
|
|
dragBtn: true,
|
|
mask: false,
|
|
inside: true,
|
|
rule() {
|
|
const built = buildTripKitChildren()
|
|
return {
|
|
type: 'tripKit',
|
|
props: {
|
|
tripReasonField: built.tripReasonField,
|
|
tripListField: built.tripListField,
|
|
tripDaysField: built.tripDaysField,
|
|
tripRemarkField: built.tripRemarkField,
|
|
tripCompanionsField: built.tripCompanionsField,
|
|
tripExternalField: built.tripExternalField
|
|
},
|
|
children: built.children
|
|
}
|
|
},
|
|
props() {
|
|
return []
|
|
}
|
|
}
|