showAttrVal.vm 6.5 KB
#if($!{id} < 0)
#set($layout = "layout/empty.vm")
#end
<DIV id="navBar" class="page-header">
	<li><a href="$!{contextPath}/">首页</a><span class="divider">></span>
		<a href="$!{contextPath}/titan/attribute">属性管理</a>>
		<a href="">属性值编辑</a>
	</li>
</DIV>
<div class="table-header">
    <table class="table">
        <tr>
            <td>属性名称:$!{attrName}</td>
			#if($!{dealType} == 1)
				<td>属性类型:$!{attrType}</td>
			#end
			#if($!{dealType} == 1 || $!{dealType} == 2)
				 <td>属性输入类型:$!{attrInputType}</td>
			#end
			#if($!{dealType} == 3)
				<td>线上属性类型:$!{attrType}</td>
				<td>线上属性输入类型:$!{upStr}</td>
				<td>线下属性输入类型:$!{downStr}</td>
			#end           
		</tr>
	</table>
	<input type="hidden" id="params" value="$!{params}">
</div>
<div class="table-responsive">
	<div class="dataTables_wrapper">
    	<div class="row" style="height:70px">
			<div class="col-sm-6">
        		<div class="bottomBar">
					#if($!{addAttrValue})
                    	<button id='add-attr-value' class="btn btn-primary"  onclick="XUI.Attribute.AttrVal.disableBatchInsert()">
                    		添加属性值
                        </button>
                    <button id='batch-add-attr-value' class="btn btn-primary" #if($!{isBatch} == 1) style="display:none;" #end onclick="XUI.Attribute.AttrVal.showBatchInsert()">
                		&nbsp;批量添加&nbsp;
                    </button>
                    #end
                </div>
            </div>
        </div>
    </div>
	<fieldset >
		<form class="form-horizontal" name="insertAttrValue" method="POST" data-resultType="JSON" id="attr-value">
			<div class="alert alert-danger" id="attrAlert"style="DISPLAY: none"></div>
			<input type="hidden" id="attr-item-id" name="attr-val-id" value="$!{id}">
        	<table id="attr-val-tb" class="table table-striped table-bordered table-hover dataTable">
            	<thead >
    				<tr>
    					<th>
                			
                        </th>
                		<th>
                			属性值名称
                        </th>
                		<th>
                			操作
                        </th>
                    </tr>
                </thead>
    			<tbody >
            #foreach(${item} in ${list})
                <tr id="$!{item.id}">
    				<td width=10%>
					#if($!{addAttrValue})
    					<img src="/assets/image/u61.png" style="cursor: pointer;" onclick="XUI.Attribute.AttrVal.order('down',this);" alt="向下排序" title="向下排序" class="img">
                	    <img src="/assets/image/u140.png" style="cursor: pointer;" onclick="XUI.Attribute.AttrVal.order('up',this);" alt="向上排序" title="向上排序" class="img">
					#end		
                    </td>
                    <td width=35%>
    					<label attrValId="$!{item.id}" class="col-xs-10"  onClick="XUI.Attribute.AttrVal.modify(this,$!{item.id},$!{type})" #if($!{item.show} == 1) status="show" #else status="hide" #end attrId="$!{item.id}" value="$!{item.value}">$!{item.value}</label>
    					<span id="attr-value-edit-hide" style="display:NONE" class="input-icon">
    						<input type="text" id="attr-value-edit" maxlength="10" attrValId="$!{item.id}" class="col-xs-10"  value="$!{item.value}" onblur="XUI.Attribute.AttrVal.saveItem(this,$!{item.id},$!{id})" #if($!{item.show} == 1) status="show" #else status="hide" #end  />
    							<div >
    							</div>
    					</span>
            		</td>
                    <td width=55%>
            			<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                             #if($!{item.show} == 1)
    							<span id="show-label">已显示</span>
								#if($!{updateAttrShow})
    							  <a class="green" id="$!{item.id}" onclick="XUI.Attribute.AttrVal.toggleStatus(this)">[隐藏]</a>
								#end
                             #else
    							<span id="show-label">已隐藏</span>
								#if($!{updateAttrShow})
									<a class="green" id="$!{item.id}" onclick="XUI.Attribute.AttrVal.toggleStatus(this)">[显示]</a>
								#end
                			 #end			
							 #if($!{deleteAttrValue})
    							<a class="red" onclick="XUI.Attribute.AttrVal.deleteVal(this,$!{item.id})"><i class="icon-trash"></i>[删除]</a>
							 #end
                        </div>
            		</td>
            	</tr>
            #end
                </tbody>
            </table>
            <div class="dataTables_wrapper">
    			<div class="row">
					<div class="col-sm-3">
        			</div>
        			<div class="bottomBar ">
        				<button id="save-attr" class="btn btn-primary">提交更改</button>
        			</div>
    			</div>
			</div>
    	</form>
	</fieldset>
</div>
<div>
	<form class="form-horizontal" name="InsertAttrValue" method="POST" action="/titan/attribute" data-resultType="JSON"  id="batch-attr-value" style="display:none;">
		<div class="alert alert-danger" id="attrAlert"style="DISPLAY: none"></div>
		<textarea id="batch-value" rows="12" cols="100" wrap="physical" placeholder="每行请输入不超过10个字符"></textarea>
		<div class="dataTables_wrapper">
    	<div class="row">
			<div class="col-sm-3">
        	</div>
        	<div class="bottomBar ">
        		<input type="submit" id="batch-save-attr" class="btn btn-primary" onclick="return XUI.Attribute.AttrVal.saveBatchEvent()" value="提交" />
        	</div>
    	</div>
    	</div>
	</form>
</div>
<script tyep="text/javascript">
  $(document).ready(function(){
  	XUI.Attribute.AttrVal.init();
  });
</script>
<script id="attr_val_row_tmpl" type="text/x-jquery-tmpl">
    <tr>
		<td width=10%>
			<img src="/assets/image/u61.png" style="cursor: pointer;" onclick="XUI.Attribute.AttrVal.order('down',this);" alt="向下排序" title="向下排序" class="img">
            <img src="/assets/image/u140.png" style="cursor: pointer;" onclick="XUI.Attribute.AttrVal.order('up',this);" alt="向上排序" title="向上排序" class="img">
         </td>
        <td width=35%>
			<span id="attr-value-edit-hide"  class="input-icon">
				<input type="text" class="col-xs-10" maxlength="10" id="attr-value" order="" status="show" keyId="" />
			</span>
    	</td>
        <td width=55%>
    	<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">        
        	<span id="show-label">已显示</span>
        	<a class="green" onclick="XUI.Attribute.AttrVal.toggleStatus(this)">[隐藏]</a>
        	<a class="red" onclick="XUI.Attribute.AttrVal.deleteVal(this,null)"><i class="icon-trash"></i> [删除]</a>
    	</div>
    	</td>
    </tr>
</script>