feat(tenant): 租户管理页面优化
- 将租户管理和子账号管理路由的isKeepAlive设置为false - 添加oldPhone变量用于记录原始手机号 - 在编辑租户时保存原始手机号 - 当租户手机号发生变更时显示特殊提示信息 - 修复租户用户页面组件名称错误
This commit is contained in:
parent
6b2eccf99e
commit
81f4d33a4a
|
|
@ -366,7 +366,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||||
title: '租户管理',
|
title: '租户管理',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: false,
|
||||||
isAffix: true,
|
isAffix: true,
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['common'],
|
roles: ['common'],
|
||||||
|
|
@ -381,7 +381,7 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||||
title: '子账号管理',
|
title: '子账号管理',
|
||||||
isLink: '',
|
isLink: '',
|
||||||
isHide: false,
|
isHide: false,
|
||||||
isKeepAlive: true,
|
isKeepAlive: false,
|
||||||
isAffix: true,
|
isAffix: true,
|
||||||
isIframe: false,
|
isIframe: false,
|
||||||
roles: ['common'],
|
roles: ['common'],
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ const formData = reactive({
|
||||||
daterange: [],
|
daterange: [],
|
||||||
permissions: [...PERMISSIONS.map(() => 1)],
|
permissions: [...PERMISSIONS.map(() => 1)],
|
||||||
});
|
});
|
||||||
|
const oldPhone = ref('');
|
||||||
|
|
||||||
const validatePhone = (rule: any, value: any, callback: any) => {
|
const validatePhone = (rule: any, value: any, callback: any) => {
|
||||||
const phoneRegex = /^1[3456789]\d{9}$/;
|
const phoneRegex = /^1[3456789]\d{9}$/;
|
||||||
|
|
@ -98,6 +99,7 @@ const dialogTableVisible = ref(false);
|
||||||
function open(data) {
|
function open(data) {
|
||||||
dialogTableVisible.value = true;
|
dialogTableVisible.value = true;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
oldPhone.value = data.phone;
|
||||||
Object.assign(formData, { ...data, daterange: [data.validStart, data.validEnd], permissions: data.permissions.map((item) => item.enabled) });
|
Object.assign(formData, { ...data, daterange: [data.validStart, data.validEnd], permissions: data.permissions.map((item) => item.enabled) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +138,11 @@ async function submit() {
|
||||||
if (formData.id) {
|
if (formData.id) {
|
||||||
updateTenant(params).then((res) => {
|
updateTenant(params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
if(oldPhone.value !== formData.phone) {
|
||||||
|
ElMessage.success('租户手机号已更新,如需使用新手机号作为子账号登录,请手动修改!');
|
||||||
|
} else {
|
||||||
ElMessage.success('操作成功');
|
ElMessage.success('操作成功');
|
||||||
|
}
|
||||||
close();
|
close();
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg || '操作失败');
|
ElMessage.error(res.msg || '操作失败');
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="tenant">
|
<script setup lang="ts" name="tenantUser">
|
||||||
import { onMounted, ref, reactive } from 'vue';
|
import { onMounted, ref, reactive } from 'vue';
|
||||||
import { NextLoading } from '/@/utils/loading';
|
import { NextLoading } from '/@/utils/loading';
|
||||||
import tableComponents from '/@/components/tableComponents/index.vue';
|
import tableComponents from '/@/components/tableComponents/index.vue';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue