diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php index ea0e5aa17..7719f2df4 100755 --- a/app/admin/controller/Common.php +++ b/app/admin/controller/Common.php @@ -40,6 +40,12 @@ class Common extends BaseController protected $data_get; protected $data_request; + // 页面操作表单 + protected $form_back_params; + protected $form_back_control; + protected $form_back_action; + protected $form_back_url; + // 当前系统操作名称 protected $module_name; protected $controller_name; @@ -173,6 +179,22 @@ class Common extends BaseController $default_theme = 'default'; $assign['default_theme'] = $default_theme; + // 基础表单数据、去除数组和对象列 + $form_back_params = $this->data_request; + if(!empty($form_back_params) && is_array($form_back_params)) + { + foreach($form_back_params as $k=>$v) + { + if(is_array($v) || is_object($v)) + { + unset($form_back_params[$k]); + } + } + unset($form_back_params['id'], $form_back_params['form_back_control'], $form_back_params['form_back_action']); + } + $this->form_back_params = $form_back_params; + $assign['form_back_params'] = $this->form_back_params; + // 当前系统操作名称 $this->module_name = RequestModule(); $this->controller_name = RequestController(); @@ -186,13 +208,25 @@ class Common extends BaseController // 当前插件操作名称, 兼容插件模块名称 if(empty($this->data_request['pluginsname'])) { + // 插件名称/控制器/方法 $this->plugins_module_name = ''; $this->plugins_controller_name = ''; $this->plugins_action_name = ''; + + // 页面表单操作指定返回、方法默认index + $this->form_back_control = empty($this->data_request['form_back_control']) ? $this->controller_name : $this->data_request['form_back_control']; + $this->form_back_action = empty($this->data_request['form_back_action']) ? 'index' : $this->data_request['form_back_action']; + $this->form_back_url = MyUrl($this->module_name.'/'.$this->form_back_control.'/'.$this->form_back_action, $this->form_back_params); } else { + // 插件名称/控制器/方法 $this->plugins_module_name = $this->data_request['pluginsname']; $this->plugins_controller_name = empty($this->data_request['pluginscontrol']) ? 'index' : $this->data_request['pluginscontrol']; $this->plugins_action_name = empty($this->data_request['pluginsaction']) ? 'index' : $this->data_request['pluginsaction']; + + // 页面表单操作指定返回、方法默认index + $this->form_back_control = empty($this->data_request['form_back_control']) ? $this->plugins_controller_name : $this->data_request['form_back_control']; + $this->form_back_action = empty($this->data_request['form_back_action']) ? 'index' : $this->data_request['form_back_action']; + $this->form_back_url = PluginsAdminUrl($this->plugins_module_name, $this->form_back_control, $this->form_back_action, $this->form_back_params); } // 当前插件操作名称 @@ -200,6 +234,9 @@ class Common extends BaseController $assign['plugins_controller_name'] = $this->plugins_controller_name; $assign['plugins_action_name'] = $this->plugins_action_name; + // 基础表单返回url + $assign['form_back_url'] = $this->form_back_url; + // 管理员 $assign['admin'] = $this->admin; @@ -251,6 +288,10 @@ class Common extends BaseController // 开发模式 $assign['shopxo_is_develop'] = MyConfig('shopxo.is_develop'); + // 加载页面加载层、是否加载图片动画 + $assign['is_page_loading'] = ($this->module_name.$this->controller_name.$this->action_name == 'adminindexindex') ? 0 : 1; + $assign['is_page_loading_images'] = 1; + // 是否加载视频播放器组件 $assign['is_load_ckplayer'] = 0; diff --git a/app/admin/view/default/public/footer.html b/app/admin/view/default/public/footer.html index 2d15c2b12..84518ac43 100755 --- a/app/admin/view/default/public/footer.html +++ b/app/admin/view/default/public/footer.html @@ -135,7 +135,6 @@ {{if isset($is_load_hiprint) and $is_load_hiprint eq 1}} - diff --git a/app/admin/view/default/public/header.html b/app/admin/view/default/public/header.html index b1a4d3dd0..ec2c69d3d 100755 --- a/app/admin/view/default/public/header.html +++ b/app/admin/view/default/public/header.html @@ -106,7 +106,8 @@ -{{if $module_name.$controller_name.$action_name neq 'adminindexindex'}} + +{{if isset($is_page_loading) and $is_page_loading eq 1}} {{include file="public/page_loading" /}} {{/if}} diff --git a/app/admin/view/default/public/loading.html b/app/admin/view/default/public/loading.html index 37a179964..f6347b4f0 100644 --- a/app/admin/view/default/public/loading.html +++ b/app/admin/view/default/public/loading.html @@ -1,4 +1,3 @@
-

