修改简化元数据提交过程

This commit is contained in:
Li Jianxuan 2013-01-28 03:17:07 +00:00
parent cc5738a606
commit bb5e39f45d
1 changed files with 96 additions and 16 deletions

View File

@ -40,19 +40,19 @@ $this->breadcrumb()->setSeparator(' > ');
<div class="step_ctl">
<ul>
<li>
<a href="javascript:void(0);" onclick="jumpstep(1)">
<a href="javascript:void(0);" onclick="jumpstep(1)" class="step_btns">
<div class="title">Step1</div>
<div class="description">元数据基本信息</div>
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="jumpstep(2)">
<a href="javascript:void(0);" onclick="save(0,this,2)" class="step_btns">
<div class="title">Step2</div>
<div class="description">时空范围</div>
</a>
</li>
<li>
<a href="javascript:void(0);" onclick="jumpstep(3)">
<a href="javascript:void(0);" onclick="save(0,this,3)" class="step_btns">
<div class="title">Step3</div>
<div class="description">元数据基本信息</div>
</a>
@ -93,7 +93,7 @@ $this->breadcrumb()->setSeparator(' > ');
</div>
<div class="control-group" id="next_step_button" >
<div class="controls">
<button type="button" onclick="save()" class="btn btn-green">下一步</button>
<button type="button" onclick="save(0,this,2)" class="btn btn-green">下一步</button>
</div>
</div>
</fieldset>
@ -160,6 +160,11 @@ $this->breadcrumb()->setSeparator(' > ');
</div>
</fieldset>
<div class="control-group" id="next_step_button" >
<div class="controls">
<button type="button" onclick="save(0,this,3)" class="btn btn-green">下一步</button>
</div>
</div>
</div>
<div class="stepy_content" id="step_content_3" style="display:none;">
<fieldset>
@ -268,8 +273,8 @@ $this->breadcrumb()->setSeparator(' > ');
<div class="control-group">
<div class="controls">
<button type="button" onclick="save(0,this)" class="btn btn-green">保存草稿</button>
<button type="button" onclick="save(1,this)" class="btn btn-green">提交元数据</button>
<button type="button" onclick="save(0,this,'')" class="btn btn-green">保存草稿</button>
<button type="button" onclick="save(1,this,'')" class="btn btn-green">提交元数据</button>
</div>
</div>
@ -301,12 +306,6 @@ $(function() {
InputTextSet();
});
//FormStep
function jumpstep(id){
$('.stepy_content').css('display','none');
$('#step_content_'+id).css("display","block");
}
// Metadata Commit Part
function getValue(){
return $('#metadata_temp_value').serialize();
@ -333,8 +332,12 @@ function prepare(){
});
}
function save(s,btn){
function save(s,btn,jump){
prepare();
if(CheckStep(jump) == false)
{
return false;
}
var postdata = "";
if(s>0)
{
@ -359,11 +362,16 @@ function save(s,btn){
}
if(typeof(data.saved) != 'undefined')
{
if(jump != '')
{
jumpstep(jump);
}else{
Alert('保存成功');
}
}
if(typeof(data.uuid)!='undefined')
{
$('#temp_uuid').val(data.uuid);$('#form_part_b').css('display','block');$('#next_step_button').hide();initialize()
$('#temp_uuid').val(data.uuid);$('#form_part_b').css('display','block');initialize();
}
}
else{
@ -383,6 +391,68 @@ function save(s,btn){
});
}
//FormStep
function jumpstep(id){
$('.stepy_content').css('display','none');
$('#step_content_'+id).css("display","block");
}
function CheckStep(id){
if($('input[name=title]').val() == "")
{
Alert("请输入元数据标题");
return false;
}
if($('input[name=title_en]').val() == "")
{
Alert("请输入元数据英文标题");
return false;
}
if($('textarea[name=description]').val() == "")
{
Alert("请输入元数据简介");
return false;
}
if(id == 2)
{
return true;
}
if(id == 3)
{
if($('input[name=timebegin]').val() == "")
{
Alert("请选择数据开始时间");
return false;
}
if($('input[name=timeend]').val() == "")
{
Alert("请选择数据结束时间");
return false;
}
if($('input[name=east]').val() == "")
{
Alert("请选择数据地理范围:东");
return false;
}
if($('input[name=south]').val() == "")
{
Alert("请选择数据地理范围:南");
return false;
}
if($('input[name=west]').val() == "")
{
Alert("请选择数据地理范围:西");
return false;
}
if($('input[name=north]').val() == "")
{
Alert("请选择数据地理范围:北");
return false;
}
return true;
}
}
function AutoComplete(input)
{
if($('#auto-complete-elements').length > 0)
@ -629,7 +699,7 @@ function MapValueChange(east,north,west,south){
}
function InputValueChange(){
if($(input.east).val() != "" && $(input.west).val() != "" && $(input.north).val() != "" && $(input.south).val() != "")
if(MapInputValueCheck() == true)
{
if(rectangle == null)
{
@ -644,6 +714,16 @@ function InputValueChange(){
}
}
function MapInputValueCheck()
{
if($(input.east).val() != "" && $(input.west).val() != "" && $(input.north).val() != "" && $(input.south).val() != "")
{
return true;
}else{
return false;
}
}
$(input.east).bind('blur',InputValueChange);
$(input.west).bind('blur',InputValueChange);
$(input.north).bind('blur',InputValueChange);