@/*
|
头像参数的说明:
|
name : 名称
|
id : 头像的id
|
@*/
|
<div class="form-group" id="${id}_container">
|
<style type="text/css">.avatar-btn-hide { opacity: 0 }</style>
|
<label class="col-sm-3 control-label head-scu-label">
|
@if(isNotEmpty(required)){
|
<span style="color: red;">*</span>
|
@}
|
${name}</label>
|
<div class="col-sm-9">
|
<div class="col-sm-12">
|
<div class="col-sm-4">
|
<div id="${id}PreId">
|
<img width="100px" height="100px" src="${ctxPath}/static/img/NoPIC.png" />
|
</div>
|
</div>
|
<div class="col-sm-2">
|
<div class="head-scu-btn upload-btn" id="${id}BtnId">
|
<i class="fa fa-upload"></i> <span>上传</span>
|
</div>
|
</div>
|
@if( isNotEmpty( placeholder)) {
|
<div class="col-sm-8 col-sm-offset-4" style="color: red;">
|
${placeholder!}
|
</div>
|
@}
|
</div>
|
<div class="col-sm-12">
|
<div class="progress progress-striped" style="margin-top: 20px;">
|
<div id="${id}progressBar" style="width: 0%" aria-valuemax="100"
|
aria-valuemin="0" aria-valuenow="0" role="progressbar"
|
class="progress-bar progress-bar-info"></div>
|
</div>
|
<input style="opacity:0" id="${id}" value="${value!}" name="${id}"/>
|
</div>
|
<script>$(function () {
|
// 初始化图片上传
|
var imageUp = new $WebUploadImage("${id}");
|
imageUp.setUploadBarId("${id}progressBar");
|
imageUp.init();
|
|
if ( "${value!}") {
|
var $image = $("#${id}PreId").find("img");
|
$image.attr( "src", "${value!}");
|
$("#${id}BtnId").find( "span").text("更改");
|
|
$( "#${id}_container").find("img").on( "click", function() {
|
Feng.openImageLayerMax( this);
|
});
|
}
|
|
$("#${id}").on( "valueChange", function (){
|
$("#${id}BtnId").find( "span").text("更改");
|
|
$( "#${id}_container").find("img").on( "click", function() {
|
Feng.openImageLayerMax( this);
|
});
|
});
|
|
$.fn.extend({
|
avatar_disabled: function ( flag) {
|
var $this = $(this);
|
var $id = "#" + $this.attr( "id");
|
if ( flag) {
|
$this.val("");
|
$($id + "PreId").find( "img")
|
.attr( "src", "${ctxPath}/static/img/NoPIC.png");
|
$($id + "progressBar").css({width: "0%"});
|
}
|
$($id + "BtnId")[ flag ? "addClass":"removeClass"]( "avatar-btn-hide");
|
},
|
avatar_disable_btn: function( flag) {
|
var $id = "#" + $(this).attr( "id");
|
$($id + "BtnId")[ flag ? "hide":"show"]();
|
},
|
hide_container: function ( flag) {
|
var id = $( this).attr( "id");
|
$( "#" + id + "_container")[ (!flag) ? "show": "hide"]();
|
}
|
});
|
})</script>
|
</div>
|
</div>
|
@if(isNotEmpty(underline) && underline == 'true'){
|
<div class="hr-line-dashed"></div>
|
@}
|