|
@@ -27,6 +27,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
@@ -57,6 +58,7 @@ import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -147,8 +149,32 @@ public class TextdictInfoController extends BladeController {
|
|
|
@PostMapping("/remove")
|
|
|
@ApiOperationSupport(order = 7)
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
|
|
|
- textdictInfoService.deleDataInfoById(id);
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) throws FileNotFoundException {
|
|
|
+
|
|
|
+ TextdictInfo textdictInfo = textdictInfoService.getById(ids);
|
|
|
+ if(textdictInfo.getType()==5){
|
|
|
+ // 获取 节点信息
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(textdictInfo.getTabId()));
|
|
|
+
|
|
|
+ // 读取html页面信息
|
|
|
+ File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
+ String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
+ // 样式集合
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ //解析
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ Elements trs = table.select("tr");
|
|
|
+ String trtd[] = textdictInfo.getColKey().split("__");
|
|
|
+ Element element = trs.get(Integer.parseInt(trtd[1].split("_")[0])).select("td").get(Integer.parseInt(trtd[1].split("_")[1]));
|
|
|
+ if(element.html().indexOf("el-tooltip")>=0){
|
|
|
+ Element newele = element.children().get(0).children().get(0);
|
|
|
+ element.empty().append(newele+"");
|
|
|
+ File writefile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
+ FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ textdictInfoService.deleDataInfoById(ids);
|
|
|
return R.success("成功");
|
|
|
}
|
|
|
|
|
@@ -184,29 +210,25 @@ public class TextdictInfoController extends BladeController {
|
|
|
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");
|
|
|
-
|
|
|
+ System.out.println(y2);
|
|
|
String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
|
|
|
String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
|
|
|
|
|
|
String vmode = "formData." + keyname;
|
|
|
if (textdictInfo.getTextId().equals("input")) { // 单选框
|
|
|
element.empty().append("<el-input type='text' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
- element.children().get(0).attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
} else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
|
|
|
int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
|
|
|
- //@focus='getInformation("+oncklickText+")'
|
|
|
element.empty().append("<el-input :rows=" + rowspan * 2 + " type='textarea' placeholder=" + placeholder + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
|
|
|
- element.children().get(0).attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
} else if (textdictInfo.getTextId().equals("select")) { // 下拉框
|
|
|
String selectText = " <el-select v-model=" + vmode + " 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='" + i + "' :label='" + optionList.get(i).getDictValue() + "' :value='" + i + "' > </el-option>";
|
|
|
+ selectText += "<el-option key='" + i + "' label='" + optionList.get(i).getDictValue() + "' value='" + i + "' > </el-option>";
|
|
|
}
|
|
|
selectText += "</el-select>";
|
|
|
element.empty().append(selectText);
|
|
|
- element.children().get(0).attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
} else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
|
|
|
|
|
|
String radioText = "<template v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
|
|
@@ -217,40 +239,33 @@ public class TextdictInfoController extends BladeController {
|
|
|
}
|
|
|
radioText += "</template>";
|
|
|
element.empty().append(radioText);
|
|
|
- element.children().get(0).attr("v-on:click", "getInformation(" + oncklickText + ")");
|
|
|
- element.attr("tabindex", "-1");
|
|
|
} else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
|
|
|
-
|
|
|
- String checkbox = "<template 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++)
|
|
|
- checkbox += "<el-checkbox>" + optionList.get(i).getDictValue() + "</el-checkbox>";
|
|
|
+ Integer[] data = new Integer[optionList.size()];
|
|
|
+ JSONArray objs = new JSONArray();
|
|
|
+
|
|
|
+ for (int i = 0; i < optionList.size(); i++){
|
|
|
+ data[i]=i+1;
|
|
|
+ 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 :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);
|
|
|
}
|
|
|
- checkbox += "</template>";
|
|
|
- element.empty().append(checkbox);
|
|
|
- element.children().get(0).attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
- element.attr("tabindex", "-1");
|
|
|
} else if (textdictInfo.getTextId().equals("date")) { // 日期
|
|
|
-
|
|
|
element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' placeholder='" + placeholder + "'> </el-date-picker>");
|
|
|
- element.children().get(0).attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
-
|
|
|
} else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
|
|
|
element.empty().append("<el-date-picker 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("@focus", "getInformation(" + oncklickText + ")");
|
|
|
element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
|
|
|
} else if (textdictInfo.getTextId().equals("img")) {
|
|
|
- /*element.empty().append("<el-upload :disabled='formUploadLoading' v-loading='formUploadLoading' element-loading-text='上传中...' :on-progress='uploadprogress' @exceed='formUploadExceed' :on-error='formUploadError' placeholder="+placeholder+" v-model="+vmode+" keyname="+keyname+" weighing="+weighing+" class='hc-upload-table-form' action='/api/blade-resource/oss/endpoint/put-file' trIndex="+trindex+" tdIndex="+tdindex+" x1="+x1+" x2="+x2+" y1="+y1+" y2="+y2+" accept='image/png,image/jpg,image/jpeg' :headers='getTokenHeader' :show-file-list='false' > <img v-if='"+vmode+"' :src="+vmode+" class='hc-table-form-img' /> <div class='hc-table-form-icon' v-else> 点此选择文件并上传 </div> <div v-if="+vmode+" class='hc-table-form-del' >" +
|
|
|
- " <el-button type='danger'"+ " plain @click.stop=delTableFormFile('"+keyname+"')>删除当前文件</el-button> " +
|
|
|
- " </div></el-upload>");*/
|
|
|
-
|
|
|
- element.empty().append("<hc-table-form-upload :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 + "/> ");
|
|
|
-
|
|
|
- //element.children().get(0);
|
|
|
- element.attr("@focus", "getInformation(" + oncklickText + ")");
|
|
|
- element.attr("tabindex", "-1");
|
|
|
+ element.empty().append("<hc-table-form-upload :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> ");
|
|
|
+ }else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
|
|
|
+ element.empty().append("<hc-form-select-search type='dap_site_data' :val=" + vmode + " contractId='' pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + " @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + " x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
|
|
|
}
|
|
|
+ element.attr("@click", "getInformation(" + oncklickText + ")");
|
|
|
File writefile = new File(wbsTreePrivate.getHtmlUrl());
|
|
|
FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
Thread.sleep(300);
|
|
@@ -263,6 +278,9 @@ public class TextdictInfoController extends BladeController {
|
|
|
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);
|
|
|
}
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
|
|
@@ -275,25 +293,40 @@ public class TextdictInfoController extends BladeController {
|
|
|
public R<String> saveSigInfo(@Valid @RequestBody JSONObject dataInfo) throws IOException {
|
|
|
|
|
|
JSONArray jsonArray = dataInfo.getJSONArray("dataInfo");
|
|
|
- if(jsonArray==null || jsonArray.size()==0){
|
|
|
- return R.fail("保存列表无任何数据");
|
|
|
- }
|
|
|
- Long tableId = jsonArray.getJSONObject(0).getLong("tabId");
|
|
|
-
|
|
|
+ Long tableId = dataInfo.getLong("tabId");
|
|
|
// 删除
|
|
|
textdictInfoService.getBaseMapper().delete(Wrappers.<TextdictInfo>query().lambda()
|
|
|
.eq(TextdictInfo::getTabId, tableId));
|
|
|
+ if(jsonArray==null || jsonArray.size()==0 ){
|
|
|
+ return R.fail("保存列表无任何数据");
|
|
|
+ }
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(tableId);
|
|
|
// 读取html页面信息
|
|
|
File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
+
|
|
|
// 样式集合
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
+
|
|
|
//解析
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements trs = table.select("tr");
|
|
|
|
|
|
+ Elements onlyInfo = doc.select("el-input[readonly]");
|
|
|
+ if(onlyInfo!=null && onlyInfo.size()>=1){
|
|
|
+ for(Element element :onlyInfo ){
|
|
|
+ element.removeAttr("readonly");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Elements tryInfo = doc.select("td[dqid]");
|
|
|
+ if(tryInfo!=null && tryInfo.size()>=1){
|
|
|
+ for(Element element :tryInfo ){
|
|
|
+ element.removeAttr("dqid");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<TextdictInfo> textdictInfos = new ArrayList<>();
|
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
@@ -304,7 +337,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
|
|
|
String id = element.children().get(0).attr("keyname");
|
|
|
textdictInfo.setName("电签位置配置");
|
|
|
- textdictInfo.setType(2);
|
|
|
+ textdictInfo.setType(jsonObject.getInteger("type"));
|
|
|
textdictInfo.setColKey(id);
|
|
|
textdictInfo.setSigRoleId(jsonObject.getString("sigRoleId"));
|
|
|
textdictInfo.setTabId(jsonObject.getString("tabId"));
|
|
@@ -316,7 +349,7 @@ public class TextdictInfoController extends BladeController {
|
|
|
textdictInfoService.saveOrUpdate(textdictInfo);
|
|
|
element.removeAttr("dqId");
|
|
|
element.attr("dqId", textdictInfo.getId() + "");
|
|
|
- element.children().get(0).attr("readonly", true);
|
|
|
+ element.children().get(0).attr("readonly","true");
|
|
|
}
|
|
|
|
|
|
// 写入 excel
|