mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-04 11:26:03 +00:00
feat 钱包日志, 用户和角色选择器新增数据源属性, eslint 规则微调, 恢复sass依赖
This commit is contained in:
@@ -54,6 +54,7 @@ module.exports = {
|
|||||||
'vue/singleline-html-element-content-newline': 'off',
|
'vue/singleline-html-element-content-newline': 'off',
|
||||||
'vue/attribute-hyphenation': 'off',
|
'vue/attribute-hyphenation': 'off',
|
||||||
'vue/require-default-prop': 'off',
|
'vue/require-default-prop': 'off',
|
||||||
|
'vue/no-setup-props-destructure': 'off',
|
||||||
'vue/require-explicit-emits': 'off',
|
'vue/require-explicit-emits': 'off',
|
||||||
'vue/html-self-closing': [
|
'vue/html-self-closing': [
|
||||||
'error',
|
'error',
|
||||||
|
@@ -109,7 +109,7 @@
|
|||||||
"eslint": "^8.13.0",
|
"eslint": "^8.13.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^8.6.0",
|
"eslint-plugin-vue": "^8.7.1",
|
||||||
"esno": "^0.14.1",
|
"esno": "^0.14.1",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
@@ -126,6 +126,7 @@
|
|||||||
"rollup": "^2.70.2",
|
"rollup": "^2.70.2",
|
||||||
"rollup-plugin-visualizer": "^5.6.0",
|
"rollup-plugin-visualizer": "^5.6.0",
|
||||||
"stylelint": "^14.7.1",
|
"stylelint": "^14.7.1",
|
||||||
|
"sass": "^1.56.1",
|
||||||
"stylelint-config-prettier": "^9.0.3",
|
"stylelint-config-prettier": "^9.0.3",
|
||||||
"stylelint-config-recommended": "^7.0.0",
|
"stylelint-config-recommended": "^7.0.0",
|
||||||
"stylelint-config-recommended-vue": "^1.4.0",
|
"stylelint-config-recommended-vue": "^1.4.0",
|
||||||
|
@@ -60,23 +60,23 @@
|
|||||||
|
|
||||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||||
|
|
||||||
const props = withDefaults(
|
const {
|
||||||
defineProps<{
|
title = '选择角色',
|
||||||
// 名称
|
multiple = false,
|
||||||
title: string
|
width = 640,
|
||||||
// 是否是查询看状态
|
dataSource = page,
|
||||||
multiple: boolean
|
} = defineProps<{
|
||||||
// 宽度
|
// 名称
|
||||||
width?: number | string
|
title: string
|
||||||
}>(),
|
// 是否是查询看状态
|
||||||
{
|
multiple: boolean
|
||||||
title: '选择角色',
|
// 宽度
|
||||||
multiple: false,
|
width?: number | string
|
||||||
width: 640,
|
// 数据源
|
||||||
},
|
dataSource?: Function
|
||||||
)
|
}>()
|
||||||
const emits = defineEmits(['ok'])
|
|
||||||
|
|
||||||
|
const emits = defineEmits(['ok'])
|
||||||
let visible = $ref(false)
|
let visible = $ref(false)
|
||||||
let selectRoleIds = $ref<string[]>([])
|
let selectRoleIds = $ref<string[]>([])
|
||||||
let selectRoleId = $ref<string>()
|
let selectRoleId = $ref<string>()
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
{ field: 'code', type: STRING, name: '编号', placeholder: '请输入角色编号' },
|
{ field: 'code', type: STRING, name: '编号', placeholder: '请输入角色编号' },
|
||||||
]
|
]
|
||||||
const checkboxConfig = computed(() => {
|
const checkboxConfig = computed(() => {
|
||||||
return props.multiple
|
return multiple
|
||||||
? {
|
? {
|
||||||
reserve: true,
|
reserve: true,
|
||||||
checkMethod: banCheckbox,
|
checkMethod: banCheckbox,
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
: {}
|
: {}
|
||||||
})
|
})
|
||||||
const radioConfig = computed(() => {
|
const radioConfig = computed(() => {
|
||||||
return !props.multiple
|
return !multiple
|
||||||
? {
|
? {
|
||||||
reserve: true,
|
reserve: true,
|
||||||
checkRowKey: selectRoleId,
|
checkRowKey: selectRoleId,
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
*/
|
*/
|
||||||
function init(param) {
|
function init(param) {
|
||||||
visible = true
|
visible = true
|
||||||
if (props.multiple) {
|
if (multiple) {
|
||||||
selectRoleIds = param || selectRoleId
|
selectRoleIds = param || selectRoleId
|
||||||
} else {
|
} else {
|
||||||
selectRoleId = param || selectRoleId
|
selectRoleId = param || selectRoleId
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
*/
|
*/
|
||||||
function queryPage() {
|
function queryPage() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
page({
|
dataSource({
|
||||||
...model.queryParam,
|
...model.queryParam,
|
||||||
...pages,
|
...pages,
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
* 选中确定回调
|
* 选中确定回调
|
||||||
*/
|
*/
|
||||||
function handleOk() {
|
function handleOk() {
|
||||||
if (props.multiple) {
|
if (multiple) {
|
||||||
checkboxCallback()
|
checkboxCallback()
|
||||||
} else {
|
} else {
|
||||||
radioCallback()
|
radioCallback()
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
* 禁止选中的行 复选
|
* 禁止选中的行 复选
|
||||||
*/
|
*/
|
||||||
function banCheckbox({ row }) {
|
function banCheckbox({ row }) {
|
||||||
return !selectUserIds.includes(row.id)
|
return !selectRoleIds.includes(row.id)
|
||||||
}
|
}
|
||||||
defineExpose({ init })
|
defineExpose({ init })
|
||||||
</script>
|
</script>
|
||||||
|
@@ -70,11 +70,14 @@
|
|||||||
multiple: boolean
|
multiple: boolean
|
||||||
// 宽度
|
// 宽度
|
||||||
width?: number | string
|
width?: number | string
|
||||||
|
// 数据源
|
||||||
|
dataSource?: Function
|
||||||
}
|
}
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
title: '选择用户',
|
title: '选择用户',
|
||||||
multiple: false,
|
multiple: false,
|
||||||
width: 640,
|
width: 640,
|
||||||
|
dataSource: page,
|
||||||
})
|
})
|
||||||
const emits = defineEmits(['ok'])
|
const emits = defineEmits(['ok'])
|
||||||
|
|
||||||
@@ -125,12 +128,14 @@
|
|||||||
*/
|
*/
|
||||||
function queryPage() {
|
function queryPage() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
page({
|
props
|
||||||
...model.queryParam,
|
.dataSource({
|
||||||
...pages,
|
...model.queryParam,
|
||||||
}).then(({ data }) => {
|
...pages,
|
||||||
pageQueryResHandel(data)
|
})
|
||||||
})
|
.then(({ data }) => {
|
||||||
|
pageQueryResHandel(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 选中确定回调
|
* 选中确定回调
|
||||||
|
@@ -99,7 +99,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, nextTick, reactive } from 'vue'
|
import { computed, nextTick } from 'vue'
|
||||||
import { $ref } from 'vue/macros'
|
import { $ref } from 'vue/macros'
|
||||||
import useFormEdit from '/@/hooks/bootx/useFormEdit'
|
import useFormEdit from '/@/hooks/bootx/useFormEdit'
|
||||||
import { add, get, update, BpmModelNode } from './ModelNode.api'
|
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"
|
@page-change="handleTableChange"
|
||||||
/>
|
/>
|
||||||
<wallet-info ref="walletInfo" />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { $ref } from 'vue/macros'
|
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 useTablePage from '/@/hooks/bootx/useTablePage'
|
||||||
import WalletInfo from './WalletInfo.vue'
|
import WalletInfo from './WalletInfo.vue'
|
||||||
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
|
import { VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
|
||||||
@@ -73,8 +74,8 @@
|
|||||||
import { useMessage } from '/@/hooks/web/useMessage'
|
import { useMessage } from '/@/hooks/web/useMessage'
|
||||||
import { QueryField, STRING } from '/@/components/Bootx/Query/Query'
|
import { QueryField, STRING } from '/@/components/Bootx/Query/Query'
|
||||||
import { useDict } from '/@/hooks/bootx/useDict'
|
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
|
// 使用hooks
|
||||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||||
const { notification, createMessage, createConfirm } = useMessage()
|
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
|
// 使用hooks
|
||||||
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, pages, model, loading } = useTablePage(queryPage)
|
||||||
const { notification, createWarningModal, createMessage } = useMessage()
|
const { notification, createMessage } = useMessage()
|
||||||
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
const fields = [] as QueryField[]
|
const fields = [] as QueryField[]
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
page({
|
page({
|
||||||
...model.queryParam,
|
...model.queryParam,
|
||||||
...pages,
|
...pages,
|
||||||
dictId: dictInfo.id,
|
dictId: dictInfo?.id,
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
pageQueryResHandel(data)
|
pageQueryResHandel(data)
|
||||||
})
|
})
|
||||||
|
10
yarn.lock
10
yarn.lock
@@ -4451,7 +4451,7 @@ eslint-plugin-prettier@^4.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
prettier-linter-helpers "^1.0.0"
|
prettier-linter-helpers "^1.0.0"
|
||||||
|
|
||||||
eslint-plugin-vue@^8.6.0:
|
eslint-plugin-vue@^8.7.1:
|
||||||
version "8.7.1"
|
version "8.7.1"
|
||||||
resolved "https://registry.npmmirror.com/eslint-plugin-vue/-/eslint-plugin-vue-8.7.1.tgz#f13c53547a0c9d64588a675cc5ecc6ccaf63703f"
|
resolved "https://registry.npmmirror.com/eslint-plugin-vue/-/eslint-plugin-vue-8.7.1.tgz#f13c53547a0c9d64588a675cc5ecc6ccaf63703f"
|
||||||
integrity sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==
|
integrity sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==
|
||||||
@@ -8294,10 +8294,10 @@ safe-regex@^1.1.0:
|
|||||||
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||||
|
|
||||||
sass@^1.55.0:
|
sass@^1.56.1:
|
||||||
version "1.55.0"
|
version "1.56.1"
|
||||||
resolved "https://registry.npmmirror.com/sass/-/sass-1.55.0.tgz#0c4d3c293cfe8f8a2e8d3b666e1cf1bff8065d1c"
|
resolved "https://registry.npmmirror.com/sass/-/sass-1.56.1.tgz#94d3910cd468fd075fa87f5bb17437a0b617d8a7"
|
||||||
integrity sha512-Pk+PMy7OGLs9WaxZGJMn7S96dvlyVBwwtToX895WmCpAOr5YiJYEUJfiJidMuKb613z2xNWcXCHEuOvjZbqC6A==
|
integrity sha512-VpEyKpyBPCxE7qGDtOcdJ6fFbcpOM+Emu7uZLxVrkX8KVU/Dp5UF7WLvzqRuUhB6mqqQt1xffLoG+AndxTZrCQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
chokidar ">=3.0.0 <4.0.0"
|
chokidar ">=3.0.0 <4.0.0"
|
||||||
immutable "^4.0.0"
|
immutable "^4.0.0"
|
||||||
|
Reference in New Issue
Block a user