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