|
按照外卖案例后台管理页面,来制作我自己的内容管理页面,添加了attachmentSimple组件,图片已经传到数据库中。在image中bind-attr-src属性中按照你们案例填写 $model.transUrl($object),同时也拷贝了改代码并把数据字段换成我自己文件的, Model.prototype.transUrl = function(row) { var src = null;
if (row.val('fImg_title') != null && row.val('fImg_title') != "" && row.val('fImg_title') != "[]") {
var imageJson = eval("(" + row.val('fImg_title') + ")");
var realFileName = imageJson[0]["realFileName"];
var storeFileName = imageJson[0]["storeFileName"];
var ownerID = row.val('fID');
var operateType = "browse";
var url = this.actionUrl + '?realFileName=' + realFileName + '&storeFileName=' + storeFileName + '&ownerID=' + ownerID + '&operateType=' + operateType;
src = require.toUrl(url);
}
return src;
};
问题1、保存后出现如图提示:
但是你们的案例里面没有这个错误提示。
然后在baas中也添加了service.m 文件,同时在js文件里面顶部也添加了this.actionUrl = "/baas/lfc/attachment/SimpleFileStore"; 然后模型编译baas出现错误,控制台提示如下:
2017-03-14 10:45:45 开始-WINDOW生成中间文件: /UI2/lfc/newsManage.w
2017-03-14 10:45:45 结束-WINDOW生成中间文件: /UI2/lfc/newsManage.w
2017-03-14 10:45:45 开始-中间文件生成缓存文件: /UI2/lfc/newsManage.w
2017-03-14 10:45:46 结束-中间文件生成缓存文件: /UI2/lfc/newsManage.w
2017-03-14 10:45:46 开始-WINDOW生成中间文件: /UI2/system/components/justep/attachment/demo/demoSimple.w
2017-03-14 10:45:46 结束-WINDOW生成中间文件: /UI2/system/components/justep/attachment/demo/demoSimple.w
2017-03-14 10:45:46 开始-中间文件生成缓存文件: /UI2/system/components/justep/attachment/demo/demoSimple.w
2017-03-14 10:45:47 结束-中间文件生成缓存文件: /UI2/system/components/justep/attachment/demo/demoSimple.w
2017-03-14 10:45:50 Action[lfc/attachment/SimpleFileStore] Method加载失败,可能原因:Baas模型没有编译,请Baas模型编译后重启服务!
java.lang.NoSuchMethodException: lfc.Attachment__do.SimpleFileStore(com.alibaba.fastjson.JSONObject, com.justep.baas.action.ActionContext)
at java.lang.Class.getMethod(Class.java:1786)
at com.justep.baas.action.Engine.execAction(Unknown Source)
at com.justep.baas.action.Engine.execAction(Unknown Source)
at com.justep.baas.servlet.BaasServlet.execService(Unknown Source)
at com.justep.baas.servlet.BaasServlet.service(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
com.justep.baas.action.ActionException: Action[lfc/attachment/SimpleFileStore] Method加载失败,可能原因:Baas模型没有编译,请Baas模型编译后重启服务!
at com.justep.baas.action.Engine.execAction(Unknown Source)
at com.justep.baas.action.Engine.execAction(Unknown Source)
at com.justep.baas.servlet.BaasServlet.execService(Unknown Source)
at com.justep.baas.servlet.BaasServlet.service(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: lfc.Attachment__do.SimpleFileStore(com.alibaba.fastjson.JSONObject, com.justep.baas.action.ActionContext)
at java.lang.Class.getMethod(Class.java:1786)
... 16 more
最后就是前台界面显示,图片无法加载:
前台界面
在$model.transUrl($object) ,$object这个值不知道是什么原因,帮忙解决下图片显示问题。
|
|