Bläddra i källkod

js代码调整

master
郑根木 2 år sedan
förälder
incheckning
7dc5822fde
3 ändrade filer med 11 tillägg och 2 borttagningar
  1. +1
    -0
      smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java
  2. +9
    -1
      smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java
  3. +1
    -1
      smtweb-framework/sw-system-bpm/src/main/resources/static/template/js_event.ftl

+ 1
- 0
smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/CodeBuildHandler.java Visa fil

@@ -190,6 +190,7 @@ public class CodeBuildHandler extends AbstractHandler {
model.put("packageName", packageName);
model.put("formTitle", form.getTitle());
model.put("service", sName);
model.put("eventPath", ModelFormHelper.getEventPath(form));

CodeGenerator.getInstance().generateService(model, codeJavaPath + "/" + sName + "Service.java");
}


+ 9
- 1
smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/design/form/ModelFormHelper.java Visa fil

@@ -357,13 +357,21 @@ public class ModelFormHelper {
* @param opts
*/
public static void buildOptsEx(ModelForm bean, SwMap opts) {
String eventPath = getEventPath(bean);
if (StringUtils.isNotEmpty(eventPath)) {
opts.put(KEY_EVENT_PATH, eventPath);
}
}

public static String getEventPath(ModelForm bean) {
String moduleName = ModelProjectCache.getInstance().getModule(bean.getPrjId());
if (StringUtils.isNotEmpty(moduleName)) {
String ep = moduleName;
String cn = ModelCatalogCache.getInstance().getFullName(bean.getMcId());
if (StringUtils.isNotEmpty(cn)) ep = ep + "." + cn;
opts.put(KEY_EVENT_PATH, ep + "." + bean.getName());
return ep + "." + bean.getName();
}
return "";
}

/**


+ 1
- 1
smtweb-framework/sw-system-bpm/src/main/resources/static/template/js_event.ftl Visa fil

@@ -2,7 +2,7 @@
* Created by ${user} at ${sysTime}
* 注册事件类【${title}】,参看event.defaultEvent.js
*/
window.$swEvent.setup("defaultEvent", {
window.$swEvent.setup("${eventPath}", {
setup(page){
const { $params,$refs, $widgets, $model, $utils, $tabRouter, $api } = page;
const { $$message, $$http } = $utils;


Laddar…
Avbryt
Spara