|
@@ -228,93 +228,236 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+// /**
|
|
|
+// * 保存字段信息
|
|
|
+// */
|
|
|
+// @PostMapping("/saveTextInfo")
|
|
|
+// @ApiOperationSupport(order = 9)
|
|
|
+// @ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
|
|
|
+// public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
|
|
|
+//
|
|
|
+// // 获取 节点信息
|
|
|
+// WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
|
|
|
+//
|
|
|
+// // 读取html页面信息
|
|
|
+// String path = "";
|
|
|
+// String fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
+//
|
|
|
+// InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
+//
|
|
|
+// String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
+// // 样式集合
|
|
|
+// Document doc = Jsoup.parse(htmlString);
|
|
|
+//
|
|
|
+// //解析
|
|
|
+// Element table = doc.select("table").first();
|
|
|
+// Elements trs = table.select("tr");
|
|
|
+// Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
|
|
|
+// if (element.html().indexOf("el-tooltip") >= 0) {
|
|
|
+// element = element.children().get(0);
|
|
|
+// }
|
|
|
+// String trindex = element.children().get(0).attr("trindex");
|
|
|
+// String tdindex = element.children().get(0).attr("tdindex");
|
|
|
+// String x1 = element.children().get(0).attr("x1");
|
|
|
+// String x2 = element.children().get(0).attr("x2");
|
|
|
+// String y1 = element.children().get(0).attr("y1");
|
|
|
+// String y2 = element.children().get(0).attr("y2");
|
|
|
+// String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
|
|
|
+// String keyname = element.children().get(0).attr("keyname");
|
|
|
+// String weighing = element.children().get(0).attr("weighing");
|
|
|
+// String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
|
|
|
+// String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
|
|
|
+//
|
|
|
+// String vmode = "formData." + keyname;
|
|
|
+// String leftCli = "inputLeftClick($event,'" + keyname + "')";
|
|
|
+// if (textdictInfo.getTextId().equals("input")) { // 文本框
|
|
|
+// element.empty().append("<el-input @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
+//
|
|
|
+// } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
|
|
|
+// int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
|
|
|
+//
|
|
|
+// element.empty().append("<el-input :rows=" + rowspan * 2 + " id=" + keyname + " @mouseup.left=" + leftCli + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' placeholder=" + placeholder + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
+//
|
|
|
+// } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
|
|
|
+// String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
|
|
|
+// List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+// if (optionList != null && optionList.size() >= 1) {
|
|
|
+// for (int i = 0; i < optionList.size(); i++)
|
|
|
+// selectText += "<el-option key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "' value='" + optionList.get(i).getDictValue() + "' > </el-option>";
|
|
|
+// }
|
|
|
+// selectText += "</el-select>";
|
|
|
+// element.empty().append(selectText);
|
|
|
+//
|
|
|
+// } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
|
|
|
+//
|
|
|
+// String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
|
|
|
+// List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+// if (optionList != null && optionList.size() >= 1) {
|
|
|
+// for (int i = 0; i < optionList.size(); i++)
|
|
|
+// radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
|
|
|
+// }
|
|
|
+// radioText += "</el-radio-group >";
|
|
|
+// element.empty().append(radioText);
|
|
|
+// } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
|
|
|
+// List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+// if (optionList != null && optionList.size() >= 1) {
|
|
|
+// JSONArray objs = new JSONArray();
|
|
|
+// for (int i = 0; i < optionList.size(); i++) {
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("key", i + 1);
|
|
|
+// jsonObject.put("name", optionList.get(i).getDictValue());
|
|
|
+// objs.add(jsonObject);
|
|
|
+// }
|
|
|
+// String checkbox = "<hc-form-checkbox-group @keyDowns='dateKeydown()' :objs='" + objs + "' @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
|
|
|
+// element.empty().append(checkbox);
|
|
|
+// }
|
|
|
+// } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
|
|
|
+//
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
+// }
|
|
|
+//
|
|
|
+// /*else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
+// } else if (textdictInfo.getTextId().equals("dateHMS")) { // 日期--时分秒
|
|
|
+// element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
+// } else if (textdictInfo.getTextId().equals("dateSM")) { // 日期--时分
|
|
|
+// element.empty().append("<el-time-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
+// } else if (textdictInfo.getTextId().equals("dateMDHM")) { // 日期--月日时分
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM月DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
+// } else if (textdictInfo.getTextId().equals("dateDHM")) { // 日期--日时分
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
+// }*/
|
|
|
+//
|
|
|
+// else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
+// element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
+// } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
|
|
|
+// element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
+// element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
+//
|
|
|
+// } else if (textdictInfo.getTextId().equals("img")) { //图片
|
|
|
+// element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + " keyName=" + keyname + " weighing=" + weighing + " @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
|
|
|
+// element.removeAttr("style");
|
|
|
+// } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
|
|
|
+// element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
|
|
|
+// } else if (textdictInfo.getTextId().equals("strengthSearch")){ //强度搜索框
|
|
|
+// element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
|
|
|
+// }
|
|
|
+// element.attr("@click", "getInformation(" + oncklickText + ")");
|
|
|
+//
|
|
|
+// File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
+// if (!writeFile.exists()) {
|
|
|
+// if (StringUtils.isNotEmpty(path)) {
|
|
|
+// File file = new File(path);
|
|
|
+// if (!file.exists()) {
|
|
|
+// file.mkdirs();
|
|
|
+// }
|
|
|
+// FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+// }
|
|
|
+// Thread.sleep(300);
|
|
|
+// // 清空相关的保存数据
|
|
|
+// String tabName = wbsTreePrivate.getInitTableName();
|
|
|
+// String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
+// List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
|
|
|
+// if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
|
|
|
+// String clarSql = "update " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
|
|
|
+// jdbcTemplate.execute(clarSql);
|
|
|
+// }
|
|
|
+// fileInputStream.close();
|
|
|
+// return R.success("操作成功");
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 保存字段信息
|
|
|
*/
|
|
|
@PostMapping("/saveTextInfo")
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
|
|
|
- public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
|
|
|
+ public R saveTextInfo(@Valid @RequestBody List<TextdictDataInfoVO> list) throws Exception {
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ // 获取 节点信息
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(list.get(0).getTableId());
|
|
|
|
|
|
- // 获取 节点信息
|
|
|
- WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
|
|
|
+ // 读取html页面信息
|
|
|
+ String path = "";
|
|
|
+ String fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
|
|
|
- // 读取html页面信息
|
|
|
- String path = "";
|
|
|
- String fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
+ InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
|
|
|
- InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
+ String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
+ // 样式集合
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
- // 样式集合
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
+ //解析
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ Elements trs = table.select("tr");
|
|
|
+ for (TextdictDataInfoVO textdictInfo : list) {
|
|
|
+ Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
|
|
|
+ if (element.html().indexOf("el-tooltip") >= 0) {
|
|
|
+ element = element.children().get(0);
|
|
|
+ }
|
|
|
+ String trindex = element.children().get(0).attr("trindex");
|
|
|
+ String tdindex = element.children().get(0).attr("tdindex");
|
|
|
+ String x1 = element.children().get(0).attr("x1");
|
|
|
+ String x2 = element.children().get(0).attr("x2");
|
|
|
+ String y1 = element.children().get(0).attr("y1");
|
|
|
+ String y2 = element.children().get(0).attr("y2");
|
|
|
+ String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
|
|
|
+ String keyname = element.children().get(0).attr("keyname");
|
|
|
+ String weighing = element.children().get(0).attr("weighing");
|
|
|
+ String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
|
|
|
+ String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
|
|
|
+
|
|
|
+ String vmode = "formData." + keyname;
|
|
|
+ String leftCli = "inputLeftClick($event,'" + keyname + "')";
|
|
|
+ if (textdictInfo.getTextId().equals("input")) { // 文本框
|
|
|
+ element.empty().append("<el-input @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
+
|
|
|
+ } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
|
|
|
+ int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
|
|
|
+
|
|
|
+ element.empty().append("<el-input :rows=" + rowspan * 2 + " id=" + keyname + " @mouseup.left=" + leftCli + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' placeholder=" + placeholder + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
+
|
|
|
+ } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
|
|
|
+ String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
|
|
|
+ List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+ if (optionList != null && optionList.size() >= 1) {
|
|
|
+ for (int i = 0; i < optionList.size(); i++)
|
|
|
+ selectText += "<el-option key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "' value='" + optionList.get(i).getDictValue() + "' > </el-option>";
|
|
|
+ }
|
|
|
+ selectText += "</el-select>";
|
|
|
+ element.empty().append(selectText);
|
|
|
|
|
|
- //解析
|
|
|
- Element table = doc.select("table").first();
|
|
|
- Elements trs = table.select("tr");
|
|
|
- Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
|
|
|
- if (element.html().indexOf("el-tooltip") >= 0) {
|
|
|
- element = element.children().get(0);
|
|
|
- }
|
|
|
- String trindex = element.children().get(0).attr("trindex");
|
|
|
- String tdindex = element.children().get(0).attr("tdindex");
|
|
|
- String x1 = element.children().get(0).attr("x1");
|
|
|
- String x2 = element.children().get(0).attr("x2");
|
|
|
- String y1 = element.children().get(0).attr("y1");
|
|
|
- String y2 = element.children().get(0).attr("y2");
|
|
|
- String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
|
|
|
- String keyname = element.children().get(0).attr("keyname");
|
|
|
- String weighing = element.children().get(0).attr("weighing");
|
|
|
- String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
|
|
|
- String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
|
|
|
-
|
|
|
- String vmode = "formData." + keyname;
|
|
|
- String leftCli = "inputLeftClick($event,'" + keyname + "')";
|
|
|
- if (textdictInfo.getTextId().equals("input")) { // 文本框
|
|
|
- element.empty().append("<el-input @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
-
|
|
|
- } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
|
|
|
- int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
|
|
|
-
|
|
|
- element.empty().append("<el-input :rows=" + rowspan * 2 + " id=" + keyname + " @mouseup.left=" + leftCli + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='textarea' placeholder=" + placeholder + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
-
|
|
|
- } else if (textdictInfo.getTextId().equals("select")) { // 下拉框
|
|
|
- String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
|
|
|
- List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
- if (optionList != null && optionList.size() >= 1) {
|
|
|
- for (int i = 0; i < optionList.size(); i++)
|
|
|
- selectText += "<el-option key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "' value='" + optionList.get(i).getDictValue() + "' > </el-option>";
|
|
|
- }
|
|
|
- selectText += "</el-select>";
|
|
|
- element.empty().append(selectText);
|
|
|
+ } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
|
|
|
|
|
|
- } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
|
|
|
+ String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
|
|
|
+ List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+ if (optionList != null && optionList.size() >= 1) {
|
|
|
+ for (int i = 0; i < optionList.size(); i++)
|
|
|
+ radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
|
|
|
+ }
|
|
|
+ radioText += "</el-radio-group >";
|
|
|
+ element.empty().append(radioText);
|
|
|
+ } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
|
|
|
+ List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
+ if (optionList != null && optionList.size() >= 1) {
|
|
|
+ JSONArray objs = new JSONArray();
|
|
|
+ for (int i = 0; i < optionList.size(); i++) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("key", i + 1);
|
|
|
+ jsonObject.put("name", optionList.get(i).getDictValue());
|
|
|
+ objs.add(jsonObject);
|
|
|
+ }
|
|
|
+ String checkbox = "<hc-form-checkbox-group @keyDowns='dateKeydown()' :objs='" + objs + "' @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
|
|
|
+ element.empty().append(checkbox);
|
|
|
+ }
|
|
|
+ } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
|
|
|
|
|
|
- String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
|
|
|
- List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
- if (optionList != null && optionList.size() >= 1) {
|
|
|
- for (int i = 0; i < optionList.size(); i++)
|
|
|
- radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
|
|
|
- }
|
|
|
- radioText += "</el-radio-group >";
|
|
|
- element.empty().append(radioText);
|
|
|
- } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
|
|
|
- List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
|
|
|
- if (optionList != null && optionList.size() >= 1) {
|
|
|
- JSONArray objs = new JSONArray();
|
|
|
- for (int i = 0; i < optionList.size(); i++) {
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("key", i + 1);
|
|
|
- jsonObject.put("name", optionList.get(i).getDictValue());
|
|
|
- objs.add(jsonObject);
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
}
|
|
|
- String checkbox = "<hc-form-checkbox-group @keyDowns='dateKeydown()' :objs='" + objs + "' @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
|
|
|
- element.empty().append(checkbox);
|
|
|
- }
|
|
|
- } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
|
|
|
-
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY年MM月DD日 HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
- }
|
|
|
|
|
|
/*else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
|
|
|
element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
@@ -328,45 +471,48 @@ public class TextdictInfoController extends BladeController {
|
|
|
element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-time-picker>");
|
|
|
}*/
|
|
|
|
|
|
- else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
- element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
- } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
|
|
|
- element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
- element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
-
|
|
|
- } else if (textdictInfo.getTextId().equals("img")) { //图片
|
|
|
- element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + " keyName=" + keyname + " weighing=" + weighing + " @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
|
|
|
- element.removeAttr("style");
|
|
|
- } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
|
|
|
- element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
|
|
|
- } else if (textdictInfo.getTextId().equals("strengthSearch")){ //强度搜索框
|
|
|
- element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
|
|
|
- }
|
|
|
- element.attr("@click", "getInformation(" + oncklickText + ")");
|
|
|
-
|
|
|
- File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
- if (!writeFile.exists()) {
|
|
|
- if (StringUtils.isNotEmpty(path)) {
|
|
|
- File file = new File(path);
|
|
|
- if (!file.exists()) {
|
|
|
- file.mkdirs();
|
|
|
+ else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
+ element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
+ } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
|
|
|
+ element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + " start-placeholder='开始日期' end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
|
|
|
+ element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
+
|
|
|
+ } else if (textdictInfo.getTextId().equals("img")) { //图片
|
|
|
+ element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + " keyName=" + keyname + " weighing=" + weighing + " @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
|
|
|
+ element.removeAttr("style");
|
|
|
+ } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
|
|
|
+ element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
|
|
|
+ } else if (textdictInfo.getTextId().equals("strengthSearch")) { //强度搜索框
|
|
|
+ element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='contextmenuClick(" + parm + ")' @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
|
|
|
+ }
|
|
|
+ element.attr("@click", "getInformation(" + oncklickText + ")");
|
|
|
+
|
|
|
+ Thread.sleep(300);
|
|
|
+ // 清空相关的保存数据
|
|
|
+ String tabName = wbsTreePrivate.getInitTableName();
|
|
|
+ String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
+ List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
|
|
|
+ if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
|
|
|
+ String clarSql = "update " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
|
|
|
+ jdbcTemplate.execute(clarSql);
|
|
|
}
|
|
|
- FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
}
|
|
|
- } else {
|
|
|
- FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
- }
|
|
|
- Thread.sleep(300);
|
|
|
- // 清空相关的保存数据
|
|
|
- String tabName = wbsTreePrivate.getInitTableName();
|
|
|
- String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
- List<Map<String, Object>> tablist = jdbcTemplate.queryForList(isExitSql);
|
|
|
- if (tablist != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
|
|
|
- String clarSql = "update " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
|
|
|
- jdbcTemplate.execute(clarSql);
|
|
|
+ File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
+ if (!writeFile.exists()) {
|
|
|
+ if (StringUtils.isNotEmpty(path)) {
|
|
|
+ File file = new File(path);
|
|
|
+ if (!file.exists()) {
|
|
|
+ file.mkdirs();
|
|
|
+ }
|
|
|
+ FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+ }
|
|
|
+ fileInputStream.close();
|
|
|
+ return R.success("操作成功");
|
|
|
}
|
|
|
- fileInputStream.close();
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|