Eova列表顯示圖片並點擊放大

eova3.3.0支持新的上傳文件姿式:設置元字段配置javascript

{"filename":"ORIGINAL_TIME"}

在原先保存原文件名的基礎上動態增長了時間戳,在保留上傳文件名的同時,又避免了文件名重複替換的問題
 java

// 原文件名_時間戳(用於保持原文件+不重名)
if (fileNameConfig.equals("ORIGINAL_TIME")) {
	return System.currentTimeMillis() + "@" + file.getOriginalFileName();
}

設置圖片顯示:元字段格式化器設置展現web

function(value, row, index, field) {
    if (value) {
        return '<img src="http://域名/目錄/' + value + '" height=25>'
    }
    return value
}

點擊放大js,複製存放到webapp目錄下app

$(document).ready(function () {
    setTimeout(function () {
        $("img").click(function (e) {
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose:true,
                content: '<img style="width:300px;height:300px"src="'+e.currentTarget.currentSrc+'">' 
            });
        })
    },1000);

});

菜單對象引入該js,刷新頁面就可實現圖片點擊放大webapp

相關文章
相關標籤/搜索