Skip to content

Commit

Permalink
feat(frontend): 单据管理迭代 TencentBlueKing#7190
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Nov 21, 2024
1 parent 9c672ad commit e02cd0d
Show file tree
Hide file tree
Showing 749 changed files with 20,016 additions and 18,674 deletions.
3 changes: 3 additions & 0 deletions dbm-ui/frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
dist
lib
patch
public
src/types/auto-imports.d.ts
Binary file modified dbm-ui/frontend/lib/bk-icon/fonts/iconcool.eot
Binary file not shown.
453 changes: 237 additions & 216 deletions dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dbm-ui/frontend/lib/bk-icon/fonts/iconcool.ttf
Binary file not shown.
Binary file modified dbm-ui/frontend/lib/bk-icon/fonts/iconcool.woff
Binary file not shown.
19 changes: 9 additions & 10 deletions dbm-ui/frontend/lib/bk-icon/iconcool.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dbm-ui/frontend/lib/bk-icon/iconcool.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions dbm-ui/frontend/lib/bk-icon/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
-moz-osx-font-smoothing: grayscale;
}

.db-icon-tags:before {
content: "\e206";
}
.db-icon-check-circle-fill:before {
content: "\e1a7";
}
Expand Down Expand Up @@ -497,6 +500,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.db-icon-backup-2:before {
content: "\e1af";
}
.db-icon-loading-tubiao:before {
content: "\e208";
}
.db-icon-host-select:before {
content: "\e1b0";
}
Expand Down Expand Up @@ -557,6 +563,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.db-icon-dirty-host:before {
content: "\e1ca";
}
.db-icon-tag-3:before {
content: "\e207";
}
.db-icon-saoba:before {
content: "\e1f4";
}
Expand Down
80 changes: 41 additions & 39 deletions dbm-ui/frontend/src/common/const/ticketTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,41 +44,43 @@ export enum TicketTypes {
MYSQL_ACCOUNT_RULE_CHANGE = 'MYSQL_ACCOUNT_RULE_CHANGE', // MySQL 权限变更
}
export enum TicketTypes {
REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY',
REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT',
REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE',
REDIS_BACKUP = 'REDIS_BACKUP',
REDIS_PURGE = 'REDIS_PURGE',
REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE',
REDIS_CLUSTER_APPLY = 'REDIS_CLUSTER_APPLY',
REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF',
REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY',
REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY',
REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE',
REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE',
REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR',
REDIS_DESTROY = 'REDIS_DESTROY',
REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN',
REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE',
REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB',
REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB',
REDIS_INS_APPLY = 'REDIS_INS_APPLY',
REDIS_INSTANCE_PROXY_CLOSE = 'REDIS_INSTANCE_PROXY_CLOSE',
REDIS_INSTANCE_PROXY_OPEN = 'REDIS_INSTANCE_PROXY_OPEN',
REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY',
REDIS_KEYS_DELETE = 'REDIS_KEYS_DELETE',
REDIS_KEYS_EXTRACT = 'REDIS_KEYS_EXTRACT',
REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH',
REDIS_PLUGIN_CREATE_CLB = 'REDIS_PLUGIN_CREATE_CLB',
REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB',
REDIS_PLUGIN_CREATE_POLARIS = 'REDIS_PLUGIN_CREATE_POLARIS',
REDIS_PLUGIN_DELETE_CLB = 'REDIS_PLUGIN_DELETE_CLB',
REDIS_PLUGIN_DELETE_POLARIS = 'REDIS_PLUGIN_DELETE_POLARIS',
REDIS_CLUSTER_CUTOFF = 'REDIS_CLUSTER_CUTOFF', // redis 整机替换
REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP', // redis 接入层扩容
REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN', // redis 接入层缩容
REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN', // redis 集群容量变更
REDIS_SCALE_UP = 'REDIS_SCALE_UP', // redis 存储层扩容
REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN', // redis 存储层缩容
REDIS_MASTER_SLAVE_SWITCH = 'REDIS_MASTER_SLAVE_SWITCH', // redis 主故障切换
REDIS_SLOTS_MIGRATE = 'REDIS_SLOTS_MIGRATE', // redis slots 迁移
REDIS_PLUGIN_DNS_BIND_CLB = 'REDIS_PLUGIN_DNS_BIND_CLB',
REDIS_PLUGIN_DNS_UNBIND_CLB = 'REDIS_PLUGIN_DNS_UNBIND_CLB',
REDIS_DATA_STRUCTURE = 'REDIS_DATA_STRUCTURE', // redis 定点构造
REDIS_DATA_STRUCTURE_TASK_DELETE = 'REDIS_DATA_STRUCTURE_TASK_DELETE', // redis 构造销毁
REDIS_CLUSTER_ADD_SLAVE = 'REDIS_CLUSTER_ADD_SLAVE', // redis 新建从库
REDIS_CLUSTER_DATA_COPY = 'REDIS_CLUSTER_DATA_COPY', // redis 数据复制
REDIS_CLUSTER_SHARD_NUM_UPDATE = 'REDIS_CLUSTER_SHARD_NUM_UPDATE', // redis 集群分片变更
REDIS_CLUSTER_TYPE_UPDATE = 'REDIS_CLUSTER_TYPE_UPDATE', // redis 集群类型变更
REDIS_DATACOPY_CHECK_REPAIR = 'REDIS_DATACOPY_CHECK_REPAIR', // redis 数据校验与修复
REDIS_CLUSTER_ROLLBACK_DATA_COPY = 'REDIS_CLUSTER_ROLLBACK_DATA_COPY', // redis 数据回写
REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE', // redis 版本升级
REDIS_INS_APPLY = 'REDIS_INS_APPLY', // redis 主从集群部署
REDIS_INSTANCE_OPEN = 'REDIS_INSTANCE_OPEN', // redis 主从集群启用
REDIS_INSTANCE_CLOSE = 'REDIS_INSTANCE_CLOSE', // redis 主从集群禁用
REDIS_INSTANCE_DESTROY = 'REDIS_INSTANCE_DESTROY', // redis 主从集群删除
REDIS_PURGE = 'REDIS_PURGE',
REDIS_PROXY_CLOSE = 'REDIS_PROXY_CLOSE',
REDIS_PROXY_OPEN = 'REDIS_PROXY_OPEN',
REDIS_PROXY_SCALE_DOWN = 'REDIS_PROXY_SCALE_DOWN',
REDIS_PROXY_SCALE_UP = 'REDIS_PROXY_SCALE_UP',
REDIS_SCALE_DOWN = 'REDIS_SCALE_DOWN',
REDIS_SCALE_UP = 'REDIS_SCALE_UP',
REDIS_SCALE_UPDOWN = 'REDIS_SCALE_UPDOWN',
REDIS_SLOTS_MIGRATE = 'REDIS_SLOTS_MIGRATE',
REDIS_VERSION_UPDATE_ONLINE = 'REDIS_VERSION_UPDATE_ONLINE',
}
export enum TicketTypes {
TENDBCLUSTER_APPLY = 'TENDBCLUSTER_APPLY',
Expand Down Expand Up @@ -118,27 +120,27 @@ export enum TicketTypes {
TENDBCLUSTER_ACCOUNT_RULE_CHANGE = 'TENDBCLUSTER_ACCOUNT_RULE_CHANGE', // spider 权限变更
}
export enum TicketTypes {
MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层
MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数
MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权
MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份
MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换
MONGODB_DISABLE = 'MONGODB_DISABLE', // mongodb禁用
MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启
MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请
MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请
MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用
MONGODB_DESTROY = 'MONGODB_DESTROY', // MongoDB 集群删除
MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更
MONGODB_ENABLE = 'MONGODB_ENABLE', // MongoDB 集群启用
MONGODB_EXCEL_AUTHORIZE = 'MONGODB_EXCEL_AUTHORIZE', // MongoDB 导入授权
MONGODB_AUTHORIZE_RULES = 'MONGODB_AUTHORIZE_RULES', // MongoDB 集群授权
MONGODB_EXCEL_AUTHORIZE_RULES = 'MONGODB_EXCEL_AUTHORIZE_RULES', // MongoDB 导入授权
MONGODB_EXEC_SCRIPT_APPLY = 'MONGODB_EXEC_SCRIPT_APPLY', // mongo 变更脚本执行
MONGODB_ADD_SHARD_NODES = 'MONGODB_ADD_SHARD_NODES', // mongo 扩容 shard 节点数
MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数
MONGODB_ADD_MONGOS = 'MONGODB_ADD_MONGOS', // mongo 扩容接入层
MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层
MONGODB_CUTOFF = 'MONGODB_CUTOFF', // mongo 整机替换
MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份
MONGODB_INSTANCE_RELOAD = 'MONGODB_INSTANCE_RELOAD', // mongodb重启
MONGODB_REMOVE_NS = 'MONGODB_REMOVE_NS', // mongo 清档
MONGODB_BACKUP = 'MONGODB_BACKUP', // mongo 库表备份
MONGODB_REDUCE_MONGOS = 'MONGODB_REDUCE_MONGOS', // mongo 缩容接入层
MONGODB_REDUCE_SHARD_NODES = 'MONGODB_REDUCE_SHARD_NODES', // mongo 缩容 shard 节点数
MONGODB_RESTORE = 'MONGODB_RESTORE', // mongo 定点构造
MONGODB_SCALE_UPDOWN = 'MONGODB_SCALE_UPDOWN', // MongoDB 分片式集群单个容量变更
MONGODB_SHARD_APPLY = 'MONGODB_SHARD_APPLY', // MongoDB 分片式集群部署申请
MONGODB_REPLICASET_APPLY = 'MONGODB_REPLICASET_APPLY', // MongoDB 副本集部署申请
MONGODB_TEMPORARY_DESTROY = 'MONGODB_TEMPORARY_DESTROY', // mongo 临时集群销毁
MONGODB_FULL_BACKUP = 'MONGODB_FULL_BACKUP', // mongo 全库备份
}
export enum TicketTypes {
SQLSERVER_SINGLE_APPLY = 'SQLSERVER_SINGLE_APPLY', // sqlserver单节点部署
Expand Down
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/common/importComps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ export const setGlobalComps = (app: App<Element>) => {
app.component('AuthSwitcher', AuthSwitch);
app.component('AuthRouterLink', AuthRouterLink);
app.component('BKTableColumn', Table.Column);

console.log('aapp = ', app);
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class="fail-tip">
&nbsp;,&nbsp;
<span style="color: #ea3636">{{ $t('执行失败') }}</span>
&nbsp;,&nbsp;{{ $t('待确认') }}
&nbsp;,&nbsp;{{ $t('待继续') }}
</span>
</div>
</div>
Expand Down
58 changes: 34 additions & 24 deletions dbm-ui/frontend/src/components/db-popconfirm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
</div>
<div
ref="popRef"
style="width: 280px; padding: 15px 10px">
:style="contentStyle">
<div style="font-size: 16px; line-height: 20px; color: #313238">
{{ title }}
</div>
<div style="margin-top: 10px; font-size: 12px; color: #63656e">
{{ content }}
<slot name="content">
{{ content }}
</slot>
</div>
<div style="margin-top: 16px; text-align: right">
<BkButton
Expand All @@ -51,14 +53,17 @@

interface Props {
title: string;
content: string;
content?: string;
placement?: Placement;
width?: number;
confirmHandler: () => Promise<any> | void;
cancelHandler?: () => Promise<any> | void;
}

const props = withDefaults(defineProps<Props>(), {
placement: 'top',
content: '',
width: 280,
cancelHandler: () => Promise.resolve(),
});

Expand All @@ -72,6 +77,11 @@
const popRef = ref();
const isConfirmLoading = ref(false);

const contentStyle = computed(() => ({
width: `${props.width}px`,
padding: '15px 10px',
}));

const handleConfirm = () => {
isConfirmLoading.value = true;
Promise.resolve()
Expand Down Expand Up @@ -114,7 +124,7 @@
{
name: 'flip',
options: {
fallbackPlacements: ['top-start', 'top-end'],
fallbackPlacements: ['top', 'bottom'],
allowedAutoPlacements: ['top-start', 'top-end'],
},
},
Expand Down Expand Up @@ -147,25 +157,25 @@
background-color: #fff;
}

.tippy-arrow {
position: absolute;
bottom: -6px !important;
left: 50% !important;
background: #fff;
border: 1px solid #dcdee5 !important;
transform: translateX(-50%) rotateZ(45deg) !important;
box-shadow: 0 0 6px 0 #dcdee5 !important;

&::before {
content: none;
}
}

&[data-placement^='top-end'] {
& > .tippy-arrow {
right: -6px;
left: unset !important;
}
}
// .tippy-arrow {
// position: absolute;
// bottom: -6px !important;
// left: 50% !important;
// background: #fff;
// border: 1px solid #dcdee5 !important;
// transform: translateX(-50%) rotateZ(45deg) !important;
// box-shadow: 0 0 6px 0 #dcdee5 !important;

// &::before {
// content: none;
// }
// }

// &[data-placement^='top-end'] {
// & > .tippy-arrow {
// right: -6px;
// left: unset !important;
// }
// }
}
</style>
5 changes: 5 additions & 0 deletions dbm-ui/frontend/src/components/db-search-select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
.search-container-selected {
height: 22px;
max-width: 250px !important;

.selected-name {
height: 22px;
overflow: hidden;
}
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
text
theme="primary"
@click="handleToggleMore">
{{ t('更多') }}
<DbIcon
class="ml-4"
:type="isMore ? 'up-big' : 'down-big'" />
<slot name="actionText">
{{ t('更多') }}
<DbIcon
class="ml-4"
:type="isMore ? 'up-big' : 'down-big'" />
</slot>
</BkButton>
</div>
</div>
</template>
<script setup lang="ts">
import { nextTick, onBeforeUpdate, onMounted, ref } from 'vue';
import { nextTick, onBeforeUpdate, onMounted, ref, type VNode } from 'vue';
import { useI18n } from 'vue-i18n';
interface Props {
Expand All @@ -39,6 +41,11 @@
expandable: true,
});
defineSlots<{
default?: () => VNode;
actionText?: () => VNode;
}>();
const { t } = useI18n();
const rootRef = ref<HTMLElement>();
Expand Down
37 changes: 18 additions & 19 deletions dbm-ui/frontend/src/components/scroll-faker/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@
scrollContent: any;
};
}
</script>
<script setup lang="ts">

