提交数据

This commit is contained in:
zouzhibin 2022-05-02 10:52:07 +08:00
parent efac688b25
commit 7e1e460a28
9 changed files with 213 additions and 3 deletions

View File

@ -22,6 +22,7 @@
"vue-cropper": "^1.0.3",
"vue-cropperjs": "^5.0.0",
"vue-mugen-scroll": "^0.2.6",
"vue-qr": "^4.0.6",
"vue-router": "^4.0.0-0",
"vue-splitpane": "^1.0.6",
"vuedraggable": "^4.1.0",

View File

@ -42,6 +42,28 @@ export const constantRoutes: Array<RouteRecordRaw&extendRoute> = [
]
const clipboardTable = {
path: '/clipboard',
component: Layout,
redirect: 'noRedirect',
name: 'clipboard',
meta: {
title: 'clipboard',
icon: 'document-copy',
roles:['other']
},
children: [
{
path: 'index',
component: () => import('@/views/clipboard/index.vue'),
name: 'map',
meta: { title: 'clipboard', noCache: true , roles:['other'] ,icon: 'document-copy',}
},
]
}
// 异步组件
export const asyncRoutes = [
tableRouter,
@ -49,8 +71,9 @@ export const asyncRoutes = [
chatRouter,
componentsRouter,
othersRouter,
externalLink,
errorRouter,
externalLink,
clipboardTable,
permissionRouter,
{

View File

@ -36,6 +36,12 @@ const othersRouter = {
name: 'splitpane',
meta: { title: '分割模块', noCache: true }
},
{
path: 'qrcode',
component: () => import('@/views/other/qrcode.vue'),
name: 'qrcode',
meta: { title: '生成二维码', noCache: true }
},
]
}

View File

@ -50,7 +50,7 @@
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s;
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s;
}
.fade-transform-enter-from {

33
src/utils/clipboard.ts Normal file
View File

@ -0,0 +1,33 @@
import Clipboard from 'clipboard'
import { ElMessage } from 'element-plus'
function clipboardSuccess() {
ElMessage({
message: '复制成功',
type: 'success',
duration: 1500
})
}
function clipboardError() {
ElMessage({
message: '复制失败',
type: 'error'
})
}
export default function handleClipboard(text, event) {
const clipboard = new Clipboard(event.target, {
text: () => text
})
clipboard.on('success', () => {
clipboardSuccess()
clipboard.destroy()
})
clipboard.on('error', () => {
clipboardError()
clipboard.destroy()
})
clipboard.onClick(event)
}

View File

@ -0,0 +1,17 @@
<template>
<div>
<el-input v-model="inputData" placeholder="请输入" style="width:400px;max-width:100%;" />
<el-button type="primary" @click="handleCopy(inputData,$event)">
<el-icon style="margin-right: 6px"><document-copy /></el-icon>
</el-button>
</div>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import clip from '@/utils/clipboard'
const inputData = ref('https://github.com/zouzhibin/vue-admin-perfect')
const handleCopy = (text, event)=> {
clip(text, event)
}
</script>

11
src/views/other/count.vue Normal file
View File

@ -0,0 +1,11 @@
<template>
</template>
<script lang="ts" setup>
</script>
<style>
</style>

View File

@ -0,0 +1,34 @@
<template>
<div>
<el-input v-model="inputData" placeholder="请输入" style="width:400px;max-width:100%;" />
<el-button type="primary" @click="handleQrcode(1)">
<el-icon style="margin-right: 6px"><collection /></el-icon>
</el-button>
<el-button type="primary" @click="handleQrcode(2)">生成带logo</el-button>
<div>
<vue-qr :logoSrc="src" :text="inputData" :size="200"></vue-qr>
</div>
</div>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import vueQr from 'vue-qr/src/packages/vue-qr.vue'
import three from '@/assets/3.png'
const src = ref(null)
const src2 = ref()
import clip from '@/utils/clipboard'
const inputData = ref('https://github.com/zouzhibin/vue-admin-perfect')
const handleQrcode = (type)=> {
switch (type) {
case 1:
src.value=null
return
case 2:
src.value=three
return;
}
}
</script>

View File

@ -2209,6 +2209,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
brace-expansion@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
balanced-match "^1.0.0"
braces@^2.3.1, braces@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
@ -2632,7 +2639,7 @@ cli-spinners@^2.0.0:
clipboard@^2.0.10:
version "2.0.10"
resolved "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.10.tgz#e61f6f7139ac5044c58c0484dcac9fb2a918bfd6"
resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.10.tgz#e61f6f7139ac5044c58c0484dcac9fb2a918bfd6"
integrity sha512-cz3m2YVwFz95qSEbCDi2fzLN/epEN9zXBvfgAoGkvGOJZATMl9gtTDVOtBYkx2ODUJl2kvmud7n32sV2BpYR4g==
dependencies:
good-listener "^1.2.2"
@ -3252,6 +3259,13 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
decompress-response@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc"
integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
dependencies:
mimic-response "^3.1.0"
deep-equal@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a"
@ -4261,6 +4275,18 @@ glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.1.tgz#00308f5c035aa0b2a447cd37ead267ddff1577d3"
integrity sha512-cF7FYZZ47YzmCu7dDy50xSRRfO3ErRfrXuLZcNIuyiJEco0XSrGtuilG19L5xp3NcwTx7Gn+X6Tv3fmsUPTbow==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^5.0.1"
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^11.1.0:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
@ -5137,6 +5163,11 @@ javascript-stringify@^2.0.1:
resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz#27c76539be14d8bd128219a2d731b09337904e79"
integrity sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==
js-binary-schema-parser@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/js-binary-schema-parser/-/js-binary-schema-parser-2.0.3.tgz#3d7848748e8586e63b34e8911b643f59cfb6396e"
integrity sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg==
js-message@1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/js-message/-/js-message-1.0.7.tgz#fbddd053c7a47021871bb8b2c95397cc17c20e47"
@ -5633,6 +5664,11 @@ mimic-fn@^2.1.0:
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
mimic-response@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
mini-css-extract-plugin@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
@ -5660,6 +5696,13 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"
minimatch@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b"
integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==
dependencies:
brace-expansion "^2.0.1"
minimist@^1.2.0, minimist@^1.2.5:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
@ -6175,6 +6218,11 @@ parent-module@^1.0.0:
dependencies:
callsites "^3.0.0"
parenthesis@^3.1.5:
version "3.1.8"
resolved "https://registry.yarnpkg.com/parenthesis/-/parenthesis-3.1.8.tgz#3457fccb8f05db27572b841dad9d2630b912f125"
integrity sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw==
parse-asn1@^5.0.0, parse-asn1@^5.1.5:
version "5.1.6"
resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4"
@ -6236,6 +6284,11 @@ path-browserify@0.0.1:
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==
path-browserify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd"
integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==
path-dirname@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0"
@ -7428,6 +7481,20 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
simple-concat@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f"
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==
simple-get@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543"
integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==
dependencies:
decompress-response "^6.0.0"
once "^1.3.1"
simple-concat "^1.0.0"
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
@ -7716,6 +7783,13 @@ strict-uri-encode@^1.0.0:
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=
string-split-by@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/string-split-by/-/string-split-by-1.0.0.tgz#53895fb3397ebc60adab1f1e3a131f5372586812"
integrity sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==
dependencies:
parenthesis "^3.1.5"
string-width@^3.0.0, string-width@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
@ -8407,6 +8481,17 @@ vue-mugen-scroll@^0.2.6:
element-in-view "^0.1.0"
throttleit "^1.0.0"
vue-qr@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/vue-qr/-/vue-qr-4.0.6.tgz#8b91993e4975417e5255aafdb2564721e2e4019a"
integrity sha512-nqk4q6JY3zOnAnErKjCwtLUFFBGk08GNP+NvUbMFmx/F/jOHg3X/xk3xRtVr7KVV6enbZU13WeITzlz92XbMTQ==
dependencies:
glob "^8.0.1"
js-binary-schema-parser "^2.0.2"
path-browserify "^1.0.1"
simple-get "^4.0.1"
string-split-by "^1.0.0"
vue-router@^4.0.0-0:
version "4.0.14"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.14.tgz#ce2028c1c5c33e30c7287950c973f397fce1bd65"