diff --git a/src/components/common/Header.vue b/src/components/common/Header.vue index f4c12db..51dbba1 100644 --- a/src/components/common/Header.vue +++ b/src/components/common/Header.vue @@ -8,6 +8,7 @@ :key="btn.key || index" :type="btn.type || 'default'" :icon="btn.icon" + v-auth="btn.auth" @click="handleButtonClick(btn)" :disabled="btn.disabled" > @@ -28,6 +29,7 @@ interface HeaderButton { icon?: Component disabled?: boolean key?: string | number // 可选的唯一标识 + auth?: string // 权限 } // 定义组件属性接口 diff --git a/src/views/capital/currency/options.ts b/src/views/capital/currency/options.ts index 60f0a98..c0d47ea 100644 --- a/src/views/capital/currency/options.ts +++ b/src/views/capital/currency/options.ts @@ -2,9 +2,9 @@ * @description: 搜索配置 */ export const buttons = [ - { label: '添加', type: 'primary', key: 'add' }, - { label: '编辑', type: 'primary', key: 'edit' }, - { label: '删除', type: 'danger', key: 'delete' }, + { label: '添加', type: 'primary', key: 'add', auth: 'currency_createCurrency' }, + { label: '编辑', type: 'primary', key: 'edit', auth: 'currency_editCurrency' }, + { label: '删除', type: 'danger', key: 'delete', auth: 'currency_delCurrency' }, ] export const tableColumns = [ { prop: 'name', label: '币名' }, diff --git a/src/views/capital/fundFlow/options.ts b/src/views/capital/fundFlow/options.ts index 2e2281c..d75fc45 100644 --- a/src/views/capital/fundFlow/options.ts +++ b/src/views/capital/fundFlow/options.ts @@ -56,6 +56,7 @@ export const tableColumns = [ { prop: 'username', label: '用户名' }, //单号 { prop: 'orderNo', label: '单号' }, + { prop: 'account_id', label: '子账号' }, //操作类型 { prop: 'type', label: '操作类型' }, //资金流向 diff --git a/src/views/capital/rechangeChanl/index.vue b/src/views/capital/rechangeChanl/index.vue index f2237ae..c84b47c 100644 --- a/src/views/capital/rechangeChanl/index.vue +++ b/src/views/capital/rechangeChanl/index.vue @@ -47,6 +47,7 @@ import { editChannel, delChannel, } from '@/api/modules/capital/rechangeChanl.ts' +import { getCurrencyList } from '@/api/modules/capital/currency.ts' import { ElMessageBox } from 'element-plus' type ChannelType = { @@ -60,10 +61,6 @@ type ChannelType = { status: number } -const getTypeText = (type: number | string) => { - return ['', '法币', '数字货币'][type] -} - const getStatusText = (status: number | string) => { return ['', '正常', '禁用'][status] } @@ -73,7 +70,6 @@ const initData = async () => { console.log(res) tableData.value = res.map((item: ChannelType) => ({ ...item, - typeStr: getTypeText(item.type), statusStr: getStatusText(item.status), })) as ChannelType[] clearSelection() @@ -93,6 +89,11 @@ const formData = ref({ api_url: '', api_appid: '', api_key: '', + beneficiary_name: '', + beneficiary_bank_name: '', + swift_bic_code: '', + beneficiary_bank_address: '', + channel_code: '', status: 1, }) const formItems = ref(formItemsData) @@ -124,6 +125,11 @@ const resetFormData = () => { api_appid: '', api_key: '', status: 1, + beneficiary_name: '', + beneficiary_bank_name: '', + swift_bic_code: '', + beneficiary_bank_address: '', + channel_code: '', } } @@ -138,20 +144,12 @@ const handleEdit = () => { dialogVisible.value = true dialogTitleType.value = 2 - formData.value = { - id: currentRow.id, - name: currentRow.name, - channel_fee: currentRow.channel_fee, - type: currentRow.type, - api_url: currentRow.api_url, - api_appid: currentRow.api_appid, - api_key: currentRow.api_key, - status: currentRow.status, - } + formData.value = currentRow } const handleDelete = () => { console.log('handleDisable') + if (!currentRow.id) return ElMessage.warning('请先选择要删除的记录') ElMessageBox.confirm('确认删除吗?', '提示', { type: 'warning', confirmButtonText: '确定', @@ -175,6 +173,13 @@ const clearSelection = () => { onMounted(() => { initData() + getCurrencyList().then((data) => { + console.log(data) + optionsMap.value.type = (data || []).map((item: any) => ({ + value: item.id, + label: item.symbol, + })) + }) })