rabin пре 2 година
родитељ
комит
931dfa90ab
4 измењених фајлова са 28 додато и 9 уклоњено
  1. 1 1
      assets/layadmin/html/inc/script.html
  2. 1 1
      src/Auth.php
  3. 19 7
      src/Database.php
  4. 7 0
      src/Lib/Input.php

+ 1 - 1
assets/layadmin/html/inc/script.html

@@ -41,4 +41,4 @@
 <script type="text/javascript" src="../script/lib/layui/xm-select/xm-select.js"></script>
 
 <!-- 加载主要js,很乱,后续优化 -->
-<script type="text/javascript" src="../script/lib/manage/main.js?712"></script>
+<script type="text/javascript" src="../script/lib/manage/main.js?713"></script>

+ 1 - 1
src/Auth.php

@@ -31,7 +31,7 @@ class Auth
      */
     public function __construct()
     {
-        $this->save = new Oper(false, 'session');
+        $this->save = new Oper(false, 'cookie');
         $this->name = 'manage';
     }
 

+ 19 - 7
src/Database.php

@@ -3589,6 +3589,9 @@ class Database
         if (isset($param['control'])) {
             $class .= ' ' . $key . '_input';
         }
+        if (isset($param['control_url'])) {
+            $class .= ' control_url';
+        }
 
         return $class;
     }
@@ -3750,7 +3753,7 @@ class Database
                         if ($this->id && $hk === 'id') {
                             $hv['update'] = 'hidden';
                         }
-                        if (isset($hv['update']) && $hv['update'] && !isset($hv['tab'])) {
+                        if (isset($hv['update']) && $hv['update'] && (!isset($hv['tab']) || (isset($hv['tab']) && $hv['tab'] <= 0))) {
                             $n = $hv['name'];
                             unset($hv['name']);
                             $s = '';
@@ -3785,7 +3788,7 @@ class Database
                                 if ($this->id && $hk === 'id') {
                                     $hv['update'] = 'hidden';
                                 }
-                                if (isset($hv['update']) && $hv['update'] && !isset($hv['tab'])) {
+                                if (isset($hv['update']) && $hv['update'] && (!isset($hv['tab']) || (isset($hv['tab']) && $hv['tab'] <= 0))) {
                                     unset($hv['name']);
                                     $s = '';
                                     $hv['ext'] = $param['name'] . '_c_' . $bk . '_i_' . $hk;
@@ -3965,7 +3968,14 @@ class Database
             } else {
                 $style = '';
             }
-            $result .= '<div class="layui-tab layui-tab-brief dever_' . $key . '_child dever_form_add_child" lay-filter="component-tabs-brief" style="'.$style.'" id="' . $key . '-child-' . ($index + 1) . '"><ul class="layui-tab-title">';
+
+            $result .= '<div class="layui-tab layui-tab-brief dever_' . $key . '_child dever_form_add_child" lay-filter="component-tabs-brief" style="'.$style.'" id="' . $key . '-child-' . ($index + 1) . '">';
+            if ($delete) {
+                $result .= '<div class="dever_form_delete" style="cursor:pointer">[删除]</div><ul class="layui-tab-title" style="width:50%">';
+            } else {
+                $result .= '<ul class="layui-tab-title">';
+            }
+            
             $tab = '<div class="layui-tab-content">';
             $i = 0;
             foreach ($config['tab_config'] as $k => $v) {
@@ -4069,7 +4079,12 @@ class Database
      */
     public function update_action_api()
     {
-        Dever::submit_check(false, true);
+        $col = Dever::input('col');
+        $value = Dever::input('value');
+        if (!$col && !$value) {
+            Dever::submit_check(false, true);
+        }
+        
 
         $method = false;
 
@@ -4097,9 +4112,6 @@ class Database
 
                 $method = 'update';
 
-                $col = Dever::input('col');
-                $value = Dever::input('value');
-
                 if ($col && $value) {
                     $method = 'update_' . $col;
                     //Dever::setInput('set_' . $col, $value);

+ 7 - 0
src/Lib/Input.php

@@ -762,6 +762,9 @@ class Input
                 } elseif (isset($param['load'])) {
                     $js = ' onchange="loadChange($(this), \'' . $param['load'] . '\')" ';
                     $js .= ' onload="loadChange($(this), \'' . $param['load'] . '\')" ';
+                } elseif (isset($param['control_url'])) {
+                    $param['control_url'] = Dever::url($param['control_url']);
+                    $js = ' control_url="'.$param['control_url'].'" data-id="'.$param['where_id'].'"';
                 } elseif (isset($param['bind'])) {
                     $param['bind'][2] = isset($param['bind'][2]) ? str_replace('"', '\'', json_encode($param['bind'][2], true)) : false;
                     $js = $param['bind'][0] . '="' . $param['bind'][1] . '(\'' . $param['name'] . '\', $(this), ' . $param['bind'][2] . ')" ';
@@ -1025,6 +1028,10 @@ class Input
             if (isset($param['control']) && is_string($param['control'])) {
                 $xm_on = 'inputShow(e, \'' . $param['control'] . '\');';
                 $change = ' show_id="' . $param['control'] . '"';
+            } elseif (isset($param['control_url'])) {
+                $param['control_url'] = Dever::url($param['control_url']);
+                $xm_on = 'inputShowUrl(e, \'' . $param['control_url'] . '\');';
+                $change = ' control_url="'.$param['control_url'].'"  data-id="'.$param['where_id'].'"';
             } elseif (isset($param['load'])) {
                 $xm_on = 'loadChange(e, \'' . $param['load'] . '\');';
             } elseif (isset($param['bind'])) {