showAttrVal.vm
6.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#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()">
批量添加
</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>