|
|
@@ -18,6 +18,7 @@ import {
|
|
|
|
|
|
import {
|
|
|
deleteApplicationApi,
|
|
|
+ getMenuPermissionButtonsApi,
|
|
|
getMyApplicationListApi,
|
|
|
getPartnersApi,
|
|
|
type UserApi,
|
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
import ApplicationModal from './application-modal.vue';
|
|
|
|
|
|
const applicationMenu = ref<Array<{ label: string; value: any }>>([]);
|
|
|
+const permissionButtons = ref<string[]>([]);
|
|
|
|
|
|
const modalOpen = ref(false);
|
|
|
const modalMode = ref<'add' | 'edit'>('add');
|
|
|
@@ -179,6 +181,23 @@ async function fetchPartners() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+async function fetchMenuPermissionButtons() {
|
|
|
+ if (!isLogin.value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ const result = await getMenuPermissionButtonsApi({
|
|
|
+ menu_code: 'Sys_Menu_Project',
|
|
|
+ });
|
|
|
+ if (result?.result) {
|
|
|
+ permissionButtons.value = result.result;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取菜单权限按钮失败:', error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
async function deleteApplication(item: any) {
|
|
|
if (!isLogin.value) {
|
|
|
return;
|
|
|
@@ -206,6 +225,7 @@ watch(
|
|
|
if (newValue) {
|
|
|
fetchApplicationList();
|
|
|
fetchPartners();
|
|
|
+ fetchMenuPermissionButtons();
|
|
|
}
|
|
|
},
|
|
|
{ immediate: true },
|
|
|
@@ -363,7 +383,12 @@ watch(
|
|
|
</svg>
|
|
|
{{ $t('btn.reset') }}
|
|
|
</Button>
|
|
|
- <Button class="h-[42px]" type="primary" @click="handleAddNew">
|
|
|
+ <Button
|
|
|
+ v-if="permissionButtons.includes('add')"
|
|
|
+ class="h-[42px]"
|
|
|
+ type="primary"
|
|
|
+ @click="handleAddNew"
|
|
|
+ >
|
|
|
<img
|
|
|
alt=""
|
|
|
class="h-[21.5px] w-[21.5px] cursor-pointer"
|
|
|
@@ -400,10 +425,18 @@ watch(
|
|
|
{{ item.name }}
|
|
|
</span>
|
|
|
<Dropdown
|
|
|
+ v-if="
|
|
|
+ permissionButtons.includes('edit') ||
|
|
|
+ permissionButtons.includes('del')
|
|
|
+ "
|
|
|
:menu="{
|
|
|
items: [
|
|
|
- { key: 'Edit', label: $t('applicationManagement.edit') },
|
|
|
- { key: 'Remove', label: $t('applicationManagement.remove') },
|
|
|
+ ...(permissionButtons.includes('edit')
|
|
|
+ ? [{ key: 'Edit', label: $t('applicationManagement.edit') }]
|
|
|
+ : []),
|
|
|
+ ...(permissionButtons.includes('del')
|
|
|
+ ? [{ key: 'Remove', label: $t('applicationManagement.remove') }]
|
|
|
+ : []),
|
|
|
],
|
|
|
}"
|
|
|
placement="bottom"
|