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

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. 35
      shandan-system/src/main/resources/view/sys/file/dirUploadLayer.html

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

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

@ -38,12 +38,13 @@
<div class="layui-upload" id="uploader-table"></div> <div class="layui-upload" id="uploader-table"></div>
</div> </div>
<div class="layui-form dynamic-form" lay-filter="file-form" <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" <div class="layui-form-item"
th:each="field,iterStat : ${uploadFormConfig}" th:each="field,iterStat : ${uploadFormConfig}"
th:if="${field.isShow}" th:if="${field.isShow}"
th:style="${field.fieldType == 'textarea' ? 'width: calc(100% - 30px);' : ''}" th:style="${field.fieldType == 'textarea' ? 'width: calc(100% - 30px);' : ''}"
th:with="username=*{userName}"> th:with="username=*{userName}">
<label th:if="${field.isRequired}" class="layui-form-label"> <label th:if="${field.isRequired}" class="layui-form-label">
<label style="color: red">*</label> <label style="color: red">*</label>
<label th:text="${field.showTitle}">*</label> <label th:text="${field.showTitle}">*</label>
@ -84,22 +85,24 @@
th:id="${'dict-'+field.fieldName}"></div> th:id="${'dict-'+field.fieldName}"></div>
</div> </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> <label class="layui-form-label" th:text="${labelSet.fieldTitle}">标签类型</label>
<div class="layui-input-block label-set-component" <div class="layui-input-block">
th:data-id="${labelSet.id}" <div class="label-set-component"
th:data-field-title="${labelSet.fieldTitle}" th:data-id="${labelSet.id}"
th:data-label-id="${labelSet.labelId}" th:data-field-title="${labelSet.fieldTitle}"
th:data-label-title="${labelSet.labelTitle}" th:data-label-id="${labelSet.labelId}"
th:data-label-id-path="${labelSet.labelIdPath}" th:data-label-title="${labelSet.labelTitle}"
th:data-label-title-path="${labelSet.labelTitlePath}" th:data-label-id-path="${labelSet.labelIdPath}"
style="width:calc(100% - 120px);margin-left: 0"></div> th:data-label-title-path="${labelSet.labelTitlePath}"
style="width:calc(100% - 120px);margin-left: 0"></div>
</div>
</div> </div>
<div class="layui-form-item other-label-item"> <div class="layui-form-item other-label-item" style="width: 100%">
<label class="layui-form-label"><a class="label-type choose-data add-other" <label class="layui-form-label"><a class="label-type choose-data add-other" id="addOtherLabelBtn">添加</a>其他标签</label>
id="addOtherLabelBtn">添加</a>其他标签</label> <div class="layui-input-block other-label-item">
<div class="layui-input-block label-set-component other-label" th:data-field-title="其他标签" <div class="label-set-component other-label" th:data-field-title="其他标签"></div>
style="width:calc(100% - 120px);margin-left: 0"></div> </div>
</div> </div>
</div> </div>
<div class="bottom-btns"> <div class="bottom-btns">