bug
This commit is contained in:
parent
1d355d822e
commit
50732616d0
13
src/App.vue
13
src/App.vue
|
|
@ -5,11 +5,14 @@
|
|||
:breakpoint="992"
|
||||
>
|
||||
<TopLoading ref="topLoadingRef" />
|
||||
<router-view v-slot="{ Component }">
|
||||
<KeepAlive>
|
||||
<component :is="Component" />
|
||||
</KeepAlive>
|
||||
</router-view>
|
||||
<!--
|
||||
最外层 router-view 不要再包 <KeepAlive>。
|
||||
原因:App.vue 下同时存在两个根路由(User、Layout/realName/livenessVerification),
|
||||
如果在 App.vue 处包 <KeepAlive>,路由在 User 和业务路由之间切换时,
|
||||
被缓存的顶层组件会随其后继组件重新挂载而重复创建(导致 onMounted 触发多次、接口被重复调用)。
|
||||
业务页面的 <KeepAlive> 已经在 Layout.vue 中按 route.meta.keepAlive 精确控制。
|
||||
-->
|
||||
<router-view />
|
||||
</MobileScale>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ export const getFundDetailListApi = (params: any) => {
|
|||
|
||||
//获取枚举字典选项
|
||||
export const getEnumDicOptionsApi = () => {
|
||||
return request.get('/user/getEnumDicOptions', {})
|
||||
return request.get('/user/getEnumDicOptions', undefined, { showMessage: false })
|
||||
}
|
||||
|
|
@ -85,10 +85,10 @@
|
|||
<el-icon><User /></el-icon>
|
||||
个人中心
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="password">
|
||||
<!-- <el-dropdown-item command="password">
|
||||
<el-icon><Lock /></el-icon>
|
||||
修改密码
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-item> -->
|
||||
<el-dropdown-item divided command="logout">
|
||||
<el-icon><SwitchButton /></el-icon>
|
||||
退出登录
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ onMounted(() => {
|
|||
<style scoped lang="scss">
|
||||
.market-maker-dashboard {
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
<el-input v-model="marketForm.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="phone" class="phone-item" v-if="activeTab === 'phone'">
|
||||
<el-select v-model="marketForm.countryCode" placeholder="请选择国家区号">
|
||||
<el-select v-model="marketForm.mobile_area" placeholder="请选择国家区号">
|
||||
<el-option
|
||||
v-for="item in countryOptions"
|
||||
:key="item.code"
|
||||
|
|
@ -449,9 +449,12 @@ const marketForm = ref({
|
|||
//邮箱或手机号
|
||||
email: '',
|
||||
phone: '',
|
||||
countryCode: '+86',
|
||||
// 手机区号
|
||||
mobile_area: '+86',
|
||||
accountName: '',
|
||||
level: '',
|
||||
is_base_ts: 1,
|
||||
base_ts: '',
|
||||
parentAccountName: '',
|
||||
riskControlTemplate: '',
|
||||
positionRatio: '',
|
||||
|
|
@ -1040,7 +1043,8 @@ const isBaseTsDisabled = computed(() => {
|
|||
const initMarketForm = {
|
||||
email: '',
|
||||
phone: '',
|
||||
countryCode: '+86',
|
||||
// 手机区号
|
||||
mobile_area: '+86',
|
||||
accountName: '',
|
||||
level: '',
|
||||
is_base_ts: 1,
|
||||
|
|
@ -1228,7 +1232,11 @@ const handleSubmit = async () => {
|
|||
reg_type: activeTab.value === 'email' ? '1' : '2',
|
||||
username: marketForm.value.accountName,
|
||||
par_user_id: marketForm.value.parentAccountName,
|
||||
mobile: activeTab.value === 'phone' ? marketForm.value.phone : '',
|
||||
// 手机号添加时,mobile 为区号+手机号
|
||||
mobile_area:marketForm.value.mobile_area,
|
||||
mobile: activeTab.value === 'phone'
|
||||
? `${marketForm.value.mobile_area}${marketForm.value.phone}`
|
||||
: '',
|
||||
email: activeTab.value === 'email' ? marketForm.value.email : '',
|
||||
password: '888888',
|
||||
toucun_percent: marketForm.value.positionRatio,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const rules = (marketForm: any, row?: any, isEdit?: boolean): FormRules =
|
|||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 验证国家码必填
|
||||
if (!marketForm.countryCode) {
|
||||
if (!marketForm.mobile_area) {
|
||||
return callback(new Error('请选择国家/地区码'));
|
||||
}
|
||||
// 验证手机号必填
|
||||
|
|
@ -19,7 +19,7 @@ export const rules = (marketForm: any, row?: any, isEdit?: boolean): FormRules =
|
|||
return callback(new Error('请输入手机号码'));
|
||||
}
|
||||
// 中国大陆手机号格式验证(仅+86时生效)
|
||||
if (marketForm.countryCode === '+86' && !/^1[3-9]\d{9}$/.test(value)) {
|
||||
if (marketForm.mobile_area === '+86' && !/^1[3-9]\d{9}$/.test(value)) {
|
||||
return callback(new Error('请输入正确的中国大陆手机号'));
|
||||
}
|
||||
callback();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
<el-input v-model="clientForm.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="phone" class="phone-item" v-if="activeTab === 'phone'">
|
||||
<el-select v-model="clientForm.countryCode" placeholder="请选择国家区号">
|
||||
<el-select v-model="clientForm.mobile_area" placeholder="请选择国家区号">
|
||||
<el-option v-for="item in countryOptions" :key="item.code" :label="item.code" :value="item.code">
|
||||
<div class="country-option">
|
||||
<span class="country-name">{{ item.name }}</span>
|
||||
|
|
@ -218,7 +218,8 @@ const clientForm = ref({
|
|||
agentUsername: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
countryCode: '+86',
|
||||
// 手机区号
|
||||
mobile_area: '+86',
|
||||
//是否升级
|
||||
isUpgrade: 1,
|
||||
//是否变更客户名
|
||||
|
|
@ -228,7 +229,7 @@ const clientForm = ref({
|
|||
|
||||
// 定义客户表单配置
|
||||
const clientFormRef = ref()
|
||||
const clientFormRules = ref(rules())
|
||||
const clientFormRules = computed(() => rules(clientForm.value))
|
||||
// 定义客户表单选项是否已获取
|
||||
const optionsFetched = ref(false)
|
||||
const useId = ref('')
|
||||
|
|
@ -371,7 +372,8 @@ const handleAdd = () => {
|
|||
agentUsername: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
countryCode: '+86',
|
||||
// 手机区号
|
||||
mobile_area: '+86',
|
||||
//是否升级
|
||||
isUpgrade: 1,
|
||||
//是否变更客户名
|
||||
|
|
@ -422,7 +424,11 @@ const handleSubmit = async () => {
|
|||
const params = {
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
email: clientForm.value.email,
|
||||
mobile: clientForm.value.phone,
|
||||
mobile_area: clientForm.value.mobile_area,
|
||||
// 手机号添加时,mobile 为区号+手机号
|
||||
mobile: activeTab.value === 'phone'
|
||||
? `${clientForm.value.mobile_area}${clientForm.value.phone}`
|
||||
: clientForm.value.phone,
|
||||
parent_id: clientForm.value.agentUsername,
|
||||
risk_control_id: clientForm.value.riskTemplate,
|
||||
fee_setting_id: clientForm.value.feeTemplate,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { FormRules } from 'element-plus'
|
||||
export const rules = (): FormRules => {
|
||||
export const rules = (clientForm: any): FormRules => {
|
||||
return {
|
||||
//手续费模板
|
||||
feeTemplate: [
|
||||
|
|
@ -15,8 +15,24 @@ export const rules = (): FormRules => {
|
|||
],
|
||||
//手机号
|
||||
phone: [
|
||||
{ required: true, message: '请输入手机号', trigger: ['blur'] },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号格式', trigger: ['blur'] },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 验证国家码必填
|
||||
if (!clientForm.mobile_area) {
|
||||
return callback(new Error('请选择国家/地区码'));
|
||||
}
|
||||
// 验证手机号必填
|
||||
if (!value) {
|
||||
return callback(new Error('请输入手机号码'));
|
||||
}
|
||||
// 中国大陆手机号格式验证(仅+86时生效)
|
||||
if (clientForm.mobile_area === '+86' && !/^1[3-9]\d{9}$/.test(value)) {
|
||||
return callback(new Error('请输入正确的中国大陆手机号'));
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
//邮箱
|
||||
email: [
|
||||
|
|
|
|||
Loading…
Reference in New Issue