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('关联的资源实例') }}