feat 商户通知类型

This commit is contained in:
DaxPay
2024-08-05 20:15:56 +08:00
parent 2abda94830
commit dcb4fbbb57
5 changed files with 120 additions and 28 deletions

View File

@@ -12,16 +12,6 @@ export const page = (params) => {
})
}
/**
* 详情
*/
export const get = (id) => {
return defHttp.get<Result<ChannelConst>>({
url: '/const/api/findById',
params: { id },
})
}
export interface ChannelConst extends BaseEntity {
/** 编码 */
code?: string

View File

@@ -11,15 +11,6 @@ export const page = (params) => {
params,
})
}
/**
* 详情
*/
export const get = (id) => {
return defHttp.get<Result<ChannelConst>>({
url: '/const/channel/findById',
params: { id },
})
}
export interface ChannelConst extends BaseEntity {
/** 编码 */

View File

@@ -11,15 +11,6 @@ export const page = (params) => {
params,
})
}
/**
* 详情
*/
export const get = (id) => {
return defHttp.get<Result<MethodConst>>({
url: '/const/method/findById',
params: { id },
})
}
export interface MethodConst extends BaseEntity {
/** 编码 */

View File

@@ -0,0 +1,24 @@
import { defHttp } from '@/utils/http/axios'
import { PageResult, Result } from '#/axios'
import { BaseEntity } from '#/web'
/**
* 分页
*/
export const page = (params) => {
return defHttp.get<Result<PageResult<NotifyConst>>>({
url: '/const/merchant/notify/page',
params,
})
}
export interface NotifyConst extends BaseEntity {
/** 编码 */
code?: string
/** 名称 */
name?: string
/** 是否启用 */
enable?: boolean
/** 描述 */
description?: string
}

View File

@@ -0,0 +1,96 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query
:query-params="model.queryParam"
:fields="fields"
@query="queryPage"
@reset="resetQueryParams"
/>
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
<div class="h-65vh">
<vxe-table
height="auto"
row-id="id"
ref="xTable"
:data="pagination.records"
:loading="loading"
>
<vxe-column type="seq" width="60" />
<vxe-column field="code" title="编码" :min-width="80" />
<vxe-column field="name" title="名称" :min-width="120" />
<vxe-column field="remark" title="描述" />
<vxe-column field="enable" title="是否启用" :width="80">
<template #default="{ row }">
<a-tag v-if="row.enable" color="green">启用</a-tag>
<a-tag v-else color="red">停用</a-tag>
</template>
</vxe-column>
</vxe-table>
</div>
<vxe-pager
size="medium"
:loading="loading"
:current-page="pagination.current"
:page-size="pagination.size"
:total="pagination.total"
@page-change="handleTableChange"
/>
</div>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { page } from './NotifyConst.api'
import useTablePage from '@/hooks/bootx/useTablePage'
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { QueryField } from '@/components/Bootx/Query/Query'
// 使用hooks
const {
handleTableChange,
pageQueryResHandel,
resetQueryParams,
pagination,
pages,
model,
loading,
} = useTablePage(queryPage)
// 查询条件
const fields = [
{ field: 'code', type: 'string', name: '编码', placeholder: '请输入编码' },
{ field: 'name', type: 'string', name: '名称', placeholder: '请输入名称' },
] as QueryField[]
const xTable = ref<VxeTableInstance>()
const xToolbar = ref<VxeToolbarInstance>()
onMounted(() => {
vxeBind()
queryPage()
})
function vxeBind() {
xTable.value?.connect(xToolbar.value as VxeToolbarInstance)
}
/**
* 分页查询
*/
function queryPage() {
loading.value = true
page({
...model.queryParam,
...pages,
}).then(({ data }) => {
pageQueryResHandel(data)
})
return Promise.resolve()
}
</script>
<style lang="less" scoped></style>