fix: 全局bug调整

This commit is contained in:
xinxin.wu 2024-03-01 13:38:30 +08:00 committed by 刘瑞斌
parent e1c098cbc9
commit dd470ba328
13 changed files with 55 additions and 33 deletions

View File

@ -239,7 +239,9 @@
watchEffect(() => {
if (switchOrgVisible.value || menuSwitchOrgVisible.value) {
getOrgList();
if (appStore.packageType === 'enterprise' && licenseStore.hasLicense()) {
getOrgList();
}
nextTick(() => {
//
const activeOrgDom = document.querySelector('.switch-org-dropdown-list')?.querySelector('.active-org');

View File

@ -21,10 +21,12 @@
import usePermission from '@/hooks/usePermission';
import appClientMenus from '@/router/app-menus';
import { useAppStore } from '@/store';
import useLicenseStore from '@/store/modules/setting/license';
import { listenerRouteChange } from '@/utils/route-listener';
import { RouteEnum } from '@/enums/routeEnum';
const licenseStore = useLicenseStore();
const copyRouters = cloneDeep(appClientMenus) as RouteRecordRaw[];
const permission = usePermission();
const appStore = useAppStore();
@ -85,9 +87,9 @@
const filterMenuTopRouter =
currentParent?.children?.filter((item: any) => {
if (permission.accessRouter(item) && item.meta?.isTopMenu) {
if (item.name === RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT) {
return appStore.packageType === 'enterprise';
}
// if (item.name === RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT) {
// return appStore.packageType === 'enterprise';
// }
return true;
}
return false;
@ -112,9 +114,30 @@
activeMenus.value = [appStore.getCurrentTopMenu?.name || ''];
}
onBeforeMount(() => {
appStore.initSystemPackage();
});
watch(
() => appStore.currentOrgId,
async () => {
await appStore.initSystemPackage();
if (appStore.packageType === 'enterprise') {
licenseStore.getValidateLicense();
}
},
{
immediate: true,
}
);
watch(
() => appStore.packageType,
(val) => {
const topMenus = appStore.getTopMenus;
if (val === 'enterprise') {
appStore.setTopMenus(topMenus);
} else {
appStore.setTopMenus(topMenus.filter((item) => item.name !== RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT));
}
}
);
</script>
<style lang="less" scoped>

View File

@ -1,4 +1,4 @@
export default {
'formCreate.PleaseEnter': '默认值',
'formCreate.PleaseEnter': '请输入',
'formCreate.PleaseSelect': '请选择',
};

View File

@ -155,10 +155,13 @@
import { LOCALE_OPTIONS } from '@/locale';
import useLocale from '@/locale/useLocale';
import useAppStore from '@/store/modules/app';
import useLicenseStore from '@/store/modules/setting/license';
import useUserStore from '@/store/modules/user';
import { IconInfoCircle, IconQuestionCircle } from '@arco-design/web-vue/es/icon';
const licenseStore = useLicenseStore();
const props = defineProps<{
isPreview?: boolean;
logo?: string;

View File

@ -11,10 +11,6 @@ export default function setupUserLoginInfoGuard(router: Router) {
clearToken();
}
if (to.name !== 'login' && hasToken(to.name as string)) {
const appStore = useAppStore();
if (!appStore.packageType) {
await appStore.initSystemPackage();
}
next();
} else {
// 未登录的都直接跳转至登录页,访问的页面地址缓存到 query 上

View File

@ -240,8 +240,6 @@ const useAppStore = defineStore('app', {
async initSystemPackage() {
try {
this.packageType = await getPackageType();
// await getPackageType();
// this.packageType = 'community';
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);

View File

@ -23,14 +23,11 @@ const useLicenseStore = defineStore('license', {
async getValidateLicense() {
const appStore = useAppStore();
try {
await appStore.initSystemPackage();
if (appStore.packageType === 'enterprise') {
const result = await getLicenseInfo();
if (!result || !result.status || !result.license || !result.license.count) {
return;
}
this.setLicenseStatus(result.status);
const result = await getLicenseInfo();
if (!result || !result.status || !result.license || !result.license.count) {
return;
}
this.setLicenseStatus(result.status);
} catch (error) {
console.log(error);
}

View File

@ -84,9 +84,8 @@ const useUserStore = defineStore('user', {
async login(loginForm: LoginData) {
try {
const res = await userLogin(loginForm);
const licenseStore = useLicenseStore();
const appStore = useAppStore();
licenseStore.getValidateLicense();
setToken(res.sessionId, res.csrfToken);
appStore.setCurrentOrgId(res.lastOrganizationId || '');

View File

@ -1210,7 +1210,7 @@
title: item.fieldName,
slotName: item.fieldId as string,
dataIndex: item.fieldId,
showInTable: true,
showInTable: false,
showDrag: true,
width: 300,
};

View File

@ -731,7 +731,7 @@
async function handleBatchDelete() {
openModal({
type: 'error',
title: t('caseManagement.featureCase.batchDeleteCompleted', {number: batchParams.value.currentSelectCount}),
title: t('caseManagement.featureCase.batchDeleteCompleted', { number: batchParams.value.currentSelectCount }),
content: t('caseManagement.featureCase.cleanOutDeleteOnRecycleTip'),
okText: t('common.confirmDelete'),
cancelText: t('common.cancel'),
@ -791,7 +791,7 @@
function handleBatchCleanOut(record: CaseManagementTable) {
openModal({
type: 'error',
title: t('caseManagement.featureCase.completedDeleteCaseTitle', {name: characterLimit(record.name)}),
title: t('caseManagement.featureCase.completedDeleteCaseTitle', { name: characterLimit(record.name) }),
content: t('caseManagement.featureCase.cleanOutDeleteOnRecycleTip'),
okText: t('common.confirmDelete'),
cancelText: t('common.cancel'),
@ -854,7 +854,7 @@
title: item.fieldName,
slotName: item.fieldId as string,
dataIndex: item.fieldId,
showInTable: true,
showInTable: false,
showDrag: true,
width: 300,
};
@ -1010,10 +1010,10 @@
onMounted(async () => {
getRecycleModules();
await getDefaultFields();
await initFilter();
initRecycleList();
});
await getDefaultFields();
</script>
<style scoped lang="less">

View File

@ -285,7 +285,11 @@ export const getTotalFieldOptionList = (totalData: DefinedFieldItem[]) => {
effect: {
required: false,
},
props: { ...currentFormRules.props, options: selectOptions },
props: {
...currentFormRules.props,
options: selectOptions,
placeholder: t('system.orgTemplate.defaultValue'),
},
},
],
fApi: null,

View File

@ -128,7 +128,7 @@ export default {
'system.orgTemplate.deleteStateContent':
'After delete, will be effective in the project and delete irrevocable, please careful operation.',
'system.orgTemplate.deleteFiledContent':
'After deleting fields will be removed from the field list, please careful operation.',
'This field has been used in the template, data will be lost after deletion, please be careful!',
'system.orgTemplate.deleteSuccess': 'Delete Successfully',
'system.orgTemplate.setInitStateSuccess': 'Set the initial state successfully',
'system.orgTemplate.setEndStateSuccess': 'Setting the end status succeeded',
@ -179,7 +179,7 @@ export default {
'system.orgTemplate.templateBug': 'Bug',
'system.orgTemplate.enableTip': 'Are you sure to enable the project template',
'system.orgTemplate.enableWarningTip': 'Enabled, irreversible for organization template, please careful operation.',
'system.orgTemplate.typeEmptyTip': 'The type cannot be empty',
'system.orgTemplate.typeEmptyTip': 'The filed type cannot be empty',
'system.orgTemplate.searchOrgPlaceholder': 'Please enter the organization name :{name}',
'system.orgTemplate.associatedField': 'Associated field ',
'system.orgTemplate.associatedHasField': 'Associate an added field',

View File

@ -122,7 +122,7 @@ export default {
'system.orgTemplate.setInitState': '设为初始态',
'system.orgTemplate.deleteStateTitle': '确定删除 {name} 状态吗?',
'system.orgTemplate.deleteStateContent': '删除后,会在项目中立即生效且删除不可撤回,请谨慎操作!',
'system.orgTemplate.deleteFiledContent': '删除后,字段将从字段列表移除,请谨慎操作!',
'system.orgTemplate.deleteFiledContent': '该字段在模板中已使用,删除后数据将会丢失,请谨慎操作!',
'system.orgTemplate.deleteSuccess': '删除成功',
'system.orgTemplate.setInitStateSuccess': '设置初始态成功',
'system.orgTemplate.setEndStateSuccess': '设置结束状态成功',
@ -168,7 +168,7 @@ export default {
'system.orgTemplate.templateBug': '缺陷',
'system.orgTemplate.enableTip': '确认启用项目模版吗',
'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!',
'system.orgTemplate.typeEmptyTip': '类型不能为空',
'system.orgTemplate.typeEmptyTip': '字段类型不能为空',
'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称: {name} ',
'system.orgTemplate.associatedField': '关联字段 ',
'system.orgTemplate.associatedHasField': '关联已添加的字段',