【代码评审】Bpm:钉钉表单设计器

pull/612/MERGE
YunaiV 2024-12-09 07:52:52 +08:00
parent acb00ba866
commit 7697054918
2 changed files with 9 additions and 9 deletions

View File

@ -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>

View File

@ -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