Ver código fonte

datasync / showInfo / showError

luoyifan 3 anos atrás
pai
commit
e552375b99
3 arquivos alterados com 66 adições e 1 exclusões
  1. 19 0
      dist/yvan-ext.css
  2. 46 0
      dist/yvan-ext.js
  3. 1 1
      dist/yvan-ext.js.map

+ 19 - 0
dist/yvan-ext.css

@@ -1,3 +1,22 @@
+/* 对话框 警告和提示 */
+.x-dlg-icon.info {
+    font: normal normal normal 40px/1 FontAwesome;
+    color: #31708f;
+}
+
+.x-dlg-icon.info:before {
+    content: "\f05a"
+}
+
+.x-dlg-icon.error {
+    font: normal normal normal 40px/1 FontAwesome;
+    color: #a94442;
+}
+
+.x-dlg-icon.error:before {
+    content: "\f071"
+}
+
 /* 合计行 */
 .x-grid-row-summary .x-grid-cell {
     font-weight: bold;

+ 46 - 0
dist/yvan-ext.js

@@ -61134,6 +61134,22 @@ define(['exports'], function (exports) { 'use strict';
             cls: 'show-icon-messagebox',
         });
     }
+    /**
+     * 显示错误异常信息
+     * @param msg 错误内容
+     * @param sender 发送者按钮(可以为空)
+     */
+    function showInfoDialogSimple(msg, sender) {
+        console.info(msg);
+        Ext.MessageBox.show({
+            title: '提示',
+            msg: msg,
+            buttons: Ext.MessageBox.OK,
+            animateTarget: sender,
+            icon: 'info',
+            cls: 'show-icon-messagebox',
+        });
+    }
     function msgError(msg, sender) {
         showErrorDialog(msg, sender);
     }
@@ -61366,6 +61382,7 @@ define(['exports'], function (exports) { 'use strict';
         var vm = extHandle.lookupViewModel();
         return vm.yvanScope;
     }
+    //# sourceMappingURL=lib.js.map
 
     /**
      * 全局 ajax 方法
@@ -63117,6 +63134,12 @@ define(['exports'], function (exports) { 'use strict';
         showErrorDialog(msg, sender);
     }
     /**
+     * 错误对话框的强提醒
+     */
+    function showInfoDialog(msg, sender) {
+        showInfoDialogSimple(msg, sender);
+    }
+    /**
      * 用于计算 express 表达式
      */
     function evalFunction(data, express) {
@@ -63174,6 +63197,7 @@ define(['exports'], function (exports) { 'use strict';
         stopEvent: stopEvent,
         msg: msg$1,
         showErrorDialog: showErrorDialog$1,
+        showInfoDialog: showInfoDialog,
         evalFunction: evalFunction,
         getGridEditRows: getGridEditRows
     });
@@ -131759,6 +131783,27 @@ define(['exports'], function (exports) { 'use strict';
             window['system'] = {};
         }
         lodash.extend(window['system'], SystemLib);
+        Ext.apply(Ext.util.Format, {
+            // 百分比
+            percentRenderer: function (v, rd, model) {
+                if (!v) {
+                    v = 0;
+                }
+                v = v.toFixed(2);
+                var v1 = v > 100 ? 100 : v;
+                v1 = v1 < 0 ? 0 : v1;
+                //@ts-ignore
+                var v2 = parseInt(v1 * 2.55).toString(16);
+                if (v2.length == 1)
+                    v2 = '0' + v2;
+                return Ext.String
+                    .format('<div>'
+                    + '<div style="float:left;border:1px solid #008000;height:15px;width:100%;">'
+                    + '<div style="float:left;text-align:center;width:100%;color:blue;">{0}%</div>'
+                    + '<div style="background: #FAB2{2};width:{1}%;height:13px;"></div>'
+                    + '</div></div>', v, v1, v2);
+            }
+        });
         initComponent();
         initPanel();
         initGridColumn();
@@ -131847,6 +131892,7 @@ define(['exports'], function (exports) { 'use strict';
     exports.setComboStore = setComboStore;
     exports.setDesignMode = setDesignMode;
     exports.showErrorDialog = showErrorDialog$1;
+    exports.showInfoDialog = showInfoDialog;
     exports.showWidget = showWidget;
     exports.sqlUrlTransform = sqlUrlTransform;
     exports.stopEvent = stopEvent;

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/yvan-ext.js.map