@@ -156,15 +156,18 @@ public class DynPageSaveHandler extends AbstractDynPageHandler { | |||||
if (id <= 0) { | if (id <= 0) { | ||||
bean = dao.createBean(); | bean = dao.createBean(); | ||||
bean.setIsNew(true); | bean.setIsNew(true); | ||||
//暂时不考虑list保存的情况 | |||||
bean.getData().putAll(data); | |||||
setNewId(bean); | setNewId(bean); | ||||
} else { | } else { | ||||
bean = dao.queryEntity(id); | bean = dao.queryEntity(id); | ||||
if (bean == null) { | if (bean == null) { | ||||
throw new BizException("没有找到待保存的记录:" + table.getName() + "." + id); | throw new BizException("没有找到待保存的记录:" + table.getName() + "." + id); | ||||
} | } | ||||
//暂时不考虑list保存的情况 | |||||
bean.getData().putAll(data); | |||||
} | } | ||||
//暂时不考虑list保存的情况 | |||||
bean.getData().putAll(data); | |||||
return bean; | return bean; | ||||
} | } | ||||
@@ -2,6 +2,7 @@ package cc.smtweb.system.bpm.web.sys.user.area; | |||||
import cc.smtweb.framework.core.common.SwMap; | import cc.smtweb.framework.core.common.SwMap; | ||||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | import cc.smtweb.framework.core.db.impl.DefaultEntity; | ||||
import cc.smtweb.framework.core.util.NumberUtil; | |||||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | ||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageLoadHandler; | import cc.smtweb.system.bpm.web.engine.dynPage.DynPageLoadHandler; | ||||
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageSaveHandler; | import cc.smtweb.system.bpm.web.engine.dynPage.DynPageSaveHandler; | ||||
@@ -16,7 +17,7 @@ public class AreaHandler { | |||||
protected void setNewId(DefaultEntity bean) { | protected void setNewId(DefaultEntity bean) { | ||||
if (bean instanceof Area) { | if (bean instanceof Area) { | ||||
Area area = (Area) bean; | Area area = (Area) bean; | ||||
area.setEntityId(Long.parseLong(area.getCode())); | |||||
area.setEntityId(NumberUtil.getLongIgnoreErr(area.getCode())); | |||||
} else { | } else { | ||||
super.setNewId(bean); | super.setNewId(bean); | ||||
} | } | ||||
@@ -0,0 +1,30 @@ | |||||
/** | |||||
* Created by 1 at 2022-07-26 17:18:17 | |||||
* 注册事件类【行政区划管理】,参看event.defaultEvent.js | |||||
*/ | |||||
window.$swEvent.setup("bpm.sys.user.area.area_list", { | |||||
setup(page){ | |||||
const { $params,$refs, $widgets, $model, $utils, $tabRouter, $api } = page || {}; | |||||
const { $$message, $$http } = $utils || {}; | |||||
const custom = {}; | |||||
// | |||||
const focusName = () => { | |||||
custom.name = $model.areacard.getFormVal("ar_name"); | |||||
}; | |||||
const changeName = (value) => { | |||||
if ($model.areacard.getFormVal("ar_full_name") === custom.name) | |||||
$model.areacard.setFormVal("ar_full_name", value); | |||||
}; | |||||
const focusCode = () => { | |||||
custom.code = $model.areacard.getFormVal("ar_code"); | |||||
}; | |||||
const changeCode = (value) => { | |||||
if ($model.areacard.getFormVal("ar_seq") === custom.code) | |||||
$model.areacard.setFormVal("ar_seq", value); | |||||
}; | |||||
return { | |||||
focusName, changeName, focusCode, changeCode | |||||
} | |||||
} | |||||
}); |
@@ -1,11 +1,13 @@ | |||||
package cc.smtweb.system.bpm.test; | package cc.smtweb.system.bpm.test; | ||||
import cc.smtweb.framework.core.util.FileUtil; | import cc.smtweb.framework.core.util.FileUtil; | ||||
import cc.smtweb.system.bpm.util.IdeaUtil; | |||||
import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; | import cc.smtweb.system.bpm.web.design.form.ModelFormHelper; | ||||
import cc.smtweb.system.bpm.web.design.form.define.PageDatasetDynCond; | import cc.smtweb.system.bpm.web.design.form.define.PageDatasetDynCond; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.Map; | |||||
/** | /** | ||||
* Created by Akmm at 2021/12/25 22:21 | * Created by Akmm at 2021/12/25 22:21 | ||||
@@ -13,13 +15,7 @@ import java.util.Collections; | |||||
public class TestMain { | public class TestMain { | ||||
public static void main(String[] args) throws Exception { | public static void main(String[] args) throws Exception { | ||||
String js = FileUtil.readFileStr("e:\\jujia\\git\\6.0\\smtweb2\\smtweb-framework\\bpm\\src\\main\\resources\\static\\event\\defaultEvent.js"); | |||||
int index = js.lastIndexOf("return "); | |||||
if (index < 0) { | |||||
return; | |||||
} | |||||
index = js.indexOf("{", index); | |||||
js = js.substring(index + 1, js.indexOf("}", index)).trim(); | |||||
System.out.println(js.split(",")); | |||||
Map<String, String> map = IdeaUtil.getModules("d:/work/smtweb2/smtweb-framework"); | |||||
} | } | ||||
} | } |