diff --git a/.gitignore b/.gitignore index 08ad47ef2..67773e1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ logs build.yml .codecc/ .vscode/ + + +pre-*-bkcodeai +bkcodeai.json diff --git a/frontend/package.json b/frontend/package.json index 196869130..66d6fd3ae 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -95,7 +95,7 @@ "acorn": "~6.4.2", "ansi-html-community": "0.0.8", "art-template": "^4.13.2", - "axios": "^0.21.3", + "axios": "^1.6.8", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "~10.0.1", "babel-helper-vue-jsx-merge-props": "^2.0.3", @@ -106,7 +106,7 @@ "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-vue-jsx": "^4.0.1", "better-npm-run": "~0.1.1", - "bk-magic-vue": "^2.5.7", + "bk-magic-vue": "^2.5.9-beta.17", "body-parser": "~1.19.0", "chalk": "~2.4.2", "cheerio": "~1.0.0-rc.3", @@ -169,9 +169,9 @@ "postcss-url": "~8.0.0", "query-string": "~6.5.0", "rimraf": "~2.6.3", - "semver": "~6.1.0", + "semver": "~7.5.2", "shelljs": "~0.8.3", - "terser-webpack-plugin": "~1.2.4", + "terser-webpack-plugin": "~4.2.3", "transliteration": "~2.1.3", "url-loader": "~1.1.2", "url-parse": ">=1.5.3", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6ef1c6d32..8c905f566 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,7 +8,7 @@ { 'no-perm-app-layout': ['403'].includes(routeName) } ]"> @@ -33,11 +33,14 @@ :route-name="routeName" :user-group-id="userGroupId"> - - @@ -80,6 +83,7 @@ provide () { return { reload: this.reload, + reloadCurPage: this.reloadCurPage, showNoticeAlert: this.isShowNoticeAlert }; }, @@ -111,7 +115,7 @@ routeName: '', userGroupId: '', isRouterAlive: true, - showNoticeAlert: true, + showNoticeAlert: false, noticeApi: `${window.AJAX_URL_PREFIX}/notice/announcements/`, enableNotice: window.ENABLE_BK_NOTICE.toLowerCase() === 'true' }; @@ -119,7 +123,10 @@ computed: { ...mapGetters(['mainContentLoading', 'user', 'externalSystemsLayout']), isShowNoticeAlert () { - return this.enableNotice && this.showNoticeAlert && !this.externalSystemsLayout.hideNoticeAlert; + return this.showNoticeAlert && this.isEnableNoticeAlert; + }, + isEnableNoticeAlert () { + return this.enableNotice && !this.externalSystemsLayout.hideNoticeAlert; } }, watch: { @@ -329,7 +336,7 @@ }, handleShowAlertChange (isShow) { - console.log(444, isShow); + console.log(isShow, '跑马灯回调'); this.showNoticeAlert = isShow; } } @@ -400,11 +407,26 @@ } + .user-org-perm-container { + .main-scroller { + height: calc(100% + 278px); + } + .views-layout { + min-width: 100%; + overflow: hidden; + } + } + .notice-app-layout { height: calc(100% - 101px) !important; .main-scroller { height: calc(100% + 91px); } + .user-org-perm-container { + .main-scroller { + height: calc(100% + 312px); + } + } } .no-perm { @@ -414,5 +436,4 @@ background-color: #ffffff; } } - diff --git a/frontend/src/common/router-handle.js b/frontend/src/common/router-handle.js index c2470b621..2639c2c48 100644 --- a/frontend/src/common/router-handle.js +++ b/frontend/src/common/router-handle.js @@ -23,7 +23,7 @@ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ - + /** * 获取不同身份的router差异 * @@ -57,7 +57,8 @@ export const getRouterDiff = (payload) => { 'userGroupSetting', 'sensitivityLevel', 'memberTemplate', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; } if (payload === 'super_manager') { @@ -95,7 +96,8 @@ export const getRouterDiff = (payload) => { 'permTransfer', 'myManageSpaceSubDetail', 'sensitivityLevel', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; } if (payload === 'system_manager') { @@ -122,12 +124,11 @@ export const getRouterDiff = (payload) => { 'systemAccessRegistry', 'systemAccessOptimize', 'systemAccessComplete', - 'resourcePermiss', 'firstManageSpace', 'secondaryManageSpace', 'authorBoundary', 'myManageSpace', - 'sensitivityLevel' + 'userOrgPerm' ]; } if (payload === 'rating_manager') { @@ -197,7 +198,8 @@ export const getRouterDiff = (payload) => { 'userGroupSetting', 'sensitivityLevel', 'memberTemplate', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; } // payload其它取值默认返回全部菜单 @@ -243,13 +245,15 @@ export const getRouterDiff = (payload) => { 'authorBoundaryEditSecondLevel', 'secondaryManageSpace', 'myManageSpace', - 'MyManageSpaceCreate', - 'ResourcePermManage' + 'myManageSpaceCreate', + 'resourcePermManage', + 'resourcePermiss', + 'sensitivityLevel' ]; }; // 导航路由 -export const getNavRouterDiff = (navIndex) => { +export const getNavRouterDiff = (navIndex, managerPerm = '') => { if (navIndex === 0 || navIndex === '') { return [ 'userGroup', @@ -274,7 +278,8 @@ export const getNavRouterDiff = (navIndex) => { 'userGroupSetting', 'sensitivityLevel', 'memberTemplate', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; } @@ -325,12 +330,13 @@ export const getNavRouterDiff = (navIndex) => { 'userGroupSetting', 'sensitivityLevel', 'memberTemplate', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; } if (navIndex === 3) { - return [ + const menuList = [ 'applyCustomPerm', 'applyProvisionPerm', 'applyJoinUserGroup', @@ -355,15 +361,40 @@ export const getNavRouterDiff = (navIndex) => { 'permTemplate', 'permTemplateDetail', 'permTemplateCreate', - 'approvalProcess', 'authorBoundary', 'secondaryManageSpace', 'myManageSpace', + 'myManageSpaceCreate', 'secondaryManageSpaceCreate', 'secondaryManageSpaceDetail', + 'authorBoundaryEditFirstLevel', + 'authorBoundaryEditSecondLevel', + 'permTemplateEdit', + 'permTemplateDiff', + 'addGroupPerm', + 'groupPermRenewal', 'userGroupSetting', 'memberTemplate', - 'resourcePermManage' + 'resourcePermManage', + 'userOrgPerm' ]; + if (['hasSystemNoSuperManager'].includes(managerPerm)) { + // 非超管用户隐藏的路由 + const hideMenuList = [ + 'user', + 'approvalProcess', + 'ratingManager', + 'gradingAdminCreate', + 'gradingAdminDetail', + 'gradingAdminEdit', + 'gradingAdminUpdateTemplate' + ]; + const systemManagerMenu = [ + ...menuList, + ...hideMenuList + ]; + return systemManagerMenu; + } + return menuList; } }; diff --git a/frontend/src/common/util.js b/frontend/src/common/util.js index 3fdabaa35..de83cc12c 100644 --- a/frontend/src/common/util.js +++ b/frontend/src/common/util.js @@ -709,3 +709,23 @@ export function isEmojiCharacter (str) { } } } + +// 获取当前unix时间戳 +export function getNowTimeExpired () { + const nowTimestamp = +new Date() / 1000; + const timeList = String(nowTimestamp).split(''); + const timeIndex = timeList.findIndex((item) => item === '.'); + const timestamp = parseInt(timeList.splice(0, timeIndex).join(''), 10); + return timestamp; +} + +// 查找当前管理员最大身份划分导航栏下菜单 +export function getManagerMenuPerm (payload) { + const isSystemManager = payload.find((item) => ['system_manager'].includes(item.type)); + const isSuperManager = payload.find((item) => ['super_manager'].includes(item.type)); + // 最大为系统管理员 + if (isSystemManager && !isSuperManager) { + return 'hasSystemNoSuperManager'; + } + return ''; +} diff --git a/frontend/src/components/choose-ip/topology-tree.vue b/frontend/src/components/choose-ip/topology-tree.vue index 45c0c94fd..d8eb2b1d7 100644 --- a/frontend/src/components/choose-ip/topology-tree.vue +++ b/frontend/src/components/choose-ip/topology-tree.vue @@ -30,7 +30,7 @@ ref="topologyTableRef" size="small" data-test-id="topology_tree_group" - ext-cls="topology-tree-table" + :ext-cls="formatTableCls" :header-border="false" :outer-border="false" :max-height="formatTableHeight" @@ -220,7 +220,7 @@ ref="topologyTableRef" size="small" data-test-id="topology_tree_group" - ext-cls="topology-tree-table" + :ext-cls="formatTableCls" :header-border="false" :outer-border="false" :data="renderTopologyData" @@ -758,6 +758,12 @@ return false; }; }, + formatTableCls () { + if (this.resourceValue) { + return 'topology-tree-table topology-tree-table-radio'; + } + return 'topology-tree-table'; + }, isTreeEmpty () { return this.allTreeData.filter((item) => item.type === 'node').length === 0 || this.searchDisplayText === this.$t(`m.common['搜索结果为空']`); } @@ -2011,4 +2017,15 @@ } } } +/deep/ .topology-tree-table { + &.topology-tree-table-radio { + .bk-table-header-wrapper { + .cell { + .bk-form-checkbox { + display: none !important; + } + } + } + } +} diff --git a/frontend/src/components/custom-perm-system-policy/index.vue b/frontend/src/components/custom-perm-system-policy/index.vue index a61568ca3..3b27112d5 100644 --- a/frontend/src/components/custom-perm-system-policy/index.vue +++ b/frontend/src/components/custom-perm-system-policy/index.vue @@ -1,12 +1,21 @@