feat:卡密列表调整
This commit is contained in:
parent
43c2467346
commit
d10532006d
@ -44,6 +44,21 @@
|
||||
<el-option label="已过期" :value="4"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡密类型">
|
||||
<el-select v-model="searchForm.cardType" placeholder="请选择卡密类型" clearable style="min-width: 100px;">
|
||||
<el-option
|
||||
label="使用核价凭证"
|
||||
value="verifyPriceCredential"
|
||||
/>
|
||||
<el-option
|
||||
label="使用克隆凭证"
|
||||
value="cloneCredential"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="searchForm.memo" placeholder="请输入备注关键词" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
<el-button @click="resetSearch">重置</el-button>
|
||||
@ -110,7 +125,7 @@
|
||||
{{ formatDateTime(row.useTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="memo" label="备注" min-width="120" />
|
||||
<el-table-column prop="note" label="备注" min-width="120"/>
|
||||
<el-table-column label="操作" fixed="right" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
@ -118,20 +133,23 @@
|
||||
type="danger"
|
||||
@click="handleDelete(row.id)"
|
||||
:disabled="row.status === 3 || row.status === 4"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.status !== 3"
|
||||
size="small"
|
||||
type="warning"
|
||||
@click="handleDisable(row.id)"
|
||||
:disabled="row.status === 4 || row.status === 0"
|
||||
>停用</el-button>
|
||||
>停用
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
size="small"
|
||||
type="success"
|
||||
@click="handleEnable(row.id)"
|
||||
>启用</el-button>
|
||||
>启用
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -182,6 +200,18 @@
|
||||
>
|
||||
<div class="card-params-content">
|
||||
<el-form :model="cardParams" label-width="80px">
|
||||
<el-form-item label="卡密类型">
|
||||
<el-select v-model="cardParams.cardType" placeholder="请选择卡密类型">
|
||||
<el-option
|
||||
label="使用核价凭证"
|
||||
value="verifyPriceCredential"
|
||||
/>
|
||||
<el-option
|
||||
label="使用克隆凭证"
|
||||
value="cloneCredential"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="有效期">
|
||||
<el-input-number v-model="cardParams.effectiveDays" :min="1" :max="365"/>
|
||||
<span class="unit-label">天</span>
|
||||
@ -220,7 +250,9 @@ const searchForm = reactive({
|
||||
status: '',
|
||||
effectiveDays: 0,
|
||||
activateTimeRange: [],
|
||||
expireTimeRange: []
|
||||
expireTimeRange: [],
|
||||
memo: '',
|
||||
cardType: '',
|
||||
})
|
||||
|
||||
// 分页配置
|
||||
@ -237,6 +269,7 @@ const cardSecretValue = ref('')
|
||||
// 添加卡密参数对话框
|
||||
const cardParamsDialogVisible = ref(false)
|
||||
const cardParams = reactive({
|
||||
cardType: 'verifyPriceCredential', // 默认值
|
||||
effectiveDays: 30,
|
||||
memo: ''
|
||||
})
|
||||
@ -306,7 +339,9 @@ const fetchData = async () => {
|
||||
cardId: searchForm.cardId || undefined,
|
||||
cardSecret: searchForm.cardSecret || undefined,
|
||||
status: searchForm.status !== null ? searchForm.status : undefined,
|
||||
effectiveDays: searchForm.effectiveDays || undefined
|
||||
effectiveDays: searchForm.effectiveDays || undefined,
|
||||
cardType: searchForm.cardType || undefined,
|
||||
memo: searchForm.memo || undefined
|
||||
}
|
||||
|
||||
// 处理激活时间范围
|
||||
@ -362,10 +397,11 @@ const handleGetCardSecret = () => {
|
||||
const submitCardSecretRequest = async () => {
|
||||
try {
|
||||
const cardData = {
|
||||
cardType: "verifyPriceCredential",
|
||||
cardType: cardParams.cardType,
|
||||
effectiveDays: cardParams.effectiveDays,
|
||||
memo: cardParams.memo
|
||||
};
|
||||
console.log("cardData", cardData)
|
||||
const res = await cardsApi.createCardSecret(cardData)
|
||||
// 由于createCardSecret方法已经处理了响应,所以直接使用res
|
||||
console.log("res", res)
|
||||
@ -434,6 +470,7 @@ const resetSearch = () => {
|
||||
searchForm.effectiveDays = 0
|
||||
searchForm.activateTimeRange = []
|
||||
searchForm.expireTimeRange = []
|
||||
searchForm.memo = ''
|
||||
pagination.current = 1
|
||||
fetchData()
|
||||
}
|
||||
@ -571,7 +608,8 @@ const getStatusText = (status) => {
|
||||
// 获取卡密类型文本
|
||||
const getCardTypeText = (type) => {
|
||||
const map = {
|
||||
'verifyPriceCredential': '使用核价凭证'
|
||||
'verifyPriceCredential': '使用核价凭证',
|
||||
'cloneCredential': '使用克隆凭证'
|
||||
}
|
||||
return map[type] || type
|
||||
}
|
||||
|
||||
@ -45,8 +45,8 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8089',
|
||||
// target: 'http://146.56.227.42:8089',
|
||||
// target: 'http://127.0.0.1:8089',
|
||||
target: 'http://146.56.227.42:8089',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/,''),
|
||||
// 如需处理WebSocket
|
||||
|
||||
Loading…
Reference in New Issue
Block a user