You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{extend name="../views/public/detail.html"/}
{block name="form"}
<script type="text/javascript">
$(document).ready(function () {
var timesJson = '{$timesListJson}';
var timesArray = JSON.parse(timesJson);
$('select[name=start_key]').change(function(){
var key = $(this).val();
changeTime(key);
});
function changeTime(key)
{
var start_html = '';
var end_html = '';
for (var index in timesArray){
if (timesArray[index]['key'] > key){
end_html += '<option value="'+timesArray[index]['key']+'">'+timesArray[index]['time']+'</option>';
}
}
$('select[name=end_key]').html(end_html);
}
});
</script>
<div class="form-group">
<label class="control-label col-lg-2">选择时段</label>
<div class="col-lg-2">
<select class="form-control m-bot15" name="start_key" notnull>
<option value="0">开始</option>
{volist name="timesList" id="vo"}
<option value="{$vo.key}" {if condition='!empty($data) && $data.start_time == $vo.time'}selected="selected" {/if}>{$vo.time}</option>
{/volist}
</select>
</div>
<div class="col-lg-2">
<select class="form-control m-bot15" name="end_key" notnull>
<option value="0">结束</option>
{volist name="timesList" id="vo"}
<option value="{$vo.key}" {if condition='!empty($data) && $data.end_time == $vo.time'}selected="selected" {/if}>{$vo.time}</option>
{/volist}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2">排序</label>
<div class="col-lg-10">
<input class="form-control" placeholder='最大值2147483647' type="number" min="0" step="1" name="sort" notnull
value="{$data.sort | default = 0}"/>
<p class="help-block">数字越大越靠前</p>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<input class="btn btn-danger" type="submit" value="提交保存">
<button class="btn btn-default backPrev" type="button">返回列表</button>
</div>
</div>
<input type="hidden" name="id" value="{$data.id | default=''}">
<input type="hidden" id="do_action" value="{:url('Spike/'.request()->action())}"/>
<input type="hidden" id="do_jump" value="{:url('Spike/times')}"/>
{/block}