增加创建链接

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"> <div class="container">
<Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" /> <Breadcrumb :items="['menu.promotion', 'menu.promotion.Table']" />
<a-card class="general-card" :title="$t('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"> <!-- <a-table :columns="columns" :data="data" @change="handleChange">
<template #columns> <template #columns>
<a-table-column title="id" data-index="id"></a-table-column> <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="open"></a-table-column>
<a-table-column title="注册人数" data-index="register"></a-table-column> <a-table-column title="注册人数" data-index="register"></a-table-column>
</template> </template>
</a-table> --> </a-table> -->
<a-table :columns="columns" :data="data" @change="handleChange"> <a-table :columns="columns" :data="data" @change="handleChange">
<template #name-filter="{ filterValue, setFilterValue, handleFilterConfirm, handleFilterReset}"> <template #name-filter="{ filterValue, setFilterValue, handleFilterConfirm, handleFilterReset }">
<div class="custom-filter"> <div class="custom-filter">
<a-space direction="vertical"> <a-space direction="vertical">
<a-input :model-value="filterValue[0]" @input="(value)=>setFilterValue([value])" /> <a-input :model-value="filterValue[0]" @input="(value) => setFilterValue([value])" />
<div class="custom-filter-footer"> <div class="custom-filter-footer">
<a-button @click="handleFilterConfirm">确认</a-button> <a-button @click="handleFilterConfirm">确认</a-button>
<a-button @click="handleFilterReset">重置</a-button> <a-button @click="handleFilterReset">重置</a-button>
</div> </div>
</a-space> </a-space>
</div> </div>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, onMounted,h } from 'vue'; import { ref, onMounted, h } from 'vue';
import { lists } from '@/api/promotion'; import { lists, Generatelink } from '@/api/promotion';
import { IconSearch } from '@arco-design/web-vue/es/icon'; import { IconSearch } from '@arco-design/web-vue/es/icon';
const data = ref([]) const data = ref([])
const createlink = async () => {
const res1 = await Generatelink()
const res = await lists()
data.value = res.data
}
onMounted(async () => { onMounted(async () => {
const res = await lists() const res = await lists()
data.value = res.data data.value = res.data
}) })
const columns = [ const columns = [
{ {
title: 'id', title: 'id',
dataIndex: 'id', dataIndex: 'id',
}, },
{ {
title: '邀请码', title: '邀请码',
dataIndex: 'invite_code', dataIndex: 'invite_code',
filterable: { filterable: {
filter: (value, record) => record.invite_code.includes(value), filter: (value, record) => record.invite_code.includes(value),
slotName: 'name-filter', slotName: 'name-filter',
icon: () => h(IconSearch) icon: () => h(IconSearch)
} }
}, },
{ {
title: '打开次数', title: '打开次数',
dataIndex: 'open', dataIndex: 'open',
},{ }, {
title: '注册人数', title: '注册人数',
dataIndex: 'register', dataIndex: 'register',
}, },
]; ];
</script> </script>