jqh 4 år sedan
förälder
incheckning
42916d74f7

+ 6 - 6
resources/assets/dcat/extra/action.js

@@ -19,10 +19,10 @@
                 error: function (target, results) {}, // 请求出错回调,返回false可以中断默认的错误处理逻辑
             }, options);
 
-            this._bind();
+            this.init();
         }
 
-        _bind() {
+        init() {
             let _this = this, options = _this.options;
 
             $(options.selector).off(options.event).on(options.event, function (e) {
@@ -42,7 +42,7 @@
 
                     Object.assign(data, options.data);
 
-                    _this._buildActionPromise(target, data).then(_this._resolver()).catch(_this._reject());
+                    _this.promise(target, data).then(_this.resolve()).catch(_this.reject());
                 }
 
                 var conform = options.confirm;
@@ -55,7 +55,7 @@
             });
         }
 
-        _resolver() {
+        resolve() {
             let _this = this, options = _this.options;
 
             return function (result) {
@@ -107,7 +107,7 @@
             };
         }
 
-        _reject() {
+        reject() {
             let options = this.options;
 
             return function (result) {
@@ -124,7 +124,7 @@
             }
         }
 
-        _buildActionPromise(target, data) {
+        promise(target, data) {
             let options = this.options;
 
             return new Promise(function (resolve, reject) {

+ 7 - 11
resources/assets/dcat/extra/grid-extend.js

@@ -50,7 +50,7 @@
                 _this.row = $this.closest('tr');
 
                 if ($this.data('inserted') == '0') {
-                    _this._request(1);
+                    _this.request(1);
                     $this.data('inserted', 1);
                 }
 
@@ -82,7 +82,7 @@
             })
         },
 
-        _request: function (page, after) {
+        request: function (page, after) {
             var _this = this,
                 row = _this.row,
                 key = _this.key,
@@ -144,7 +144,7 @@
                         // 加载更多
                         loadMore.click(function () {
                             var _t = $(this);
-                            _this._request(_t.data('page'), function () {
+                            _this.request(_t.data('page'), function () {
                                 _t.remove();
                             });
                         });
@@ -186,15 +186,11 @@
 
         this.direction = this.key = this.tier = this.row = this._req = null;
 
-        this._init();
+        this.init();
     }
 
     Orderable.prototype = {
-        _init: function () {
-            this._bindClick()
-        },
-
-        _bindClick: function () {
+        init: function () {
             var _this = this;
 
             $(_this.options.button).off('click').click(function () {
@@ -212,11 +208,11 @@
                 _this.row = $this.closest('tr');
                 _this.tier = getTier(_this.row);
 
-                _this._request();
+                _this.request();
             })
         },
 
-        _request: function () {
+        request: function () {
             var _this = this,
                 key = _this.key,
                 row = _this.row,

+ 34 - 29
resources/assets/dcat/extra/select-table.js

@@ -15,51 +15,56 @@
             },
         }, options);
 
-        let self = this,
-            values = options.values;
+        let self = this;
 
         self.options = options;
         self.$input = $(options.input);
 
-        self.labels = {};
+        self.init();
+    }
 
-        for (let i in values) {
-            self.labels[values[i]['id']] = values[i]['label']
-        }
+    SelectTable.prototype = {
+        init() {
+            let self = this,
+                options = self.options,
+                values = options.values;
 
-        // 保存临时选中的值
-        self.resetSelected();
+            self.labels = {};
 
-        $(document).on('dialog:shown', options.dialog, function () {
-            self.$dialog = $(options.dialog);
-            self.$button = self.$dialog.find(options.button);
-            self.$cancel = self.$dialog.find(options.cancel);
+            for (let i in values) {
+                self.labels[values[i]['id']] = values[i]['label']
+            }
 
-            // 提交按钮
-            self.$button.on('click', function () {
-                var selected = self.getSelectedRows();
+            // 保存临时选中的值
+            self.resetSelected();
 
-                self.setKeys(selected[1]);
+            $(document).on('dialog:shown', options.dialog, function () {
+                self.$dialog = $(options.dialog);
+                self.$button = self.$dialog.find(options.button);
+                self.$cancel = self.$dialog.find(options.cancel);
 
-                self.render(selected[0]);
+                // 提交按钮
+                self.$button.on('click', function () {
+                    var selected = self.getSelectedRows();
 
-                self.$dialog.trigger('dialog:close');
-            });
+                    self.setKeys(selected[1]);
 
-            self.$cancel.on('click', function () {
-                self.$dialog.trigger('dialog:close');
-            });
+                    self.render(selected[0]);
 
-            self._bind();
-        });
+                    self.$dialog.trigger('dialog:close');
+                });
 
-        self.render(values);
+                self.$cancel.on('click', function () {
+                    self.$dialog.trigger('dialog:close');
+                });
 
-        return self;
-    }
+                self.bind();
+            });
 
-    SelectTable.prototype = {
-        _bind() {
+            self.render(values);
+        },
+
+        bind() {
             let self = this, options = self.options;
 
             // 表格加载完成事件

+ 2 - 2
resources/assets/dcat/js/bootstrappers/Menu.js

@@ -1,11 +1,11 @@
 
 export default class Menu {
     constructor(Dcat) {
-        this.bindClick();
+        this.init();
     }
 
     // 菜单点击选中效果
-    bindClick() {
+    init() {
         if (! $('.main-sidebar .sidebar').length) {
             return;
         }

+ 4 - 4
resources/assets/dcat/js/extensions/DialogForm.js

@@ -50,10 +50,10 @@ export default class DialogForm {
         _this.isLoading = 0;
         _this.isSubmitting = 0;
 
-        _this._execute(options)
+        _this.init(options)
     }
 
-    _execute(options) {
+    init(options) {
         let _this = this,
             defUrl = options.defaultUrl,
             selector = options.buttonSelector;
@@ -160,7 +160,7 @@ export default class DialogForm {
                 content: template,
                 title: options.title,
                 yes: function () {
-                    _this._submit()
+                    _this.submit()
                 },
                 cancel: function () {
                     if (options.forceRefresh) { // 是否强制刷新
@@ -201,7 +201,7 @@ export default class DialogForm {
     }
 
     // 提交表单
-    _submit() {
+    submit() {
         let _this = this, 
             options = _this.options,
             counter = _this.$target.attr('counter'),

+ 8 - 6
resources/assets/dcat/js/extensions/Form.js

@@ -46,23 +46,23 @@ class Form {
         _this.$form = $(_this.options.form).first();
         _this._errColumns = {};
 
-        _this.submit();
+        _this.init();
     }
 
-    submit() {
+    init() {
         let _this = this;
         let confirm = _this.options.confirm;
 
         if (! confirm.title) {
-            return _this._ajaxSubmit();
+            return _this.submit();
         }
 
         Dcat.confirm(confirm.title, confirm.content, function () {
-            _this._ajaxSubmit();
+            _this.submit();
         });
     }
 
-    _ajaxSubmit() {
+    submit() {
         let Dcat = window.Dcat,
             _this = this,
             $form = _this.$form,
@@ -95,7 +95,9 @@ class Form {
                 $submitButton.buttonLoading();
             },
             success: function (response) {
-                $submitButton.buttonLoading(false);
+                setTimeout(function () {
+                    $submitButton.buttonLoading(false);
+                }, 700);
 
                 if (options.after(true, response, _this) === false) {
                     return;

+ 2 - 2
resources/assets/dcat/js/extensions/RowSelector.js

@@ -16,10 +16,10 @@ export default class RowSelector {
             container: 'table',
         }, options);
 
-        _this._bind()
+        _this.init()
     }
 
-    _bind() {
+    init() {
         let options = this.options,
             checkboxSelector = options.checkboxSelector,
             $selectAll = $(options.selectAllSelector),

+ 1 - 1
resources/assets/dcat/sass/components/_grid.scss

@@ -100,7 +100,7 @@ body:not(.dark-mode) .simple-grid {
 
     .custom-data-table {
       padding: 5px 0 0;
-      border-top: 1px solid $table-border-color;
+      //border-top: 1px solid $table-border-color;
       border-bottom: 1px solid $table-border-color;
     }
 

+ 3 - 3
resources/assets/dcat/sass/components/_table.scss

@@ -202,14 +202,14 @@ $table-border-color: #eff3f8;
   }
 
   .table.custom-data-table {
-    padding: 3px 6px 6px;
+    padding: 3px 7px 7px;
   }
 
   .table-fixed-left .table.custom-data-table {
-    padding: 3px 0 0 6px;
+    padding: 3px 0 0 7px;
   }
   .table-fixed-right .table.custom-data-table {
-    padding: 3px 6px 0 0;
+    padding: 3px 7px 0 0;
   }
   .table-fixed th {
     background: darken(#f7f7f9, 3.5%);

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/css/dcat-app-blue-dark.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/css/dcat-app-blue-light.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/css/dcat-app-blue.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/css/dcat-app-green.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/css/dcat-app.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/extra/select-table.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/extra/select-table.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 6 - 4
src/Widgets/DialogTable.php

@@ -22,7 +22,7 @@ class DialogTable extends Widget
     /**
      * @var string
      */
-    protected $width = '800px';
+    protected $width = '825px';
 
     /**
      * @var string|\Closure|Renderable
@@ -189,7 +189,9 @@ class DialogTable extends Widget
 
         $this->script = <<<JS
 (function () {
-    var id = replaceNestedFormIndex('{$this->id()}'), 
+    var id = replaceNestedFormIndex('{$this->id()}'),
+        area = screen.width <= 850 ? ['100%', '100%',] : '{$this->width}',
+        offset = screen.width <= 850 ? 0 : '70px',
         _id, _tempId, _btnId, _tb;
     
     setId(id);
@@ -204,8 +206,8 @@ class DialogTable extends Widget
         var index = layer.open({
           type: 1,
           title: '{$this->title}',
-          area: '{$this->width}',
-          offset: '70px',
+          area: area,
+          offset: offset,
           maxmin: false,
           resize: false,
           content: $(_tempId).html(),

Vissa filer visades inte eftersom för många filer har ändrats