소스 검색

发卡打印时增加loading,使用户在进行中时不可操作

liuyanpeng 1 년 전
부모
커밋
a37a9a5936
2개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      package.json
  2. 6 2
      packages/print/src/PrintEpc.vue

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pc-component-v3",
-  "version": "1.1.10",
+  "version": "1.1.11",
   "description": "",
   "main": "dist/pc-component-v3.js",
   "scripts": {

+ 6 - 2
packages/print/src/PrintEpc.vue

@@ -202,15 +202,17 @@ export default {
       _self.modal = true;
 
       let promise = PrintEpcUtil.resetTag(this.printerName);
-
+      _self.loading = true;
       promise.then(successData => {
         successData.command = 'restore';
         _self.printResult = successData;
         _self.modal = true;
+        _self.loading = false;
       }, errorData => {
         errorData.command = 'restore';
         _self.printResult = errorData;
         _self.modal = true;
+        _self.loading = false;
       });
     },
 
@@ -223,13 +225,15 @@ export default {
       _self.modal = true;
 
       let promise = PrintEpcUtil.readEpc(this.printerName);
-
+      _self.loading = true;
       promise.then(successData => {
         successData.command = 'read';
         _self.printResult = successData;
+        _self.loading = false;
       }, errorData => {
         errorData.command = 'read';
         _self.printResult = errorData;
+        _self.loading = false;
       });
     },