Browse Source

勋章场景, 类型

master
蟑螂恶霸 3 years ago
parent
commit
376368bfdf
  1. 16
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/add.html
  2. 18
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/detail.html
  3. 20
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/edit.html
  4. 2
      lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/SceneMedalController.java
  5. 11
      lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneMedal.java
  6. 5
      lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/resources/mapper/SceneMedalMapper.xml

16
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/add.html

@ -27,12 +27,24 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">类型:</label>
<div class="col-sm-10">
<select name="type" id="type" class="form-control m-b" th:with="type=${@dict.getType('medal_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">场景:</label>
<div class="col-sm-8">
<select id="post" class="form-control select2-multiple" multiple>
<select id="scene" class="form-control select2-multiple">
<option th:each="scene:${sceneList}" th:value="${scene.guid}" th:text="${scene.name}" th:disabled="${scene.status == '1'}"></option>
</select>
</div>
@ -112,6 +124,7 @@
showPreview: true,
showUpload: false,
uploadExtraData: function () {
var scene = $.form.selectSelects("scene");
var formData = $("#form-medal-add").serialize();
formData = decodeURIComponent(formData, true);
var arr = formData.split("&");
@ -135,6 +148,7 @@
});
data.option = JSON.stringify(optionList);
data.parentId = [[${parentId}]];
data.sceneId = scene;
return data;
},
// showBrowse: false,

18
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/detail.html

@ -3,6 +3,7 @@
<head>
<th:block th:include="zdxtInclude :: header('详情')"/>
<th:block th:include="zdxtInclude :: bootstrap-fileinput-css"/>
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -14,6 +15,22 @@
<input name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">场景:</label>
<div class="col-sm-8">
<select id="scene" class="form-control select2-multiple">
<option th:each="scene:${sceneList}" th:value="${scene.guid}" th:text="${scene.name}" th:selected="${scene.guid == sceneMedal.sceneId}" th:disabled="${scene.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">类型:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('medal_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
@ -52,6 +69,7 @@
</div>
<th:block th:include="zdxtInclude :: footer"/>
<th:block th:include="zdxtInclude :: bootstrap-fileinput-js"/>
<th:block th:include="include :: select2-js" />
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "small/project/medal";

20
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/medal/edit.html

@ -3,6 +3,7 @@
<head>
<th:block th:include="zdxtInclude :: header('编辑')" />
<th:block th:include="zdxtInclude :: bootstrap-fileinput-css"/>
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -14,6 +15,22 @@
<input name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">场景:</label>
<div class="col-sm-8">
<select id="scene" class="form-control select2-multiple">
<option th:each="scene:${sceneList}" th:value="${scene.guid}" th:text="${scene.name}" th:selected="${scene.guid == sceneMedal.sceneId}" th:disabled="${scene.status == '1'}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">类型:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('medal_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
@ -40,6 +57,7 @@
</div>
<th:block th:include="zdxtInclude :: footer" />
<th:block th:include="zdxtInclude :: bootstrap-fileinput-js"/>
<th:block th:include="include :: select2-js" />
<script type="text/javascript" th:inline="javascript">
var prefix = ctx + "small/project/medal"
$("#form-medal-edit").validate({
@ -131,6 +149,7 @@
showPreview: true,
showUpload: false,
uploadExtraData: function () {
var scene = $.form.selectSelects("scene");
var formData = $("#form-medal-edit").serialize();
formData = decodeURIComponent(formData, true);
var arr = formData.split("&");
@ -140,6 +159,7 @@
var value = item[1].replace("+", " ");
data[item[0]] = value;
}
data.sceneId = scene;
return data;
},
// showBrowse: false,

2
lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/SceneMedalController.java

@ -74,6 +74,8 @@ public class SceneMedalController extends BaseController {
public String detail(@PathVariable("guid") String guid, ModelMap mmap) {
SceneMedal sceneMedal = sceneMedalService.selectSceneMedalById(guid);
mmap.put("sceneMedal", sceneMedal);
List<SceneManage> sceneList = sceneManageService.selectSceneManageListAll(new SceneManage());
mmap.put("sceneList", sceneList);
return prefix + "/detail";
}

11
lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/domain/SceneMedal.java

@ -33,6 +33,9 @@ public class SceneMedal implements Serializable {
/** 绑定场景Id */
private String sceneId;
/** 类型 */
private String type;
/**
* 是否启用
*/
@ -89,6 +92,14 @@ public class SceneMedal implements Serializable {
this.sceneId = sceneId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getIconPath() {
return iconPath;
}

5
lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/resources/mapper/SceneMedalMapper.xml

@ -8,6 +8,7 @@
<result property="name" column="name"/>
<result property="iconPath" column="icon_path"/>
<result property="sceneId" column="scene_id"/>
<result property="type" column="type"/>
<result property="hide" column="hide"/>
<result property="creator" column="creator"/>
<result property="createTime" column="create_time"/>
@ -20,6 +21,7 @@
name,
icon_path,
scene_id,
type,
hide,
creator,
create_time,
@ -50,6 +52,7 @@
<if test="name != null and name != ''">`name`,</if>
<if test="iconPath != null and iconPath != ''">icon_path,</if>
<if test="sceneId != null and sceneId != ''">scene_id,</if>
<if test="type != null and type != ''">type,</if>
<if test="hide != null and hide != ''">hide,</if>
<if test="creator != null and creator != ''">creator,</if>
<if test="createTime != null ">create_time,</if>
@ -61,6 +64,7 @@
<if test="name != null and name != ''">#{name},</if>
<if test="iconPath != null and iconPath != ''">#{iconPath},</if>
<if test="sceneId != null and sceneId != ''">#{sceneId},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="hide != null and hide != ''">#{hide},</if>
<if test="creator != null and creator != ''">#{creator},</if>
<if test="createTime != null ">#{createTime},</if>
@ -75,6 +79,7 @@
<if test="name != null and name != ''">name = #{name},</if>
<if test="iconPath != null and iconPath != ''">icon_path = #{iconPath},</if>
<if test="sceneId != null and sceneId != ''">scene_id = #{sceneId},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="hide != null and hide != ''">hide = #{hide},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>

Loading…
Cancel
Save