refactor: application add show_exec

This commit is contained in:
wxg0103 2025-06-06 17:17:52 +08:00
parent 8ab4456ec3
commit 66d4b6c81a
3 changed files with 65 additions and 55 deletions

View File

@ -26,6 +26,7 @@ class ApplicationAccessToken(AppModelMixin):
base_field=models.CharField(max_length=128, blank=True)
, default=list)
show_source = models.BooleanField(default=False, verbose_name="是否显示知识来源")
show_exec = models.BooleanField(default=False, verbose_name="是否显示执行详情")
language = models.CharField(max_length=10, verbose_name="语言", default=None, null=True)

View File

@ -24,11 +24,15 @@
<el-space direction="vertical" alignment="start">
<el-checkbox
v-model="form.show_source"
:label="
isWorkFlow(detail.type)
? $t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')
: $t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')
"
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')"
/>
</el-space>
</el-form-item>
<el-form-item>
<el-space direction="vertical" alignment="start">
<el-checkbox
v-model="form.show_exec"
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')"
/>
</el-space>
</el-form-item>
@ -48,9 +52,9 @@ import { ref, watch } from 'vue'
import {useRoute} from 'vue-router'
import type {FormInstance, FormRules, UploadFiles} from 'element-plus'
import applicationApi from '@/api/application/application'
import { isWorkFlow } from '@/utils/application'
import {MsgSuccess, MsgError} from '@/utils/message'
import {getBrowserLang, langList, t} from '@/locales'
const route = useRoute()
const {
params: {id}
@ -61,6 +65,7 @@ const emit = defineEmits(['refresh'])
const displayFormRef = ref()
const form = ref<any>({
show_source: false,
show_exec: false,
language: ''
})
@ -73,6 +78,7 @@ watch(dialogVisible, (bool) => {
if (!bool) {
form.value = {
show_source: false,
show_exec: false,
language: ''
}
}
@ -80,6 +86,7 @@ watch(dialogVisible, (bool) => {
const open = (data: any, content: any) => {
detail.value = content
form.value.show_source = data.show_source
form.value.show_exec = data.show_exec
form.value.language = data.language
dialogVisible.value = true
}

View File

@ -370,11 +370,11 @@
<el-space direction="vertical" alignment="start" :size="2">
<el-checkbox
v-model="xpackForm.show_source"
:label="
isWorkFlow(detail.type)
? $t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')
: $t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')
"
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')"
/>
<el-checkbox
v-model="xpackForm.show_exec"
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')"
/>
<el-checkbox
v-model="xpackForm.show_history"
@ -416,7 +416,6 @@
import {computed, ref, watch} from 'vue'
import {useRoute} from 'vue-router'
import type {FormInstance, FormRules, UploadFiles} from 'element-plus'
import { isWorkFlow } from '@/utils/application'
import {isAppIcon} from '@/utils/common'
import applicationXpackApi from '@/api/application/application-xpack'
import {MsgSuccess, MsgError} from '@/utils/message'
@ -435,6 +434,7 @@ const emit = defineEmits(['refresh'])
const defaultSetting = {
show_source: false,
show_exec: false,
language: '',
show_history: true,
draggable: true,
@ -463,6 +463,7 @@ const displayFormRef = ref()
const xpackForm = ref<any>({
show_source: false,
show_exec: false,
language: '',
show_history: false,
draggable: false,
@ -531,6 +532,7 @@ const onChange = (file: any, fileList: UploadFiles, attr: string) => {
const open = (data: any, content: any) => {
detail.value = content
xpackForm.value.show_source = data.show_source
xpackForm.value.show_exec = data.show_exec
xpackForm.value.show_history = data.show_history
xpackForm.value.language = data.language
xpackForm.value.draggable = data.draggable