提交 fd91a807 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 查看卷王连接,显示卷王账号信息

上级 9de6d65d
<script setup lang="ts">
import { Lock } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { useClipboard } from '@vueuse/core'
const modelValue = defineModel<boolean>({ default: false })
const props = defineProps<{ account: string; password: string }>()
const { copy } = useClipboard()
function handleCopy(value: string) {
copy(value)
ElMessage.success('复制成功')
}
function handleSubmit() {
window.open(`https://surveyking.ezijing.com?account=${props.account}&password=${props.password}`)
}
</script>
<template>
<div class="surveyKing-tips" @click="modelValue = true">
<el-icon><Lock /></el-icon>
</div>
<el-dialog title="账号密码" width="500" v-model="modelValue" @update:modelValue="$emit('update:modelValue')">
<el-form labelWidth="140" labelSuffix=":">
<el-form-item label="卷王账号">{{ account }} <el-button text type="primary" @click="handleCopy(account)">复制</el-button></el-form-item>
<el-form-item label="密码">{{ password }} <el-button text type="primary" @click="handleCopy(password)">复制</el-button></el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="handleSubmit">确定</el-button>
</template>
</el-dialog>
</template>
<style lang="scss">
.surveyKing-tips {
position: fixed;
right: 40px;
bottom: 100px;
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.2);
}
</style>
...@@ -3,6 +3,7 @@ import type { ConfigAttribute } from '../types' ...@@ -3,6 +3,7 @@ import type { ConfigAttribute } from '../types'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import Icon from '@/components/ConnectionIcon.vue' import Icon from '@/components/ConnectionIcon.vue'
import { getConnectionDetails, asyncOfficialAccountInfo, asyncOfficialAccountUsers } from '../api' import { getConnectionDetails, asyncOfficialAccountInfo, asyncOfficialAccountUsers } from '../api'
const SurveyKingDialog = defineAsyncComponent(() => import('../components/SurveyKingDialog.vue'))
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
...@@ -486,7 +487,8 @@ const platformList = [ ...@@ -486,7 +487,8 @@ const platformList = [
{ {
title: '访问卷王表单网站', title: '访问卷王表单网站',
onClick() { onClick() {
window.open('https://surveyking.ezijing.com/') surveyKingDialogVisible.value = true
// window.open('https://surveyking.ezijing.com/')
} }
}, },
{ {
...@@ -518,6 +520,7 @@ const iconMap: Record<string, string> = { ...@@ -518,6 +520,7 @@ const iconMap: Record<string, string> = {
'13': '99', '13': '99',
'14': '100' '14': '100'
} }
const surveyKingDialogVisible = ref<boolean>(false)
</script> </script>
<template> <template>
...@@ -547,6 +550,11 @@ const iconMap: Record<string, string> = { ...@@ -547,6 +550,11 @@ const iconMap: Record<string, string> = {
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</AppCard> </AppCard>
<SurveyKingDialog
v-model="surveyKingDialogVisible"
:account="getAttributeValueByProp('account')"
:password="getAttributeValueByProp('password')"
v-if="detail?.type === '13'"></SurveyKingDialog>
</template> </template>
<style lang="scss"> <style lang="scss">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论