bootstrap 表格列格式為進度條,並從後臺獲取進度的資料
阿新 • • 發佈:2019-01-27
@ApiOperation(value = "獲取進度", notes = "獲取進度") @RequestMapping(value = "/getProcess", method = RequestMethod.GET) @ResponseBody public Map getProcessValues(@RequestParam(value = "planId", required = false, defaultValue = "") String planId) { // // stringBuffer.append("<div class=\"progress\">");// stringBuffer.append("<div class=\"progress-bar progress-bar-info\" role=\"progressbar\" aria-valuenow=\"60\""); // stringBuffer.append(" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: " + str + "%;\">"); // // stringBuffer.append(" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 40%;\">");// stringBuffer.append("<span class=\"sr-only\">40% 完成</span> "); // stringBuffer.append("</div>"); // stringBuffer.append(" </div>"); // stringBuffer.append(""); // stringBuffer.append(""); int n = new Random().nextInt(100) + 1; String str = String.valueOf(n);// StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("<small>當前進度:" + str + "%</small>"); stringBuffer.append("<div class=\"progress progress-mini\">"); stringBuffer.append(" <div style=\"width: " + str + "%;\" class=\"progress-bar\"></div>"); stringBuffer.append("</div>"); stringBuffer.append(""); stringBuffer.append(""); stringBuffer.append(""); stringBuffer.append(""); Map<String, Object> map = new HashMap<>(); // map.put(planId, stringBuffer.toString()); System.out.println("" + map); return map; }