新增:文件预览页面改为文件属性根据表单配置进行动态渲染

master
Guo XIn 1 year ago
parent 0e3cb15881
commit 40db95fc0c
  1. 2
      shandan-system/src/main/resources/static/css/sys/file/fileView.css
  2. 8
      shandan-system/src/main/resources/static/js/sys/file/view.js
  3. 46
      shandan-system/src/main/resources/view/sys/file/fileView.html

@ -51,6 +51,8 @@ ul.file-viewer-tab li:hover {
} }
.file-property .field-name{ .file-property .field-name{
width: 70px; width: 70px;
text-align: right;
padding-right: 10px;
} }
.file-property .field-value{ .file-property .field-value{
flex: 1; flex: 1;

@ -9,6 +9,9 @@
layui.use(['layer', 'laytpl', 'dropdown', 'carousel', 'form', 'datalabel'], function () { layui.use(['layer', 'laytpl', 'dropdown', 'carousel', 'form', 'datalabel'], function () {
for (let col in file) { for (let col in file) {
switch (col) { switch (col) {
case 'secretLevel':
$(`label[name="${col}"]`).text(DICT.getText('secret_level', file[col]));
break;
case 'taskNature': case 'taskNature':
$(`label[name="${col}"]`).text(DICT.getText('task_nature', file[col])); $(`label[name="${col}"]`).text(DICT.getText('task_nature', file[col]));
break; break;
@ -26,7 +29,10 @@ layui.use(['layer', 'laytpl', 'dropdown', 'carousel', 'form', 'datalabel'], func
} }
} }
break; break;
case 'secretLevel': case 'exerciseData':
$(`label[name="${col}"]`).text(file[col] == 0 ? '否' : '是');
break;
case '':
$(`label[name="${col}"]`).text(DICT.getText('secret_level', file[col])); $(`label[name="${col}"]`).text(DICT.getText('secret_level', file[col]));
break; break;
default: default:

@ -35,45 +35,13 @@
<label class="field-name">文件名称</label> <label class="field-name">文件名称</label>
<label class="field-value" name="fileName"></label> <label class="field-value" name="fileName"></label>
</div> </div>
<div class="file-property"> <div class="file-property"
<label class="field-name">文件密级</label> th:each="field,iterStat : ${uploadFormConfig}"
<label class="field-value" name="secretLevel"></label> th:if="${field.isShow}"
</div> th:style="${field.fieldType == 'textarea' ? 'width: calc(100% - 30px);' : ''}"
<div class="file-property"> th:with="username=*{userName}">
<label class="field-name">录入人员</label> <label class="field-name" th:text="${field.showTitle}">文件名称</label>
<label class="field-value" name="entryStaff"></label> <label class="field-value" th:name="${field.fieldName}" th:value="${field.fieldName}"></label>
</div>
<div class="file-property">
<label class="field-name">导弹编号</label>
<label class="field-value" name="missileNumber"></label>
</div>
<div class="file-property">
<label class="field-name">目标/靶标类型</label>
<label class="field-value" name="targetNumber"></label>
</div>
<div class="file-property">
<label class="field-name">文件来源</label>
<label class="field-value" name="source"></label>
</div>
<div class="file-property">
<label class="field-name">目标性质</label>
<label class="field-value" name="taskNature"></label>
</div>
<div class="file-property">
<label class="field-name">部队代号</label>
<label class="field-value" name="troopCode"></label>
</div>
<div class="file-property">
<label class="field-name">装备型号</label>
<label class="field-value" name="equipmentModel"></label>
</div>
<div class="file-property">
<label class="field-name">任务时间</label>
<label class="field-value" th:text="${file_inputDate}"></label>
</div>
<div class="file-property">
<label class="field-name">文件描述</label>
<label class="field-value" name="remark"></label>
</div> </div>
<div class="file-property" th:each="labelSet, iterState:${LabelConfigSet}"> <div class="file-property" th:each="labelSet, iterState:${LabelConfigSet}">
<label class="field-name" th:text="${labelSet.fieldTitle}">标签类型</label> <label class="field-name" th:text="${labelSet.fieldTitle}">标签类型</label>