Xiao_123 пре 6 месеци
родитељ
комит
b1ad09b6de

+ 49 - 0
package-lock.json

@@ -13,6 +13,7 @@
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^5.1.10",
         "axios": "^1.6.8",
+        "crypto-js": "^4.2.0",
         "echarts": "^5.4.3",
         "element-plus": "^2.8.0",
         "html2canvas": "^1.4.1",
@@ -28,6 +29,7 @@
         "roboto-fontface": "*",
         "v-clipboard": "^3.0.0-next.1",
         "vue": "^3.4.0",
+        "vue-clipboard3": "^2.0.0",
         "vue-i18n": "9",
         "vue-picture-cropper": "^0.7.0",
         "vue-router": "^4.3.0",
@@ -2021,6 +2023,17 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/clipboard": {
+      "version": "2.0.11",
+      "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
+      "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
+      "license": "MIT",
+      "dependencies": {
+        "good-listener": "^1.2.2",
+        "select": "^1.1.2",
+        "tiny-emitter": "^2.0.0"
+      }
+    },
     "node_modules/cliui": {
       "version": "6.0.0",
       "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
@@ -2540,6 +2553,12 @@
         "node": ">=0.4.0"
       }
     },
+    "node_modules/delegate": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
+      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
+      "license": "MIT"
+    },
     "node_modules/dijkstrajs": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
@@ -3700,6 +3719,15 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/good-listener": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
+      "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
+      "license": "MIT",
+      "dependencies": {
+        "delegate": "^3.1.2"
+      }
+    },
     "node_modules/gopd": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz",
@@ -6275,6 +6303,12 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/select": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
+      "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==",
+      "license": "MIT"
+    },
     "node_modules/semver": {
       "version": "7.6.0",
       "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.0.tgz",
@@ -7159,6 +7193,12 @@
       "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
       "dev": true
     },
+    "node_modules/tiny-emitter": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
+      "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
+      "license": "MIT"
+    },
     "node_modules/tiny-warning": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/tiny-warning/-/tiny-warning-1.0.3.tgz",
@@ -8004,6 +8044,15 @@
         }
       }
     },
+    "node_modules/vue-clipboard3": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/vue-clipboard3/-/vue-clipboard3-2.0.0.tgz",
+      "integrity": "sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==",
+      "license": "MIT",
+      "dependencies": {
+        "clipboard": "^2.0.6"
+      }
+    },
     "node_modules/vue-demi": {
       "version": "0.14.7",
       "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",

+ 4 - 3
package.json

@@ -9,11 +9,12 @@
     "format": "prettier --write src/"
   },
   "dependencies": {
-    "@wangeditor/editor": "^5.1.23",
-    "@wangeditor/editor-for-vue": "^5.1.10",
     "@mdi/font": "7.0.96",
     "@vuepic/vue-datepicker": "^8.7.0",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^5.1.10",
     "axios": "^1.6.8",
+    "crypto-js": "^4.2.0",
     "echarts": "^5.4.3",
     "element-plus": "^2.8.0",
     "html2canvas": "^1.4.1",
@@ -25,11 +26,11 @@
     "pinia-plugin-persistedstate": "^3.2.1",
     "pnpm": "^9.1.0",
     "qrcode": "^1.5.4",
-    "crypto-js": "^4.2.0",
     "qs": "^6.12.1",
     "roboto-fontface": "*",
     "v-clipboard": "^3.0.0-next.1",
     "vue": "^3.4.0",
+    "vue-clipboard3": "^2.0.0",
     "vue-i18n": "9",
     "vue-picture-cropper": "^0.7.0",
     "vue-router": "^4.3.0",

+ 14 - 9
src/views/recruit/enterprise/systemManagement/groupAccount/components/link.vue

@@ -7,7 +7,7 @@
         <span v-if="code">{{ shareUrlTxt }}</span>
         <span v-else class="color-666">点击刷新生成邀请链接</span>
       </div>
-      <!-- <v-btn color="primary" class="mr-3" @click="copy()">{{ $t('common.copy') }}</v-btn> -->
+      <v-btn color="primary" class="mr-3" @click="copy()">{{ $t('common.copy') }}</v-btn>
       <v-btn color="green" variant="outlined" @click="refresh()">{{ $t('common.refresh') }}</v-btn>
     </div>
     <div class="mt-5 color-777">请复制链接进行分享,链接{{ day }}天内有效</div>
@@ -23,6 +23,9 @@ import {
 } from '@/api/recruit/enterprise/enterpriseInvite.js'
 import { computed, ref } from 'vue'
 defineOptions({name: 'groupAccount-component-invite'})
+import clipboard3 from 'vue-clipboard3'
+const { toClipboard } = clipboard3()
+
 const props = defineProps({
   inviteType: {
     type: [Number, String],
@@ -78,14 +81,16 @@ const refresh = async () => {
   }
 }
 
-// const copy = async () => {
-//   try {
-//     await navigator.clipboard.writeText(shareUrlTxt.value)
-//     Snackbar.success('复制成功')
-//   } catch (err) {
-//     Snackbar.error('复制失败,请手动复制。')
-//   }
-// }
+const copy = async () => {
+  try {
+    // await navigator.clipboard.writeText(shareUrlTxt.value)
+    console.log(shareUrlTxt.value, 'shareUrlTxt.value')
+    await toClipboard(shareUrlTxt.value)
+    Snackbar.success('复制成功')
+  } catch (err) {
+    Snackbar.error('复制失败,请手动复制。')
+  }
+}
 
 </script>
 <style lang="scss" scoped>