signupNum

This commit is contained in:
Leo_Ding 2025-08-14 18:35:30 +08:00
parent dc23c31f98
commit 28a0e90b2f
12 changed files with 650 additions and 52 deletions

View File

@ -12,8 +12,8 @@ VITE_ROUTER_BASE=/
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC=https://zh.shibeitong.com
# VITE_API_BASIC=http://10.10.1.6:8070
# VITE_API_BASIC=https://zh.shibeitong.com
VITE_API_BASIC=http://10.10.1.6:8070
VITE_API_HTTP=/api/v1/
# storage
VITE_STORAGE_NAMESPACE = gin-admin_local_

View File

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

View File

@ -47,9 +47,15 @@ const equiteEnum = new EnumManager([
// {value:7,name:'kangyang'},
// {value:8,name:'fangchan'},
]);
export {
customersEnum,areaEnum,rightEnum,equiteEnum
const typerEnum=new EnumManager([
{value:'product',name:'实体产品'},
{value:'hotel',name:'酒店'},
{value:'table',name:'表单'},
{value:'qrcode',name:'二维码'},
])
export {
customersEnum,areaEnum,rightEnum,equiteEnum,typerEnum
}
// // 获取整个数组
// console.log(roleEnum.getAll());

View File

@ -73,9 +73,9 @@ export default {
lotteryProduct: '奖品列表',
lotteryOrders: '抽奖记录',
equite: '南通权益兑换',
equite: '南通权益兑换记录',
hotel: '酒店优惠',
parentChild: '亲子礼遇',
parentChild: '线上会员礼遇',
jiazhuang: '家装团购',
life: '生活服务',
lvyou: '旅游',
@ -87,7 +87,7 @@ export default {
aiya: '爱牙抵用券',
yllvs: '医疗绿色',
ycequite: '盐城权益兑换',
ycequite: '盐城权益兑换记录',
ycjztg: '家装团购',
ycqwsc: '全屋纱窗安装服务',
ycfwjbj: '房屋精保洁',
@ -95,8 +95,9 @@ export default {
ycxwybm: '盐城享物业便民',
ycjd: '盐城市内景点畅玩',
ycyllvs: '医疗绿色通道',
ycparentChild: '亲子权益',
ycparentChild: '线上会员礼遇',
ycbirth: '生日礼遇',
activityOrder:'活动报名列表',
banner:'首页轮播图'
banner:'首页轮播图',
equiteMgt:'权益兑换'
}

View File

@ -0,0 +1,17 @@
import { CoffeeOutlined } from '@ant-design/icons-vue'
export default [
{
path: 'equiteMgt/index',
name: 'equiteMgt',
component: 'equiteMgt/index.vue',
meta: {
icon: CoffeeOutlined,
title: '权益列表',
isMenu: true,
keepAlive: true,
permission: '*',
}
}
]

View File

@ -19,6 +19,7 @@ import equite from './equite'
import ycequite from './ycequite'
import lottery from './lottery'
import equiteMgt from './equiteMgt'
export default [
...home,
@ -40,5 +41,6 @@ export default [
...activity,
...equite,
...lottery,
...ycequite
...ycequite,
...equiteMgt
]

View File

@ -88,7 +88,7 @@ export default [
name: 'ycparentChild',
component: 'ycequite/ycparentChild/index.vue',
meta: {
title: '亲子权益',
title: '线上会员礼遇',
isMenu: true,
keepAlive: true,
permission: '*',

View File

@ -18,17 +18,23 @@
</a-col>
<a-col :span="24">
<a-form-item :label="'活动开始时间'" name="startAt">
<a-date-picker v-model:value="formData.startAt" :show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm" style="width: 100%;" />
<a-date-picker v-model:value="formData.startAt"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm"
style="width: 100%;" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'活动结束时间'" name="endAt">
<a-date-picker v-model:value="formData.endAt" :show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm" style="width: 100%;" />
<a-date-picker v-model:value="formData.endAt"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm"
style="width: 100%;" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'报名截止时间'" name="endSignupAt">
<a-date-picker v-model:value="formData.endSignupAt" :show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm" style="width: 100%;" />
<a-date-picker v-model:value="formData.endSignupAt"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm"
style="width: 100%;" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -69,7 +75,8 @@
</a-col>
<a-col :span="24">
<a-form-item :label="'活动图片'" name="fileList">
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="20" />
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp"
:fileNumber="20" />
</a-form-item>
</a-col>
</a-row>
@ -90,7 +97,7 @@ import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import GxUpload from '@/components/GxUpload/index.vue'
import { customersEnum, areaEnum } from "@/enums/useEnum"
import {spliceUrl} from "@/utils/util"
import { spliceUrl } from "@/utils/util"
const emit = defineEmits(['ok'])
const { t } = useI18n() // t
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
@ -170,8 +177,8 @@ async function handleEdit(record = {}) {
formData.value.endAt = dayjs(data.endAt)
formData.value.endSignupAt = dayjs(data.endSignupAt)
if (data.images&&data.images.length>0) {
formData.value.fileList = data.images.map(item=>config('http.apiBasic') + item)
if (data.images && data.images.length > 0) {
formData.value.fileList = data.images.map(item => config('http.apiBasic') + item)
}
} catch (error) {
message.error({ content: error.message })
@ -191,8 +198,9 @@ function handleOk() {
showLoading()
const params = {
...values,
cover:spliceUrl(formData.value.fileList[0]),
images:formData.value.fileList?formData.value.fileList.map(item=>spliceUrl(item)):[]
cover: spliceUrl(formData.value.fileList[0]),
images: formData.value.fileList ? formData.value.fileList.map(item => spliceUrl(item)) : [],
signupNum: formData.value.signupNum || 0,
}
let result = null
switch (modal.value.type) {
@ -231,10 +239,10 @@ function handleCancel() {
hideModal()
}
const onRangeChange = (value, dateString) => {
console.log('value',value)
console.log('value', value)
console.log('Formatted Selected Time: ', dateString);
formData.value.startAt=dayjs(dateString[0])
formData.value.endAt=dayjs(dateString[1])
formData.value.startAt = dayjs(dateString[0])
formData.value.endAt = dayjs(dateString[1])
console.log(formData.value)
};

View File

@ -67,6 +67,7 @@ formRules.value = {
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
img: [{ required: true, message: '请上传图片', trigger: 'change' }],
areaId: [{ required: true, message: '请选择区域', trigger: 'change' }],
}
/**
* 新建

View File

@ -0,0 +1,293 @@
<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="12">
<a-form-item :label="'订单联系人'" name="concatName">
<a-input :placeholder="'请输入订单联系人'" v-model:value="formData.concatName"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'订单电话'" name="concatPhone">
<a-input :placeholder="'请输入订单电话'" v-model:value="formData.concatPhone"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'所需积分'" name="price">
<a-input-number :placeholder="'请输入所需积分'" style="width: 100%;"
v-model:value="formData.price"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'库存'" name="stock">
<a-input-number :placeholder="'请输入库存数量'" style="width: 100%;"
v-model:value="formData.stock"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'兑换数量上限'" name="maxNum">
<a-input-number :placeholder="'请输入兑换数量上限'" style="width: 100%;"
v-model:value="formData.maxNum"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'兑换次数上限'" name="canNum">
<a-input-number :placeholder="'请输入兑换次数上限'" style="width: 100%;"
v-model:value="formData.canNum"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'详情'" name="details">
<x-editor v-model="editorContent" :uploadHandler="uploadHandler"
:height="300"></x-editor>
<!-- <a-textarea :placeholder="'请输入详情'" v-model:value="formData.details" style="width: 100%;"
:rows="4"></a-textarea> -->
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item :label="'是否热门'" name="isHot">
<a-radio-group v-model:value="formData.isHot" :options="[
{ label: '是', value: true },
{ label: '否', value: false },
]"></a-radio-group>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item :label="'所属区域'" name="areaId">
<a-select ref="select" v-model:value="formData.areaId">
<a-select-option v-for="item in areaEnum.getAll()" :value="item.value">{{
item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'所属分类'" name="categoryId">
<a-select ref="select" v-model:value="formData.categoryId">
<a-select-option v-for="item in categoryList" :value="item.value">{{
item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'权益到期时间'" name="expireAt">
<a-date-picker v-model:value="formData.expireAt"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }" format="YYYY-MM-DD HH:mm"
style="width: 100%;" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'礼品有效期(天)'" name="expire">
<a-input-number :placeholder="'请输入礼品有效期'" style="width: 100%;"
v-model:value="formData.expire"></a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item :label="'产品类别'" name="type">
<a-select v-model:value="formData.type" placeholder="请选择产品类别">
<a-select-option v-for="value in typerEnum.getAll()" :key="value.value"
:value="value.value">{{ value.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<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-col :span="24">
<a-form-item :label="'封面图'" name="fileList">
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
</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 { typerEnum, areaEnum } from "@/enums/useEnum"
import { spliceUrl } from "@/utils/util"
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 fileList = ref([])
const categoryList = ref([])
const editorContent = ref('')
formRules.value = {
name: [{ required: true, message: '请输入权益名称' }],
concatName: [{ required: true, message: '请输入订单联系人' }],
concatPhone: [{ required: true, message: '请输入订单电话' }],
price: [{ required: true, message: '请输入所需积分' }],
stock: [{ required: true, message: '请输入库存数量' }],
maxNum: [{ required: true, message: '请输入兑换数量上限' }],
canNum: [{ required: true, message: '请输入兑换次数上限' }],
// details: [{ required: true, message: '' }],
isHot: [{ required: true, message: '请选择是否热门' }],
areaId: [{ required: true, message: '请选择所属区域' }],
expireAt: [{ required: true, message: '请选择权益到期时间' }],
expire: [{ required: true, message: '请输入礼品有效期' }],
type: [{ required: true, message: '请选择产品类别' }],
status: [{ required: true, message: '请选择状态' }],
fileList: [{ required: true, message: '请上传封面图', trigger: 'change' }],
categoryId: [{ required: true, message: '请选择所属分类', trigger: 'change' }]
}
onBeforeMount(() => {
formData.value.areaId = 1
formData.value.isHot = true
getCategory()
})
async function getCategory() {
const { data, success } = await apis.equiteMgt.getCategory({ current: 1, pageSize: 99 }).catch()
if (success) {
console.log(data)
categoryList.value = data.map(item => ({ value: item.id, name: item.name }))
}
}
/**
* 新建
*/
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.equiteMgt.getItem(record.id).catch()
if (!success) {
hideModal()
return
}
hideSpining()
formData.value = { ...data }
formData.value.expireAt = data?.expireAt ? dayjs(data?.expireAt) : ''
editorContent.value = data.details
if (data.cover && data.cover.length > 0) {
formData.value.fileList = [data.cover].map(item => config('http.apiBasic') + item)
}
} 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 = {
...values,
cover: spliceUrl(formData.value.fileList[0]),
details: editorContent.value,
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.equiteMgt.createProject(params).catch((error) => {
throw new Error(error)
})
break
case 'edit':
result = await apis.equiteMgt.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() {
formData.value.areaId = 1
hideModal()
}
const onRangeChange = (value, dateString) => {
console.log('value', value)
console.log('Formatted Selected Time: ', dateString);
formData.value.startAt = dayjs(dateString[0])
formData.value.endAt = dayjs(dateString[1])
console.log(formData.value)
};
/**
* 关闭后
*/
function onAfterClose() {
editorContent.value = ''
resetForm()
hideLoading()
}
defineExpose({
handleCreate,
handleEdit,
})
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,240 @@
<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="areaId">
<a-select v-model:value="searchFormData.areaId" allowClear>
<a-select-option :value="1">南通</a-select-option>
<a-select-option :value="2">盐城</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 === 'cover'">
<a-image v-if="record.cover" :src="config('http.apiBasic') + record.cover" />
</template>
<template v-if="column.dataIndex === 'expireAt'">
<span>{{ record.expireAt && dayjs(record.expireAt).format('YYYY-MM-DD HH:mm') }}</span>
</template>
<template v-if="column.dataIndex === 'details'">
<span style="cursor: pointer;color:#1677ff;"
@click="content = record.details || ''; type = 2; open = true" type="link">点击查看</span>
</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="'isHot' === column.dataIndex">
<a-tag v-if="record.isHot === true" :color="'red'">热门</a-tag>
<a-tag v-if="record.isHot === false" :color="'#999999'">非热门</a-tag>
</template> -->
<template v-if="column.dataIndex === 'areaId'">
<span>{{ areaEnum.getName(record.areaId) }}</span>
</template>
<template v-if="'type' === column.dataIndex">
<span>{{ typerEnum.getName(record.type) }}</span>
</template>
<template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
<a-tooltip>
<template #title> 编辑</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="open" :title="type === 1 ? '权益图片' : '权益详情'" @ok="open = false">
<template v-if="type === 1">
<a-image v-if="imgList.length > 0" :width="200" v-for="item of imgList"
:src="config('http.apiBasic') + item" />
<span v-else>
暂无图片
</span>
</template>
<template v-else>
<a-card>
<span v-html="content"></span>
</a-card>
</template>
</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 dayjs from 'dayjs'
import { usePagination } from '@/hooks'
import { typerEnum, areaEnum } from "@/enums/useEnum"
import EditDialog from './components/EditDialog.vue'
import { PlusOutlined, EditOutlined, DeleteOutlined, QrcodeOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
defineOptions({
name: 'equiteMgt',
})
const { t } = useI18n() // t
const open = ref(false)
const imgList = ref([])
const type = ref(1)
const columns = [
{ title: '封面图', dataIndex: 'cover', width: 80 },
{ title: '权益名称', dataIndex: 'name', width: 200 },
{ title: '订单联系人', dataIndex: 'concatName', width: 200 },
{ title: '订单电话', dataIndex: 'concatPhone', width: 200 },
{ title: '所需积分', dataIndex: 'price', width: 100, align: 'center' },
{ title: '库存', dataIndex: 'stock', width: 100, align: 'center' },
{ title: '兑换数量上限', dataIndex: 'maxNum', width: 120 },
{ title: '兑换次数上限', dataIndex: 'canNum', width: 120 },
{ title: '详情', dataIndex: 'details', align: 'center', width: 100 },
// { title: '', dataIndex: 'isHot', align: 'center', width: 100 },
{ title: '所属区域', dataIndex: 'areaId', width: 90, align: 'center' },
{ title: '权益到期时间', dataIndex: 'expireAt', width: 120, align: 'center' },
{ title: '礼品有效期/天', dataIndex: 'expire', width: 90, align: 'center' },
{ title: '产品类别', dataIndex: 'type', width: 90, align: 'center' },
{ title: '状态', dataIndex: 'status', key: 'introduce', width: 60, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120, 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.equiteMgt
.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.equiteMgt.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()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -29,7 +29,7 @@
</a-row>
</a-form>
</template>
</x-search-bar> -->
</x-search-bar> -->
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card type="flex">
@ -44,14 +44,18 @@
<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 === 'areaId'">
<template v-if="column.dataIndex === 'areaId'">
<span>{{ areaEnum.getName(record.areaId) }}</span>
</template>
<template v-if="column.dataIndex === 'cover'">
<a-image :width="60" :src="config('http.apiBasic')+record.cover || $imageErr.imgErr" />
<a-image :width="60" :src="config('http.apiBasic') + record.cover || $imageErr.imgErr" />
</template>
<template v-if="column.dataIndex === 'pushAt'">
<span>{{ dayjs(record.pushAt).format('YYYY-MM-DD') }}</span>
</template>
<template v-if="column.dataIndex === 'content'">
<span style="cursor: pointer;color:#1677ff;"
@click="content = record.content || ''; modalType = 2; qropen = true" type="link">点击查看</span>
</template>
<template v-if="'status' === column.dataIndex">
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
@ -72,11 +76,17 @@
</a-card>
</a-col>
</a-row>
<a-modal v-model:open="qropen" :title="'生成二维码'" @ok="qropen = false" :footer="null">
<a-card class="mb-8-2"
<a-modal v-model:open="qropen" :title="modalType==1?'生成二维码':'查看内容'" @ok="qropen = false" :footer="null">
<a-card v-if="modalType==1" 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-card v-else >
<div style="height: 450px;overflow-y: scroll;">
<div v-html="content" ></div>
</div>
</a-card>
</a-modal>
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
</template>
@ -90,11 +100,12 @@ import { config } from '@/config'
import dayjs from 'dayjs'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import { PlusOutlined, EditOutlined, DeleteOutlined,QrcodeOutlined } from '@ant-design/icons-vue'
import { PlusOutlined, EditOutlined, DeleteOutlined, QrcodeOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import qrlogo from '@/assets/qrlogo.png'
import { customersEnum, areaEnum } from "@/enums/useEnum"
const content = ref('')
const modalType=ref(1)
const qrValue = ref('')
const qropen = ref(false)
defineOptions({
@ -103,12 +114,12 @@ defineOptions({
const { t } = useI18n() // t
const columns = [
{ title: '所属区域', dataIndex: 'areaId', width: 90, align: 'center' },
{ title: '封面', dataIndex: 'cover', width: 120,align:'center'},
{ title: '房刊标题', dataIndex: 'title', width: 120,align:'center', ellipsis: true},
{ title: '封面', dataIndex: 'cover', width: 120, align: 'center' },
{ title: '房刊标题', dataIndex: 'title', width: 120, align: 'center', ellipsis: true },
{ title: '楼盘名称', dataIndex: 'name', key: 'title', ellipsis: true },
{ title: '发布时间', dataIndex: 'pushAt', key: 'pushAt' },
{ title: '内容', dataIndex: 'content', key: 'title',ellipsis: true },
{ title: '状态', dataIndex: 'status', key: 'introduce', width: 100,align:'center' },
{ title: '内容', dataIndex: 'content', key: 'title', ellipsis: true },
{ title: '状态', dataIndex: 'status', key: 'introduce', width: 100, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 150, align: 'center' },
]
@ -198,17 +209,19 @@ function handleResetSearch() {
getPageList()
}
const createQrcode = (params) => {
const {name,areaId,id}=params
const item={ title:name,
typer:'activity',
pathUrl:'/pages/sceneDetail/index.vue',
const { name, areaId, id } = params
const item = {
title: name,
typer: 'activity',
pathUrl: '/pages/sceneDetail/index.vue',
areaId,
relationId:id,
kvalue1:'',
kvalue2:'',
kvalue3:'',
kvalue4:'',
kvalue5:'',}
relationId: id,
kvalue1: '',
kvalue2: '',
kvalue3: '',
kvalue4: '',
kvalue5: '',
}
qrValue.value = JSON.stringify(item)
console.log(qrValue.value)
qropen.value = true