|
|
@@ -1117,23 +1117,25 @@ export default function FormDesigner() {
|
|
|
size="small"
|
|
|
/>
|
|
|
</div>
|
|
|
- {field.type === 'input' && (
|
|
|
+ {(field.type === 'input' || field.type === 'textarea' || field.type === 'password') && (
|
|
|
<>
|
|
|
- <div>
|
|
|
- <label className="text-xs text-gray-600 mb-1 block">类型</label>
|
|
|
- <Select
|
|
|
- value={field.inputType || 'text'}
|
|
|
- onChange={(value) => updateField(field.id, { inputType: value })}
|
|
|
- size="small"
|
|
|
- className="w-full"
|
|
|
- >
|
|
|
- <Select.Option value="text">文本</Select.Option>
|
|
|
- <Select.Option value="password">密码</Select.Option>
|
|
|
- <Select.Option value="number">数字</Select.Option>
|
|
|
- <Select.Option value="email">邮箱</Select.Option>
|
|
|
- <Select.Option value="url">URL</Select.Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
+ {field.type === 'input' && (
|
|
|
+ <div>
|
|
|
+ <label className="text-xs text-gray-600 mb-1 block">类型</label>
|
|
|
+ <Select
|
|
|
+ value={field.inputType || 'text'}
|
|
|
+ onChange={(value) => updateField(field.id, { inputType: value })}
|
|
|
+ size="small"
|
|
|
+ className="w-full"
|
|
|
+ >
|
|
|
+ <Select.Option value="text">文本</Select.Option>
|
|
|
+ <Select.Option value="password">密码</Select.Option>
|
|
|
+ <Select.Option value="number">数字</Select.Option>
|
|
|
+ <Select.Option value="email">邮箱</Select.Option>
|
|
|
+ <Select.Option value="url">URL</Select.Option>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div>
|
|
|
<label className="text-xs text-gray-600 mb-1 block">最大输入长度</label>
|
|
|
<InputNumber
|
|
|
@@ -1145,24 +1147,24 @@ export default function FormDesigner() {
|
|
|
/>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <label className="text-xs text-gray-600 mb-1 block">输入框占位文本</label>
|
|
|
+ <label className="text-xs text-gray-600 mb-1 block">占位文本</label>
|
|
|
<Input
|
|
|
value={typeof field.placeholder === 'string' ? field.placeholder : ''}
|
|
|
onChange={(e) => updateField(field.id, { placeholder: e.target.value })}
|
|
|
- size="small"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div className="flex items-center justify-between">
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
<label className="text-xs text-gray-600">是否显示清除按钮</label>
|
|
|
- <Switch
|
|
|
+ <Switch
|
|
|
checked={field.showClear}
|
|
|
onChange={(checked) => updateField(field.id, { showClear: checked })}
|
|
|
- size="small"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</>
|
|
|
)}
|
|
|
- {field.type !== 'input' && (
|
|
|
+ {!(field.type === 'input' || field.type === 'textarea' || field.type === 'password') && (
|
|
|
<div>
|
|
|
<label className="text-xs text-gray-600 mb-1 block">占位符</label>
|
|
|
<Input
|