新增:文件编辑表单改为根据表单配置动态渲染加载

master
Guo XIn 1 year ago
parent 11f46f0e9c
commit 0e3cb15881
  1. 159
      shandan-system/src/main/resources/view/sys/file/fileEditLayer.html

@ -15,10 +15,6 @@
.layui-form-item .layui-input-inline {
width: 260px;
}
.label-set-component{
margin-left: 120px;
}
.star-mark{color: red; display: none}
</style>
<script th:inline="javascript">
const file = /*[[${file}]]*/ {};
@ -34,7 +30,7 @@
<div class="layui-upload">
<h2 th:text="${file.fileName}" style="margin-bottom: 10px;"></h2>
</div>
<form class="layui-form" id="file-form" lay-filter="file-form" style="border: 1px solid #eee; padding-top:15px">
<form class="layui-form dynamic-form" id="file-form" lay-filter="file-form" style="border: 1px solid #eee; padding-top:15px">
<input type="hidden" name="id">
<input type="hidden" name="fileName">
<input type="hidden" name="entityId">
@ -48,107 +44,72 @@
<input type="hidden" name="currentChunkIndex">
<input type="hidden" name="MD5">
<input type="hidden" name="isFirst">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span style="color: red">*</span>文件密级</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="secret_level" dict-name="secretLevel"
dict-width="100%" id="dict-secret-level"></div>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">是否演训数据</label>
<div class="layui-input-inline">
<input class="layui-input" type="radio" name="exerciseData" value="0" title="否" checked lay-filter="exerciseData"/>
<input class="layui-input" type="radio" name="exerciseData" value="1" title="是" lay-filter="exerciseData"/>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">录入人员</label>
<div class="layui-input-inline">
<input class="layui-input" name="entryStaff" type="text" readonly>
</div>
<label class="layui-form-label"><span class="star-mark">*</span>任务时间</label>
<div class="layui-input-inline">
<input class="layui-input" id="input-data" name="inputDate" type="text">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="star-mark">*</span>文件来源</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="data_source" dict-name="source"
dict-width="100%" id="dict-data-form"></div>
</div>
<label class="layui-form-label">目标/靶标类型</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="target_type" dict-name="targetNumber"
dict-width="100%" id="dict-target-type"></div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="star-mark">*</span>任务代号</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="task_code" dict-name="taskCode"
dict-width="100%" id="dict-task-code"></div>
</div>
<label class="layui-form-label"><span class="star-mark">*</span>任务性质</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="task_nature" dict-name="taskNature"
dict-width="100%" id="dict-task-nature"></div>
</div>
<div class="layui-form-item"
th:each="field,iterStat : ${uploadFormConfig}"
th:if="${field.isShow}"
th:style="${field.fieldType == 'textarea' ? 'width: calc(100% - 30px);' : ''}"
th:with="username=*{userName}">
<label th:if="${field.isRequired}" class="layui-form-label">
<label style="color: red">*</label>
<label th:text="${field.showTitle}">*</label>
</label>
<label th:if="${!field.isRequired}" class="layui-form-label" th:text="${field.showTitle}"></label>
<div class="layui-input-block">
<!-- 文本框类型 -->
<input class="layui-input" type="text" autocomplete="off"
th:if="${field.fieldType == 'input' || field.fieldType == 'date'}"
th:name="${field.fieldName}"
th:value="${field.fieldName}"
th:disabled="${field.isDisabled}"
th:placeholder="${field.showTitle}"
th:readonly="${field.fieldName == 'inputDate' || field.fieldName == 'entryStaff'}"
th:lay-verify="${field.isRequired ? 'required' : ''}">
<!-- 文本域类型 -->
<textarea class="layui-textarea" type="text" autocomplete="off"
th:if="${field.fieldType == 'textarea'}"
th:name="${field.fieldName}"
th:disabled="${field.isDisabled}"
th:placeholder="${field.showTitle}"
th:lay-verify="${field.isRequired ? 'required' : ''}"></textarea>
<th:block th:if="${field.fieldType == 'radio' && field.isShow}">
<input class="layui-inline" type="radio"
th:each="exp, stat : ${#strings.listSplit(field.dictType, ';')}"
th:with="tmp=${#strings.arraySplit(exp, '-')}, value=${tmp[0]}, title=${tmp[1]}, checked=${#arrays.length(tmp)==3?tmp[2]:false}"
th:name="${field.fieldName}"
th:value="${value}"
th:title="${title}"
th:checked="${checked}"
/>
</th:block>
<!-- 数据字典类型 -->
<div dict-component="select"
th:if="${field.fieldType == 'dict'}"
th:disabled="${field.isDisabled}"
th:dict-type="${field.dictType}"
th:dict-name="${field.fieldName}"
th:id="${'dict-'+field.fieldName}"></div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="star-mark">*</span>部队代号</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="troop_code" dict-name="troopCode"
dict-width="100%" id="dict-troop-code"></div>
</div>
<label class="layui-form-label"><span class="star-mark">*</span>装备型号</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="equipment_model" dict-name="equipmentModel"
dict-width="100%" id="dict-equipment-model"></div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">导弹编号</label>
<div class="layui-input-inline">
<div dict-component="select" dict-type="missile_number" dict-name="missileNumber"
dict-width="100%" id="dict-missile-number"></div>
</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">文件描述</label>
<div class="layui-input-block" style="margin-left: 120px; width:640px;">
<textarea class="layui-textarea" name="remark"></textarea>
</div>
</div>
<div class="layui-form-item" th:each="labelSet, iterState:${LabelConfigSet}">
<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"
th:data-id="${labelSet.id}"
th:data-field-title="${labelSet.fieldTitle}"
th:data-label-id="${labelSet.labelId}"
th:data-label-title="${labelSet.labelTitle}"
th:data-label-id-path="${labelSet.labelIdPath}"
th:data-label-title-path="${labelSet.labelTitlePath}"></div>
<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}"
th:data-label-title="${labelSet.labelTitle}"
th:data-label-id-path="${labelSet.labelIdPath}"
th:data-label-title-path="${labelSet.labelTitlePath}"></div>
</div>
</div>
<div class="layui-form-item other-label-item">
<div class="layui-form-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 label-set-component other-label" th:data-field-title="其他标签"></div>
<div class="layui-input-block other-label-item">
<div class="label-set-component other-label" th:data-field-title="其他标签"></div>
</div>
</div>
<button class="layui-btn layui-btn-sm" id="btn_submit"
style="position: absolute; left: -50px; height: 0; border:0">
style="width: 100%;position: absolute; left: -50px; height: 0; border:0">
</button>
</form>
</div>