ysy пре 1 година
родитељ
комит
100d9f69b6

+ 6 - 0
src/main.js

@@ -16,6 +16,12 @@ import authSelection from '@/components/authSelection';
 Vue.component('authSelection', authSelection);
 Vue.component('HeaderTitle', HeaderTitle);
 
+
+import clickOnce from './utils/clickOnce.js';
+// 注册全局自定义指令
+Vue.directive('click-once', clickOnce);
+
+
 // bpmnProcessDesigner 需要引入
 import MyPD from '@/components/bpmnProcessDesigner/package/index.js';
 Vue.use(MyPD);

+ 35 - 0
src/utils/clickOnce.js

@@ -0,0 +1,35 @@
+export default {
+  bind(el, binding, vnode) {
+    // 创建加载指示器元素
+    const loadingIndicator = document.createElement('i');
+    loadingIndicator.classList.add('loading-indicator', 'el-icon-loading'); // 假设使用 Element UI 的加载图标
+    el.appendChild(loadingIndicator);
+
+    // 隐藏加载指示器,默认不显示
+    loadingIndicator.style.display = 'none';
+
+    // 保存加载指示器引用
+    el._loadingIndicator = loadingIndicator;
+
+    // 添加点击事件监听器
+    el.addEventListener('click', () => {
+      // 显示加载指示器
+      loadingIndicator.style.display = 'inline-block';
+
+      // 禁用按钮
+      el.setAttribute('disabled', '');
+
+      // 假设这里有一个异步操作,完成后需要隐藏加载指示器和重新启用按钮
+      setTimeout(() => {
+        loadingIndicator.style.display = 'none';
+        el.removeAttribute('disabled'); // 重新启用按钮
+      }, 2000); // 模拟异步操作耗时2秒
+    });
+
+    // 清理事件监听器,防止内存泄漏
+    vnode.context.$once('hook:beforeDestroy', () => {
+      el.removeEventListener('click', () => {});
+      el.removeChild(loadingIndicator);
+    });
+  }
+};

+ 1 - 1
src/views/materialReturn/components/returnPop.vue

@@ -142,7 +142,7 @@
 
     <template slot="footer">
       <el-button size="mini" @click="handleClose">取 消</el-button>
-      <el-button size="mini" type="primary" @click="save()">确 定</el-button>
+      <el-button size="mini"  v-click-once type="primary" @click="save()">确 定</el-button>
     </template>
 
     <pickList

+ 3 - 3
src/views/produce/components/produceOrder.vue

@@ -110,15 +110,15 @@
 
           {
             prop: 'productCode',
-            label: '产品编码',
+            label: '编码',
             align: 'center',
-                 minWidth: '160',
+            minWidth: '160',
             showOverflowTooltip: true,
         
           },
           {
             prop: 'productName',
-            label: '产品名称',
+            label: '名称',
             align: 'center',
             showOverflowTooltip: true,
           },

+ 2 - 2
src/views/produceOrder/index.vue

@@ -296,12 +296,12 @@
           },
           {
             prop: 'productCode',
-            label: '物料编码',
+            label: '编码',
             align: 'center'
           },
           {
             prop: 'productName',
-            label: '产品名称',
+            label: '名称',
             align: 'center'
           },
           {

+ 2 - 2
src/views/produceWord/index.vue

@@ -152,12 +152,12 @@ r++<template>
           },
           {
             prop: 'productCode',
-            label: '产品编码',
+            label: '编码',
             align: 'center'
           },
           {
             prop: 'productName',
-            label: '产品名称',
+            label: '名称',
             align: 'center'
           },
           {