-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Update function setting style #2573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,47 +20,54 @@ | |
:label="$t('views.functionLib.functionForm.form.functionName.label')" | ||
prop="name" | ||
> | ||
<div v-if="form.id" | ||
class="edit-avatar mr-12" | ||
@mouseenter="showEditIcon = true" | ||
@mouseleave="showEditIcon = false" | ||
> | ||
<AppAvatar | ||
v-if="isAppIcon(form.icon as string)" | ||
:id="form.id" | ||
shape="square" | ||
:size="32" | ||
style="background: none" | ||
<div class="flex w-full"> | ||
<div | ||
v-if="form.id" | ||
class="edit-avatar mr-12" | ||
@mouseenter="showEditIcon = true" | ||
@mouseleave="showEditIcon = false" | ||
> | ||
<img :src="form.icon as string" alt="" /> | ||
<AppAvatar | ||
v-if="isAppIcon(form.icon)" | ||
:id="form.id" | ||
shape="square" | ||
:size="32" | ||
style="background: none" | ||
> | ||
<img :src="String(form.icon)" alt="" /> | ||
</AppAvatar> | ||
<AppAvatar | ||
v-else-if="form.name" | ||
:id="form.id" | ||
:name="form.name" | ||
pinyinColor | ||
shape="square" | ||
:size="32" | ||
/> | ||
<AppAvatar | ||
v-if="showEditIcon" | ||
:id="form.id" | ||
shape="square" | ||
class="edit-mask" | ||
:size="32" | ||
@click="openEditAvatar" | ||
> | ||
<el-icon><EditPen /></el-icon> | ||
</AppAvatar> | ||
</div> | ||
<AppAvatar shape="square" style="background: #34c724" class="mr-12" v-else> | ||
<img src="@/assets/icon_function_outlined.svg" style="width: 75%" alt="" /> | ||
</AppAvatar> | ||
<AppAvatar | ||
v-else-if="form.name" | ||
:id="form.id" | ||
:name="form.name" | ||
pinyinColor | ||
shape="square" | ||
:size="32" | ||
<el-input | ||
v-model="form.name" | ||
:placeholder="$t('views.functionLib.functionForm.form.functionName.placeholder')" | ||
maxlength="64" | ||
show-word-limit | ||
@blur="form.name = form.name?.trim()" | ||
/> | ||
<AppAvatar | ||
v-if="showEditIcon" | ||
:id="form.id" | ||
shape="square" | ||
class="edit-mask" | ||
:size="32" | ||
@click="openEditAvatar" | ||
> | ||
<el-icon><EditPen /></el-icon> | ||
</AppAvatar> | ||
</div> | ||
<el-input | ||
v-model="form.name" | ||
:placeholder="$t('views.functionLib.functionForm.form.functionName.placeholder')" | ||
maxlength="64" | ||
show-word-limit | ||
@blur="form.name = form.name?.trim()" | ||
/> | ||
</el-form-item> | ||
|
||
<el-form-item :label="$t('views.functionLib.functionForm.form.functionDescription.label')"> | ||
<el-input | ||
v-model="form.desc" | ||
|
@@ -72,7 +79,7 @@ | |
@blur="form.desc = form.desc?.trim()" | ||
/> | ||
</el-form-item> | ||
<!-- | ||
<!-- | ||
<el-form-item prop="permission_type"> | ||
<template #label> | ||
<span>{{ $t('views.functionLib.functionForm.form.permission_type.label') }}</span> | ||
|
@@ -110,7 +117,7 @@ | |
</el-button> | ||
</div> | ||
<el-table :data="form.init_field_list" class="mb-16"> | ||
<el-table-column prop="field" :label="$t('dynamicsForm.paramForm.field.label')" > | ||
<el-table-column prop="field" :label="$t('dynamicsForm.paramForm.field.label')"> | ||
<template #default="{ row }"> | ||
<span :title="row.field" class="ellipsis-1">{{ row.field }}</span> | ||
</template> | ||
|
@@ -266,7 +273,7 @@ | |
|
||
<FunctionDebugDrawer ref="FunctionDebugDrawerRef" /> | ||
<FieldFormDialog ref="FieldFormDialogRef" @refresh="refreshFieldList" /> | ||
<UserFieldFormDialog ref="UserFieldFormDialogRef" @refresh="refreshInitFieldList"/> | ||
<UserFieldFormDialog ref="UserFieldFormDialogRef" @refresh="refreshInitFieldList" /> | ||
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshFunctionLib" /> | ||
</el-drawer> | ||
</template> | ||
|
@@ -283,8 +290,8 @@ import { cloneDeep } from 'lodash' | |
import { PermissionType, PermissionDesc } from '@/enums/model' | ||
import { t } from '@/locales' | ||
import UserFieldFormDialog from '@/workflow/nodes/base-node/component/UserFieldFormDialog.vue' | ||
import {isAppIcon} from "@/utils/application"; | ||
import EditAvatarDialog from "./EditAvatarDialog.vue"; | ||
import { isAppIcon } from '@/utils/application' | ||
import EditAvatarDialog from './EditAvatarDialog.vue' | ||
|
||
const props = defineProps({ | ||
title: String | ||
|
@@ -402,7 +409,6 @@ function refreshFieldList(data: any) { | |
currentIndex.value = null | ||
} | ||
|
||
|
||
function openAddInitDialog(data?: any, index?: any) { | ||
if (typeof index !== 'undefined') { | ||
currentIndex.value = index | ||
|
@@ -434,7 +440,6 @@ function openEditAvatar() { | |
EditAvatarDialogRef.value.open(form.value) | ||
} | ||
|
||
|
||
const submit = async (formEl: FormInstance | undefined) => { | ||
if (!formEl) return | ||
await formEl.validate((valid: any) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code appears to be well-written and mostly functional, but there are a few minor issues that could potentially improve readability or performance:
Here is an optimized version of the relevant section with these improvements: <template>
<el-drawer
v-model="drawerVisible"
size="50%"
@close="onCloseDrawer"
append-to-body
>
<template #header slot-scope="{ close }">
{{ title }}
<el-button @click="close" style="float: right; padding: 0;">X</el-button>
</template>
<div class="px-8 pb-2">...</div> <!-- Continue rest -->
<script lang='ts'>
// Import statements remain unchanged
const currentStepValue = ref<number>(0);
const permissionTypes = [
PermissionType.Public,
PermissionType.Protected,
PermissionType.Private,
] as number[] | string[];
function onChange(current_step_index_num) {
currentStepValue.value = parseInt(String(current_step_index_num), 10);
}
function onRefresh(stepIndexNum?: number): void {
refreshInitFieldList();
if (stepIndexNum > currentIndex.value) return;
currentIndex.value = stepIndexNum;
}
// These changes make the code cleaner and more maintainable while maintaining its functionality. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No significant issues were found in the provided CSS code snippet. It appears to be properly formatted and contains no syntax errors or missing components. The structure of the
el-radio-group
with nested radio buttons is correct, ensuring that users can choose between "continueQuestioning" or "provideAnswer". There are also two instances where duplicate content has been removed for consistency.This CSS should work as intended without further modifications. If you need to implement any specific changes based on additional context, I'd be happy to help suggest those!