Files
yusheng-admin/src/views/gift/giftClassif/index.vue

67 lines
2.5 KiB
Vue
Raw Normal View History

2025-08-11 11:11:49 +08:00
<script setup lang="ts">
import { onMounted } from "vue";
import { useData } from "./hook";
import SearchForm from "@/components/SearchForm/index.vue";
import { PureTableBar } from "@/components/RePureTableBar";
import { deviceDetection } from "@pureadmin/utils";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import AddFill from "@iconify-icons/ri/add-circle-line";
const {
searchLabel,
searchForm,
onSearch,
isShow,
tableList,
pagination,
tableLabel,
handleSizeChange,
handleCurrentChange,
handleDelete,
loading,
openDialog
} = useData();
defineOptions({
name: "roomType"
});
onMounted(() => {
onSearch(searchForm.value);
});
</script>
<template>
<div class="main">
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch" />
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
2025-08-16 17:05:52 +08:00
<PureTableBar title="标签列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
2025-08-11 11:11:49 +08:00
@refresh="onSearch">
<template #buttons>
<el-button type="primary" :icon="useRenderIcon(AddFill)" @click="openDialog('新增', {})">
2025-08-16 17:05:52 +08:00
新增礼物标签
2025-08-11 11:11:49 +08:00
</el-button>
</template>
<template v-slot="{ size, dynamicColumns }">
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" default-expand-all
:loading="loading" :size="size" row-key="id" adaptive :adaptiveConfig="{ offsetBottom: 108 }"
:data="tableList" :columns="dynamicColumns" :pagination="{ ...pagination, size }" :header-cell-style="{
background: 'var(--el-fill-color-light)',
color: 'var(--el-text-color-primary)'
}" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange">
<template #operation="{ row }">
<el-button link type="primary" :size="size" @click="openDialog('编辑', row)">
编辑
</el-button>
2025-08-16 17:05:52 +08:00
<el-popconfirm :title="`是否确认删除标签名称为${row.name}的这条数据`" @confirm="handleDelete(row)">
2025-08-11 11:11:49 +08:00
<template #reference>
<el-button link type="primary" :size="size"> 删除 </el-button>
</template>
</el-popconfirm>
</template>
</pure-table>
</template>
</PureTableBar>
</div>
</div>
</template>
<style scoped lang="scss"></style>