增加创建链接

This commit is contained in:
lingling 2025-02-24 22:08:45 +08:00
parent 719551bbb0
commit 128ada0d4e
1 changed files with 36 additions and 26 deletions

View File

@ -2,6 +2,10 @@
<div class="container">
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('menu.promotion.Table')">
<div style="display: flex;justify-content: space-between;">
<a-button type="primary" @click="createlink">生成新链接</a-button>
<div>http://127.0.0.1:8787/Recommend/index?invite_code=</div>
</div>
<!-- <a-table :columns="columns" :data="data" @change="handleChange">
<template #columns>
<a-table-column title="id" data-index="id"></a-table-column>
@ -9,57 +13,63 @@
<a-table-column title="打开次数" data-index="open"></a-table-column>
<a-table-column title="注册人数" data-index="register"></a-table-column>
</template>
</a-table> -->
</a-table> -->
<a-table :columns="columns" :data="data" @change="handleChange">
<template #name-filter="{ filterValue, setFilterValue, handleFilterConfirm, handleFilterReset}">
<div class="custom-filter">
<a-space direction="vertical">
<a-input :model-value="filterValue[0]" @input="(value)=>setFilterValue([value])" />
<div class="custom-filter-footer">
<a-button @click="handleFilterConfirm">确认</a-button>
<a-button @click="handleFilterReset">重置</a-button>
</div>
</a-space>
</div>
</template>
</a-table>
<template #name-filter="{ filterValue, setFilterValue, handleFilterConfirm, handleFilterReset }">
<div class="custom-filter">
<a-space direction="vertical">
<a-input :model-value="filterValue[0]" @input="(value) => setFilterValue([value])" />
<div class="custom-filter-footer">
<a-button @click="handleFilterConfirm">确认</a-button>
<a-button @click="handleFilterReset">重置</a-button>
</div>
</a-space>
</div>
</template>
</a-table>
</a-card>
</div>
</template>
<script setup>
import { ref, onMounted,h } from 'vue';
import { lists } from '@/api/promotion';
import { ref, onMounted, h } from 'vue';
import { lists, Generatelink } from '@/api/promotion';
import { IconSearch } from '@arco-design/web-vue/es/icon';
const data = ref([])
const createlink = async () => {
const res1 = await Generatelink()
const res = await lists()
data.value = res.data
}
onMounted(async () => {
const res = await lists()
data.value = res.data
})
const columns = [
{
{
title: 'id',
dataIndex: 'id',
},
{
},
{
title: '邀请码',
dataIndex: 'invite_code',
filterable: {
filter: (value, record) => record.invite_code.includes(value),
slotName: 'name-filter',
icon: () => h(IconSearch)
filter: (value, record) => record.invite_code.includes(value),
slotName: 'name-filter',
icon: () => h(IconSearch)
}
},
{
},
{
title: '打开次数',
dataIndex: 'open',
},{
}, {
title: '注册人数',
dataIndex: 'register',
},
];
},
];
</script>