优化:数据资源编辑表单和文件上传表单在渲染其他标签时样式错乱的问题

master
Guo XIn 1 year ago
parent 789a50dc58
commit 11f46f0e9c
  1. 8
      shandan-bianmu/src/main/resources/view/business/metadata/metadataEdit.html
  2. 4
      shandan-common/src/main/resources/static/js/common/layui/extend/datalabel.js
  3. 19
      shandan-system/src/main/resources/view/sys/file/dirUploadLayer.html

@ -69,10 +69,10 @@
th:data-label-title-path="${labelSet.labelTitlePath}"></div>
</div>
<div class="layui-form-item other-label-item">
<label class="layui-form-label"><a class="label-type choose-data add-other"
id="addOtherLabelBtn">添加</a>其他标签</label>
<div class="layui-input-block label-set-component other-label"
th:data-field-title="其他标签"></div>
<label class="layui-form-label"><a class="label-type choose-data add-other" id="addOtherLabelBtn">添加</a>其他标签</label>
<div class="layui-input-block other-label-item">
<div class="label-set-component other-label" th:data-field-title="其他标签"></div>
</div>
</div>
<!-- 隐藏域 -->
<input type="text" name="id" hidden="hidden"/>

@ -250,8 +250,8 @@ layui.define(['globalTree'], function (exports) {
}
function addOtherLabel(value, readonly) {
let template = `<div class="layui-input-block label-set-component other-label ${readonly?'read-only':''}" th:data-field-title="其他标签"></div>`;
$('.other-label-item').append(template);
let template = `<div class="label-set-component other-label ${readonly?'read-only':''}" th:data-field-title="其他标签"></div>`;
$('.other-label-item.layui-input-block').append(template);
let cid = _KEY + _CACHE.size,
component = new Component(cid, $('.label-set-component.other-label:last'));

@ -38,7 +38,8 @@
<div class="layui-upload" id="uploader-table"></div>
</div>
<div class="layui-form dynamic-form" lay-filter="file-form"
style="border: 1px solid #eee; padding-top:15px; margin-bottom: 50px;" th:object="${@securityUtil.getLoginSysUser()}">
style="border: 1px solid #eee; padding-top:15px; margin-bottom: 50px;"
th:object="${@securityUtil.getLoginSysUser()}">
<div class="layui-form-item"
th:each="field,iterStat : ${uploadFormConfig}"
th:if="${field.isShow}"
@ -84,9 +85,10 @@
th:id="${'dict-'+field.fieldName}"></div>
</div>
</div>
<div class="layui-form-item" th:each="labelSet, iterState:${LabelConfigSet}" style="width: 100%">
<div class="layui-form-item" style="width: 100%" th:each="labelSet, iterState:${LabelConfigSet}">
<label class="layui-form-label" th:text="${labelSet.fieldTitle}">标签类型</label>
<div class="layui-input-block label-set-component"
<div class="layui-input-block">
<div class="label-set-component"
th:data-id="${labelSet.id}"
th:data-field-title="${labelSet.fieldTitle}"
th:data-label-id="${labelSet.labelId}"
@ -95,11 +97,12 @@
th:data-label-title-path="${labelSet.labelTitlePath}"
style="width:calc(100% - 120px);margin-left: 0"></div>
</div>
<div class="layui-form-item other-label-item">
<label class="layui-form-label"><a class="label-type choose-data add-other"
id="addOtherLabelBtn">添加</a>其他标签</label>
<div class="layui-input-block label-set-component other-label" th:data-field-title="其他标签"
style="width:calc(100% - 120px);margin-left: 0"></div>
</div>
<div class="layui-form-item other-label-item" style="width: 100%">
<label class="layui-form-label"><a class="label-type choose-data add-other" id="addOtherLabelBtn">添加</a>其他标签</label>
<div class="layui-input-block other-label-item">
<div class="label-set-component other-label" th:data-field-title="其他标签"></div>
</div>
</div>
</div>
<div class="bottom-btns">