From c8cc9f09d50dce81b747260ae58ce9149c5d9dce Mon Sep 17 00:00:00 2001 From: hlinx <327159425@qq.com> Date: Mon, 8 Apr 2024 16:03:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E6=9D=83=E9=99=90=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20#3605?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/apply-items/BusinessItems.vue | 89 ++++--- .../apply-permission/render-result.vue | 6 +- .../src/components/auth-component/button.vue | 24 +- dbm-ui/frontend/src/layout/Index.vue | 2 +- .../src/layout/components/PlatformManage.vue | 2 +- dbm-ui/frontend/src/router/index.ts | 2 + dbm-ui/frontend/src/services/model/es/es.ts | 10 +- .../function-controller/functionController.ts | 2 +- .../src/services/model/monitor/duty-rule.ts | 6 + .../src/services/model/mysql/tendbha.ts | 3 +- .../src/services/model/mysql/tendbsingle.ts | 1 - .../model/notice-group/notice-group.ts | 2 - .../src/services/model/partition/partition.ts | 1 + .../src/services/model/spider/tendbCluster.ts | 7 +- dbm-ui/frontend/src/services/permission.ts | 37 ++- dbm-ui/frontend/src/services/source/cmdb.ts | 4 +- .../src/services/source/influxdbGroup.ts | 33 ++- .../src/services/source/monitorNoticeGroup.ts | 2 +- dbm-ui/frontend/src/stores/useUserProfile.ts | 6 +- .../src/views/duty-rule-manage/Index.vue | 16 ++ .../index}/Index.vue | 4 +- .../index}/components/content/Index.vue | 228 +++++++++++------- .../components/content/RenderRotateTable.vue | 0 .../components/edit-rule/CustomRotate.vue | 0 .../components/edit-rule/CycleRotate.vue | 0 .../index}/components/edit-rule/Index.vue | 0 .../components/edit-rule/SortTagInput.vue | 0 .../src/views/duty-rule-manage/routes.ts | 45 ++++ .../components/render-group/Index.vue | 87 ++++--- .../render-group/components/Create.vue | 8 +- .../monitor-alarm-db/alarm-group/Index.vue | 13 +- .../src/views/monitor-alarm-plat/routes.ts | 17 -- .../mysql/ha-cluster-list/components/List.vue | 191 +++++++-------- .../views/mysql/partition-manage/Index.vue | 50 ++-- .../common/const.ts | 0 .../components/AccountDialog.vue | 0 .../components/CreateRule.vue | 0 .../{permission => permission-rule}/index.vue | 198 +++++++-------- dbm-ui/frontend/src/views/mysql/routes.ts | 2 +- .../single-cluster-list/components/List.vue | 147 ++++++----- .../src/views/resource-manage/pool/Index.vue | 5 +- .../list/components/list/Index.vue | 222 +++++++++-------- .../spider-manage/partition-manage/Index.vue | 43 ++-- .../views/spider-manage/permission/Index.vue | 101 ++++---- .../spider-manage/permission/common/types.ts | 7 +- .../index/Index.vue | 8 +- 46 files changed, 916 insertions(+), 715 deletions(-) create mode 100644 dbm-ui/frontend/src/views/duty-rule-manage/Index.vue rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/Index.vue (96%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/content/Index.vue (74%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/content/RenderRotateTable.vue (100%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/edit-rule/CustomRotate.vue (100%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/edit-rule/CycleRotate.vue (100%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/edit-rule/Index.vue (100%) rename dbm-ui/frontend/src/views/{monitor-alarm-plat/rotation-setting => duty-rule-manage/index}/components/edit-rule/SortTagInput.vue (100%) create mode 100644 dbm-ui/frontend/src/views/duty-rule-manage/routes.ts rename dbm-ui/frontend/src/views/mysql/{permission => permission-rule}/common/const.ts (100%) rename dbm-ui/frontend/src/views/mysql/{permission => permission-rule}/components/AccountDialog.vue (100%) rename dbm-ui/frontend/src/views/mysql/{permission => permission-rule}/components/CreateRule.vue (100%) rename dbm-ui/frontend/src/views/mysql/{permission => permission-rule}/index.vue (75%) diff --git a/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue b/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue index 013541a884..00c08d59aa 100644 --- a/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue +++ b/dbm-ui/frontend/src/components/apply-items/BusinessItems.vue @@ -16,39 +16,41 @@ :label="t('所属业务')" property="bk_biz_id" required> - - + + import _ from 'lodash'; import { useI18n } from 'vue-i18n'; + import { useRequest } from 'vue-request'; import { useRoute } from 'vue-router'; import { getBizs } from '@services/source/cmdb'; import type { BizItem } from '@services/types'; - import { useGlobalBizs, useUserProfile } from '@stores'; + import { useUserProfile } from '@stores'; import { UserPersonalSettings } from '@common/const'; import { nameRegx } from '@common/regex'; @@ -94,7 +97,7 @@ perrmisionActionId: string; } - defineProps(); + const props = defineProps(); const emits = defineEmits(); @@ -113,14 +116,15 @@ const { t } = useI18n(); const route = useRoute(); - const { bizs: bizList } = useGlobalBizs(); const userProfile = useUserProfile(); + const bizList = shallowRef([]); const currentBiz = shallowRef(); const favorBizIdMap = shallowRef(makeMap(userProfile.profile[UserPersonalSettings.APP_FAVOR] || [])); const hasEnglishName = ref(false); + const appAbbrRef = ref(); - const withFavorBizList = computed(() => _.sortBy(bizList, (item) => favorBizIdMap.value[item.bk_biz_id])); + const withFavorBizList = computed(() => _.sortBy(bizList.value, (item) => favorBizIdMap.value[item.bk_biz_id])); const dbAppAbbrPlaceholder = t('以小写英文字母开头_且只能包含英文字母_数字_连字符'); @@ -142,7 +146,16 @@ }, ]; - const appAbbrRef = ref(); + const { loading: isBizLoading } = useRequest(getBizs, { + defaultParams: [ + { + action: props.perrmisionActionId, + }, + ], + onSuccess(result) { + bizList.value = result; + }, + }); watch( route, @@ -160,7 +173,7 @@ watch( bizId, () => { - currentBiz.value = _.find(bizList, (item) => item.bk_biz_id === bizId.value); + currentBiz.value = _.find(bizList.value, (item) => item.bk_biz_id === bizId.value); const englishName = currentBiz.value?.english_name; hasEnglishName.value = !!englishName; appAbbr.value = englishName ?? ''; diff --git a/dbm-ui/frontend/src/components/apply-permission/render-result.vue b/dbm-ui/frontend/src/components/apply-permission/render-result.vue index e7df7ac710..36235a0746 100644 --- a/dbm-ui/frontend/src/components/apply-permission/render-result.vue +++ b/dbm-ui/frontend/src/components/apply-permission/render-result.vue @@ -25,8 +25,8 @@ - - + + @@ -41,7 +41,7 @@

