|
@@ -4,6 +4,9 @@ import copy from 'copy-to-clipboard'
|
|
|
import { get, post } from '../../utils/request'
|
|
|
import { userStore } from '@/store/userInfo'
|
|
|
import { productListNameMapping } from '../../utils/mapping'
|
|
|
+import CopyId from '@/components/icon/copy.vue'
|
|
|
+import CopyIdActive from '@/components/icon/copyActive.vue'
|
|
|
+import Update from '@/components/icon/update.vue'
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
const currentPage = ref(1)
|
|
@@ -20,6 +23,7 @@ const role = userStore().user.role
|
|
|
const serverId = ref('')
|
|
|
const serverIdDialogVisible = ref(false)
|
|
|
const file = ref(null)
|
|
|
+const isCopyServerId = ref(false)
|
|
|
|
|
|
onMounted(() => {
|
|
|
let pageText = document.getElementsByClassName('el-pagination__jump')[0]
|
|
@@ -32,7 +36,7 @@ onMounted(() => {
|
|
|
const base = isWindows ? baseurl + '/windows/store?mode=team' : baseurl + '/store?mode=team'
|
|
|
url.value = base + '&email=' + userStore().user.email
|
|
|
pagingQuery()
|
|
|
- getproductList()
|
|
|
+ getProductList()
|
|
|
})
|
|
|
//筛选
|
|
|
const searchInfo = () => {
|
|
@@ -58,7 +62,7 @@ const pagingQuery = () => {
|
|
|
})
|
|
|
}
|
|
|
//获取已购买产品
|
|
|
-const getproductList = (val) => {
|
|
|
+const getProductList = (val) => {
|
|
|
get('/pdf-tech/product/listWithAll').then(
|
|
|
(res) => {
|
|
|
productList.value = productListNameMapping(res.data.result)
|
|
@@ -83,6 +87,17 @@ const handleCurrentChange = (value) => {
|
|
|
|
|
|
const upLoadChange = (value) => {
|
|
|
file.value = value.raw
|
|
|
+ const length = file.value.name.split(".").length
|
|
|
+ const type = file.value.name.split(".")[length - 1]
|
|
|
+ if (type !== 'txt') {
|
|
|
+ proxy.$message({
|
|
|
+ duration: 5000,
|
|
|
+ message: 'This file does not seem to be a TXT file.',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ dialogVisible.value = false
|
|
|
+ return
|
|
|
+ }
|
|
|
const formData = new FormData()
|
|
|
formData.append("keyFile", file.value)
|
|
|
post('/pdf-tech/vppKeyFile/parseKeyFile', formData)
|
|
@@ -93,13 +108,15 @@ const upLoadChange = (value) => {
|
|
|
message: 'Upload Successfully',
|
|
|
type: 'success'
|
|
|
})
|
|
|
+ pagingQuery()
|
|
|
} else {
|
|
|
proxy.$message({
|
|
|
duration: 5000,
|
|
|
- message: 'Upload Failed',
|
|
|
+ message: 'Verify Failed, please try again',
|
|
|
type: 'error'
|
|
|
})
|
|
|
}
|
|
|
+ dialogVisible.value = false
|
|
|
})
|
|
|
.catch(() => {
|
|
|
proxy.$message({
|
|
@@ -107,6 +124,7 @@ const upLoadChange = (value) => {
|
|
|
message: 'Upload Failed',
|
|
|
type: 'error'
|
|
|
})
|
|
|
+ dialogVisible.value = false
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -120,22 +138,30 @@ const handleGetKeyFile = async () => {
|
|
|
serverIdDialogVisible.value = true
|
|
|
}
|
|
|
|
|
|
-const copyServerId = () => {
|
|
|
+const copyServerId = (val) => {
|
|
|
copy(serverId.value)
|
|
|
- proxy.$message({
|
|
|
- duration: 5000,
|
|
|
- message: 'Copy Successfully',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- serverIdDialogVisible.value = false
|
|
|
+ if (val === 'icon') {
|
|
|
+ isCopyServerId.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ isCopyServerId.value = false
|
|
|
+ }, 2000)
|
|
|
+ } else {
|
|
|
+ proxy.$message({
|
|
|
+ duration: 5000,
|
|
|
+ message: 'Copy Successfully',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ serverIdDialogVisible.value = false
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="flex flex-col items-center">
|
|
|
- <el-dialog title="" :visible.sync="dialogVisible" width="376px" top="30vh" center :show-close="false">
|
|
|
- <h3 class="text-16px font-bold mt-16px">Update Your License</h3>
|
|
|
- <p>
|
|
|
+ <el-dialog :visible.sync="dialogVisible" width="376px" top="30vh" center :show-close="false">
|
|
|
+ <Update class="mx-auto" />
|
|
|
+ <h3 class="text-16px font-bold mt-16px text-center my-16px">Update Your License</h3>
|
|
|
+ <p class=" text-center">
|
|
|
Don't have a key file yet? <span class="text-16px text-[#1460F3] cursor-pointer" @click="handleGetKeyFile">Get one</span>
|
|
|
</p>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -145,6 +171,7 @@ const copyServerId = () => {
|
|
|
:on-change="upLoadChange"
|
|
|
:auto-upload="false"
|
|
|
:show-file-list="false"
|
|
|
+ accept=".txt"
|
|
|
action=""
|
|
|
>
|
|
|
<el-button type="primary">
|
|
@@ -153,12 +180,19 @@ const copyServerId = () => {
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="" :visible.sync="serverIdDialogVisible" width="376px" top="30vh" :show-close="false">
|
|
|
- <h3 class="text-16px font-bold mt-16px">Copy Server ID</h3>
|
|
|
- <p>Contact us with your Server ID to get your key file</p>
|
|
|
- <h3 class="text-16px font-bold mt-16px">Sever ID:</h3>
|
|
|
- <p>{{ serverId }}</p>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <el-dialog :visible.sync="serverIdDialogVisible" width="404px" top="30vh" :show-close="false">
|
|
|
+ <h3 class="text-24px leading-32px font-bold mb-24px">Copy Server ID</h3>
|
|
|
+ <p class="text-16px leading-20px">Contact us with your Server ID to get your key file</p>
|
|
|
+ <h3 class="text-16px leading-20px font-bold mt-8px">Sever ID:</h3>
|
|
|
+ <div class="w-full rounded-6px border-1 border-[#D9D9D9] flex items-center justify-between pl-12px h-40px mt-4px">
|
|
|
+ {{ serverId }}
|
|
|
+ <div @click="copyServerId('icon')" class="cursor-pointer mr-4px copyBtn relative">
|
|
|
+ <CopyId />
|
|
|
+ <CopyIdActive class="hidden" />
|
|
|
+ <div class="tips absolute hidden bg-[#373A47] rounded-4px p-8px text-14px leading-20px text-white top-[-48px] right-[-8px] whitespace-nowrap" :class="isCopyServerId && 'right-[-36px]'">{{ isCopyServerId ? 'Copy Success' : 'Copy' }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer copyId">
|
|
|
<el-button @click="serverIdDialogVisible = false">Cancel</el-button>
|
|
|
<el-button type="primary" @click="copyServerId">Copy</el-button>
|
|
|
</span>
|
|
@@ -260,5 +294,50 @@ const copyServerId = () => {
|
|
|
.el-table::v-deep .cell{
|
|
|
word-break: break-word;
|
|
|
}
|
|
|
+::v-deep .el-dialog {
|
|
|
+ .el-dialog__body {
|
|
|
+ display: inherit;
|
|
|
+ text-align: left;
|
|
|
+ color: #232A40;
|
|
|
+ .copyBtn {
|
|
|
+ .tips:before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ bottom: -10px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ border-style: solid;
|
|
|
+ border-width: 10px 10px 0 10px;
|
|
|
+ border-color: #373A47 transparent transparent transparent;
|
|
|
+ }
|
|
|
+ &:hover {
|
|
|
+ .tips {
|
|
|
+ display: inherit;
|
|
|
+ }
|
|
|
+ & svg:nth-child(1) {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ & svg:nth-child(2) {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dialog-footer {
|
|
|
+ button {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .copyId {
|
|
|
+ .el-button + .el-button {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
+ button {
|
|
|
+ width: 170px;
|
|
|
+ height: 48px;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|