This commit is contained in:
Leo_Ding 2025-08-18 09:56:21 +08:00
parent 28a0e90b2f
commit 3f5e002f43
29 changed files with 470 additions and 9 deletions

View File

@ -0,0 +1,14 @@
/**
* 区域模块接口
*/
import request from '@/utils/request'
// 获取项目列表
export const getProjectList = (params) => request.basic.get('/api/v1/product-categories', params)
// 获取单挑数据
export const getItem = (id) => request.basic.get(`/api/v1/product-categories/${id}`)
// 添加条目
export const createProject = (params) => request.basic.post('/api/v1/product-categories', params)
// 更新role
export const updateItem = (id, params) => request.basic.put(`/api/v1/product-categories/${id}`, params)
// 删除数据
export const delItem = (id) => request.basic.delete(`/api/v1/product-categories/${id}`)

View File

@ -99,5 +99,6 @@ export default {
ycbirth: '生日礼遇', ycbirth: '生日礼遇',
activityOrder:'活动报名列表', activityOrder:'活动报名列表',
banner:'首页轮播图', banner:'首页轮播图',
equiteMgt:'权益兑换' equiteMgt:'权益兑换',
equiteType:'权益兑换类型'
} }

View File

@ -13,5 +13,18 @@ export default [
permission: '*', permission: '*',
} }
} },
{
path: 'equiteType/index',
name: 'equiteType',
component: 'equiteType/index.vue',
meta: {
icon: CoffeeOutlined,
title: '权益类型',
isMenu: true,
keepAlive: true,
permission: '*',
}
},
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,9 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -21,7 +21,12 @@
<a-input :placeholder="'请输入订单电话'" v-model:value="formData.concatPhone"></a-input> <a-input :placeholder="'请输入订单电话'" v-model:value="formData.concatPhone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-item :label="'排序'" name="sequence">
<a-input-number :placeholder="'请输入排序'" style="width: 100%;"
v-model:value="formData.sequence"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item :label="'所需积分'" name="price"> <a-form-item :label="'所需积分'" name="price">
<a-input-number :placeholder="'请输入所需积分'" style="width: 100%;" <a-input-number :placeholder="'请输入所需积分'" style="width: 100%;"
@ -29,8 +34,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item :label="'库存'" name="stock"> <a-form-item :label="'已兑'" name="stock">
<a-input-number :placeholder="'请输入库存数量'" style="width: 100%;" <a-input-number :placeholder="'请输入已兑数量'" style="width: 100%;"
v-model:value="formData.stock"></a-input-number> v-model:value="formData.stock"></a-input-number>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -151,7 +156,8 @@ formRules.value = {
concatName: [{ required: true, message: '请输入订单联系人' }], concatName: [{ required: true, message: '请输入订单联系人' }],
concatPhone: [{ required: true, message: '请输入订单电话' }], concatPhone: [{ required: true, message: '请输入订单电话' }],
price: [{ required: true, message: '请输入所需积分' }], price: [{ required: true, message: '请输入所需积分' }],
stock: [{ required: true, message: '请输入库存数量' }], sequence: [{ required: true, message: '请输入排序' }],
stock: [{ required: true, message: '请输入已兑数量' }],
maxNum: [{ required: true, message: '请输入兑换数量上限' }], maxNum: [{ required: true, message: '请输入兑换数量上限' }],
canNum: [{ required: true, message: '请输入兑换次数上限' }], canNum: [{ required: true, message: '请输入兑换次数上限' }],
// details: [{ required: true, message: '' }], // details: [{ required: true, message: '' }],

View File

@ -79,7 +79,7 @@
<a-tooltip> <a-tooltip>
<template #title>{{ $t('pages.system.delete') }}</template> <template #title>{{ $t('pages.system.delete') }}</template>
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button> <delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
</template> </template>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
@ -118,7 +118,7 @@ import { PlusOutlined, EditOutlined, DeleteOutlined, QrcodeOutlined } from '@ant
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
defineOptions({ defineOptions({
name: 'equiteMgt', name: 'equiteType',
}) })
const { t } = useI18n() // t const { t } = useI18n() // t
const open = ref(false) const open = ref(false)
@ -131,7 +131,8 @@ const columns = [
{ title: '订单联系人', dataIndex: 'concatName', width: 200 }, { title: '订单联系人', dataIndex: 'concatName', width: 200 },
{ title: '订单电话', dataIndex: 'concatPhone', width: 200 }, { title: '订单电话', dataIndex: 'concatPhone', width: 200 },
{ title: '所需积分', dataIndex: 'price', width: 100, align: 'center' }, { title: '所需积分', dataIndex: 'price', width: 100, align: 'center' },
{ title: '库存', dataIndex: 'stock', width: 100, align: 'center' }, { title: '已兑', dataIndex: 'stock', width: 100, align: 'center' },
{ title: '排序', dataIndex: 'sequence', width: 100, align: 'center' },
{ title: '兑换数量上限', dataIndex: 'maxNum', width: 120 }, { title: '兑换数量上限', dataIndex: 'maxNum', width: 120 },
{ title: '兑换次数上限', dataIndex: 'canNum', width: 120 }, { title: '兑换次数上限', dataIndex: 'canNum', width: 120 },
{ title: '详情', dataIndex: 'details', align: 'center', width: 100 }, { title: '详情', dataIndex: 'details', align: 'center', width: 100 },

View File

@ -0,0 +1,168 @@
<template>
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
<a-spin :spinning="spining">
<a-form ref="formRef" :model="formData" :rules="formRules">
<a-card class="mb-8-2">
<a-row :gutter="12">
<a-col :span="24">
<a-form-item :label="'名称'" name="name">
<a-input :placeholder="'名称'" v-model:value="formData.name"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'排序'" name="sequence">
<a-input-number :placeholder="'请输入排序'" style="width: 100%;"
v-model:value="formData.sequence"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'状态'" name="status">
<a-radio-group v-model:value="formData.status" :options="[
{ label: '启用', value: 'enabled' },
{ label: '停用', value: 'disabled' },
]"></a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-card>
</a-form>
</a-spin>
</a-modal>
</template>
<script setup>
import { cloneDeep } from 'lodash-es'
import { ref, onBeforeMount } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal, useSpining } from '@/hooks'
import { message } from 'ant-design-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import GxUpload from '@/components/GxUpload/index.vue'
import { spliceUrl } from '@/utils/util'
const areaFormRef = ref()
const emit = defineEmits(['ok'])
const { t } = useI18n() // t
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
const { spining, showSpining, hideSpining } = useSpining()
const cancelText = ref(t('button.cancel'))
const okText = ref(t('button.confirm'))
const rolesValue = ref([])
const roles = ref([])
const ceshi = ref('1222')
const areaList = ref([])
const childOpen = ref(false)
const fileList = ref([])
const formArea = ref({ name: '', status: 'enabled' })
formRules.value = {
name: { required: true, message: '请输入案场名称' },
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
}
/**
* 新建
*/
function handleCreate() {
showModal({
type: 'create',
title: '新增',
})
// initData()
formData.value.status = 'enabled'
}
/**
* 编辑
*/
async function handleEdit(record = {}) {
showModal({
type: 'edit',
title: '编辑',
})
try {
showSpining()
const { data, success } = await apis.equiteType.getItem(record.id).catch()
if (!success) {
hideModal()
return
}
hideSpining()
formData.value = { ...data }
} catch (error) {
message.error({ content: error.message })
hideSpining()
}
}
const uploadSuccess = (data) => {
fileList.value.push(data)
}
/**
* 确定
*/
function handleOk() {
formRef.value.validateFields().then(async (values) => {
try {
showLoading()
const params = {
name: formData.value.name,
status: formData.value.status,
sequence: formData.value.sequence
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.equiteType.createProject(params).catch((error) => {
throw new Error(error)
})
break
case 'edit':
result = await apis.equiteType.updateItem(formData.value.id, params).catch(() => {
throw new Error(error)
})
break
}
hideLoading()
if (config('http.code.success') === result?.success) {
hideModal()
emit('ok')
}
} catch (error) {
message.error({ content: error.message })
hideLoading()
}
})
.catch((e) => {
hideLoading()
})
}
/**
* 取消
*/
function handleCancel() {
hideModal()
}
/**
* 关闭后
*/
function onAfterClose() {
resetForm()
hideLoading()
}
defineExpose({
handleCreate,
handleEdit,
})
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,214 @@
<template>
<!-- <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item label="岗位名称" name="name">
<a-input placeholder="请输入岗位名称" v-model:value="searchFormData.name"></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option value="">全部</a-select-option>
<a-select-option value="enabled">启用</a-select-option>
<a-select-option value="disabled">停用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col class="align-right" v-bind="colSpan">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
<x-action-bar class="mb-8-2">
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新增类型
</a-button>
</x-action-bar>
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'img'">
<a-image :width="60" :src="config('http.apiBasic')+record.img || $imageErr.imgErr" />
</template>
<template v-if="'status' === column.dataIndex">
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
</template>
<template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
<a-tooltip>
<template #title> {{ $t('pages.system.user.edit') }}</template>
<edit-outlined /> </a-tooltip></x-action-button>
<x-action-button @click="handleDelete(record)">
<a-tooltip>
<template #title>{{ $t('pages.system.delete') }}</template>
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
<a-modal v-model:open="qropen" :title="'生成二维码'" @ok="qropen = false" :footer="null">
<a-card class="mb-8-2"
style="display: flex;align-items: center;flex-direction: column;justify-content: center;">
<x-qrCode :value="qrValue" :icon="qrlogo" :iconBackgroundColor="'#ffffff'" :size="180"></x-qrCode>
</a-card>
</a-modal>
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { formatUtcDateTime } from '@/utils/util'
import { config } from '@/config'
import { statusUserTypeEnum } from '@/enums/system'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import { PlusOutlined, EditOutlined, DeleteOutlined,QrcodeOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import qrlogo from '@/assets/qrlogo.png'
const content = ref('')
const qrValue = ref('')
const qropen = ref(false)
defineOptions({
name: 'projectList',
})
const { t } = useI18n() // t
const columns = [
{ title: '名称名称', dataIndex: 'name', key: 'title' },
{ title: '状态', dataIndex: 'status', width: 100,align:'center' },
{ title: '排序号', dataIndex: 'sequence', width: 100,align:'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 150, align: 'center' },
]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } =
usePagination()
const editDialogRef = ref()
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}
*/
async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { success, data, total } = await apis.equiteType
.getProjectList({
pageSize,
current: current,
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
hideLoading()
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
}
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.equiteType.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
const createQrcode = (params) => {
const {name,areaId,id}=params
const item={ title:name,
typer:'activity',
pathUrl:'/pages/sceneDetail/index.vue',
areaId,
relationId:id,
kvalue1:'',
kvalue2:'',
kvalue3:'',
kvalue4:'',
kvalue5:'',}
qrValue.value = JSON.stringify(item)
console.log(qrValue.value)
qropen.value = true
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,7 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -80,6 +80,8 @@ const columns = [
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination() const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]

View File

@ -79,6 +79,8 @@ const columns = [
{ title: '联系人姓名', dataIndex: 'concatName' }, { title: '联系人姓名', dataIndex: 'concatName' },
{ title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' }, { title: '创建时间', dataIndex: 'createdAt', width: 150, align: 'center' },
{ title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' }, { title: '过期时间', dataIndex: 'expireAt', width: 150, align: 'center' },
{ title: '权益名称', dataIndex: 'productName', width: 150, align: 'center' },
{ title: '状态', dataIndex: 'status', width: 100, align: 'center' }, { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' }, { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
] ]