mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-08 13:18:02 +00:00
feat 钱包日志, 用户和角色选择器新增数据源属性, eslint 规则微调, 恢复sass依赖
This commit is contained in:
@@ -60,23 +60,23 @@
|
||||
|
||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 名称
|
||||
title: string
|
||||
// 是否是查询看状态
|
||||
multiple: boolean
|
||||
// 宽度
|
||||
width?: number | string
|
||||
}>(),
|
||||
{
|
||||
title: '选择角色',
|
||||
multiple: false,
|
||||
width: 640,
|
||||
},
|
||||
)
|
||||
const emits = defineEmits(['ok'])
|
||||
const {
|
||||
title = '选择角色',
|
||||
multiple = false,
|
||||
width = 640,
|
||||
dataSource = page,
|
||||
} = defineProps<{
|
||||
// 名称
|
||||
title: string
|
||||
// 是否是查询看状态
|
||||
multiple: boolean
|
||||
// 宽度
|
||||
width?: number | string
|
||||
// 数据源
|
||||
dataSource?: Function
|
||||
}>()
|
||||
|
||||
const emits = defineEmits(['ok'])
|
||||
let visible = $ref(false)
|
||||
let selectRoleIds = $ref<string[]>([])
|
||||
let selectRoleId = $ref<string>()
|
||||
@@ -86,7 +86,7 @@
|
||||
{ field: 'code', type: STRING, name: '编号', placeholder: '请输入角色编号' },
|
||||
]
|
||||
const checkboxConfig = computed(() => {
|
||||
return props.multiple
|
||||
return multiple
|
||||
? {
|
||||
reserve: true,
|
||||
checkMethod: banCheckbox,
|
||||
@@ -94,7 +94,7 @@
|
||||
: {}
|
||||
})
|
||||
const radioConfig = computed(() => {
|
||||
return !props.multiple
|
||||
return !multiple
|
||||
? {
|
||||
reserve: true,
|
||||
checkRowKey: selectRoleId,
|
||||
@@ -108,7 +108,7 @@
|
||||
*/
|
||||
function init(param) {
|
||||
visible = true
|
||||
if (props.multiple) {
|
||||
if (multiple) {
|
||||
selectRoleIds = param || selectRoleId
|
||||
} else {
|
||||
selectRoleId = param || selectRoleId
|
||||
@@ -121,7 +121,7 @@
|
||||
*/
|
||||
function queryPage() {
|
||||
loading.value = true
|
||||
page({
|
||||
dataSource({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
}).then(({ data }) => {
|
||||
@@ -132,7 +132,7 @@
|
||||
* 选中确定回调
|
||||
*/
|
||||
function handleOk() {
|
||||
if (props.multiple) {
|
||||
if (multiple) {
|
||||
checkboxCallback()
|
||||
} else {
|
||||
radioCallback()
|
||||
@@ -175,7 +175,7 @@
|
||||
* 禁止选中的行 复选
|
||||
*/
|
||||
function banCheckbox({ row }) {
|
||||
return !selectUserIds.includes(row.id)
|
||||
return !selectRoleIds.includes(row.id)
|
||||
}
|
||||
defineExpose({ init })
|
||||
</script>
|
||||
|
@@ -70,11 +70,14 @@
|
||||
multiple: boolean
|
||||
// 宽度
|
||||
width?: number | string
|
||||
// 数据源
|
||||
dataSource?: Function
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
title: '选择用户',
|
||||
multiple: false,
|
||||
width: 640,
|
||||
dataSource: page,
|
||||
})
|
||||
const emits = defineEmits(['ok'])
|
||||
|
||||
@@ -125,12 +128,14 @@
|
||||
*/
|
||||
function queryPage() {
|
||||
loading.value = true
|
||||
page({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
}).then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
})
|
||||
props
|
||||
.dataSource({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
})
|
||||
.then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 选中确定回调
|
||||
|
@@ -99,7 +99,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, nextTick, reactive } from 'vue'
|
||||
import { computed, nextTick } from 'vue'
|
||||
import { $ref } from 'vue/macros'
|
||||
import useFormEdit from '/@/hooks/bootx/useFormEdit'
|
||||
import { add, get, update, BpmModelNode } from './ModelNode.api'
|
||||
|
@@ -12,6 +12,16 @@ export function page(params) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页(未开通钱包的用户)
|
||||
*/
|
||||
export function pageByNotWallet(params) {
|
||||
return defHttp.get<Result<PageResult<Wallet>>>({
|
||||
url: '/wallet/pageByNotWallet',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*/
|
||||
|
@@ -57,7 +57,8 @@
|
||||
@page-change="handleTableChange"
|
||||
/>
|
||||
<wallet-info ref="walletInfo" />
|
||||
<b-user-select-modal ref="userSelectModal" multiple @ok="createBatchWallet" />
|
||||
<wallet-log-list ref="walletLogList" />
|
||||
<b-user-select-modal ref="userSelectModal" multiple :data-source="pageByNotWallet" @ok="createBatchWallet" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -65,7 +66,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted } from 'vue'
|
||||
import { $ref } from 'vue/macros'
|
||||
import { createWalletBatch, del, lock, page, unlock } from './Wallet.api'
|
||||
import { createWalletBatch, del, lock, page, pageByNotWallet, unlock } from './Wallet.api'
|
||||
import useTablePage from '/@/hooks/bootx/useTablePage'
|
||||
import WalletInfo from './WalletInfo.vue'
|
||||
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
|
||||
@@ -73,8 +74,8 @@
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
import { QueryField, STRING } from '/@/components/Bootx/Query/Query'
|
||||
import { useDict } from '/@/hooks/bootx/useDict'
|
||||
import BUserSelectModal from "/@/components/Bootx/UserSelectModal/BUserSelectModal.vue";
|
||||
|
||||
import BUserSelectModal from '/@/components/Bootx/UserSelectModal/BUserSelectModal.vue'
|
||||
import WalletLogList from "/@/views/modules/payment/wallet/list/WalletLogList.vue";
|
||||
// 使用hooks
|
||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||
const { notification, createMessage, createConfirm } = useMessage()
|
||||
|
47
src/views/modules/payment/wallet/list/WalletLog.api.ts
Normal file
47
src/views/modules/payment/wallet/list/WalletLog.api.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { defHttp } from '/@/utils/http/axios'
|
||||
import { PageResult, Result } from '/#/axios'
|
||||
import { BaseEntity } from '/#/web'
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
export function pageByWalletId(params) {
|
||||
return defHttp.get<Result<PageResult<WalletLog>>>({
|
||||
url: '/wallet/log/pageByWalletId',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条
|
||||
*/
|
||||
export function get(id) {
|
||||
return defHttp.get<Result<WalletLog>>({
|
||||
url: '/wallet/log/findById',
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包日志
|
||||
*/
|
||||
export interface WalletLog extends BaseEntity {
|
||||
// 钱包id
|
||||
walletId?: string
|
||||
// 用户id
|
||||
userId?: string
|
||||
// 类型
|
||||
type?: number
|
||||
// 交易记录ID
|
||||
paymentId?: string
|
||||
// 操作终端ip
|
||||
clientIp?: string
|
||||
// 备注
|
||||
remark?: string
|
||||
// 业务ID
|
||||
businessId?: string
|
||||
// 操作源
|
||||
operationSource?: number
|
||||
// 金额
|
||||
amount?: number
|
||||
}
|
76
src/views/modules/payment/wallet/list/WalletLogList.vue
Normal file
76
src/views/modules/payment/wallet/list/WalletLogList.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<basic-drawer forceRender showFooter v-bind="$attrs" title="钱包日志列表" width="60%" :visible="visible" @close="visible = false">
|
||||
<vxe-toolbar ref="xToolbar" custom :refresh="{ query: queryPage }" />
|
||||
<vxe-table row-id="id" ref="xTable" :data="pagination.records" :loading="loading">
|
||||
<vxe-column type="seq" title="序号" width="60" />
|
||||
<vxe-column field="type" title="类型">
|
||||
<template #default="{ row }">
|
||||
{{ dictConvert('WalletLogType', row.type) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="amount" title="金额" />
|
||||
<vxe-column field="operationSource" title="操作类型">
|
||||
<template #default="{ row }">
|
||||
{{ dictConvert('WalletLogOperation', row.operationSource) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="remark" title="备注" />
|
||||
</vxe-table>
|
||||
<vxe-pager
|
||||
size="medium"
|
||||
:loading="loading"
|
||||
:current-page="pagination.current"
|
||||
:page-size="pagination.size"
|
||||
:total="pagination.total"
|
||||
@page-change="handleTableChange"
|
||||
/>
|
||||
</basic-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue'
|
||||
import useTablePage from '/@/hooks/bootx/useTablePage'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
import { QueryField } from '/@/components/Bootx/Query/Query'
|
||||
import { $ref } from 'vue/macros'
|
||||
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
|
||||
import { nextTick } from 'vue'
|
||||
import { pageByWalletId } from '/@/views/modules/payment/wallet/list/WalletLog.api'
|
||||
import { useDict } from '/@/hooks/bootx/useDict'
|
||||
|
||||
// 使用hooks
|
||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||
const { notification, createMessage } = useMessage()
|
||||
const { dictConvert } = useDict()
|
||||
|
||||
// 查询条件
|
||||
const fields = [] as QueryField[]
|
||||
let visible = $ref(false)
|
||||
let walletId = $ref<string>()
|
||||
|
||||
const xTable = $ref<VxeTableInstance>()
|
||||
const xToolbar = $ref<VxeToolbarInstance>()
|
||||
|
||||
nextTick(() => {
|
||||
xTable?.connect(xToolbar as VxeToolbarInstance)
|
||||
})
|
||||
|
||||
function init(id) {
|
||||
visible = true
|
||||
walletId = id
|
||||
queryPage()
|
||||
}
|
||||
// 分页查询
|
||||
function queryPage() {
|
||||
pageByWalletId({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
walletId,
|
||||
}).then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
})
|
||||
}
|
||||
defineExpose({ init })
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@@ -57,7 +57,7 @@
|
||||
|
||||
// 使用hooks
|
||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||
const { notification, createWarningModal, createMessage } = useMessage()
|
||||
const { notification, createMessage } = useMessage()
|
||||
|
||||
// 查询条件
|
||||
const fields = [] as QueryField[]
|
||||
@@ -84,7 +84,7 @@
|
||||
page({
|
||||
...model.queryParam,
|
||||
...pages,
|
||||
dictId: dictInfo.id,
|
||||
dictId: dictInfo?.id,
|
||||
}).then(({ data }) => {
|
||||
pageQueryResHandel(data)
|
||||
})
|
||||
|
Reference in New Issue
Block a user