处理中...

\ No newline at end of file diff --git a/app/admin/view/default/public/module/detail_avg.html b/app/admin/view/default/public/module/detail_avg.html index f4fdb8f7d..5dd83efd8 100644 --- a/app/admin/view/default/public/module/detail_avg.html +++ b/app/admin/view/default/public/module/detail_avg.html @@ -57,7 +57,7 @@ {{if isset($t['label']) and isset($t['view_type']) and in_array($t['view_type'], ['images', 'field', 'module', 'status']) and (!isset($t['is_detail']) or $t['is_detail'] eq 1)}}
  • {{$t.label}}
    -
    +
    {{include file="public/module/detail_content" /}}
  • diff --git a/app/admin/view/default/public/module/detail_content.html b/app/admin/view/default/public/module/detail_content.html index 951849ec1..1c63b86c2 100644 --- a/app/admin/view/default/public/module/detail_content.html +++ b/app/admin/view/default/public/module/detail_content.html @@ -15,16 +15,16 @@ style=" {{if isset($t['is_badge']) and $t['is_badge'] eq 1 and !empty($t['badge_key']) and !empty($t['badge_style']) and is_array($t['badge_style']) and isset($form_table_data_detail[$t['badge_key']]) and isset($t['badge_style'][$form_table_data_detail[$t['badge_key']]]) and substr($t['badge_style'][$form_table_data_detail[$t['badge_key']]], 0, 1) eq '#'}}background: {{$t['badge_style'][$form_table_data_detail[$t['badge_key']]]}};{{/if}} {{if isset($t['is_color']) and $t['is_color'] eq 1 and !empty($t['color_key']) and !empty($t['color_style']) and is_array($t['color_style']) and isset($form_table_data_detail[$t['color_key']]) and isset($t['color_style'][$form_table_data_detail[$t['color_key']]]) and substr($t['color_style'][$form_table_data_detail[$t['color_key']]], 0, 1) eq '#'}}color: {{$t['color_style'][$form_table_data_detail[$t['color_key']]]}};{{/if}}" - {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_detail[$t['popover_field']])}}data-am-popover="{content: '{{$form_table_data_detail[$t['popover_field']]|raw}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} + {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_detail[$t['popover_field']])}}data-am-popover="{content: '{{:PopoverContentHandle($form_table_data_detail[$t['popover_field']])}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} > {{if isset($t['is_first_tips']) and $t['is_first_tips'] eq 1 and ((!empty($t['first_tips_key']) and !empty($form_table_data_detail[$t['first_tips_key']])) or (!empty($t['first_tips_data'])))}} - + {{/if}} {{if isset($t['is_first_link']) and $t['is_first_link'] eq 1 and ((!empty($t['first_link_key']) and !empty($form_table_data_detail[$t['first_link_key']])) or (!empty($t['first_link_data'])))}} - + {{/if}} diff --git a/app/admin/view/default/public/module/form_table.html b/app/admin/view/default/public/module/form_table.html index 903a13d70..f1a27746e 100644 --- a/app/admin/view/default/public/module/form_table.html +++ b/app/admin/view/default/public/module/form_table.html @@ -67,7 +67,7 @@ {{switch $t.search_config.form_type}} {{case input}} - + {{/case}} {{case select}} @@ -100,27 +100,27 @@ {{case section}}
    - + - - +
    {{/case}} {{case datetime}}
    - + - - +
    {{/case}} {{case date}}
    - + - - +
    {{/case}} {{case ym}} - + {{/case}} {{case module}} @@ -203,16 +203,16 @@ style=" {{if isset($t['is_badge']) and $t['is_badge'] eq 1 and !empty($t['badge_key']) and !empty($t['badge_style']) and is_array($t['badge_style']) and isset($form_table_data_list[$i][$t['badge_key']]) and isset($t['badge_style'][$form_table_data_list[$i][$t['badge_key']]]) and substr($t['badge_style'][$form_table_data_list[$i][$t['badge_key']]], 0, 1) eq '#'}}background: {{$t['badge_style'][$form_table_data_list[$i][$t['badge_key']]]}};{{/if}} {{if isset($t['is_color']) and $t['is_color'] eq 1 and !empty($t['color_key']) and !empty($t['color_style']) and is_array($t['color_style']) and isset($form_table_data_list[$i][$t['color_key']]) and isset($t['color_style'][$form_table_data_list[$i][$t['color_key']]]) and substr($t['color_style'][$form_table_data_list[$i][$t['color_key']]], 0, 1) eq '#'}}color: {{$t['color_style'][$form_table_data_list[$i][$t['color_key']]]}};{{/if}}" - {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_list[$i][$t['popover_field']])}}data-am-popover="{content: '{{$form_table_data_list[$i][$t['popover_field']]|raw}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} + {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_list[$i][$t['popover_field']])}}data-am-popover="{content: '{{:PopoverContentHandle($form_table_data_list[$i][$t['popover_field']])}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} > {{if isset($t['is_first_tips']) and $t['is_first_tips'] eq 1 and ((!empty($t['first_tips_key']) and !empty($form_table_data_list[$i][$t['first_tips_key']])) or (!empty($t['first_tips_data'])))}} - + {{/if}} {{if isset($t['is_first_link']) and $t['is_first_link'] eq 1 and ((!empty($t['first_link_key']) and !empty($form_table_data_list[$i][$t['first_link_key']])) or (!empty($t['first_link_data'])))}} - + {{/if}} diff --git a/app/admin/view/default/public/page_loading.html b/app/admin/view/default/public/page_loading.html index 6b1374c60..05927e004 100644 --- a/app/admin/view/default/public/page_loading.html +++ b/app/admin/view/default/public/page_loading.html @@ -1,3 +1,7 @@
    - + {{if isset($is_page_loading_images) and $is_page_loading_images eq 1}} + + {{else /}} + + {{/if}}
    \ No newline at end of file diff --git a/app/common.php b/app/common.php index 60a1b54dc..252bc1760 100755 --- a/app/common.php +++ b/app/common.php @@ -11,6 +11,20 @@ // 应用公共文件 +/** + * 弹出内容处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2022-09-26 + * @desc description + * @param [string] $content [展示的内容] + */ +function PopoverContentHandle($content) +{ + return str_replace(["\n", "'", '"'], ['
    ', '', ''], $content); +} + /** * 生成uuid * @author Devil diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 166c2d3b5..7354342f3 100755 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -49,6 +49,12 @@ class Common extends BaseController protected $data_get; protected $data_request; + // 页面操作表单 + protected $form_back_params; + protected $form_back_control; + protected $form_back_action; + protected $form_back_url; + // 当前系统操作名称 protected $module_name; protected $controller_name; @@ -231,6 +237,22 @@ class Common extends BaseController $default_theme = strtolower(MyC('common_default_theme', 'default', true)); $assign['default_theme'] = $default_theme; + // 基础表单数据、去除数组和对象列 + $form_back_params = $this->data_request; + if(!empty($form_back_params) && is_array($form_back_params)) + { + foreach($form_back_params as $k=>$v) + { + if(is_array($v) || is_object($v)) + { + unset($form_back_params[$k]); + } + } + unset($form_back_params['id'], $form_back_params['form_back_control'], $form_back_params['form_back_action']); + } + $this->form_back_params = $form_back_params; + $assign['form_back_params'] = $this->form_back_params; + // 当前系统操作名称 $this->module_name = RequestModule(); $this->controller_name = RequestController(); @@ -244,13 +266,25 @@ class Common extends BaseController // 当前插件操作名称, 兼容插件模块名称 if(empty($this->data_request['pluginsname'])) { + // 插件名称/控制器/方法 $this->plugins_module_name = ''; $this->plugins_controller_name = ''; $this->plugins_action_name = ''; + + // 页面表单操作指定返回、方法默认index + $this->form_back_control = empty($this->data_request['form_back_control']) ? $this->controller_name : $this->data_request['form_back_control']; + $this->form_back_action = empty($this->data_request['form_back_action']) ? 'index' : $this->data_request['form_back_action']; + $this->form_back_url = MyUrl($this->module_name.'/'.$this->form_back_control.'/'.$this->form_back_action, $this->form_back_params); } else { + // 插件名称/控制器/方法 $this->plugins_module_name = $this->data_request['pluginsname']; $this->plugins_controller_name = empty($this->data_request['pluginscontrol']) ? 'index' : $this->data_request['pluginscontrol']; $this->plugins_action_name = empty($this->data_request['pluginsaction']) ? 'index' : $this->data_request['pluginsaction']; + + // 页面表单操作指定返回、方法默认index + $this->form_back_control = empty($this->data_request['form_back_control']) ? $this->plugins_controller_name : $this->data_request['form_back_control']; + $this->form_back_action = empty($this->data_request['form_back_action']) ? 'index' : $this->data_request['form_back_action']; + $this->form_back_url = PluginsHomeUrl($this->plugins_module_name, $this->form_back_control, $this->form_back_action, $this->form_back_params); } // 当前插件操作名称 @@ -258,6 +292,9 @@ class Common extends BaseController $assign['plugins_controller_name'] = $this->plugins_controller_name; $assign['plugins_action_name'] = $this->plugins_action_name; + // 基础表单返回url + $assign['form_back_url'] = $this->form_back_url; + // 分页信息 $this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1); $this->page_size = min(empty($this->data_request['page_size']) ? MyC('common_page_size', 10, true) : intval($this->data_request['page_size']), 1000); @@ -333,6 +370,10 @@ class Common extends BaseController // 开发模式 $assign['shopxo_is_develop'] = MyConfig('shopxo.is_develop'); + // 默认不加载页面加载层、是否加载图片动画 + $assign['is_page_loading'] = 0; + $assign['is_page_loading_images'] = 0; + // 顶部右侧导航 $assign['common_nav_top_right_list'] = NavigationService::HomeHavTopRight(['user'=>$this->user]); diff --git a/app/index/view/default/public/footer.html b/app/index/view/default/public/footer.html index 7f52ad5e9..7f58ddbba 100755 --- a/app/index/view/default/public/footer.html +++ b/app/index/view/default/public/footer.html @@ -114,7 +114,6 @@ {{if isset($is_load_hiprint) and $is_load_hiprint eq 1}} - diff --git a/app/index/view/default/public/header.html b/app/index/view/default/public/header.html index 71f5ea122..30a968910 100755 --- a/app/index/view/default/public/header.html +++ b/app/index/view/default/public/header.html @@ -120,6 +120,11 @@ + +{{if isset($is_page_loading) and $is_page_loading eq 1}} + {{include file="public/page_loading" /}} +{{/if}} + {{if (!isset($page_pure) or $page_pure neq 1) and (!isset($is_header) or $is_header eq 1)}} {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} diff --git a/app/index/view/default/public/module/detail_avg.html b/app/index/view/default/public/module/detail_avg.html index f4fdb8f7d..5dd83efd8 100644 --- a/app/index/view/default/public/module/detail_avg.html +++ b/app/index/view/default/public/module/detail_avg.html @@ -57,7 +57,7 @@ {{if isset($t['label']) and isset($t['view_type']) and in_array($t['view_type'], ['images', 'field', 'module', 'status']) and (!isset($t['is_detail']) or $t['is_detail'] eq 1)}}
  • {{$t.label}}
    -
    +
    {{include file="public/module/detail_content" /}}
  • diff --git a/app/index/view/default/public/module/detail_content.html b/app/index/view/default/public/module/detail_content.html index 951849ec1..1c63b86c2 100644 --- a/app/index/view/default/public/module/detail_content.html +++ b/app/index/view/default/public/module/detail_content.html @@ -15,16 +15,16 @@ style=" {{if isset($t['is_badge']) and $t['is_badge'] eq 1 and !empty($t['badge_key']) and !empty($t['badge_style']) and is_array($t['badge_style']) and isset($form_table_data_detail[$t['badge_key']]) and isset($t['badge_style'][$form_table_data_detail[$t['badge_key']]]) and substr($t['badge_style'][$form_table_data_detail[$t['badge_key']]], 0, 1) eq '#'}}background: {{$t['badge_style'][$form_table_data_detail[$t['badge_key']]]}};{{/if}} {{if isset($t['is_color']) and $t['is_color'] eq 1 and !empty($t['color_key']) and !empty($t['color_style']) and is_array($t['color_style']) and isset($form_table_data_detail[$t['color_key']]) and isset($t['color_style'][$form_table_data_detail[$t['color_key']]]) and substr($t['color_style'][$form_table_data_detail[$t['color_key']]], 0, 1) eq '#'}}color: {{$t['color_style'][$form_table_data_detail[$t['color_key']]]}};{{/if}}" - {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_detail[$t['popover_field']])}}data-am-popover="{content: '{{$form_table_data_detail[$t['popover_field']]|raw}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} + {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_detail[$t['popover_field']])}}data-am-popover="{content: '{{:PopoverContentHandle($form_table_data_detail[$t['popover_field']])}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} > {{if isset($t['is_first_tips']) and $t['is_first_tips'] eq 1 and ((!empty($t['first_tips_key']) and !empty($form_table_data_detail[$t['first_tips_key']])) or (!empty($t['first_tips_data'])))}} - + {{/if}} {{if isset($t['is_first_link']) and $t['is_first_link'] eq 1 and ((!empty($t['first_link_key']) and !empty($form_table_data_detail[$t['first_link_key']])) or (!empty($t['first_link_data'])))}} - + {{/if}} diff --git a/app/index/view/default/public/module/form_table.html b/app/index/view/default/public/module/form_table.html index 903a13d70..f1a27746e 100644 --- a/app/index/view/default/public/module/form_table.html +++ b/app/index/view/default/public/module/form_table.html @@ -67,7 +67,7 @@ {{switch $t.search_config.form_type}} {{case input}} - + {{/case}} {{case select}} @@ -100,27 +100,27 @@ {{case section}}
    - + - - +
    {{/case}} {{case datetime}}
    - + - - +
    {{/case}} {{case date}}
    - + - - +
    {{/case}} {{case ym}} - + {{/case}} {{case module}} @@ -203,16 +203,16 @@ style=" {{if isset($t['is_badge']) and $t['is_badge'] eq 1 and !empty($t['badge_key']) and !empty($t['badge_style']) and is_array($t['badge_style']) and isset($form_table_data_list[$i][$t['badge_key']]) and isset($t['badge_style'][$form_table_data_list[$i][$t['badge_key']]]) and substr($t['badge_style'][$form_table_data_list[$i][$t['badge_key']]], 0, 1) eq '#'}}background: {{$t['badge_style'][$form_table_data_list[$i][$t['badge_key']]]}};{{/if}} {{if isset($t['is_color']) and $t['is_color'] eq 1 and !empty($t['color_key']) and !empty($t['color_style']) and is_array($t['color_style']) and isset($form_table_data_list[$i][$t['color_key']]) and isset($t['color_style'][$form_table_data_list[$i][$t['color_key']]]) and substr($t['color_style'][$form_table_data_list[$i][$t['color_key']]], 0, 1) eq '#'}}color: {{$t['color_style'][$form_table_data_list[$i][$t['color_key']]]}};{{/if}}" - {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_list[$i][$t['popover_field']])}}data-am-popover="{content: '{{$form_table_data_list[$i][$t['popover_field']]|raw}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} + {{if isset($t['is_popover']) and $t['is_popover'] eq 1 and !empty($t['popover_field']) and !empty($form_table_data_list[$i][$t['popover_field']])}}data-am-popover="{content: '{{:PopoverContentHandle($form_table_data_list[$i][$t['popover_field']])}}', trigger: 'hover focus', theme: 'sm'}"{{/if}} > {{if isset($t['is_first_tips']) and $t['is_first_tips'] eq 1 and ((!empty($t['first_tips_key']) and !empty($form_table_data_list[$i][$t['first_tips_key']])) or (!empty($t['first_tips_data'])))}} - + {{/if}} {{if isset($t['is_first_link']) and $t['is_first_link'] eq 1 and ((!empty($t['first_link_key']) and !empty($form_table_data_list[$i][$t['first_link_key']])) or (!empty($t['first_link_data'])))}} - + {{/if}} diff --git a/app/index/view/default/public/page_loading.html b/app/index/view/default/public/page_loading.html new file mode 100644 index 000000000..05927e004 --- /dev/null +++ b/app/index/view/default/public/page_loading.html @@ -0,0 +1,7 @@ +
    + {{if isset($is_page_loading_images) and $is_page_loading_images eq 1}} + + {{else /}} + + {{/if}} +
    \ No newline at end of file diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index 53624ab47..1811a6dc7 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -672,7 +672,7 @@ button.colorpicker-submit img { */ .am-page-loading { opacity: 1; - background: #f5f5f5; + background: #fafafa; display: block; } @@ -787,6 +787,9 @@ button.colorpicker-submit img { -moz-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.2); box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.2); } +.am-table-scrollable-horizontal .am-table > thead > tr > td { + border-bottom: 1px solid rgba(0,0,0,.06); +} .am-table-scrollable-horizontal .am-table > thead > tr > td, .am-table-scrollable-horizontal .am-table > tbody > tr:first-child > td { border-top: 0px !important; @@ -1173,4 +1176,20 @@ form .am-tab-panel .am-form-group:last-child { } .richtext p { margin:5px 0; +} + +/** + * 表单内部操作导航 + */ +.form-legend-fixed { + position: sticky; + top: 0; + background: #fff; + z-index: 10; +} +.form-legend-fixed-right button { + border: 0px; +} +.form-legend-fixed-right .am-badge:not(:first-child) { + margin-left: 10px; } \ No newline at end of file diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 31e65daf6..052d6f77c 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -2107,29 +2107,51 @@ function FormTableContainerInit() $(this).find('.am-grid-fixed-right').first().addClass('am-grid-fixed-right-shadow'); }); - // 右侧操作栏更多按钮显示容器宽度处理 + // 右侧操作栏更多按钮显示容器宽度处理点击事件、鼠标进入和移除事件 $('.am-table-scrollable-horizontal .am-table tr .am-operate-grid-more-list button.am-dropdown-toggle').on('click', function() { - var $parent = $(this).parent(); - var length = $parent.find('.am-dropdown-content .am-badge').length; - if(length == 0) - { - Prompt(window['lang_not_operate_error'] || '没有相关操作', 'warning'); - $parent.removeClass('am-active'); - $parent.find('.am-dropdown-content').remove(); - } else { - if(length > 1) - { - var width = ((length-1)*10)+30; - $parent.find('.am-dropdown-content .am-badge').each(function(k, v) - { - width += $(this).outerWidth(); - }); - $parent.find('.am-dropdown-content').css('width', width+'px'); - } - $parent.addClass('am-dropdown-flip'); - } + FormTableContainerOperateGridMoreListInit($(this)); }); + $('.am-table-scrollable-horizontal .am-table tr .am-operate-grid-more-list button.am-dropdown-toggle').on('mouseenter', function() + { + FormTableContainerOperateGridMoreListInit($(this)); + }); + $('.am-table-scrollable-horizontal .am-table tr .am-operate-grid-more-list button.am-dropdown-toggle').on('mouseleave', function() + { + FormTableContainerOperateGridMoreListInit($(this)); + }); + } +} + +/** + * 表格容器列表更多操作处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2022-09-27 + * @desc description + * @param {[object]} e [当前对象] + */ +function FormTableContainerOperateGridMoreListInit(e) +{ + var $parent = e.parent(); + var length = $parent.find('.am-dropdown-content .am-badge').length; + if(length == 0) + { + Prompt(window['lang_not_operate_error'] || '没有相关操作', 'warning'); + $parent.removeClass('am-active'); + $parent.find('.am-dropdown-content').remove(); + } else { + if(length > 1) + { + var width = ((length-1)*10)+30; + $parent.find('.am-dropdown-content .am-badge').each(function(k, v) + { + width += e.outerWidth(); + }); + $parent.find('.am-dropdown-content').css('width', width+'px'); + } + $parent.addClass('am-dropdown-flip'); } } @@ -2477,7 +2499,7 @@ function JsonStringToJsonObject(value) { if((value || null) != null && typeof(value) == 'string') { - value = JSON.parse(print_data); + value = eval('(' + value + ')'); } return value; } @@ -2495,11 +2517,25 @@ function JsonObjectToJsonString(value) { if((value || null) != null && typeof(value) == 'object') { - value = JSON.stringify(print_data); + value = JSON.stringify(value); } return value; } +/** + * 弹出内容处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2022-09-26 + * @desc description + * @param [string] content [展示的内容] + */ +function PopoverContentHandle(content) +{ + return content.replace(new RegExp("\n", 'g'), '
    ').replace(new RegExp("'", 'g'), '').replace(new RegExp('"', 'g'), ''); +} + // 公共数据操作 $(function() @@ -2799,12 +2835,10 @@ $(function() } }); - /** - * 页面加载 loading - */ + // 页面加载loading if($('.am-page-loading').length > 0) { - $('.am-page-loading').fadeOut(500); + $('.am-page-loading').fadeOut(800); } // 全屏操作 @@ -3698,4 +3732,69 @@ $(function() window.close(); } }); + + // dropdown组件hover显示 + $(document).on('mouseenter', '.am-dropdown .am-dropdown-toggle', function() + { + $('body .am-dropdown').each(function(k, v) + { + var config = JsonStringToJsonObject($(this).attr('data-am-dropdown')) || null; + if(config != null && (config.trigger || null) == 'hover') + { + $(this).dropdown('close'); + } + }); + var $parent = $(this).parent(); + var config = JsonStringToJsonObject($parent.attr('data-am-dropdown')) || null; + if(config != null && (config.trigger || null) == 'hover') + { + if($parent.find('.am-dropdown-content').css('display') != 'block') + { + $parent.find('.am-dropdown-content').attr('data-is-stay', 1); + $parent.dropdown('open'); + } + } + }); + $(document).on('mouseleave', '.am-dropdown .am-dropdown-toggle', function() + { + var $parent = $(this).parent(); + var config = JsonStringToJsonObject($parent.attr('data-am-dropdown')) || null; + if(config != null && (config.trigger || null) == 'hover') + { + $parent.find('.am-dropdown-content').attr('data-is-stay', 0); + setTimeout(function() + { + if((parseInt($parent.find('.am-dropdown-content').attr('data-is-stay') || 0)) == 0) + { + $parent.dropdown('close'); + } + }, 1000); + } + }); + $(document).on('mouseenter', '.am-dropdown .am-dropdown-content', function() + { + var $parent = $(this).parent(); + var config = JsonStringToJsonObject($parent.attr('data-am-dropdown')) || null; + if(config != null && (config.trigger || null) == 'hover') + { + $(this).attr('data-is-stay', 1); + } + }); + $(document).on('mouseleave', '.am-dropdown .am-dropdown-content', function() + { + var $parent = $(this).parent(); + var config = JsonStringToJsonObject($parent.attr('data-am-dropdown')) || null; + if(config != null && (config.trigger || null) == 'hover') + { + $(this).attr('data-is-stay', 0); + $parent.dropdown('close'); + } + }); + + // 返回上一页、默认-1 + $(document).on('click', '.back-submit-event', function() + { + var number = $(this).data('number') || '-1'; + window.history.go(number); + }); }); \ No newline at end of file diff --git a/public/static/common/lib/amazeui-chosen/amazeui.chosen.css b/public/static/common/lib/amazeui-chosen/amazeui.chosen.css index 4b40e1aeb..849bf81a7 100755 --- a/public/static/common/lib/amazeui-chosen/amazeui.chosen.css +++ b/public/static/common/lib/amazeui-chosen/amazeui.chosen.css @@ -154,8 +154,7 @@ background-clip: padding-box } .chosen-container-single.chosen-container-single-nosearch .chosen-search { - position: absolute; - left: -9999px + display: none; } .chosen-container .chosen-results { color: #444; diff --git a/public/static/common/lib/assets/css/amazeui.css b/public/static/common/lib/assets/css/amazeui.css index 7f5ee64d3..bdad7ed11 100755 --- a/public/static/common/lib/assets/css/amazeui.css +++ b/public/static/common/lib/assets/css/amazeui.css @@ -2088,6 +2088,8 @@ th { /* Bordered version */ .am-table-bordered { border: 1px solid rgba(0,0,0,.06); +} +table.am-table-bordered { border-left: none; } .am-table-bordered > thead > tr > th,