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