BUG修复,及部分页面增加按钮权限
This commit is contained in:
parent
adcbbb6752
commit
2f54ebef78
|
|
@ -416,6 +416,7 @@ const handleSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
await editCustomerApi({ ...params, point_diffs_json: JSON.stringify(marginRatioJSON) })
|
await editCustomerApi({ ...params, point_diffs_json: JSON.stringify(marginRatioJSON) })
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
await getCustomerList(userId.value)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('提交失败:', err)
|
console.log('提交失败:', err)
|
||||||
}
|
}
|
||||||
|
|
@ -428,6 +429,7 @@ const handleSubmit = async () => {
|
||||||
fee_handling_percent: commissionRatioForm.value.commissionRatio,
|
fee_handling_percent: commissionRatioForm.value.commissionRatio,
|
||||||
})
|
})
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
await getCustomerList(userId.value)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('提交失败:', err)
|
console.log('提交失败:', err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="deposit-channel">
|
<div class="deposit-channel">
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
<el-button type="primary" @click="handleAdd">添加</el-button>
|
<el-button type="primary" @click="handleAdd" v-auth="'channel_createChannel'">添加</el-button>
|
||||||
<el-button type="primary" @click="handleEdit">编辑</el-button>
|
<el-button type="primary" @click="handleEdit" v-auth="'channel_editChannel'">编辑</el-button>
|
||||||
<el-button type="danger" @click="handleDelete">删除</el-button>
|
<el-button type="danger" @click="handleDelete" v-auth="'channel_delChannel'">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
<DepositChannelTable
|
<DepositChannelTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,12 @@
|
||||||
>
|
>
|
||||||
<template #button>
|
<template #button>
|
||||||
<!-- 审核动作先保留按钮交互,后续可直接接接口 -->
|
<!-- 审核动作先保留按钮交互,后续可直接接接口 -->
|
||||||
<el-button type="danger" plain @click="handleReject">驳回</el-button>
|
<el-button type="danger" plain @click="handleReject" v-auth="'user_reviewRechargeOrder'"
|
||||||
<el-button type="success" @click="handleApprove">通过</el-button>
|
>驳回</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" @click="handleApprove" v-auth="'user_reviewRechargeOrder'"
|
||||||
|
>通过</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" plain @click="handleExport">导出</el-button>
|
<el-button type="primary" plain @click="handleExport">导出</el-button>
|
||||||
</template>
|
</template>
|
||||||
</RechangeSearch>
|
</RechangeSearch>
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,32 @@
|
||||||
<div class="transfer">
|
<div class="transfer">
|
||||||
<div class="title">转账</div>
|
<div class="title">转账</div>
|
||||||
<el-card class="transfer-card">
|
<el-card class="transfer-card">
|
||||||
<div class="transfer-item">1.佣金钱包转出时,需要管理员审核通过后才能转账成功。其余内部转账操作无需通过管理员审核,如发现对应账号没有收到转账资金,请于客服人员联系。</div>
|
<div class="transfer-item">
|
||||||
<div class="transfer-item">2.如转出账号与转入账号的货币单位不同,系统将按照当日汇率进行换算</div>
|
1.佣金钱包转出时,需要管理员审核通过后才能转账成功。其余内部转账操作无需通过管理员审核,如发现对应账号没有收到转账资金,请于客服人员联系。
|
||||||
<div class="transfer-item">3.若有在途订单时进行了MT账号的转出操作,因浮动盈亏影响,可能会导致转出失败</div>
|
</div>
|
||||||
<div class="transfer-item">4.第三方转账只支持钱包之间转账,且会转到对方主钱包(佣金钱包不允许转入),需要管理员审核通过后才能转账成功</div>
|
<div class="transfer-item">
|
||||||
|
2.如转出账号与转入账号的货币单位不同,系统将按照当日汇率进行换算
|
||||||
|
</div>
|
||||||
|
<div class="transfer-item">
|
||||||
|
3.若有在途订单时进行了MT账号的转出操作,因浮动盈亏影响,可能会导致转出失败
|
||||||
|
</div>
|
||||||
|
<div class="transfer-item">
|
||||||
|
4.第三方转账只支持钱包之间转账,且会转到对方主钱包(佣金钱包不允许转入),需要管理员审核通过后才能转账成功
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="transfer-type">
|
<div class="transfer-type">
|
||||||
<div class="type-title">转账类型</div>
|
<div class="type-title">转账类型</div>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<el-button :type="transferType === 'internal' ? 'primary' : 'default'"
|
<el-button
|
||||||
@click="handleTransferTabClick('internal')">内部转账</el-button>
|
:type="transferType === 'internal' ? 'primary' : 'default'"
|
||||||
<el-button :type="transferType === 'external' ? 'primary' : 'default'"
|
@click="handleTransferTabClick('internal')"
|
||||||
@click="handleTransferTabClick('external')">第三方转账</el-button>
|
>内部转账</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
:type="transferType === 'external' ? 'primary' : 'default'"
|
||||||
|
@click="handleTransferTabClick('external')"
|
||||||
|
>第三方转账</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="transfer-form">
|
<div class="transfer-form">
|
||||||
|
|
@ -21,22 +35,36 @@
|
||||||
<div class="externa-title">转出账号: 主钱包</div>
|
<div class="externa-title">转出账号: 主钱包</div>
|
||||||
<el-card class="external-card">
|
<el-card class="external-card">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<svg t="1774503695687" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="2732" width="200" height="200">
|
t="1774503695687"
|
||||||
|
class="icon"
|
||||||
|
viewBox="0 0 1024 1024"
|
||||||
|
version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
p-id="2732"
|
||||||
|
width="200"
|
||||||
|
height="200"
|
||||||
|
>
|
||||||
<path
|
<path
|
||||||
d="M512.54 156.23a353.21 353.21 0 1 1-138 27.83 352.25 352.25 0 0 1 138-27.83m0-60C283.61 96.23 98 281.81 98 510.74s185.61 414.51 414.54 414.51 414.51-185.58 414.51-414.51S741.47 96.23 512.54 96.23z"
|
d="M512.54 156.23a353.21 353.21 0 1 1-138 27.83 352.25 352.25 0 0 1 138-27.83m0-60C283.61 96.23 98 281.81 98 510.74s185.61 414.51 414.54 414.51 414.51-185.58 414.51-414.51S741.47 96.23 512.54 96.23z"
|
||||||
p-id="2733"></path>
|
p-id="2733"
|
||||||
|
></path>
|
||||||
<path
|
<path
|
||||||
d="M512 478a29.89 29.89 0 0 1-21.13-8.71l-133-132a30 30 0 1 1 42.26-42.58l133 132A30 30 0 0 1 512 478z"
|
d="M512 478a29.89 29.89 0 0 1-21.13-8.71l-133-132a30 30 0 1 1 42.26-42.58l133 132A30 30 0 0 1 512 478z"
|
||||||
p-id="2734"></path>
|
p-id="2734"
|
||||||
|
></path>
|
||||||
<path
|
<path
|
||||||
d="M512 478a30 30 0 0 1-21.21-51.21l128-128a30 30 0 0 1 42.42 42.42l-128 128A29.88 29.88 0 0 1 512 478z"
|
d="M512 478a30 30 0 0 1-21.21-51.21l128-128a30 30 0 0 1 42.42 42.42l-128 128A29.88 29.88 0 0 1 512 478z"
|
||||||
p-id="2735"></path>
|
p-id="2735"
|
||||||
|
></path>
|
||||||
<path
|
<path
|
||||||
d="M660 529H366a30 30 0 0 1 0-60h294a30 30 0 0 1 0 60z m0 95H366a30 30 0 0 1 0-60h294a30 30 0 0 1 0 60z"
|
d="M660 529H366a30 30 0 0 1 0-60h294a30 30 0 0 1 0 60z m0 95H366a30 30 0 0 1 0-60h294a30 30 0 0 1 0 60z"
|
||||||
p-id="2736"></path>
|
p-id="2736"
|
||||||
<path d="M512 776a30 30 0 0 1-30-30V448a30 30 0 0 1 60 0v298a30 30 0 0 1-30 30z"
|
></path>
|
||||||
p-id="2737"></path>
|
<path
|
||||||
|
d="M512 776a30 30 0 0 1-30-30V448a30 30 0 0 1 60 0v298a30 30 0 0 1-30 30z"
|
||||||
|
p-id="2737"
|
||||||
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<div class="money">
|
<div class="money">
|
||||||
|
|
@ -45,32 +73,52 @@
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<TransferForm :key="transferType" class="transfer-main-form" :form-data="transferForm" :form-rules="transferFormRules"
|
<TransferForm
|
||||||
:form-items="transferFormItemOptions" :options-map="transferFormOptionsMap" ref="mainTransferFormRef">
|
:key="transferType"
|
||||||
|
class="transfer-main-form"
|
||||||
|
:form-data="transferForm"
|
||||||
|
:form-rules="transferFormRules"
|
||||||
|
:form-items="transferFormItemOptions"
|
||||||
|
:options-map="transferFormOptionsMap"
|
||||||
|
ref="mainTransferFormRef"
|
||||||
|
>
|
||||||
</TransferForm>
|
</TransferForm>
|
||||||
<div class="transfer-type verify" v-if="transferType === 'external'">
|
<div class="transfer-type verify" v-if="transferType === 'external'">
|
||||||
<div class="type-title">验证方式</div>
|
<div class="type-title">验证方式</div>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<el-button :type="verifyType === 'email' ? 'primary' : 'default'"
|
<el-button
|
||||||
@click="handleVerifyTabClick('email')">邮箱验证</el-button>
|
:type="verifyType === 'email' ? 'primary' : 'default'"
|
||||||
<el-button :type="verifyType === 'phone' ? 'primary' : 'default'"
|
@click="handleVerifyTabClick('email')"
|
||||||
@click="handleVerifyTabClick('phone')">手机号验证</el-button>
|
>邮箱验证</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
:type="verifyType === 'phone' ? 'primary' : 'default'"
|
||||||
|
@click="handleVerifyTabClick('phone')"
|
||||||
|
>手机号验证</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="username">{{ verifyType === "email" ? userInfo.email : userInfo.phone }}</div>
|
<div class="username">{{ verifyType === 'email' ? userInfo.email : userInfo.phone }}</div>
|
||||||
<el-form class="verify-form" :model="transferForm" :rules="transferFormRules" ref="verifyFormRef">
|
<el-form
|
||||||
|
class="verify-form"
|
||||||
|
:model="transferForm"
|
||||||
|
:rules="transferFormRules"
|
||||||
|
ref="verifyFormRef"
|
||||||
|
>
|
||||||
<el-form-item prop="code">
|
<el-form-item prop="code">
|
||||||
<el-input v-model="transferForm.code" style="max-width: 300px" placeholder="请输入验证码">
|
<el-input
|
||||||
|
v-model="transferForm.code"
|
||||||
|
style="max-width: 300px"
|
||||||
|
placeholder="请输入验证码"
|
||||||
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button type="primary" @click="handleSendCode" :disabled="sendState.isCounting">{{
|
<el-button type="primary" @click="handleSendCode" :disabled="sendState.isCounting">{{
|
||||||
sendState.isCounting ? `${sendState.countdown}s后重新获取` : '发送验证码' }}</el-button>
|
sendState.isCounting ? `${sendState.countdown}s后重新获取` : '发送验证码'
|
||||||
|
}}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" @click="handleSubmit">提交转账</el-button>
|
<el-button type="primary" @click="handleSubmit" v-auth="'user_transfer'">提交转账</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
@ -87,7 +135,6 @@ import { getTransferWalletOptionsApi, transferApi } from '@/api/modules/funding/
|
||||||
//方法
|
//方法
|
||||||
import { getStorage } from '@/utils/storage'
|
import { getStorage } from '@/utils/storage'
|
||||||
|
|
||||||
|
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
import { sendCaptcha, initCaptchaState, clearCaptchaTimer } from '@/utils/sendCaptcha'
|
import { sendCaptcha, initCaptchaState, clearCaptchaTimer } from '@/utils/sendCaptcha'
|
||||||
|
|
@ -108,7 +155,7 @@ const createDefaultTransferForm = () => ({
|
||||||
// 最大可转账金额
|
// 最大可转账金额
|
||||||
MaxOutAmount: '',
|
MaxOutAmount: '',
|
||||||
type: '',
|
type: '',
|
||||||
code: ''
|
code: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -120,7 +167,25 @@ const transferForm = ref(createDefaultTransferForm())
|
||||||
*/
|
*/
|
||||||
const mainTransferFormRef = ref()
|
const mainTransferFormRef = ref()
|
||||||
const verifyFormRef = ref()
|
const verifyFormRef = ref()
|
||||||
const transferFormItemOptions = computed(() => transferType.value === 'internal' ? internalFormItem : externalFormItem)
|
const transferFormItemOptions = computed(() =>
|
||||||
|
transferType.value === 'internal' ? internalFormItem : externalFormItem,
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => transferForm.value.transferOutAccount,
|
||||||
|
(val) => {
|
||||||
|
console.log(
|
||||||
|
'transferForm.value.transferOutAccount',
|
||||||
|
val,
|
||||||
|
transferFormOptionsMap.value.transferOutAccount,
|
||||||
|
)
|
||||||
|
transferForm.value.transferInAccount = null
|
||||||
|
transferFormOptionsMap.value.transferInAccount =
|
||||||
|
transferFormOptionsMap.value.transferOutAccount.filter((item: any) => item.value !== val)
|
||||||
|
},
|
||||||
|
{ inmediate: true, deep: true },
|
||||||
|
)
|
||||||
|
|
||||||
const transferFormRules = ref(rules(transferForm.value))
|
const transferFormRules = ref(rules(transferForm.value))
|
||||||
const transferFormOptionsMap = ref({
|
const transferFormOptionsMap = ref({
|
||||||
transferOutAccount: [],
|
transferOutAccount: [],
|
||||||
|
|
@ -141,8 +206,8 @@ const sendState = ref<any>({
|
||||||
})
|
})
|
||||||
|
|
||||||
//初始化验证码倒计时状态
|
//初始化验证码倒计时状态
|
||||||
const emailCaptchaState = initCaptchaState('email'); // 邮箱专属
|
const emailCaptchaState = initCaptchaState('email') // 邮箱专属
|
||||||
const phoneCaptchaState = initCaptchaState('phone'); // 手机专属
|
const phoneCaptchaState = initCaptchaState('phone') // 手机专属
|
||||||
|
|
||||||
// 邮箱验证码状态
|
// 邮箱验证码状态
|
||||||
const { isCounting: emailIsCounting, countdown: emailCountdown } = emailCaptchaState
|
const { isCounting: emailIsCounting, countdown: emailCountdown } = emailCaptchaState
|
||||||
|
|
@ -150,18 +215,17 @@ const { isCounting: emailIsCounting, countdown: emailCountdown } = emailCaptchaS
|
||||||
// 手机验证码状态
|
// 手机验证码状态
|
||||||
const { isCounting: phoneIsCounting, countdown: phoneCountdown } = phoneCaptchaState
|
const { isCounting: phoneIsCounting, countdown: phoneCountdown } = phoneCaptchaState
|
||||||
|
|
||||||
|
|
||||||
// 统一更新sendState的方法
|
// 统一更新sendState的方法
|
||||||
const updateSendState = (type: string) => {
|
const updateSendState = (type: string) => {
|
||||||
if (type === 'email') {
|
if (type === 'email') {
|
||||||
sendState.value = {
|
sendState.value = {
|
||||||
isCounting: emailIsCounting,
|
isCounting: emailIsCounting,
|
||||||
countdown: emailCountdown
|
countdown: emailCountdown,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendState.value = {
|
sendState.value = {
|
||||||
isCounting: phoneIsCounting,
|
isCounting: phoneIsCounting,
|
||||||
countdown: phoneCountdown
|
countdown: phoneCountdown,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -178,8 +242,8 @@ onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
verifyType,
|
verifyType,
|
||||||
(newTab, oldTab) => {
|
(newTab, oldTab) => {
|
||||||
verifyType.value = newTab;
|
verifyType.value = newTab
|
||||||
console.log('verifyType.value', verifyType.value);
|
console.log('verifyType.value', verifyType.value)
|
||||||
// 只有“主动切换tab”(oldTab有值)时才处理,初始化时(oldTab为undefined)不触发
|
// 只有“主动切换tab”(oldTab有值)时才处理,初始化时(oldTab为undefined)不触发
|
||||||
if (oldTab === undefined) return
|
if (oldTab === undefined) return
|
||||||
|
|
||||||
|
|
@ -192,7 +256,7 @@ watch(
|
||||||
updateSendState(currentType)
|
updateSendState(currentType)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: false } // 关键:关闭立即执行,避免刷新时触发
|
{ immediate: false }, // 关键:关闭立即执行,避免刷新时触发
|
||||||
)
|
)
|
||||||
|
|
||||||
// 定义发送验证码接口
|
// 定义发送验证码接口
|
||||||
|
|
@ -202,73 +266,62 @@ const sendCodeApi = async () => {
|
||||||
email: userInfo.email,
|
email: userInfo.email,
|
||||||
mobile: userInfo.mobile,
|
mobile: userInfo.mobile,
|
||||||
reg_type: verifyType.value === 'email' ? 1 : 2,
|
reg_type: verifyType.value === 'email' ? 1 : 2,
|
||||||
type: 'resetPass_code'
|
type: 'resetPass_code',
|
||||||
}
|
}
|
||||||
return userStore.sendCode(sendParams)
|
return userStore.sendCode(sendParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
//发送验证码
|
//发送验证码
|
||||||
const handleSendCode = async () => {
|
const handleSendCode = async () => {
|
||||||
const currentType = verifyType.value;
|
const currentType = verifyType.value
|
||||||
// 确定类型:手机/邮箱
|
// 确定类型:手机/邮箱
|
||||||
const type: string = currentType || 'email';
|
const type: string = currentType || 'email'
|
||||||
|
|
||||||
if (type === 'phone') {
|
if (type === 'phone') {
|
||||||
// 场景1:发送手机验证码
|
// 场景1:发送手机验证码
|
||||||
if (!userInfo.phone) {
|
if (!userInfo.phone) {
|
||||||
ElMessage.error('请先绑定手机号');
|
ElMessage.error('请先绑定手机号')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行发送
|
// 执行发送
|
||||||
await sendCaptcha(
|
await sendCaptcha(type, userInfo.phone, phoneCaptchaState, () => sendCodeApi())
|
||||||
type,
|
updateSendState(type)
|
||||||
userInfo.phone,
|
|
||||||
phoneCaptchaState,
|
|
||||||
() => sendCodeApi()
|
|
||||||
);
|
|
||||||
updateSendState(type);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 场景2:发送邮箱验证码
|
// 场景2:发送邮箱验证码
|
||||||
if (!userInfo.email) {
|
if (!userInfo.email) {
|
||||||
ElMessage.error('请先绑定邮箱');
|
ElMessage.error('请先绑定邮箱')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行发送
|
// 执行发送
|
||||||
await sendCaptcha(
|
await sendCaptcha(type, userInfo.email, emailCaptchaState, () => sendCodeApi())
|
||||||
type,
|
updateSendState(type)
|
||||||
userInfo.email,
|
|
||||||
emailCaptchaState,
|
|
||||||
() => sendCodeApi()
|
|
||||||
);
|
|
||||||
updateSendState(type);
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 组件卸载时清除定时器(关键:防止内存泄漏)
|
// 组件卸载时清除定时器(关键:防止内存泄漏)
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearCaptchaTimer(emailCaptchaState);
|
clearCaptchaTimer(emailCaptchaState)
|
||||||
clearCaptchaTimer(phoneCaptchaState);
|
clearCaptchaTimer(phoneCaptchaState)
|
||||||
});
|
})
|
||||||
/**
|
/**
|
||||||
* @description 监听transferOutAccount变化,获取对应的MaxAmount
|
* @description 监听transferOutAccount变化,获取对应的MaxAmount
|
||||||
*/
|
*/
|
||||||
watch(
|
watch(
|
||||||
[
|
[
|
||||||
() => transferForm.value.transferOutAccount,
|
() => transferForm.value.transferOutAccount,
|
||||||
() => transferFormOptionsMap.value.transferOutAccount
|
() => transferFormOptionsMap.value.transferOutAccount,
|
||||||
],
|
],
|
||||||
([newVal]) => {
|
([newVal]) => {
|
||||||
if (!newVal || !transferFormOptionsMap.value.transferOutAccount.length) return
|
if (!newVal || !transferFormOptionsMap.value.transferOutAccount.length) return
|
||||||
|
|
||||||
const item = transferFormOptionsMap.value.transferOutAccount.find(
|
const item = transferFormOptionsMap.value.transferOutAccount.find(
|
||||||
(item: any) => item.value === newVal
|
(item: any) => item.value === newVal,
|
||||||
)
|
)
|
||||||
transferForm.value.MaxOutAmount = item?.amount || 0
|
transferForm.value.MaxOutAmount = item?.amount || 0
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
/**
|
/**
|
||||||
* @description 统一获取数据
|
* @description 统一获取数据
|
||||||
|
|
@ -276,7 +329,7 @@ watch(
|
||||||
const getTransferWalletOptions = async () => {
|
const getTransferWalletOptions = async () => {
|
||||||
const data: any = await getTransferWalletOptionsApi()
|
const data: any = await getTransferWalletOptionsApi()
|
||||||
transferFormOptionsMap.value.transferOutAccount = data
|
transferFormOptionsMap.value.transferOutAccount = data
|
||||||
transferFormOptionsMap.value.transferInAccount = data
|
transferFormOptionsMap.value.transferInAccount = data.filter((item: any) => item.value !== -1)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description 页面加载完成需要渲染的数据
|
* @description 页面加载完成需要渲染的数据
|
||||||
|
|
@ -287,7 +340,10 @@ onMounted(() => {
|
||||||
|
|
||||||
// 获取默认主钱包最大可转金额,切换标签或提交成功后用于恢复初始展示。
|
// 获取默认主钱包最大可转金额,切换标签或提交成功后用于恢复初始展示。
|
||||||
const getDefaultMaxOutAmount = () => {
|
const getDefaultMaxOutAmount = () => {
|
||||||
return transferFormOptionsMap.value.transferOutAccount.find((item: any) => item.value === -1)?.amount || ''
|
return (
|
||||||
|
transferFormOptionsMap.value.transferOutAccount.find((item: any) => item.value === -1)
|
||||||
|
?.amount || ''
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置转账表单:切换内部/第三方转账时清空所有输入框。
|
// 重置转账表单:切换内部/第三方转账时清空所有输入框。
|
||||||
|
|
@ -327,7 +383,7 @@ const handleVerifyParams = (type: string) => {
|
||||||
return userInfo.phone
|
return userInfo.phone
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return '1'
|
return transferForm.value.transferInAccount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -343,8 +399,8 @@ const handleSubmit = async () => {
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
type: transferType.value === 'internal' ? '1' : '2',
|
type: transferType.value === 'internal' ? '1' : '2',
|
||||||
from: String(transferForm.value.transferOutAccount),
|
from: String(transferForm.value.transferOutAccount) + '',
|
||||||
to: handleVerifyParams(transferType.value),
|
to: handleVerifyParams(transferType.value) + '',
|
||||||
amount: transferForm.value.transferAmount,
|
amount: transferForm.value.transferAmount,
|
||||||
verify_type: '',
|
verify_type: '',
|
||||||
verify_code: '',
|
verify_code: '',
|
||||||
|
|
@ -355,7 +411,11 @@ const handleSubmit = async () => {
|
||||||
if (transferType.value === 'internal') {
|
if (transferType.value === 'internal') {
|
||||||
await transferApi(params)
|
await transferApi(params)
|
||||||
} else {
|
} else {
|
||||||
await transferApi({ ...params, verify_type: verifyType.value === 'email' ? '1' : '2', verify_code: transferForm.value.code })
|
await transferApi({
|
||||||
|
...params,
|
||||||
|
verify_type: verifyType.value === 'email' ? '1' : '2',
|
||||||
|
verify_code: transferForm.value.code,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
await resetTransferForm()
|
await resetTransferForm()
|
||||||
|
|
@ -438,12 +498,10 @@ const handleSubmit = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.verify {
|
.verify {
|
||||||
|
|
||||||
.tab,
|
.tab,
|
||||||
.username {
|
.username {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.verify-form {
|
.verify-form {
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,13 @@
|
||||||
<el-card class="account">
|
<el-card class="account">
|
||||||
<h3 class="account-title">
|
<h3 class="account-title">
|
||||||
个人账户
|
个人账户
|
||||||
<el-button type="primary" size="small" @click="handleAddSubAccount">添加子账户</el-button>
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleAddSubAccount"
|
||||||
|
v-auth="'user_createAccount'"
|
||||||
|
>添加子账户</el-button
|
||||||
|
>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="account-list">
|
<div class="account-list">
|
||||||
<div class="list" v-for="item in accountList" :key="item.id">
|
<div class="list" v-for="item in accountList" :key="item.id">
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,21 @@
|
||||||
<div class="mould-fee">
|
<div class="mould-fee">
|
||||||
<header>
|
<header>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button type="primary" @click="addFee">添加模板</el-button>
|
<el-button type="primary" @click="addFee" v-auth="'feeHandl_createFeeSetting'"
|
||||||
<el-button type="primary" @click="editFee">编辑模板</el-button>
|
>添加模板</el-button
|
||||||
<el-button type="primary" @click="changeStatus(1)">启用模板</el-button>
|
>
|
||||||
<el-button type="danger" @click="changeStatus(2)">禁用模板</el-button>
|
<el-button type="primary" @click="editFee" v-auth="'feeHandl_editFeeSetting'"
|
||||||
<el-button type="primary" @click="editFeeDetail">编辑模板详情</el-button>
|
>编辑模板</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="changeStatus(1)" v-auth="'feeHandl_editFeeSetting'"
|
||||||
|
>启用模板</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" @click="changeStatus(2)" v-auth="'feeHandl_editFeeSetting'"
|
||||||
|
>禁用模板</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="editFeeDetail" v-auth="'feeHandl_setFeeSettingDetail'"
|
||||||
|
>编辑模板详情</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
|
|
@ -90,7 +100,6 @@ import {
|
||||||
import Form from '@/components/common/Form.vue'
|
import Form from '@/components/common/Form.vue'
|
||||||
import { formDataList, formRulesList } from './option.ts'
|
import { formDataList, formRulesList } from './option.ts'
|
||||||
|
|
||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const dialogTitleType = ref(1)
|
const dialogTitleType = ref(1)
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,27 @@
|
||||||
<div class="risk">
|
<div class="risk">
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
<span>风控管理</span>
|
<span>风控管理</span>
|
||||||
<el-button type="primary" @click="handleAddRisk">添加</el-button>
|
<el-button type="primary" @click="handleAddRisk" v-auth="'riskControl_createRiskControl'"
|
||||||
<el-button type="primary" @click="handleModifyRisk">修改</el-button>
|
>添加</el-button
|
||||||
<el-button type="danger" @click="handleRiskStatus">停用</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="handleModifyRisk"
|
||||||
|
v-auth="'riskControl_editRiskControlSetting'"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
@click="handleChangeStatus(2)"
|
||||||
|
v-auth="'riskControl_editRiskControlSetting'"
|
||||||
|
>停用</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="handleChangeStatus(1)"
|
||||||
|
v-auth="'riskControl_editRiskControlSetting'"
|
||||||
|
>启用</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<div class="risk-table-content">
|
<div class="risk-table-content">
|
||||||
|
|
@ -243,10 +261,10 @@ const handleModifyRisk = () => {
|
||||||
} as any
|
} as any
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRiskStatus = async () => {
|
const handleChangeStatus = async (status) => {
|
||||||
dialogTitle.value = '停用'
|
dialogTitle.value = '停用'
|
||||||
dialogType.value = 'status'
|
dialogType.value = 'status'
|
||||||
await editRiskApi({ ...selectedRow.value, status: 2 })
|
await editRiskApi({ ...selectedRow.value, status: status })
|
||||||
getRiskList()
|
getRiskList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,13 +42,18 @@ import { getTransferDetailListApi } from '@/api/modules/funding/transferDetail'
|
||||||
|
|
||||||
// 导出表格
|
// 导出表格
|
||||||
import { exportToExcel } from '@/utils/exportToExcel'
|
import { exportToExcel } from '@/utils/exportToExcel'
|
||||||
|
|
||||||
|
import { getRecentSevenDays } from '@/utils/handleTime.ts'
|
||||||
|
|
||||||
|
const initTime = getRecentSevenDays()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 定义搜索数据
|
* @description: 定义搜索数据
|
||||||
*/
|
*/
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
transferAccount: '',
|
transferAccount: '',
|
||||||
type: '',
|
type: '',
|
||||||
transferTime: '',
|
transferTime: [initTime.start, initTime.end],
|
||||||
})
|
})
|
||||||
const searchOptions = ref(search)
|
const searchOptions = ref(search)
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,6 +71,7 @@ const total = ref(0)
|
||||||
/**
|
/**
|
||||||
* @description: 定义公共请求数据方法
|
* @description: 定义公共请求数据方法
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const getTransferDetailList = async () => {
|
const getTransferDetailList = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
v-if="row.role_id === 5"
|
v-if="row.role_id === 5"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
v-auth="'agent_getSelfVarietyPointDiffConfig'"
|
||||||
@click="handleMarginRatio(row)"
|
@click="handleMarginRatio(row)"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
|
|
@ -32,6 +33,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleCommissionRatio(row)"
|
@click="handleCommissionRatio(row)"
|
||||||
|
v-auth="'agent_editAgent'"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,15 @@
|
||||||
@reset="handleReset"
|
@reset="handleReset"
|
||||||
>
|
>
|
||||||
<template #button="{ form }">
|
<template #button="{ form }">
|
||||||
<el-button type="primary" @click="handleAddMarket()"> 添加 </el-button>
|
<el-button type="primary" @click="handleAddMarket()" v-auth="'agent_createAgen'">
|
||||||
<el-button type="primary" :disabled="!selectedRow" @click="handleEditMarket()">
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="!selectedRow"
|
||||||
|
v-auth="'agent_editAgent'"
|
||||||
|
@click="handleEditMarket()"
|
||||||
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="client">
|
<div class="client">
|
||||||
<!-- 搜索组件 -->
|
<!-- 搜索组件 -->
|
||||||
<ClientSearch :search-form="clientSearchForm" :search-options="clientSearchOptions" @search="handleSearch"
|
<ClientSearch
|
||||||
@reset="handleReset">
|
:search-form="clientSearchForm"
|
||||||
|
:search-options="clientSearchOptions"
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
>
|
||||||
<template #button="{ form }">
|
<template #button="{ form }">
|
||||||
<el-button type="primary" @click="handleAdd()">
|
<el-button type="primary" @click="handleAdd()" v-auth="'user_createUser'">
|
||||||
添加客户
|
添加客户
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -13,32 +17,53 @@
|
||||||
<!-- 表格组件 -->
|
<!-- 表格组件 -->
|
||||||
<ClientTable :table-data="clientTree" :columns="clientTableColumns">
|
<ClientTable :table-data="clientTree" :columns="clientTableColumns">
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
{{row.status === 1 ? '正常' : '禁用'}}
|
{{ row.status === 1 ? '正常' : '禁用' }}
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<el-button type="primary" size="small" @click="handleChange(row)">
|
<el-button type="primary" size="small" @click="handleChange(row)" v-anth="'user_editUser'">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ClientTable>
|
</ClientTable>
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<ClientPagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
|
<ClientPagination
|
||||||
@pagination-change="handlePaginationChange" />
|
v-model="currentPage"
|
||||||
|
v-model:pageSizeValue="pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination-change="handlePaginationChange"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 客户弹窗 -->
|
<!-- 客户弹窗 -->
|
||||||
<ClientDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" @confirm="handleSubmit"
|
<ClientDialog
|
||||||
@cancel="handleCancel" @close="handleClose">
|
:visible="dialogVisible"
|
||||||
<ClientForm :form-data="clientForm" :form-rules="clientFormRules" :form-items="clientFormOptions"
|
:title="dialogTitle"
|
||||||
:options-map="clientFormOptionsMap" ref="clientFormRef">
|
:type="dialogType"
|
||||||
<template #phoneOrEmail="{ formData }" style="margin-left: 0;">
|
@confirm="handleSubmit"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<ClientForm
|
||||||
|
:form-data="clientForm"
|
||||||
|
:form-rules="clientFormRules"
|
||||||
|
:form-items="clientFormOptions"
|
||||||
|
:options-map="clientFormOptionsMap"
|
||||||
|
ref="clientFormRef"
|
||||||
|
>
|
||||||
|
<template #phoneOrEmail="{ formData }" style="margin-left: 0">
|
||||||
<div class="phone-email">
|
<div class="phone-email">
|
||||||
<div class="tab-btn">
|
<div class="tab-btn">
|
||||||
<el-button :type="activeTab === 'email' ? 'primary' : 'default'" size="small"
|
<el-button
|
||||||
@click="activeTab = 'email'">
|
:type="activeTab === 'email' ? 'primary' : 'default'"
|
||||||
|
size="small"
|
||||||
|
@click="activeTab = 'email'"
|
||||||
|
>
|
||||||
邮箱
|
邮箱
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button :type="activeTab === 'phone' ? 'primary' : 'default'" size="small"
|
<el-button
|
||||||
@click="activeTab = 'phone'">
|
:type="activeTab === 'phone' ? 'primary' : 'default'"
|
||||||
|
size="small"
|
||||||
|
@click="activeTab = 'phone'"
|
||||||
|
>
|
||||||
手机号
|
手机号
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -48,8 +73,12 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="phone" class="phone-item" v-if="activeTab === 'phone'">
|
<el-form-item prop="phone" class="phone-item" v-if="activeTab === 'phone'">
|
||||||
<el-select v-model="clientForm.countryCode" placeholder="请选择国家区号">
|
<el-select v-model="clientForm.countryCode" placeholder="请选择国家区号">
|
||||||
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code"
|
<el-option
|
||||||
:value="item.code">
|
v-for="item in countryOptions"
|
||||||
|
:key="item.code"
|
||||||
|
:label="item.code"
|
||||||
|
:value="item.code"
|
||||||
|
>
|
||||||
<div class="country-option">
|
<div class="country-option">
|
||||||
<span class="country-name">{{ item.name }}</span>
|
<span class="country-name">{{ item.name }}</span>
|
||||||
<span class="country-code">{{ item.code }}</span>
|
<span class="country-code">{{ item.code }}</span>
|
||||||
|
|
@ -73,10 +102,23 @@ import ClientPagination from '@/components/common/Pagination.vue'
|
||||||
import ClientDialog from '@/components/common/Dialog.vue'
|
import ClientDialog from '@/components/common/Dialog.vue'
|
||||||
import ClientForm from '@/components/common/Form.vue'
|
import ClientForm from '@/components/common/Form.vue'
|
||||||
// 接口
|
// 接口
|
||||||
import { getClientListApi, getFeeTemplateOptionsApi, getRiskTemplateOptionsApi, getAgentOptionsApi, createClientApi, editClientApi } from '@/api/modules/account/client'
|
import {
|
||||||
|
getClientListApi,
|
||||||
|
getFeeTemplateOptionsApi,
|
||||||
|
getRiskTemplateOptionsApi,
|
||||||
|
getAgentOptionsApi,
|
||||||
|
createClientApi,
|
||||||
|
editClientApi,
|
||||||
|
} from '@/api/modules/account/client'
|
||||||
|
|
||||||
// 配置
|
// 配置
|
||||||
import { clientSearch, clientAddFormItem, clientChangeFormItem, countryOptions, clientTableColumns } from './options'
|
import {
|
||||||
|
clientSearch,
|
||||||
|
clientAddFormItem,
|
||||||
|
clientChangeFormItem,
|
||||||
|
countryOptions,
|
||||||
|
clientTableColumns,
|
||||||
|
} from './options'
|
||||||
import { rules } from './rules'
|
import { rules } from './rules'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -135,7 +177,7 @@ const clientFormRules = ref(rules())
|
||||||
const optionsFetched = ref(false)
|
const optionsFetched = ref(false)
|
||||||
const useId = ref('')
|
const useId = ref('')
|
||||||
const clientFormOptions = computed(() => {
|
const clientFormOptions = computed(() => {
|
||||||
return dialogType.value === 'add' ? clientAddFormItem : clientChangeFormItem;
|
return dialogType.value === 'add' ? clientAddFormItem : clientChangeFormItem
|
||||||
})
|
})
|
||||||
const clientFormOptionsMap = ref<any>({
|
const clientFormOptionsMap = ref<any>({
|
||||||
feeTemplate: [],
|
feeTemplate: [],
|
||||||
|
|
@ -143,11 +185,11 @@ const clientFormOptionsMap = ref<any>({
|
||||||
agentUsername: [],
|
agentUsername: [],
|
||||||
isUpgrade: [
|
isUpgrade: [
|
||||||
{ label: '是', value: 1 },
|
{ label: '是', value: 1 },
|
||||||
{ label: '否', value: 2 }
|
{ label: '否', value: 2 },
|
||||||
],
|
],
|
||||||
status: [
|
status: [
|
||||||
{ label: '正常', value: 1 },
|
{ label: '正常', value: 1 },
|
||||||
{ label: '禁用', value: 2 }
|
{ label: '禁用', value: 2 },
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
// 定义客户表单选项切换
|
// 定义客户表单选项切换
|
||||||
|
|
@ -160,31 +202,37 @@ const activeTab = ref('email')
|
||||||
const mapObjectToOptions = (obj: Record<string, string>) => {
|
const mapObjectToOptions = (obj: Record<string, string>) => {
|
||||||
return Object.entries(obj).map(([label, value]) => ({
|
return Object.entries(obj).map(([label, value]) => ({
|
||||||
label, // 模板/代理名称
|
label, // 模板/代理名称
|
||||||
value // 模板/代理ID
|
value, // 模板/代理ID
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 统一获取数据方法
|
* @description 统一获取数据方法
|
||||||
*/
|
*/
|
||||||
const getClientList = async () => {
|
const getClientList = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
page_size: pageSize.value,
|
page_size: pageSize.value,
|
||||||
username: clientSearchForm.value.username,
|
username: clientSearchForm.value.username,
|
||||||
status: clientSearchForm.value.status || '',
|
status: clientSearchForm.value.status || '',
|
||||||
reg_start_time: clientSearchForm.value.startDateTime.length > 0 ? `${clientSearchForm.value.startDateTime} 0:00:00` : '',
|
reg_start_time:
|
||||||
reg_end_time: clientSearchForm.value.endDateTime.length > 0 ? `${clientSearchForm.value.endDateTime} 23:59:59` : '',
|
clientSearchForm.value.startDateTime.length > 0
|
||||||
|
? `${clientSearchForm.value.startDateTime} 0:00:00`
|
||||||
|
: '',
|
||||||
|
reg_end_time:
|
||||||
|
clientSearchForm.value.endDateTime.length > 0
|
||||||
|
? `${clientSearchForm.value.endDateTime} 23:59:59`
|
||||||
|
: '',
|
||||||
}
|
}
|
||||||
const data = await getClientListApi(params)
|
const data = await getClientListApi(params)
|
||||||
// 处理表格数据
|
// 处理表格数据
|
||||||
clientTree.value = data.data.map(item => ({
|
clientTree.value = data.data.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
//注册时间
|
//注册时间
|
||||||
createdTime: item.created_at,
|
createdTime: item.created_at,
|
||||||
// 映射所属代理用户名
|
// 映射所属代理用户名
|
||||||
agentUsername: item.par_uid === item.parent?.id ? item.parent?.username : '',
|
agentUsername: item.par_uid === item.parent?.id ? item.parent?.username : '',
|
||||||
}));
|
}))
|
||||||
//分页数据
|
//分页数据
|
||||||
total.value = Number(data.total)
|
total.value = Number(data.total)
|
||||||
currentPage.value = Number(data.current_page)
|
currentPage.value = Number(data.current_page)
|
||||||
|
|
@ -200,13 +248,19 @@ const getOptions = async () => {
|
||||||
const [agentRes, feeTemplateRes, riskTemplateRes] = await Promise.all([
|
const [agentRes, feeTemplateRes, riskTemplateRes] = await Promise.all([
|
||||||
getAgentOptionsApi(),
|
getAgentOptionsApi(),
|
||||||
getFeeTemplateOptionsApi(),
|
getFeeTemplateOptionsApi(),
|
||||||
getRiskTemplateOptionsApi()
|
getRiskTemplateOptionsApi(),
|
||||||
])
|
])
|
||||||
|
|
||||||
// label=名称,value=ID
|
// label=名称,value=ID
|
||||||
clientFormOptionsMap.value.agentUsername = mapObjectToOptions(agentRes as Record<string, string>)
|
clientFormOptionsMap.value.agentUsername = mapObjectToOptions(
|
||||||
clientFormOptionsMap.value.feeTemplate = mapObjectToOptions(feeTemplateRes as Record<string, string>)
|
agentRes as Record<string, string>,
|
||||||
clientFormOptionsMap.value.riskTemplate = mapObjectToOptions(riskTemplateRes as Record<string, string>)
|
)
|
||||||
|
clientFormOptionsMap.value.feeTemplate = mapObjectToOptions(
|
||||||
|
feeTemplateRes as Record<string, string>,
|
||||||
|
)
|
||||||
|
clientFormOptionsMap.value.riskTemplate = mapObjectToOptions(
|
||||||
|
riskTemplateRes as Record<string, string>,
|
||||||
|
)
|
||||||
|
|
||||||
optionsFetched.value = true // 标记已获取
|
optionsFetched.value = true // 标记已获取
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -296,7 +350,7 @@ const handleChange = (row: any) => {
|
||||||
/**
|
/**
|
||||||
* @description 分页方法
|
* @description 分页方法
|
||||||
*/
|
*/
|
||||||
const handlePaginationChange = (page: { currentPage: number, pageSize: number }) => {
|
const handlePaginationChange = (page: { currentPage: number; pageSize: number }) => {
|
||||||
currentPage.value = page.currentPage
|
currentPage.value = page.currentPage
|
||||||
pageSize.value = page.pageSize
|
pageSize.value = page.pageSize
|
||||||
handleSearch()
|
handleSearch()
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,15 @@
|
||||||
<!-- 菜单列表头 -->
|
<!-- 菜单列表头 -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h4>菜单列表</h4>
|
<h4>菜单列表</h4>
|
||||||
<el-button type="primary" @click="handleAddMenu">新增菜单</el-button>
|
<el-button type="primary" @click="handleAddMenu" v-auth="'menus_create'">新增菜单</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 菜单列表表格 -->
|
<!-- 菜单列表表格 -->
|
||||||
<MenuTable :table-data="menuTree" :columns="menuTableColumns" row-key="id" :tree-props="treeProps">
|
<MenuTable
|
||||||
|
:table-data="menuTree"
|
||||||
|
:columns="menuTableColumns"
|
||||||
|
row-key="id"
|
||||||
|
:tree-props="treeProps"
|
||||||
|
>
|
||||||
<template #icon="{ row }">
|
<template #icon="{ row }">
|
||||||
<el-icon v-if="row.icon && menuiconMap[row.icon]">
|
<el-icon v-if="row.icon && menuiconMap[row.icon]">
|
||||||
<component :is="menuiconMap[row.icon]" />
|
<component :is="menuiconMap[row.icon]" />
|
||||||
|
|
@ -17,24 +22,46 @@
|
||||||
{{ row.type === 1 ? '目录' : '按钮' }}
|
{{ row.type === 1 ? '目录' : '按钮' }}
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
<el-switch :model-value="row.status === 1" :active-value="true" :inactive-value="false" active-text="启用"
|
{{ row.status === 1 ? '启用' : '禁用' }}
|
||||||
inactive-text="禁用"/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<el-button link type="primary" size="small" @click="handleEditMenu(row)">
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleEditMenu(row)"
|
||||||
|
v-auth="'menus_edit'"
|
||||||
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="danger" size="small" @click="handleDeleteMenu(row)">
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="handleDeleteMenu(row)"
|
||||||
|
v-auth="'menus_del'"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</MenuTable>
|
</MenuTable>
|
||||||
</div>
|
</div>
|
||||||
<!-- 菜单新增/编辑弹窗 -->
|
<!-- 菜单新增/编辑弹窗 -->
|
||||||
<MenuDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType" @confirm="handleSubmit"
|
<MenuDialog
|
||||||
@cancel="handleCancel" @close="handleClose">
|
:visible="dialogVisible"
|
||||||
<MenuForm :form-data="menuForm" :form-rules="menuFormRules" :form-items="menuFormItemOptions"
|
:title="dialogTitle"
|
||||||
:options-map="menuFormOptionsMap" ref="menuFormRef" />
|
:type="dialogType"
|
||||||
|
@confirm="handleSubmit"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<MenuForm
|
||||||
|
:form-data="menuForm"
|
||||||
|
:form-rules="menuFormRules"
|
||||||
|
:form-items="menuFormItemOptions"
|
||||||
|
:options-map="menuFormOptionsMap"
|
||||||
|
ref="menuFormRef"
|
||||||
|
/>
|
||||||
</MenuDialog>
|
</MenuDialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
@ -80,16 +107,16 @@ const menuFormRef = ref<FormInstance>()
|
||||||
const menuFormRules = rules(menuForm.value, menuiconOptions)
|
const menuFormRules = rules(menuForm.value, menuiconOptions)
|
||||||
// icon和菜单表单选项映射
|
// icon和菜单表单选项映射
|
||||||
const menuFormOptionsMap = ref({
|
const menuFormOptionsMap = ref({
|
||||||
'parentName': [] as any[],
|
parentName: [] as any[],
|
||||||
'icon': menuiconOptions,
|
icon: menuiconOptions,
|
||||||
'type': [
|
type: [
|
||||||
{ label: '菜单', value: 1 },
|
{ label: '菜单', value: 1 },
|
||||||
{ label: '按钮', value: 2 }
|
{ label: '按钮', value: 2 },
|
||||||
],
|
],
|
||||||
'status': [
|
status: [
|
||||||
{ label: '启用', value: 1 },
|
{ label: '启用', value: 1 },
|
||||||
{ label: '禁用', value: 2 }
|
{ label: '禁用', value: 2 },
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -111,14 +138,11 @@ const fetchMenuList = async () => {
|
||||||
const data = await getMenuApi()
|
const data = await getMenuApi()
|
||||||
menuTree.value = data
|
menuTree.value = data
|
||||||
// 处理parentName选项,添加一级菜单选项
|
// 处理parentName选项,添加一级菜单选项
|
||||||
const parentNameOptions = data.map(item => ({
|
const parentNameOptions = data.map((item) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id ?? ''
|
value: item.id ?? '',
|
||||||
}))
|
}))
|
||||||
menuFormOptionsMap.value.parentName = [
|
menuFormOptionsMap.value.parentName = [{ label: '一级菜单', value: '0' }, ...parentNameOptions]
|
||||||
{ label: '一级菜单', value: "0" },
|
|
||||||
...parentNameOptions
|
|
||||||
]
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取菜单列表失败', err)
|
console.error('获取菜单列表失败', err)
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +189,7 @@ const handleSubmit = async () => {
|
||||||
name: menuForm.value.name, // 菜单名称
|
name: menuForm.value.name, // 菜单名称
|
||||||
parent_id: menuForm.value.parentName, // 上级菜单id
|
parent_id: menuForm.value.parentName, // 上级菜单id
|
||||||
path: menuForm.value.path, // 路由路径
|
path: menuForm.value.path, // 路由路径
|
||||||
api: menuForm.value.api , // 后端路由
|
api: menuForm.value.api, // 后端路由
|
||||||
icon: menuForm.value.icon, // 图标名称
|
icon: menuForm.value.icon, // 图标名称
|
||||||
sort: menuForm.value.sort ?? 1, // 排序(默认1)
|
sort: menuForm.value.sort ?? 1, // 排序(默认1)
|
||||||
type: menuForm.value.type ?? 1, // 默认是菜单类型
|
type: menuForm.value.type ?? 1, // 默认是菜单类型
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<NoticeSearch :search-form="searchForm" :search-options="searchOptions" @search="handleSearch"
|
<NoticeSearch
|
||||||
@reset="handleReset">
|
:search-form="searchForm"
|
||||||
|
:search-options="searchOptions"
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
>
|
||||||
<template #button>
|
<template #button>
|
||||||
<el-button type="primary" @click="handleCreate">新建</el-button>
|
<el-button type="primary" @click="handleCreate" v-auth="'notice_createNotice'"
|
||||||
|
>新建</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</NoticeSearch>
|
</NoticeSearch>
|
||||||
<div class="tab">
|
|
||||||
<el-button :type="activeTab === 2 ? 'primary' : 'default'" @click="handleTabChange(2)">已发布</el-button>
|
|
||||||
<el-button :type="activeTab === 1 ? 'primary' : 'default'" @click="handleTabChange(1)">草稿</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<NoticeTable :table-data="noticeTree" :columns="noticeTableColumnsOptions" row-key="id">
|
<NoticeTable :table-data="noticeTree" :columns="noticeTableColumnsOptions" row-key="id">
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
|
|
@ -18,28 +20,68 @@
|
||||||
{{ row.status === 1 ? '草稿' : '已发布' }}
|
{{ row.status === 1 ? '草稿' : '已发布' }}
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<el-button type="primary" size="small" v-if="row.status === 2" @click="handleView(row)">查看</el-button>
|
<el-button type="primary" size="small" v-if="row.status === 2" @click="handleView(row)"
|
||||||
|
>查看</el-button
|
||||||
|
>
|
||||||
<!-- 草稿才显示编辑/删除,已发布仅查看 -->
|
<!-- 草稿才显示编辑/删除,已发布仅查看 -->
|
||||||
<template v-if="row.status === 1">
|
<template v-if="row.status === 1">
|
||||||
<el-button type="primary" size="small" @click="handleEdit(row)">编辑</el-button>
|
<el-button
|
||||||
<el-button type="danger" size="small" @click="handleDelete(row)">删除</el-button>
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleEdit(row)"
|
||||||
|
v-auth="'notice_editNotice'"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="handleDelete(row)"
|
||||||
|
v-auth="'notice_delNotice'"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</NoticeTable>
|
</NoticeTable>
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<NoticePagination v-model="currentPage" v-model:pageSizeValue="pageSize" :total="total"
|
<NoticePagination
|
||||||
@pagination-change="handlePaginationChange" />
|
v-model="currentPage"
|
||||||
|
v-model:pageSizeValue="pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination-change="handlePaginationChange"
|
||||||
|
/>
|
||||||
<!-- dialog -->
|
<!-- dialog -->
|
||||||
<NoticeDialog :visible="dialogVisible" :title="dialogTitle" :type="dialogType"
|
<NoticeDialog
|
||||||
:show-footer="dialogType !== 'view'" @confirm="handleSubmit" @cancel="handleCancel" @close="handleClose">
|
:visible="dialogVisible"
|
||||||
<NoticeForm :form-data="noticeForm" :form-rules="noticeRules" :form-items="noticeFormItem"
|
:title="dialogTitle"
|
||||||
:options-map="noticeFormOptionsMap" ref="noticeFormRef" v-if="dialogType !== 'view'">
|
:type="dialogType"
|
||||||
|
:show-footer="dialogType !== 'view'"
|
||||||
|
@confirm="handleSubmit"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<NoticeForm
|
||||||
|
:form-data="noticeForm"
|
||||||
|
:form-rules="noticeRules"
|
||||||
|
:form-items="noticeFormItem"
|
||||||
|
:options-map="noticeFormOptionsMap"
|
||||||
|
ref="noticeFormRef"
|
||||||
|
v-if="dialogType !== 'view'"
|
||||||
|
>
|
||||||
<template #noticeContent="{ formData }">
|
<template #noticeContent="{ formData }">
|
||||||
<div style="border: 1px solid #e6e6e6; margin: 10px 0;">
|
<div style="border: 1px solid #e6e6e6; margin: 10px 0">
|
||||||
<Toolbar :editor="editorRef" :defaultConfig="toolbarConfig" mode="default"
|
<Toolbar
|
||||||
style="border-bottom: 1px solid #ccc;" />
|
:editor="editorRef"
|
||||||
<Editor v-model="valueHtml" :defaultConfig="editorConfig" mode="default"
|
:defaultConfig="toolbarConfig"
|
||||||
@onCreated="handleCreated" style="height: 300px; overflow-y: auto;" />
|
mode="default"
|
||||||
|
style="border-bottom: 1px solid #ccc"
|
||||||
|
/>
|
||||||
|
<Editor
|
||||||
|
v-model="valueHtml"
|
||||||
|
:defaultConfig="editorConfig"
|
||||||
|
mode="default"
|
||||||
|
@onCreated="handleCreated"
|
||||||
|
style="height: 300px; overflow-y: auto"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</NoticeForm>
|
</NoticeForm>
|
||||||
|
|
@ -64,11 +106,14 @@ import { search, tableColumns, formItem } from './options'
|
||||||
import { rules } from './rules'
|
import { rules } from './rules'
|
||||||
|
|
||||||
// 接口
|
// 接口
|
||||||
import { getNoticeListApi, createNoticeApi, editNoticeApi, deleteNoticeApi } from '@/api/modules/notice'
|
import {
|
||||||
|
getNoticeListApi,
|
||||||
|
createNoticeApi,
|
||||||
|
editNoticeApi,
|
||||||
|
deleteNoticeApi,
|
||||||
|
} from '@/api/modules/notice'
|
||||||
import { uploadImageApi } from '@/api/modules/upload'
|
import { uploadImageApi } from '@/api/modules/upload'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { DomEditor } from '@wangeditor/editor'
|
import { DomEditor } from '@wangeditor/editor'
|
||||||
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
||||||
import '@wangeditor/editor/dist/css/style.css'
|
import '@wangeditor/editor/dist/css/style.css'
|
||||||
|
|
@ -81,7 +126,7 @@ const toolbarRef = shallowRef()
|
||||||
const valueHtml = ref('')
|
const valueHtml = ref('')
|
||||||
// 工具栏配置
|
// 工具栏配置
|
||||||
const toolbarConfig = {
|
const toolbarConfig = {
|
||||||
excludeKeys: ["group-video", "fullScreen"]
|
excludeKeys: ['group-video', 'fullScreen'],
|
||||||
}
|
}
|
||||||
// 富文本编辑器配置
|
// 富文本编辑器配置
|
||||||
const editorConfig = {
|
const editorConfig = {
|
||||||
|
|
@ -91,18 +136,18 @@ const editorConfig = {
|
||||||
customUpload: async (file: any, insertFn: any) => {
|
customUpload: async (file: any, insertFn: any) => {
|
||||||
try {
|
try {
|
||||||
// 调用封装后的上传API
|
// 调用封装后的上传API
|
||||||
const res = await uploadImageApi(file);
|
const res = await uploadImageApi(file)
|
||||||
// 插入图片到富文本
|
// 插入图片到富文本
|
||||||
insertFn(res.url);
|
insertFn(res.url)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
// 复用你已有的错误提示逻辑(ElNotification)
|
// 复用你已有的错误提示逻辑(ElNotification)
|
||||||
const errMsg = error?.message || error?.data?.msg || '图片上传失败';
|
const errMsg = error?.message || error?.data?.msg || '图片上传失败'
|
||||||
alert(`图片${file.name}上传失败:${errMsg}`);
|
alert(`图片${file.name}上传失败:${errMsg}`)
|
||||||
ElNotification({
|
ElNotification({
|
||||||
message: errMsg || '未知的错误!',
|
message: errMsg || '未知的错误!',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
customClass: 'global-notification'
|
customClass: 'global-notification',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -111,8 +156,8 @@ const editorConfig = {
|
||||||
timeout: 30 * 1000,
|
timeout: 30 * 1000,
|
||||||
maxFileSize: 5 * 1024 * 1024,
|
maxFileSize: 5 * 1024 * 1024,
|
||||||
allowedFileTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
allowedFileTypes: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -256,7 +301,6 @@ const handleView = (row: any) => {
|
||||||
} as any
|
} as any
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleEdit = (row: any) => {
|
const handleEdit = (row: any) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = '编辑公告'
|
dialogTitle.value = '编辑公告'
|
||||||
|
|
@ -280,7 +324,7 @@ const handleDelete = async (row: any) => {
|
||||||
/**
|
/**
|
||||||
* @description: 定义分页方法
|
* @description: 定义分页方法
|
||||||
*/
|
*/
|
||||||
const handlePaginationChange = async (page: { currentPage: number, pageSize: number }) => {
|
const handlePaginationChange = async (page: { currentPage: number; pageSize: number }) => {
|
||||||
currentPage.value = page.currentPage
|
currentPage.value = page.currentPage
|
||||||
pageSize.value = page.pageSize
|
pageSize.value = page.pageSize
|
||||||
await getNoticeList()
|
await getNoticeList()
|
||||||
|
|
@ -312,7 +356,6 @@ const handleSubmit = async () => {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
getNoticeList()
|
getNoticeList()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,39 @@
|
||||||
* @description: 搜索配置
|
* @description: 搜索配置
|
||||||
*/
|
*/
|
||||||
export const search = [
|
export const search = [
|
||||||
{ prop: 'noticeName', label: '公告名称', type: 'input' as const, placeholder: '请输入公告名称', width: '120px' },
|
|
||||||
{
|
{
|
||||||
prop: "startDateTime", label: '发布时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
prop: 'noticeName',
|
||||||
|
label: '公告名称',
|
||||||
|
type: 'input' as const,
|
||||||
|
placeholder: '请输入公告名称',
|
||||||
|
width: '120px',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'startDateTime',
|
||||||
|
label: '发布时间',
|
||||||
|
type: 'date' as const,
|
||||||
|
dateType: 'date' as const, // 时间范围选择器
|
||||||
valueFormat: 'YYYY-MM-DD',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
width: '180px',
|
width: '180px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "endDateTime", label: '结束时间', type: 'date' as const, dateType: 'date' as const, // 时间范围选择器
|
prop: 'endDateTime',
|
||||||
|
label: '结束时间',
|
||||||
|
type: 'date' as const,
|
||||||
|
dateType: 'date' as const, // 时间范围选择器
|
||||||
valueFormat: 'YYYY-MM-DD',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
width: '180px',
|
width: '180px',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'status',
|
||||||
|
label: '状态',
|
||||||
|
type: 'select' as const,
|
||||||
|
placeholder: '请选择状态',
|
||||||
|
options: [
|
||||||
|
{ label: '草稿', value: 1 },
|
||||||
|
{ label: '已发布', value: 2 },
|
||||||
|
],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<!-- 角色列表头 -->
|
<!-- 角色列表头 -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h4>角色列表</h4>
|
<h4>角色列表</h4>
|
||||||
<el-button type="primary" @click="handleAddRole">新增角色</el-button>
|
<el-button type="primary" @click="handleAddRole" v-auth="'roles_create'">新增角色</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 角色列表表格 -->
|
<!-- 角色列表表格 -->
|
||||||
<RoleTable :table-data="roleTree" :columns="roleTableColumns" row-key="id">
|
<RoleTable :table-data="roleTree" :columns="roleTableColumns" row-key="id">
|
||||||
|
|
@ -20,11 +20,33 @@
|
||||||
{{ row.created_at }}
|
{{ row.created_at }}
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<el-button link type="primary" size="small" @click="handleEditRole(row)"> 编辑 </el-button>
|
<el-button
|
||||||
<el-button link type="primary" size="small" @click="handlePermission(row)">
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleEditRole(row)"
|
||||||
|
v-auth="'roles_edit'"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handlePermission(row)"
|
||||||
|
v-auth="'roles_setPermission'"
|
||||||
|
>
|
||||||
设置权限
|
设置权限
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="danger" size="small" @click="handleDeleteRole(row)"> 删除 </el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="handleDeleteRole(row)"
|
||||||
|
v-auth="'roles_del'"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</RoleTable>
|
</RoleTable>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="trade-group">
|
<div class="trade-group">
|
||||||
<el-form-item label="交易组时间设置">
|
<el-form-item label="交易组时间设置">
|
||||||
<el-button type="primary" @click="addTableItem">添加</el-button>
|
<el-button type="primary" @click="addTableItem" v-auth="'contractVariety_createGroup'"
|
||||||
|
>添加</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
|
|
@ -60,16 +62,32 @@
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2" style="width: 140px">
|
<td rowspan="2" style="width: 140px">
|
||||||
<el-button type="primary" v-if="!item.editStatus" @click="item.editStatus = true"
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
v-if="!item.editStatus"
|
||||||
|
@click="item.editStatus = true"
|
||||||
|
v-auth="'contractVariety_editGroup'"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button type="danger" v-if="!item.editStatus" @click="deleteGroup(item.id, index)"
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
v-if="!item.editStatus"
|
||||||
|
@click="deleteGroup(item.id, index)"
|
||||||
|
v-auth="'contractVariety_delGroup'"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
<el-button type="primary" v-if="item.editStatus" @click="submitItem(index)"
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
v-if="item.editStatus"
|
||||||
|
@click="submitItem(index)"
|
||||||
|
v-auth="'contractVariety_editGroup'"
|
||||||
>确认</el-button
|
>确认</el-button
|
||||||
>
|
>
|
||||||
<el-button type="danger" v-if="item.editStatus" @click="item.editStatus = false"
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
v-if="item.editStatus"
|
||||||
|
@click="item.editStatus = false"
|
||||||
|
v-auth="'contractVariety_editGroup'"
|
||||||
>取消</el-button
|
>取消</el-button
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,17 @@
|
||||||
@reset="handleReset"
|
@reset="handleReset"
|
||||||
>
|
>
|
||||||
<template #button="{ form }">
|
<template #button="{ form }">
|
||||||
<el-button type="primary" :disabled="!selectedRow" @click="handleEdit()"> 编辑 </el-button>
|
<el-button
|
||||||
<el-button type="primary" @click="handleAdd()"> 添加 </el-button>
|
type="primary"
|
||||||
|
:disabled="!selectedRow"
|
||||||
|
@click="handleEdit()"
|
||||||
|
v-auth="'contracVarietediariety'"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="handleAdd()" v-auth="'contractVariety_createVariety'">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</VarietySearch>
|
</VarietySearch>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue