Skip to content

Commit

Permalink
feat(frontend): 新增单据通知设置页面 TencentBlueKing#8335
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Dec 2, 2024
1 parent d2737e4 commit 8e50e74
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 58 deletions.
70 changes: 14 additions & 56 deletions dbm-ui/frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,19 @@
{
"eslint.validate": ["javascript", "javascriptreact", "html", "vue"],
"eslint.alwaysShowStatus": true,
"files.eol": "\n",
"editor.unfoldOnClickAfterEndOfLine": true,
"editor.tabSize": 2,
"diffEditor.ignoreTrimWhitespace": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"editor.fontLigatures": false,
"editor.fontVariations": false,
"i18n-lazyer.defaultFolder": "/src/locales",
"search.smartCase": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"css.validate": false,
"stylelint.enable": true,
"scss.validate": false,
"stylelint.validate": ["css", "scss", "vue"],
"preCI.localCodeCheck.filter.whitePath": "",
"preCI.localCodeCheck.filter.skipPath": "",
"preCI.localCodeCheck.checkerSet.JS": ["standard_js"],
"peacock.remoteColor": "#45e35f",
"bk-code-ai.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#65c89b",
"activityBar.background": "#65c89b",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#945bc4",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#65c89b",
"statusBar.background": "#42b883",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#359268",
"statusBarItem.remoteBackground": "#42b883",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#42b883",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#42b88399",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#42b883"
}
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
12 changes: 12 additions & 0 deletions dbm-ui/frontend/src/layout/components/ConfigManage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
{{ t('单据免审批设置') }}
</span>
</BkMenuItem>
<BkMenuItem
key="TicketNotice"
v-db-console="'bizConfigManage.ticketNotice'">
<template #icon>
<DbIcon type="db-config" />
</template>
<span
v-overflow-tips.right
class="text-overflow">
{{ t('单据通知') }}
</span>
</BkMenuItem>
</BkMenuGroup>
<BkMenuGroup :name="t('设置')">
<BkMenuItem
Expand Down
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1644,5 +1644,6 @@
"分片集群": "Sharded Cluster",
"主从管理": "HA Management",
"DB 重命名:database 重命名": "DB Rename:database rename",
"这行勿动!新增翻译请在上一行添加!": ""
"这行勿动!新增翻译请在上一行添加!": "",
"单据通知": ""
}
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3658,5 +3658,6 @@
"点击上传": "点击上传",
"请选择本地 SQL 文件": "请选择本地 SQL 文件",
"这行勿动!新增翻译请在上一行添加!": ""

,
"单据通知": "单据通知"
}
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import getTemporaryPasswordModify from '@views/temporary-paassword-modify/routes
import getTicketFlowSettingBizRoutes from '@views/ticket-flow-setting-biz/routes';
import getTicketFlowSettingGlobalRoutes from '@views/ticket-flow-setting-global/routes';
import getTicketManageRoutes from '@views/ticket-manage/routes';
import getTicketNoticeRoutes from '@views/ticket-notice/routes';
import getTicketSelfApplyRoutes from '@views/ticket-self-apply/routes';
import getTicketSelfManageRoutes from '@views/ticket-self-manage/routes';
import getTicketSelfTodoRoutes from '@views/ticket-self-todo/routes';
Expand Down Expand Up @@ -127,6 +128,7 @@ export default () => {
...getTemporaryPasswordModify(),
...getTicketFlowSettingBizRoutes(),
...getTicketFlowSettingGlobalRoutes(),
...getTicketNoticeRoutes(),
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ interface ControllerData {
'bizConfigManage.dbConfigure': ControllerItem<string>;
'bizConfigManage.StaffManage': ControllerItem<string>;
'bizConfigManage.ticketFlowSetting': ControllerItem<string>;
'bizConfigManage.ticketNotice': ControllerItem<string>;
databaseManage: ControllerItem<string>;
'databaseManage.missionManage': ControllerItem<string>;
'databaseManage.whitelistManage': ControllerItem<string>;
Expand Down Expand Up @@ -219,6 +220,7 @@ export default class FunctionController {
'bizConfigManage.dbConfigure': ControllerItem<string>;
'bizConfigManage.StaffManage': ControllerItem<string>;
'bizConfigManage.ticketFlowSetting': ControllerItem<string>;
'bizConfigManage.ticketNotice': ControllerItem<string>;
databaseManage: ControllerItem<string>;
'databaseManage.missionManage': ControllerItem<string>;
'databaseManage.whitelistManage': ControllerItem<string>;
Expand Down
78 changes: 78 additions & 0 deletions dbm-ui/frontend/src/views/ticket-notice/Index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
-->

<template>
<SmartAction
class="apply-doris-page"
:offset-target="getSmartActionOffsetTarget">
<BkTable :data="tableData">
<template
v-for="column in columns"
:key="column.label">
<BkTableColumn
:field="column.field"
:index="column.index"
:label="column.label"
:width="column.width" />
</template>
</BkTable>
<template #action>
<div>
<BkButton
class="w-88"
:loading="isSubmitting"
theme="primary"
@click="handleSubmit">
{{ t('提交') }}
</BkButton>
<BkButton
class="ml8 w-88"
:disabled="isSubmitting"
@click="handleReset">
{{ t('重置') }}
</BkButton>
</div>
</template>
</SmartAction>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';

const { t } = useI18n();

const tableData = ref([]);
const isSubmitting = ref(false);

const columns = [
{ label: '序号', type: 'index', width: '120px', index: 0 },
{ label: '名称/内网IP', field: 'ip', width: '320px', index: 1 },
];

const getSmartActionOffsetTarget = () => document.querySelector('.bk-form-content');

const handleSubmit = () => {};

const handleReset = () => {};
</script>

<style lang="less" scoped>
.apply-doris-page {
display: block;

.db-card {
& ~ .db-card {
margin-top: 20px;
}
}
}
</style>
31 changes: 31 additions & 0 deletions dbm-ui/frontend/src/views/ticket-notice/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
*
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at https://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the License.
*/
import { checkDbConsole } from '@utils';

import { t } from '@locales/index';

const routes = [
{
name: 'TicketNotice',
path: 'ticket-notice',
meta: {
navName: t('单据通知'),
fullscreen: true,
},
component: () => import('@views/ticket-notice/Index.vue'),
},
];

export default function getRoutes() {
return checkDbConsole('bizConfigManage.ticketNotice') ? routes : [];
}

0 comments on commit 8e50e74

Please sign in to comment.