|
@@ -2,7 +2,7 @@
|
|
|
<el-form @submit.prevent :model="formModel" v-bind="_options" ref="formRef">
|
|
|
<el-row :gutter="5">
|
|
|
<template v-for="(item, index) in fieldList" :key="index">
|
|
|
- <el-col :span="item.span || 24" v-if="show(item.show)">
|
|
|
+ <el-col :span="item.span || 24">
|
|
|
<el-form-item :rules="item.rules" :prop="[item.field]">
|
|
|
<template #label>
|
|
|
<el-space :size="1">
|
|
@@ -147,15 +147,15 @@ interface EmitEvent {
|
|
|
(e: 'cancel'): void
|
|
|
}
|
|
|
|
|
|
-const show = (showFunction: any) => {
|
|
|
- if (!showFunction) return true
|
|
|
- if (typeof showFunction == 'function') {
|
|
|
- // 直接调用 showFunction 函数,并传入 formModel.value
|
|
|
- return showFunction(formModel.value)
|
|
|
- }
|
|
|
- // 如果 showFunction 不是函数,直接返回 true 显示该表单项
|
|
|
- return true
|
|
|
-}
|
|
|
+// const show = (showFunction: any) => {
|
|
|
+// if (!showFunction) return true
|
|
|
+// if (typeof showFunction == 'function') {
|
|
|
+// // 直接调用 showFunction 函数,并传入 formModel.value
|
|
|
+// return showFunction(formModel.value)
|
|
|
+// }
|
|
|
+// // 如果 showFunction 不是函数,直接返回 true 显示该表单项
|
|
|
+// return true
|
|
|
+// }
|
|
|
const enumMap = ref(new Map<string, { [key: string]: any }[]>())
|
|
|
const setEnumMap = async ({ field, enum: enumValue }: Form.FieldItem) => {
|
|
|
if (!enumValue) return
|