自定义页面编辑优化
parent
718804ef33
commit
983dacbf37
|
|
@ -5,7 +5,7 @@
|
|||
<img src="{{if empty($data['logo'])}}{{$attachment_host}}/static/common/images/default-images-mini.png{{else /}}{{$data.logo}}{{/if}}" class="am-img-thumbnail am-radius page-top-nav-logo" />
|
||||
<span class="page-top-nav-title">
|
||||
<span class="am-text-xs">{{if !empty($data['name'])}}{{$data.name}}{{/if}}</span>
|
||||
<a href="javascript:;" class="am-icon-eyedropper am-text-xs am-margin-left-xs" data-am-modal="{target: '#popup-saveinfo'}"></a>
|
||||
<a href="javascript:;" class="am-icon-eyedropper am-text-xs am-margin-left-xs base-edit-submit"></a>
|
||||
</span>
|
||||
<div class="page-operate-container am-fr">
|
||||
<a href="javascript:;" class="am-btn am-btn-warning am-btn-xs am-radius am-icon-close window-close-event" data-msg="{{:MyLang('save_close_page_confirm_tips')}}"> {{:MyLang('close_title')}}</a>
|
||||
|
|
@ -31,12 +31,24 @@
|
|||
// 基础数据保存回调处理
|
||||
function FormBackSaveinfoEdit(e)
|
||||
{
|
||||
// logo
|
||||
$('.page-top-nav-logo').attr('src', e.logo || '{{$attachment_host}}/static/common/images/default-images-mini.png');
|
||||
// 名称
|
||||
$('.page-top-nav-title span').text(e.name || '{{:MyLang("common_service.customview.create_name_default")}}');
|
||||
// 关闭弹窗
|
||||
$('#popup-saveinfo').modal('close');
|
||||
var $form = $('form.form-validation');
|
||||
if(parseInt($form.attr('data-opt-type') || 0) == 1)
|
||||
{
|
||||
if(e.code == 0)
|
||||
{
|
||||
Prompt(e.msg, 'success');
|
||||
} else {
|
||||
Prompt(e.msg);
|
||||
}
|
||||
$form.find('button[type="submit"]').button('reset');
|
||||
} else {
|
||||
// logo
|
||||
$('.page-top-nav-logo').attr('src', e.logo || '{{$attachment_host}}/static/common/images/default-images-mini.png');
|
||||
// 名称
|
||||
$('.page-top-nav-title span').text(e.name || '{{:MyLang("common_service.customview.create_name_default")}}');
|
||||
// 关闭弹窗
|
||||
$('#popup-saveinfo').modal('close');
|
||||
}
|
||||
}
|
||||
|
||||
// 代码编辑器初始化
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ return [
|
|||
'switch_success' => 'Switch Succeeded',
|
||||
'bind_fail' => 'Bind Failed',
|
||||
'bind_success' => 'Bind Succeeded',
|
||||
'save_fail' => 'Save Failed',
|
||||
'save_success' => 'Save Succeeded',
|
||||
'submit_fail' => 'Submit Failed',
|
||||
'submit_success' => 'Submit Succeeded',
|
||||
'booking_fail' => 'Booking Failed',
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ return [
|
|||
'switch_success' => '切换成功',
|
||||
'bind_fail' => '绑定失败',
|
||||
'bind_success' => '绑定成功',
|
||||
'save_fail' => '保存失败',
|
||||
'save_success' => '保存成功',
|
||||
'submit_fail' => '提交失败',
|
||||
'submit_success' => '提交成功',
|
||||
'booking_fail' => '预约失败',
|
||||
|
|
|
|||
|
|
@ -141,10 +141,10 @@ class CustomViewService
|
|||
$data['upd_time'] = time();
|
||||
if(Db::name('CustomView')->where(['id'=>$data_id])->update($data) === false)
|
||||
{
|
||||
return DataReturn(MyLang('update_fail'), -1);
|
||||
return DataReturn(MyLang('save_fail'), -1);
|
||||
}
|
||||
}
|
||||
return DataReturn(MyLang('operate_success'), 0, $data_id);
|
||||
return DataReturn(MyLang('save_success'), 0, $data_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
$(function()
|
||||
{
|
||||
// 开启基础编辑
|
||||
$('.base-edit-submit').on('click', function()
|
||||
{
|
||||
var $form = $('form.form-validation');
|
||||
$form.attr('data-opt-type', 0);
|
||||
$form.attr('request-type', 'sync');
|
||||
$('#popup-saveinfo').modal();
|
||||
});
|
||||
|
||||
// 保存数据
|
||||
$('.page-save-submit').on('click', function()
|
||||
{
|
||||
var $form = $('form.form-validation');
|
||||
$form.attr('request-type', 'ajax-reload');
|
||||
$form.attr('data-opt-type', 1);
|
||||
$form.attr('request-type', 'ajax-fun');
|
||||
$form.find('button[type="submit"]').trigger('click');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue