Skip to content

Commit

Permalink
data-updir
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Jan 23, 2025
1 parent b6c82af commit 2be08df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public class EasyFieldConfigProps {
* 允许上传数量
*/
public static final String IMAGE_UPLOADNUMBER = FILE_UPLOADNUMBER;

/**
* 图片获取方式(兼容附件)
*/
Expand All @@ -120,6 +119,10 @@ public class EasyFieldConfigProps {
* 图片获取方式(兼容附件)
*/
public static final String IMAGE_CAPTURE_DEF = "imageCaptureDef";
/**
* 指定上传路径
*/
public static final String IMAGE_UPDIR = FILE_UPDIR;

/**
* 自动编号规则
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/web/admin/metadata/field-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ <h5>[[${bundle.L('常用')}]]</h5>
</label>
</div>
</div>
<div th:if="${fieldType == 'FILE'}" class="form-group row J_for-FILE bosskey-show">
<label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('上传目录')}]]</label>
<div th:if="${fieldType == 'IMAGE' || fieldType == 'FILE'}" class="form-group row J_for-IMAGE J_for-FILE bosskey-show">
<label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('上传目录')}]] (LAB)</label>
<div class="col-md-12 col-xl-6 col-lg-8">
<input type="text" class="form-control form-control-sm" id="fileUpdir" th:placeholder="${bundle.L('默认')}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/assets/js/general/rb-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ class RbFormImage extends RbFormElement {
)
})}
<span title={$L('拖动或点击选择图片。需要 %s 个', `${this.__minUpload}~${this.__maxUpload}`)} className={`position-relative ${!showUpload && 'hide'}`}>
<input ref={(c) => (this._fieldValue__input = c)} type="file" className="inputfile" id={this._htmlid} accept="image/*" multiple />
<input ref={(c) => (this._fieldValue__input = c)} type="file" className="inputfile" id={this._htmlid} accept="image/*" multiple data-updir={this.props.fileUpdir || null} />
<label htmlFor={this._htmlid} className="img-thumbnail img-upload" onClick={(e) => this._fileClick(e)}>
{this._captureType === 2 ? <span className="mdi mdi-camera down-2" /> : <span className="zmdi zmdi-image-alt down-2" />}
</label>
Expand Down

0 comments on commit 2be08df

Please sign in to comment.