- {{ resourceItem.type }}-{{ resourceItem.instances.join(',') }} + {{ resourceItem.type }}:{{ resourceItem.instances.join(',') }}

--

diff --git a/dbm-ui/frontend/src/components/auth-component/button.vue b/dbm-ui/frontend/src/components/auth-component/button.vue index a899c33a2d..c8ed1ee9d9 100644 --- a/dbm-ui/frontend/src/components/auth-component/button.vue +++ b/dbm-ui/frontend/src/components/auth-component/button.vue @@ -4,19 +4,16 @@ v-bind="attrs"> - - - - - + v-cursor + class="auth-button-disable" + v-bind="inheritAttrs" + :disabled="false" + :loading="loading" + @click.stop="handleRequestPermission"> + + diff --git a/dbm-ui/frontend/src/views/mysql/partition-manage/Index.vue b/dbm-ui/frontend/src/views/mysql/partition-manage/Index.vue index 39b728c8ec..16b5439ad5 100644 --- a/dbm-ui/frontend/src/views/mysql/partition-manage/Index.vue +++ b/dbm-ui/frontend/src/views/mysql/partition-manage/Index.vue @@ -203,7 +203,7 @@ { label: t('最近一次执行状态'), field: 'status', - minWidth: 150, + width: 200, render: ({ data }: {data: PartitionModel}) => (
data.executeTimeDisplay || '--', }, { @@ -248,7 +248,7 @@ theme="primary" text actionId="mysql_partition_enable_disable" - resource={data.id} + resource={data.cluster_id} permission={data.permission.mysql_partition_enable_disable} onClick={() => handleEnable(data)}> {t('启用')} @@ -283,17 +283,21 @@ disabled={data.isRunning} actionId="mysql_partition_update" permission={data.permission.mysql_partition_update} + resource={data.cluster_id} onClick={() => handleEdit(data)}> {t('编辑')} - handleShowExecuteLog(data)}> {t('执行记录')} - + {{ default: () => ( @@ -301,35 +305,29 @@ { data.isOnline && ( handleDisable(data)}> - { t('禁用') } + resource={data.cluster_id}> +
handleDisable(data)}>{ t('禁用') }
) } handleClone(data)}> - { t('克隆') } + permission={data.permission.mysql_partition_create}> +
handleClone(data)}>{ t('克隆') }
+
+ + handleRemove(data)} + content={t('删除操作无法撤回,请谨慎操作!')} + title={t('确认删除该分区策略?')}> +
{ t('删除') }
+
- handleRemove(data)} - content={t('删除操作无法撤回,请谨慎操作!')} - title={t('确认删除该分区策略?')}> - - { t('删除') } - - ), }} diff --git a/dbm-ui/frontend/src/views/mysql/permission/common/const.ts b/dbm-ui/frontend/src/views/mysql/permission-rule/common/const.ts similarity index 100% rename from dbm-ui/frontend/src/views/mysql/permission/common/const.ts rename to dbm-ui/frontend/src/views/mysql/permission-rule/common/const.ts diff --git a/dbm-ui/frontend/src/views/mysql/permission/components/AccountDialog.vue b/dbm-ui/frontend/src/views/mysql/permission-rule/components/AccountDialog.vue similarity index 100% rename from dbm-ui/frontend/src/views/mysql/permission/components/AccountDialog.vue rename to dbm-ui/frontend/src/views/mysql/permission-rule/components/AccountDialog.vue diff --git a/dbm-ui/frontend/src/views/mysql/permission/components/CreateRule.vue b/dbm-ui/frontend/src/views/mysql/permission-rule/components/CreateRule.vue similarity index 100% rename from dbm-ui/frontend/src/views/mysql/permission/components/CreateRule.vue rename to dbm-ui/frontend/src/views/mysql/permission-rule/components/CreateRule.vue diff --git a/dbm-ui/frontend/src/views/mysql/permission/index.vue b/dbm-ui/frontend/src/views/mysql/permission-rule/index.vue similarity index 75% rename from dbm-ui/frontend/src/views/mysql/permission/index.vue rename to dbm-ui/frontend/src/views/mysql/permission-rule/index.vue index aa9c260ccf..7b7cff6d59 100644 --- a/dbm-ui/frontend/src/views/mysql/permission/index.vue +++ b/dbm-ui/frontend/src/views/mysql/permission-rule/index.vue @@ -12,99 +12,101 @@ --> -
{{ t('系统') }}{{ t('需要申请的权限') }}{{ t('系统') }}{{ t('需要申请的权限') }} {{ t('关联的资源实例') }}