interface Props {
theme?: string;
}
</script>
<script setup lang="ts">
withDefaults(defineProps<Props>(), {
theme: 'light',
});
Expand Down Expand Up @@ -129,21 +130,19 @@
handleCalcScroller();
});

const getScroll = () => {
const { scrollLeft, scrollTop } = scrollContent.value;
return {
scrollLeft,
scrollTop,
};
};

const scrollTo = (scrollLeft: number, scrollTop: number) => {
scrollContent.value.scrollTo(scrollLeft, scrollTop);
};

defineExpose({
getScroll,
scrollTo,
getScroll: () => {
const { scrollLeft, scrollTop } = scrollContent.value;
return {
scrollLeft,
scrollTop,
};
},
scrollTo: (scrollLeft: number, scrollTop: number) => {
scrollContent.value.scrollTo(scrollLeft, scrollTop);
verticalScroll.value?.scrollTo(0, scrollTop);
horizontalScrollbar.value?.scrollTo(scrollLeft, 0);
},
boxState,
});
</script>
Expand Down Expand Up @@ -177,9 +176,9 @@
}

& > .scroll-faker-content {
height: inherit;
max-width: inherit;
max-height: inherit;
height: 100%;
max-width: 100%;
max-height: 100%;
overflow: scroll;

&::-webkit-scrollbar {
Expand Down
Loading

0 comments on commit e02cd0d

Please sign in to comment.