mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: Model permission while setting knowledge or application
This commit is contained in:
parent
ed5cc3a0fa
commit
f1e8ba6e2d
|
|
@ -53,7 +53,9 @@
|
|||
<template #footer v-if="showFooter">
|
||||
<slot name="footer">
|
||||
<div class="w-full text-left cursor" @click="openCreateModel(undefined, props.modelType)">
|
||||
<el-button type="primary" link>
|
||||
<el-button type="primary" link
|
||||
v-if="permissionPrecise.create()"
|
||||
>
|
||||
<el-icon class="mr-4">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
|
|
@ -86,6 +88,7 @@ import SelectProviderDialog from '@/views/model/component/SelectProviderDialog.v
|
|||
|
||||
import { t } from '@/locales'
|
||||
import useStore from '@/stores'
|
||||
import permissionMap from '@/permission'
|
||||
|
||||
defineOptions({ name: 'ModelSelect' })
|
||||
const props = defineProps<{
|
||||
|
|
@ -95,6 +98,10 @@ const props = defineProps<{
|
|||
modelType?: ''
|
||||
}>()
|
||||
|
||||
const permissionPrecise = computed(() => {
|
||||
return permissionMap['model']['workspace']
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'change', 'submitModel'])
|
||||
const modelValue = computed({
|
||||
set: (item) => {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@
|
|||
<el-button @click.prevent="dialogVisible = false">
|
||||
{{ $t('common.cancel') }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="submit" :loading="loading">
|
||||
<el-button type="primary" @click="submit" :loading="loading"
|
||||
v-if="permissionPrecise.paramSetting(modelID)"
|
||||
>
|
||||
{{ $t('common.confirm') }}
|
||||
</el-button>
|
||||
</span>
|
||||
|
|
@ -33,11 +35,13 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import type { FormField } from '@/components/dynamics-form/type'
|
||||
import modelAPi from '@/api/model/model'
|
||||
import applicationApi from '@/api/application/application'
|
||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||
import permissionMap from '@/permission'
|
||||
|
||||
const model_form_field = ref<Array<FormField>>([])
|
||||
const emit = defineEmits(['refresh'])
|
||||
const dynamicsFormRef = ref<InstanceType<typeof DynamicsForm>>()
|
||||
|
|
@ -47,7 +51,15 @@ const loading = ref(false)
|
|||
const getApi = (model_id: string, application_id?: string) => {
|
||||
return modelAPi.getModelParamsForm(model_id, loading)
|
||||
}
|
||||
|
||||
const modelID = ref('')
|
||||
|
||||
const permissionPrecise = computed(() => {
|
||||
return permissionMap['model']['workspace']
|
||||
})
|
||||
|
||||
const open = (model_id: string, application_id?: string, model_setting_data?: any) => {
|
||||
modelID.value = model_id
|
||||
form_data.value = {}
|
||||
const api = getApi(model_id, application_id)
|
||||
api.then((ok) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue