【代码评审】Bpm:钉钉表单设计器
parent
acb00ba866
commit
7697054918
|
@ -106,7 +106,7 @@
|
|||
:key="index"
|
||||
:label="item.title"
|
||||
:value="item.field"
|
||||
:disabled ="!item.required"
|
||||
:disabled="!item.required"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
@ -369,7 +369,7 @@ const fieldsInfo = useFormFields()
|
|||
|
||||
/** 条件规则可选择的表单字段 */
|
||||
const fieldOptions = computed(() => {
|
||||
const fieldsCopy = fieldsInfo.slice();
|
||||
const fieldsCopy = fieldsInfo.slice()
|
||||
// 固定添加发起人 ID 字段
|
||||
fieldsCopy.unshift({
|
||||
field: ProcessVariableEnum.START_USER_ID,
|
||||
|
@ -379,14 +379,15 @@ const fieldOptions = computed(() => {
|
|||
return fieldsCopy
|
||||
})
|
||||
|
||||
|
||||
/** 获取字段名称 */
|
||||
const getFieldTitle = (field: string) => {
|
||||
const item = fieldsInfo.find((item) => item.field === field)
|
||||
return item?.title
|
||||
}
|
||||
|
||||
/** 获取操作符名称 */
|
||||
const getOpName = (opCode: string): string => {
|
||||
const opName = COMPARISON_OPERATORS.find((item) => item.value === opCode)
|
||||
const opName = COMPARISON_OPERATORS.find((item: any) => item.value === opCode)
|
||||
return opName?.label
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
:process-instance="processInstance"
|
||||
:process-definition="processDefinition"
|
||||
:userOptions="userOptions"
|
||||
:normal-form ="detailForm"
|
||||
:normal-form="detailForm"
|
||||
:normal-form-api="fApi"
|
||||
:writable-fields="writableFields"
|
||||
@success="refresh"
|
||||
|
@ -129,7 +129,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { BpmModelType,BpmModelFormType } from '@/utils/constants'
|
||||
import { BpmModelType, BpmModelFormType } from '@/utils/constants'
|
||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||
import { registerComponent } from '@/utils/routerHelper'
|
||||
import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
||||
|
@ -174,8 +174,7 @@ const detailForm = ref({
|
|||
value: {}
|
||||
}) // 流程实例的表单详情
|
||||
|
||||
// 表单可以编辑的字段
|
||||
const writableFields : Array<string> = [];
|
||||
const writableFields: Array<string> = [] // 表单可以编辑的字段
|
||||
|
||||
/** 获得详情 */
|
||||
const getDetail = () => {
|
||||
|
@ -279,7 +278,7 @@ const setFieldPermission = (field: string, permission: string) => {
|
|||
//@ts-ignore
|
||||
fApi.value?.disabled(false, field)
|
||||
// 加入可以编辑的字段
|
||||
writableFields.push(field);
|
||||
writableFields.push(field)
|
||||
}
|
||||
if (permission === FieldPermissionType.NONE) {
|
||||
//@ts-ignore
|
||||
|
|
Loading…
Reference in New Issue