修改授权中心样式

This commit is contained in:
limengnan 2025-11-04 12:35:32 +08:00
parent 0592ddfeea
commit d8a809ad27
2 changed files with 40 additions and 15 deletions

View File

@ -55,6 +55,10 @@
</el-form> </el-form>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog v-model="isLicense" title="授权中心" width="800px" :before-close="handleLicenseClose"
class="userInfoviewDialog">
<License v-if="isLicense" @closeLicense="handleLicenseClose"/>
</el-dialog>
</div> </div>
</template> </template>
@ -64,6 +68,10 @@
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { useAuthStore } from '../stores/index.js' import { useAuthStore } from '../stores/index.js'
import api from '../services/api.js' import api from '../services/api.js'
import License from '@/views/License.vue'
const isLicense = ref(false)
const router = useRouter() const router = useRouter()
const authStore = useAuthStore() const authStore = useAuthStore()
const time = ref(""); const time = ref("");
@ -97,6 +105,11 @@
} }
function handleClose(){ function handleClose(){
dialogVisible.value = false dialogVisible.value = false
}
function handleLicenseClose(){
isLicense.value = false
// getLicense()
} }
function dateFormat(row) { function dateFormat(row) {
const daterc = row; const daterc = row;
@ -145,11 +158,11 @@
time.value = dateFormat(new Date()) time.value = dateFormat(new Date())
// /api/license/info // /api/license/info
;(async () => { getLicense()
})
async function getLicense(){
try { try {
debugger
const json = await api.get('/api/license/info') const json = await api.get('/api/license/info')
debugger
if (!json || json.success !== true) { if (!json || json.success !== true) {
licenseBadge.value = '未授权' licenseBadge.value = '未授权'
licenseClass.value = 'badge-invalid' licenseClass.value = 'badge-invalid'
@ -185,11 +198,10 @@
licenseType.value = 'invalid' licenseType.value = 'invalid'
showActivateButton.value = true showActivateButton.value = true
} }
})() }
})
const goActivate = () => { const goActivate = () => {
router.push('/license') // router.push('/license')
isLicense.value = true
} }
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="license-container"> <div class="license-container">
<div class="page-header"> <div class="page-header">
<h2>授权中心</h2> <!-- <h2>授权中心</h2> -->
<div class="desc">在此申请激活文件或上传授权包激活</div> <div class="desc">在此申请激活文件或上传授权包激活</div>
</div> </div>
<el-tabs v-model="activeTab"> <el-tabs v-model="activeTab">
@ -14,7 +14,7 @@
<el-form-item label="联系方式"> <el-form-item label="联系方式">
<el-input v-model="form.contact_info" placeholder="请输入联系方式" /> <el-input v-model="form.contact_info" placeholder="请输入联系方式" />
</el-form-item> </el-form-item>
<el-divider>软件信息</el-divider> <div class="hintbox">软件信息</div>
<el-form-item label="产品"> <el-form-item label="产品">
<el-input :model-value="software.product" disabled /> <el-input :model-value="software.product" disabled />
</el-form-item> </el-form-item>
@ -56,7 +56,7 @@ import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { systemAPI } from '../services/api.js' import { systemAPI } from '../services/api.js'
import { licenseAPI } from '../services/api.js' import { licenseAPI } from '../services/api.js'
const emit = defineEmits([ 'closeLicense']);
const activeTab = ref('request') const activeTab = ref('request')
const form = reactive({ const form = reactive({
@ -134,6 +134,7 @@ const exportActivationFile = async () => {
downloadTextFile(filename, content) downloadTextFile(filename, content)
ElMessage.success('激活请求文件已导出') ElMessage.success('激活请求文件已导出')
// emit('closeLicense', false);
} else { } else {
throw new Error(res && res.error ? res.error : '生成激活文件失败') throw new Error(res && res.error ? res.error : '生成激活文件失败')
} }
@ -171,14 +172,26 @@ const activatePackage = async () => {
<style> <style>
.license-container { .license-container {
padding: 16px; padding:0 16px;
color: #fff; color: #fff;
} }
.page-header { margin-bottom: 12px; } .page-header { margin-bottom: 12px; }
.page-header h2 { margin: 0 0 4px 0; font-size: 20px; } .page-header h2 { margin: 0 0 4px 0; font-size: 20px; }
.desc { color: #bbb; font-size: 12px; } .desc { color: #bbb; font-size: 14px; }
.tab-content { padding: 12px 0; } .tab-content { padding: 12px 0; }
.actions { margin-top: 12px; } .actions { margin-top: 12px; }
.hint { margin-top: 8px; color: #bbb; font-size: 12px; } .hint { margin-top: 8px; color: #bbb; font-size: 14px; }
.license-form { max-width: 560px; } .license-form { max-width: 100%; }
.el-tabs__item{
color: #fff;
font-size: 16px;
}
.hintbox{
font-size: 16px;
width: 100%;
border-bottom: 1px solid #eee;
padding-bottom: 5px;
margin-bottom: 15px;
}
</style> </style>