UPDATE: 1、重新修改激活逻辑;2、优化
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import type { Activate } from '@/api/activate/interface'
|
|
||||||
|
|
||||||
export const generateApplicationCode = (params: Activate.ApplicationCodePlaintext) => {
|
export const generateApplicationCode = () => {
|
||||||
return http.post(`/activate/generateApplicationCode`, params)
|
return http.post(`/activate/generateApplicationCode`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const verifyActivationCode = (activationCode: string) => {
|
export const verifyActivationCode = (activationCode: string) => {
|
||||||
|
|||||||
@@ -1,37 +1,14 @@
|
|||||||
//激活模块
|
//激活模块
|
||||||
export namespace Activate {
|
export namespace Activate {
|
||||||
|
|
||||||
export interface ApplicationModule {
|
|
||||||
/**
|
|
||||||
* 是否申请 1是 0否
|
|
||||||
*/
|
|
||||||
apply: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ActivateModule extends ApplicationModule {
|
export interface ActivateModule {
|
||||||
/**
|
/**
|
||||||
* 是否永久 1是 0否
|
* 是否永久 1是 0否
|
||||||
*/
|
*/
|
||||||
permanently: number;
|
permanently: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApplicationCodePlaintext {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模拟式模块
|
|
||||||
*/
|
|
||||||
simulate: ApplicationModule;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数字式模块
|
|
||||||
*/
|
|
||||||
digital: ApplicationModule;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 比对式模块
|
|
||||||
*/
|
|
||||||
contrast: ApplicationModule;
|
|
||||||
}
|
|
||||||
export interface ActivationCodePlaintext {
|
export interface ActivationCodePlaintext {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,32 +41,23 @@ const modeList = [
|
|||||||
name: '模拟式模块',
|
name: '模拟式模块',
|
||||||
code: '模拟式',
|
code: '模拟式',
|
||||||
key: 'simulate',
|
key: 'simulate',
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.simulate.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.simulate.apply === 1 && activateInfo.simulate.permanently === 1
|
|
||||||
: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '数字式模块',
|
name: '数字式模块',
|
||||||
code: '数字式',
|
code: '数字式',
|
||||||
key: 'digital',
|
key: 'digital',
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.digital.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.digital.apply === 1 && activateInfo.digital.permanently === 1
|
|
||||||
: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '比对式模块',
|
name: '比对式模块',
|
||||||
code: '比对式',
|
code: '比对式',
|
||||||
key: 'contrast',
|
key: 'contrast',
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.contrast.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.contrast.apply === 1 && activateInfo.contrast.permanently === 1
|
|
||||||
: true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const handelOpen = async (item: string, key: string) => {
|
const handelOpen = async (item: string, key: string) => {
|
||||||
if (isActivateOpen === 'true' && (activateInfo[key].apply !== 1 || activateInfo[key].permanently !== 1)) {
|
if (isActivateOpen === 'true' && activateInfo[key].permanently !== 1) {
|
||||||
ElMessage.warning(`${item}模块未激活`)
|
ElMessage.warning(`${item}模块未激活`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,22 @@ export const useAuthStore = defineStore({
|
|||||||
},
|
},
|
||||||
async setActivateInfo() {
|
async setActivateInfo() {
|
||||||
const license_result = await getLicense()
|
const license_result = await getLicense()
|
||||||
const licenseData = license_result.data as unknown as Activate.ActivationCodePlaintext
|
const licenseData = license_result.data as Activate.ActivationCodePlaintext
|
||||||
|
if (!licenseData.simulate) {
|
||||||
|
licenseData.simulate = {
|
||||||
|
permanently: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!licenseData.digital) {
|
||||||
|
licenseData.digital = {
|
||||||
|
permanently: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!licenseData.contrast) {
|
||||||
|
licenseData.contrast = {
|
||||||
|
permanently: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
this.activateInfo = licenseData
|
this.activateInfo = licenseData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,30 +43,21 @@ const modeList = [
|
|||||||
code: '模拟式',
|
code: '模拟式',
|
||||||
subName: '未启用模拟式检测计划',
|
subName: '未启用模拟式检测计划',
|
||||||
img: new URL('/src/assets/images/dashboard/1.svg', import.meta.url).href,
|
img: new URL('/src/assets/images/dashboard/1.svg', import.meta.url).href,
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.simulate.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.simulate.apply === 1 && activateInfo.simulate.permanently === 1
|
|
||||||
: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '数字式模块',
|
name: '数字式模块',
|
||||||
code: '数字式',
|
code: '数字式',
|
||||||
subName: '启用数字检测计划',
|
subName: '启用数字检测计划',
|
||||||
img: new URL('/src/assets/images/dashboard/2.svg', import.meta.url).href,
|
img: new URL('/src/assets/images/dashboard/2.svg', import.meta.url).href,
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.digital.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.digital.apply === 1 && activateInfo.digital.permanently === 1
|
|
||||||
: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '比对式模块',
|
name: '比对式模块',
|
||||||
code: '比对式',
|
code: '比对式',
|
||||||
subName: '启用比对式检测计划',
|
subName: '启用比对式检测计划',
|
||||||
img: new URL('/src/assets/images/dashboard/3.svg', import.meta.url).href,
|
img: new URL('/src/assets/images/dashboard/3.svg', import.meta.url).href,
|
||||||
activated:
|
activated: isActivateOpen === 'true' ? activateInfo.contrast.permanently === 1 : true
|
||||||
isActivateOpen === 'true'
|
|
||||||
? activateInfo.contrast.apply === 1 && activateInfo.contrast.permanently === 1
|
|
||||||
: true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const handelOpen = async (item: any) => {
|
const handelOpen = async (item: any) => {
|
||||||
@@ -81,12 +72,8 @@ const handelOpen = async (item: any) => {
|
|||||||
await authStore.getAuthMenuList()
|
await authStore.getAuthMenuList()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const handleSelect = (key: string, keyPath: string[]) => {
|
const handleSelect = (key: string, keyPath: string[]) => {}
|
||||||
|
onMounted(() => {})
|
||||||
}
|
|
||||||
onMounted(() => {
|
|
||||||
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.box {
|
.box {
|
||||||
|
|||||||
@@ -294,37 +294,62 @@ const save = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
formContent.value.pt = `${ptPrimaryValue}:${ptSecondaryValue}`
|
||||||
// CT 逻辑, CT 分母是否为 ['1', '5']
|
// CT 逻辑, CT 分母是否为 ['1', '5']
|
||||||
if (!ctFinalValue.includes(ctSecondary.value)) {
|
if (!ctFinalValue.includes(ctSecondary.value)) {
|
||||||
ctErrorTips = true
|
ctErrorTips = true
|
||||||
}
|
}
|
||||||
if (ptErrorTips && ctErrorTips) {
|
if (ptErrorTips && ctErrorTips) {
|
||||||
ElMessage.error({ message: '请确认PT和CT无误!' })
|
await ElMessageBox.confirm('请确认PT和CT无误!', '提示', {
|
||||||
return
|
confirmButtonText: '继续保存',
|
||||||
|
cancelButtonText: '取消保存'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
sendParameter()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
return
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (ptErrorTips) {
|
if (ptErrorTips) {
|
||||||
ElMessage.error({ message: '请确认PT无误!' })
|
await ElMessageBox.confirm('请确认PT无误!', '提示', {
|
||||||
return
|
confirmButtonText: '继续保存',
|
||||||
|
cancelButtonText: '取消保存'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
sendParameter()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
return
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (ctErrorTips) {
|
if (ctErrorTips) {
|
||||||
ElMessage.error({ message: '请确认CT无误!' })
|
await ElMessageBox.confirm('请确认CT无误!', '提示', {
|
||||||
return
|
confirmButtonText: '确认保存',
|
||||||
|
cancelButtonText: '取消保存'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
sendParameter()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
return
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
formContent.value.pt = `${ptPrimaryValue}:${ptSecondaryValue}`
|
|
||||||
if (titleType.value != 'edit') {
|
|
||||||
formContent.value.id = generateUUID().replaceAll('-', '')
|
|
||||||
}
|
|
||||||
emit('get-parameter', formContent.value)
|
|
||||||
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
|
||||||
close()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('验证过程中出现错误', err)
|
console.error('验证过程中出现错误', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const sendParameter = () => {
|
||||||
|
if (titleType.value != 'edit') {
|
||||||
|
formContent.value.id = generateUUID().replaceAll('-', '')
|
||||||
|
}
|
||||||
|
emit('get-parameter', formContent.value)
|
||||||
|
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||||
|
close()
|
||||||
|
}
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => {
|
const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => {
|
||||||
// 重置表单
|
// 重置表单
|
||||||
|
|||||||
@@ -369,9 +369,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render: (scope: { row: { checkState: number } }) => {
|
render: (scope: { row: { checkState: number } }) => {
|
||||||
return scope.row.checkState === 0 ? (
|
return scope.row.checkState === 0 ? (
|
||||||
<el-tag type="primary" effect="dark">
|
<el-tag type="info">未检</el-tag>
|
||||||
未检
|
|
||||||
</el-tag>
|
|
||||||
) : scope.row.checkState === 1 ? (
|
) : scope.row.checkState === 1 ? (
|
||||||
<el-tag type="warning" effect="dark">
|
<el-tag type="warning" effect="dark">
|
||||||
检测中
|
检测中
|
||||||
@@ -531,7 +529,6 @@ const removeTab = async (targetName: TabPaneName) => {
|
|||||||
}
|
}
|
||||||
// 弹窗打开方法
|
// 弹窗打开方法
|
||||||
const open = async (textTitle: string, data: Plan.ReqPlan, pattern: string) => {
|
const open = async (textTitle: string, data: Plan.ReqPlan, pattern: string) => {
|
||||||
|
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
title.value = textTitle
|
title.value = textTitle
|
||||||
planTitle.value = data.name
|
planTitle.value = data.name
|
||||||
@@ -585,7 +582,7 @@ const handleTableDataUpdate = async (newData: any[]) => {
|
|||||||
planFormContent.value = matchedItem
|
planFormContent.value = matchedItem
|
||||||
//console.log('递归匹配成功:', planFormContent.value)
|
//console.log('递归匹配成功:', planFormContent.value)
|
||||||
} else {
|
} else {
|
||||||
// console.warn('未找到匹配的 planId:', planId.value)
|
// console.warn('未找到匹配的 planId:', planId.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,7 +613,7 @@ const handleRemove = async (row: any) => {
|
|||||||
ElMessage.warning(`当前设备已被子计划绑定,无法删除!`)
|
ElMessage.warning(`当前设备已被子计划绑定,无法删除!`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
proTable.value?.getTableList() // 刷新当前表格
|
proTable.value?.getTableList() // 刷新当前表格
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -690,10 +687,6 @@ const exportPlan = async () => {
|
|||||||
ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', { type: 'warning' }).then(() =>
|
ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', { type: 'warning' }).then(() =>
|
||||||
useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')
|
useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportPlanCheckResultData = async (selectedListIds: string[]) => {
|
const exportPlanCheckResultData = async (selectedListIds: string[]) => {
|
||||||
@@ -743,7 +736,6 @@ const initSSE = () => {
|
|||||||
eventSource.value = http.sse('/sse/createSse')
|
eventSource.value = http.sse('/sse/createSse')
|
||||||
|
|
||||||
eventSource.value.onmessage = event => {
|
eventSource.value.onmessage = event => {
|
||||||
|
|
||||||
const res = JSON.parse(event.data)
|
const res = JSON.parse(event.data)
|
||||||
progressData.value.percentage = res.data
|
progressData.value.percentage = res.data
|
||||||
progressData.value.message = res.message
|
progressData.value.message = res.message
|
||||||
|
|||||||
@@ -338,9 +338,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
|||||||
fieldNames: { label: 'label', value: 'id' },
|
fieldNames: { label: 'label', value: 'id' },
|
||||||
render: scope => {
|
render: scope => {
|
||||||
return scope.row.testState === 0 ? (
|
return scope.row.testState === 0 ? (
|
||||||
<el-tag type="primary" effect="dark">
|
<el-tag type="info">未检</el-tag>
|
||||||
未检
|
|
||||||
</el-tag>
|
|
||||||
) : scope.row.testState === 1 ? (
|
) : scope.row.testState === 1 ? (
|
||||||
<el-tag type="warning" effect="dark">
|
<el-tag type="warning" effect="dark">
|
||||||
检测中
|
检测中
|
||||||
|
|||||||
@@ -13,84 +13,61 @@
|
|||||||
<el-text style="margin-left: 82%">{{ 'v' + versionNumber }}</el-text>
|
<el-text style="margin-left: 82%">{{ 'v' + versionNumber }}</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-descriptions
|
<el-descriptions class="mode-descriptions" title="模块激活状态" size="small"></el-descriptions>
|
||||||
class="mode-descriptions"
|
<el-form label-position="left" :label-width="100">
|
||||||
v-if="!hadActivationCode"
|
<el-form-item class="mode-item" label="模拟式模块">
|
||||||
title="模块激活状态"
|
<el-tag
|
||||||
size="small"
|
v-if="activateInfo.simulate.permanently !== 1"
|
||||||
></el-descriptions>
|
class="activated-state"
|
||||||
<el-form
|
disable-transitions
|
||||||
ref="applicationFormRef"
|
type="danger"
|
||||||
v-if="!hadActivationCode"
|
>
|
||||||
:model="applicationForm"
|
未激活
|
||||||
label-position="left"
|
</el-tag>
|
||||||
:label-width="100"
|
<el-tag
|
||||||
>
|
v-if="activateInfo.simulate.permanently === 1"
|
||||||
<el-form-item
|
class="activated-state"
|
||||||
class="mode-item"
|
disable-transitions
|
||||||
v-if="activateInfo.simulate.apply !== 1 || activateInfo.simulate.permanently !== 1"
|
type="success"
|
||||||
label="模拟式模块"
|
>
|
||||||
prop="simulate.apply"
|
已激活
|
||||||
>
|
</el-tag>
|
||||||
<el-tag disable-transitions type="danger">未激活</el-tag>
|
|
||||||
<el-checkbox
|
|
||||||
:false-value="0"
|
|
||||||
:true-value="1"
|
|
||||||
class="apply-checkbox"
|
|
||||||
v-model="applicationForm.simulate.apply"
|
|
||||||
label="激活"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item class="mode-item" label="数字式模块">
|
||||||
class="mode-item"
|
<el-tag
|
||||||
v-if="activateInfo.simulate.apply === 1 && activateInfo.simulate.permanently === 1"
|
v-if="activateInfo.digital.permanently !== 1"
|
||||||
label="模拟式模块"
|
class="activated-state"
|
||||||
>
|
disable-transitions
|
||||||
<el-tag class="activated-tag" disable-transitions type="success">已激活</el-tag>
|
type="danger"
|
||||||
|
>
|
||||||
|
未激活
|
||||||
|
</el-tag>
|
||||||
|
<el-tag
|
||||||
|
v-if="activateInfo.digital.permanently === 1"
|
||||||
|
class="activated-state"
|
||||||
|
disable-transitions
|
||||||
|
type="success"
|
||||||
|
>
|
||||||
|
已激活
|
||||||
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item class="mode-item" label="比对式模块">
|
||||||
class="mode-item"
|
<el-tag
|
||||||
v-if="activateInfo.digital.apply !== 1 || activateInfo.digital.permanently !== 1"
|
v-if="activateInfo.contrast.permanently !== 1"
|
||||||
label="数字式模块"
|
class="activated-state"
|
||||||
prop="digital.apply"
|
disable-transitions
|
||||||
>
|
type="danger"
|
||||||
<el-tag disable-transitions type="danger">未激活</el-tag>
|
>
|
||||||
<el-checkbox
|
未激活
|
||||||
:false-value="0"
|
</el-tag>
|
||||||
:true-value="1"
|
<el-tag
|
||||||
class="apply-checkbox"
|
v-if="activateInfo.contrast.permanently === 1"
|
||||||
v-model="applicationForm.digital.apply"
|
class="activated-state"
|
||||||
label="激活"
|
disable-transitions
|
||||||
/>
|
type="success"
|
||||||
</el-form-item>
|
>
|
||||||
<el-form-item
|
已激活
|
||||||
class="mode-item"
|
</el-tag>
|
||||||
v-if="activateInfo.digital.apply === 1 && activateInfo.digital.permanently === 1"
|
|
||||||
label="数字式模块"
|
|
||||||
>
|
|
||||||
<el-tag class="activated-tag" disable-transitions type="success">已激活</el-tag>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
class="mode-item"
|
|
||||||
v-if="activateInfo.contrast.apply !== 1 || activateInfo.contrast.permanently !== 1"
|
|
||||||
label="比对式模块"
|
|
||||||
prop="contrast.apply"
|
|
||||||
>
|
|
||||||
<el-tag disable-transitions type="danger">未激活</el-tag>
|
|
||||||
<el-checkbox
|
|
||||||
:false-value="0"
|
|
||||||
:true-value="1"
|
|
||||||
class="apply-checkbox"
|
|
||||||
v-model="applicationForm.contrast.apply"
|
|
||||||
label="激活"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
class="mode-item"
|
|
||||||
v-if="activateInfo.contrast.apply === 1 && activateInfo.contrast.permanently === 1"
|
|
||||||
label="比对式模块"
|
|
||||||
>
|
|
||||||
<el-tag class="activated-tag" disable-transitions type="success">已激活</el-tag>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row v-if="applicationCode">
|
<el-row v-if="applicationCode">
|
||||||
@@ -137,25 +114,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { version } from '../../../../package.json'
|
import { version } from '../../../../package.json'
|
||||||
import type { Activate } from '@/api/activate/interface'
|
|
||||||
import { generateApplicationCode, verifyActivationCode } from '@/api/activate'
|
import { generateApplicationCode, verifyActivationCode } from '@/api/activate'
|
||||||
import { useAuthStore } from '@/stores/modules/auth'
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
|
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const activateInfo = authStore.activateInfo
|
const activateInfo = authStore.activateInfo
|
||||||
const versionNumber = ref(version)
|
const versionNumber = ref(version)
|
||||||
const applicationForm = reactive<Activate.ApplicationCodePlaintext>({
|
|
||||||
simulate: { apply: 0 },
|
|
||||||
digital: { apply: 0 },
|
|
||||||
contrast: { apply: 0 }
|
|
||||||
})
|
|
||||||
const activatedAll = computed(() => {
|
const activatedAll = computed(() => {
|
||||||
return (
|
return (
|
||||||
activateInfo.simulate.apply === 1 &&
|
|
||||||
activateInfo.simulate.permanently === 1 &&
|
activateInfo.simulate.permanently === 1 &&
|
||||||
activateInfo.digital.apply === 1 &&
|
|
||||||
activateInfo.digital.permanently === 1 &&
|
activateInfo.digital.permanently === 1 &&
|
||||||
activateInfo.contrast.apply === 1 &&
|
|
||||||
activateInfo.contrast.permanently === 1
|
activateInfo.contrast.permanently === 1
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@@ -166,25 +134,7 @@ const activationCode = ref('')
|
|||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
// 获取申请码
|
// 获取申请码
|
||||||
const getApplicationCode = async () => {
|
const getApplicationCode = async () => {
|
||||||
if (
|
const res = await generateApplicationCode()
|
||||||
applicationForm.simulate.apply == 0 &&
|
|
||||||
applicationForm.digital.apply == 0 &&
|
|
||||||
applicationForm.contrast.apply == 0
|
|
||||||
) {
|
|
||||||
ElMessage.warning('请选择需要激活的模块')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (activateInfo.simulate.apply === 1) {
|
|
||||||
applicationForm.simulate.apply = 1
|
|
||||||
}
|
|
||||||
if (activateInfo.digital.apply === 1) {
|
|
||||||
applicationForm.digital.apply = 1
|
|
||||||
}
|
|
||||||
if (activateInfo.contrast.apply === 1) {
|
|
||||||
applicationForm.contrast.apply = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await generateApplicationCode(applicationForm)
|
|
||||||
if (res.code == 'A0000') {
|
if (res.code == 'A0000') {
|
||||||
applicationCode.value = res.data as string
|
applicationCode.value = res.data as string
|
||||||
}
|
}
|
||||||
@@ -202,9 +152,6 @@ const openDialog = () => {
|
|||||||
hadActivationCode.value = false
|
hadActivationCode.value = false
|
||||||
activationCode.value = ''
|
activationCode.value = ''
|
||||||
applicationCode.value = ''
|
applicationCode.value = ''
|
||||||
applicationForm.simulate.apply = 0
|
|
||||||
applicationForm.digital.apply = 0
|
|
||||||
applicationForm.contrast.apply = 0
|
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
const beforeClose = (done: Function) => {
|
const beforeClose = (done: Function) => {
|
||||||
@@ -228,15 +175,12 @@ const submitActivation = async () => {
|
|||||||
defineExpose({ openDialog })
|
defineExpose({ openDialog })
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.apply-checkbox {
|
.activated-state {
|
||||||
margin-left: 62%;
|
|
||||||
}
|
|
||||||
.activated-tag {
|
|
||||||
margin-left: 80%;
|
margin-left: 80%;
|
||||||
}
|
}
|
||||||
.code-display,
|
.code-display,
|
||||||
.code-input {
|
.code-input {
|
||||||
font-family: consolas;
|
font-family: consolas, sans-serif;
|
||||||
}
|
}
|
||||||
:deep(.el-tag) {
|
:deep(.el-tag) {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user