feat(系统设置): 增加license数量超额提示

--story=1007021 --user=李玉号 增加license友好提示
https://www.tapd.cn/55049933/s/1133154
This commit is contained in:
shiziyuan9527 2022-04-12 14:33:11 +08:00 committed by shiziyuan9527
parent 45dcce3ec9
commit e847f0c602
11 changed files with 44 additions and 9 deletions

View File

@ -124,6 +124,11 @@ public class SystemParameterController {
return systemStatisticData;
}
@GetMapping("/user/size")
public long getSystemUserCount() {
return userService.getUserSize();
}
@GetMapping("/get/info/{key}")
public SystemParameter getInfo(@PathVariable String key) {
return systemParameterService.getInfo(key);

@ -1 +1 @@
Subproject commit 71672216eed47c925023791d964c18b0d48fe402
Subproject commit e2984c40b818db7b3a7da75c9d130c85da7598e9

View File

@ -1,14 +1,24 @@
<template>
<el-container class="ms-container">
<slot></slot>
</el-container>
<div>
<el-alert
v-if="isShowWarning"
:title="$t('license.count_warning')"
type="warning"
center
:closable="false"
show-icon>
</el-alert>
<el-container class="ms-container">
<slot></slot>
</el-container>
</div>
</template>
<script>
export default {
name: "MsContainer"
name: "MsContainer",
props: ['isShowWarning']
}
</script>

View File

@ -1,5 +1,5 @@
<template>
<ms-container>
<ms-container :is-show-warning="isShowWarning && isSystemGroup">
<ms-aside-container>
<ms-current-user/>
@ -22,10 +22,25 @@ import MsSettingMenu from "./SettingMenu";
import MsAsideContainer from "../common/components/MsAsideContainer";
import MsContainer from "../common/components/MsContainer";
import MsMainContainer from "../common/components/MsMainContainer";
import {getCurrentUser} from "@/common/js/utils";
import {GROUP_SYSTEM} from "@/common/js/constants";
export default {
name: "MsSetting",
components: {MsMainContainer, MsContainer, MsAsideContainer, MsSettingMenu, MsCurrentUser},
computed: {
isShowWarning() {
return this.$store.state.showLicenseCountWarning;
},
isSystemGroup() {
let user = getCurrentUser();
if (user && user.groups) {
let group = user.groups.filter(gp => gp && gp.type === GROUP_SYSTEM);
return group.length > 0;
}
return false;
}
}
};
</script>

@ -1 +1 @@
Subproject commit 2f477539fa0226a88cb117a4e2ba104dda7697fc
Subproject commit 25095c2a984fe8c9120dbfb9bda16449f71c971d

View File

@ -108,7 +108,7 @@ router.afterEach(() => {
export function getLicense(callback) {
return baseGet("/license/valid", data => {
validateAndSetLicense(data);
if (callback) callback();
if (callback) callback(data);
});
}

View File

@ -462,6 +462,7 @@ export default {
status: 'Valid State',
valid: 'Valid',
invalid: 'invalid',
count_warning: 'The number of system users has exceeded the license limit. Please contact the staff as soon as possible.',
expired: 'expired',
},
workstation: {

View File

@ -464,6 +464,7 @@ export default {
status: '授权状态',
valid: '有效',
invalid: '无效',
count_warning: '系统用户数已超过license限制数量请尽快联系工作人员。',
expired: '已过期',
},
workstation: {

View File

@ -464,6 +464,7 @@ export default {
status: '授權狀態',
valid: '有效',
invalid: '無效',
count_warning: '系統用戶數已超過license限制數量請盡快聯繫工作人員。',
expired: '已過期',
},
workstation: {

View File

@ -45,6 +45,7 @@ const state = {
librarySelectElement: {},
uiElementLibraryModuleIds: null,
refreshUiScenario: false,
showLicenseCountWarning: false
}
const store = new Vuex.Store({

View File

@ -28,6 +28,7 @@ const mutations = {
setUiElementLibraryModuleIds: (state, value) => state.uiElementLibraryModuleIds = value,
setRefreshUiScenario: (state, value) => state.refreshUiScenario = value,
setSelectUiGroup: (state, value) => state.selectUiGroup = value,
setShowLicenseCountWarning: (state, value) => state.showLicenseCountWarning = value,
}
export default mutations;