mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 14:52:58 +00:00
feat: tool
This commit is contained in:
parent
11fa3c4814
commit
db7b267326
|
|
@ -253,6 +253,12 @@
|
|||
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>
|
||||
{{ $t('common.param.initParam') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="isSystemShare"
|
||||
icon="Lock"
|
||||
@click.stop="openAuthorizedWorkspaceDialog(item)"
|
||||
>{{ $t('views.system.shared.authorized_workspace') }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
v-if="!item.template_id && permissionPrecise.export()"
|
||||
@click.stop="exportTool(item)"
|
||||
|
|
@ -289,6 +295,10 @@
|
|||
ref="addInternalFunctionDialogRef"
|
||||
@refresh="confirmAddInternalFunction"
|
||||
/>
|
||||
<AuthorizedWorkspace
|
||||
ref="AuthorizedWorkspaceDialogRef"
|
||||
v-if="isSystemShare"
|
||||
></AuthorizedWorkspace>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -299,6 +309,7 @@ import { useRoute } from 'vue-router'
|
|||
import InitParamDrawer from '@/views/tool/component/InitParamDrawer.vue'
|
||||
import ToolFormDrawer from '@/views/tool/ToolFormDrawer.vue'
|
||||
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
||||
import AuthorizedWorkspace from '@/views/shared/AuthorizedWorkspaceDialog.vue'
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||
|
|
@ -322,6 +333,14 @@ const type = computed(() => {
|
|||
return 'workspace'
|
||||
}
|
||||
})
|
||||
|
||||
const isShared = computed(() => {
|
||||
return folder.currentFolder.id === 'share'
|
||||
})
|
||||
const isSystemShare = computed(() => {
|
||||
return type.value === 'systemShare'
|
||||
})
|
||||
|
||||
const permissionPrecise = computed(() => {
|
||||
return permissionMap['tool'][type.value]
|
||||
})
|
||||
|
|
@ -345,18 +364,19 @@ const paginationConfig = reactive({
|
|||
total: 0,
|
||||
})
|
||||
|
||||
const currentFolder = ref<any>({})
|
||||
|
||||
const isShared = computed(() => {
|
||||
return folder.currentFolder.id === 'share'
|
||||
})
|
||||
|
||||
const search_type_change = () => {
|
||||
search_form.value = { name: '', create_user: '' }
|
||||
}
|
||||
const ToolFormDrawerRef = ref()
|
||||
const ToolDrawertitle = ref('')
|
||||
|
||||
const AuthorizedWorkspaceDialogRef = ref()
|
||||
function openAuthorizedWorkspaceDialog(row: any) {
|
||||
if (AuthorizedWorkspaceDialogRef.value) {
|
||||
AuthorizedWorkspaceDialogRef.value.open(row, 'Tool')
|
||||
}
|
||||
}
|
||||
|
||||
function openCreateDialog(data?: any) {
|
||||
// 有template_id的不允许编辑,是模板转换来的
|
||||
if (data?.template_id) {
|
||||
|
|
@ -500,7 +520,7 @@ function configInitParams(item: any) {
|
|||
|
||||
const toolStoreDialogRef = ref<InstanceType<typeof ToolStoreDialog>>()
|
||||
function openToolStoreDialog() {
|
||||
toolStoreDialogRef.value?.open(currentFolder.value.id)
|
||||
toolStoreDialogRef.value?.open(folder.currentFolder.id)
|
||||
}
|
||||
|
||||
const addInternalFunctionDialogRef = ref<InstanceType<typeof AddInternalFunctionDialog>>()
|
||||
|
|
|
|||
Loading…
Reference in New Issue