Commit d7c00b6b by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com/platform/hp-smart into dev

parents 925e8d5a 5d9faa93
......@@ -233,6 +233,12 @@
SELECT NODE_ENAME as "memberId",TREE_ENAME as "parentId" FROM ${platSchema}.TEDPI10 WHERE NODE_ENAME = #memberId#
</select>
<!-- 更新图片地址 -->
<update id="updateImage">
UPDATE ${platSchema}.TEDPI10
SET NODE_IMAGE_PATH = #nodeImagePath#
WHERE 1=1
AND NODE_ENAME = #nodeEname#
</update>
</sqlMap>
......@@ -5,7 +5,10 @@
package com.baosight.iplat4j.ef.service;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -15,6 +18,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -61,4 +65,27 @@ public class ServiceEF0000 extends ServiceEPBase {
return outInfo;
}
/**
* 上传图标
*
* @param inInfo
* @return
*/
public EiInfo uploadIcon(EiInfo inInfo) {
try {
String nodeEname = inInfo.getString("nodeEname");
String docId = inInfo.getString("docId");
AssertUtils.isEmpty(nodeEname, "请选择菜单");
AssertUtils.isEmpty(docId, "请上传图标");
Map updateMap = new HashMap();
updateMap.put("nodeEname", nodeEname);
updateMap.put("nodeImagePath", docId);
dao.update("EDPI10.updateImage", updateMap);
inInfo.setMsg("上传图标成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "上传图标失败");
}
return inInfo;
}
}
......@@ -75,6 +75,8 @@ $(function () {
resultGrid.dataSource.page(1);
});
$("#UPLOAD_ICON").on("click", uploadIcon);
IPLATUI.EFGrid = {
"result": {
loadComplete:function (e){
......@@ -128,3 +130,46 @@ $(function () {
}
});
/**
* 上传图标
*/
let uploadIcon = function () {
let rows = resultGrid.getCheckedRows()
if (rows.length != 1) {
message("请选择一条菜单数据");
return;
}
JSColorbox.open({
href: "HPSC099?methodName=initLoad",
title: "<div style='text-align: center;'>图标上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let rows = resultGrid.getCheckedRows();
let inEiInfo = new EiInfo();
inEiInfo.set("nodeEname", rows[0]['node_ename']);
inEiInfo.set("docId", docId);
EiCommunicator.send('EF0000', 'uploadIcon', inEiInfo, {
onSuccess(res) {
message(res.msg);
if (res.status > -1) {
resultGrid.dataSource.page(1);
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment