Selaa lähdekoodia

李剑-节假日信息维护功能开发-表单项增加长度限制,增加更多说明,假日数据项改成只读,只允许导入数据。

lijian 4 vuotta sitten
vanhempi
commit
72a3ed7b27

+ 4 - 6
src/main/java/platform/modules/government/web/SupermeController.java

@@ -1040,7 +1040,7 @@ public class SupermeController extends BaseController {
 
 		PageInfo<SysConfig> pageInfo = sysConfigService.findPage(pageNum, PAGESIZE,"year_");
 		modelMap.put("pageInfo", pageInfo);
-		modelMap.put("fileUrl", setFileUrl());
+		//modelMap.put("fileUrl", setFileUrl());
 		return BASE_SUPER_PATH + "holiday/holiday_list";
 	}
 
@@ -1052,7 +1052,7 @@ public class SupermeController extends BaseController {
 	 */
 	@OperationLog(value = "新增假日信息")
 	@GetMapping(value = "/holiday/add")
-	public String addHolidayPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,ModelMap modelMap) {
+	public String addHolidayPage(ModelMap modelMap) {
 
 		Map<String,String> mapTemplateFileInfo = holidayExcelTemplateUtil.getTemplateFileInfo();
 		modelMap.put("templateFileUrl",mapTemplateFileInfo.get("templateFileUrl"));
@@ -1063,14 +1063,12 @@ public class SupermeController extends BaseController {
 
 	/**
 	 * 修改相应假日信息
-	 * @param pageNum
 	 * @param modelMap
 	 * @return
 	 */
 	@OperationLog(value = "编辑假日信息")
 	@GetMapping(value = "/holiday/edit/{id}")
-	public String editHolidayPage(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-								   @PathVariable("id") Integer id,ModelMap modelMap) {
+	public String editHolidayPage(@PathVariable("id") Integer id,ModelMap modelMap) {
 		SysConfig holidayInfo = sysConfigService.findById(id);
 
 		modelMap.put("id", holidayInfo.getId());
@@ -1090,7 +1088,7 @@ public class SupermeController extends BaseController {
 	@OperationLog(value = "节假日信息删除")
 	@ResponseBody
 	@DeleteMapping(value = "/holiday/delete/{id}")
-	public ResponseMessage deleteHoliday(@PathVariable("id") int id,ModelMap modelMap) {
+	public ResponseMessage deleteHoliday(@PathVariable("id") int id) {
 		SysConfig ent2Del = sysConfigService.findById(id);
 		if (null == ent2Del) {
 			return ResponseMessage.error("未找到相应的假日信息");

+ 3 - 3
src/main/resources/static/js/super/holiday/holiday_add.js

@@ -4,7 +4,7 @@ $(function () {
             configKey: {
                 required: true,
                 minlength: 1,
-                maxlength: 60,
+                maxlength: 9,
                 remote: {
                     url: pagePath + "/super/isExistHoliday",
                     type: "get",
@@ -18,9 +18,9 @@ $(function () {
                     }
                 }
             },
-            remark: {
+            configName: {
                 minlength: 1,
-                maxlength: 200
+                maxlength: 20
             }
         },
         messages: {

+ 21 - 4
src/main/resources/templates/admin/super/holiday/holiday_add.html

@@ -17,21 +17,38 @@
 				<input type="text" class="input-text" required value="" th:value="${configName}"  th:id="configName" th:name="configName"/>
 			</div>
 		</div>
-
+		<div class="row cl">
+			<label class="form-label col-xs-4 col-sm-2"></label>
+			<div class="formControls col-xs-8 col-sm-9">
+				<span class="c-red">名称不能超过20个汉字</span>
+			</div>
+		</div>
 		<div class="row cl">
 			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>年份:</label>
 			<div class="formControls col-xs-8 col-sm-9">
-				<input type="text" class="input-text" required value="" th:value="${configKey}"  th:id="configKey" th:name="configKey"/>
+				<input type="text" class="input-text"  required value="" th:value="${configKey}?${configKey}:year_"  th:id="configKey" th:name="configKey"/>
 			</div>
 		</div>
 
 		<div class="row cl">
-			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>假日数据:</label>
+			<label class="form-label col-xs-4 col-sm-2"></label>
 			<div class="formControls col-xs-8 col-sm-9">
-				<input type="text" class="input-text" required value="" th:value="${configValue}"  th:id="configValue" th:name="configValue"/>
+				<span class="c-red">年份格式:year_xxxx(比如:year_2022)</span>
 			</div>
 		</div>
 
+		<div class="row cl">
+			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>假日数据:</label>
+			<div class="formControls col-xs-8 col-sm-9">
+				<input type="text" class="input-text" disabled="true" readOnly="true" required value="" th:value="${configValue}"  th:id="configValue" th:name="configValue"/>
+			</div>
+		</div>
+		<div class="row cl">
+			<label class="form-label col-xs-4 col-sm-2"></label>
+			<div class="formControls col-xs-8 col-sm-9">
+				<span class="c-red">假日数据:请下载模板文件,按模板文件格式制作数据,完成后导入。</span>
+			</div>
+		</div>
 
 		<div class="row cl">
 			<label class="form-label col-xs-4 col-sm-2"><span>模板文件:</span></label>