fix: 修复管理端前端 lint 与构建问题

- 收敛 easyflow-ui-admin 的 lint、格式和类型问题

- 修正 demo 页面与管理端前端构建失败点

- 验证 pnpm lint 与 pnpm build 均已通过
This commit is contained in:
2026-04-05 21:39:13 +08:00
parent bb72e19c84
commit 7e7c236c2a
240 changed files with 5151 additions and 4701 deletions

View File

@@ -4,7 +4,6 @@ import { useRoute } from 'vue-router';
import { usePreferences } from '@easyflow/preferences';
import { getOptions, sortNodes } from '@easyflow/utils';
import { getIconByValue } from '#/views/ai/model/modelUtils/defaultIcon';
import { ArrowLeft, CircleCheck, Close } from '@element-plus/icons-vue';
import { Tinyflow } from '@tinyflow-ai/vue';
@@ -14,6 +13,7 @@ import { api } from '#/api/request';
import CommonSelectDataModal from '#/components/commonSelectModal/CommonSelectDataModal.vue';
import { $t } from '#/locales';
import { router } from '#/router';
import { getIconByValue } from '#/views/ai/model/modelUtils/defaultIcon';
import ExecResult from '#/views/ai/workflow/components/ExecResult.vue';
import SingleRun from '#/views/ai/workflow/components/SingleRun.vue';
import WorkflowForm from '#/views/ai/workflow/components/WorkflowForm.vue';
@@ -143,7 +143,7 @@ const issueFocusActive = ref(false);
const focusedIssueKey = ref('');
let focusPulseTimer: ReturnType<typeof setTimeout> | undefined;
type WorkflowCheckStage = 'SAVE' | 'PRE_EXECUTE';
type WorkflowCheckStage = 'PRE_EXECUTE' | 'SAVE';
const builtInNodeIconMap: Record<string, string> = {
startNode:
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15Z"></path></svg>',
@@ -395,6 +395,15 @@ function checkStageText(stage?: string) {
}
return '-';
}
function checkStageSummaryText(stage?: string) {
return `${$t('aiWorkflow.checkStageLabel')}${checkStageText(stage)}`;
}
function checkIssueCountText(count?: number) {
return `${$t('aiWorkflow.issueCount')}${count || 0}`;
}
function issueKey(issue: any, index: number) {
return `${issue.code || '-'}-${issue.nodeId || '-'}-${issue.edgeId || '-'}-${index}`;
}
@@ -616,16 +625,8 @@ function onAsyncExecute(info: any) {
/>
</div>
<div class="check-summary">
<span
>{{ $t('aiWorkflow.checkStageLabel') }}{{
checkStageText(checkResult?.stage)
}}</span
>
<span
>{{ $t('aiWorkflow.issueCount') }}{{
checkResult?.issueCount || 0
}}</span
>
<span v-text="checkStageSummaryText(checkResult?.stage)"></span>
<span v-text="checkIssueCountText(checkResult?.issueCount)"></span>
</div>
<div class="checklist-body">
<button
@@ -645,14 +646,16 @@ function onAsyncExecute(info: any) {
<span
class="check-level"
:class="issueLevelClass(item.issue.level)"
>{{ item.issue.level || '-' }}</span
>
v-text="item.issue.level || '-'"
></span>
<span class="check-node-display">
<!-- eslint-disable vue/no-v-html -->
<span
v-if="item.nodeDisplay.icon"
class="check-node-icon"
v-html="item.nodeDisplay.icon"
/>
></span>
<!-- eslint-enable vue/no-v-html -->
<span v-else class="check-node-icon-fallback">N</span>
<span class="check-node-title">{{
item.nodeDisplay.title
@@ -676,23 +679,24 @@ function onAsyncExecute(info: any) {
}
:deep(.tf-bottom-dock) {
left: 50% !important;
bottom: 16px !important;
transform: translateX(-50%) !important;
left: 50% !important;
z-index: 46 !important;
transform: translateX(-50%) !important;
}
.head-div {
--workflow-bottom-dock-height: 56px;
--workflow-checklist-offset: calc(var(--workflow-bottom-dock-height) + 24px);
position: relative;
background-color: var(--el-bg-color);
}
.workflow-head-actions {
display: flex;
align-items: center;
gap: 8px;
align-items: center;
}
.tiny-flow-container {
@@ -706,18 +710,18 @@ function onAsyncExecute(info: any) {
.checklist-panel {
position: absolute;
left: 20px;
right: 20px;
bottom: var(--workflow-checklist-offset);
left: 20px;
z-index: 60;
max-height: min(320px, 42vh);
display: flex;
flex-direction: column;
max-height: min(320px, 42vh);
padding: 12px;
background: var(--el-bg-color-overlay);
border: 1px solid var(--el-border-color);
border-radius: 12px;
background: var(--el-bg-color-overlay);
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
box-shadow: 0 10px 28px rgb(0 0 0 / 12%);
}
.checklist-header {
@@ -742,18 +746,18 @@ function onAsyncExecute(info: any) {
}
.checklist-body {
overflow: auto;
display: flex;
flex-direction: column;
gap: 8px;
overflow: auto;
}
.check-item {
padding: 10px 12px;
text-align: left;
background: var(--el-fill-color-lighter);
border: 1px solid var(--el-border-color-lighter);
border-radius: 10px;
background: var(--el-fill-color-lighter);
padding: 10px 12px;
transition:
border-color 0.2s ease,
box-shadow 0.2s ease,
@@ -765,8 +769,8 @@ function onAsyncExecute(info: any) {
}
.check-item.is-clickable:hover {
border-color: var(--el-color-primary-light-5);
background: var(--el-fill-color-light);
border-color: var(--el-color-primary-light-5);
}
.check-item.is-active {
@@ -781,11 +785,11 @@ function onAsyncExecute(info: any) {
.check-item-meta {
display: flex;
align-items: center;
gap: 10px;
align-items: center;
margin-bottom: 6px;
font-size: 12px;
line-height: 1.2;
margin-bottom: 6px;
}
.check-level {
@@ -795,10 +799,10 @@ function onAsyncExecute(info: any) {
min-width: 56px;
height: 20px;
padding: 0 8px;
border-radius: 999px;
font-weight: 600;
color: var(--el-text-color-primary);
background: var(--el-fill-color-dark);
border-radius: 999px;
}
.check-level.is-error {
@@ -818,8 +822,8 @@ function onAsyncExecute(info: any) {
.check-node-display {
display: inline-flex;
align-items: center;
gap: 8px;
align-items: center;
min-width: 0;
}
@@ -843,24 +847,24 @@ function onAsyncExecute(info: any) {
justify-content: center;
width: 18px;
height: 18px;
border-radius: 50%;
font-size: 10px;
font-weight: 700;
color: var(--el-color-primary);
background: var(--el-color-primary-light-9);
border-radius: 50%;
}
.check-node-title {
font-size: 14px;
color: var(--el-text-color-primary);
font-weight: 500;
color: var(--el-text-color-primary);
}
.check-item-message {
font-size: 13px;
line-height: 1.45;
color: var(--el-color-danger);
word-break: break-word;
overflow-wrap: anywhere;
}
.checklist-slide-enter-active,
@@ -876,14 +880,15 @@ function onAsyncExecute(info: any) {
.workflow-issue-focus :deep(.svelte-flow__node.selected) {
border-color: var(--el-color-danger) !important;
box-shadow: 0 0 0 3px rgba(245, 108, 108, 0.26);
box-shadow: 0 0 0 3px rgb(245 108 108 / 26%);
animation: issue-node-pulse 1.2s ease-out 1;
}
@keyframes issue-node-pulse {
0% {
box-shadow: 0 0 0 0 rgba(245, 108, 108, 0.42);
box-shadow: 0 0 0 0 rgb(245 108 108 / 42%);
}
100% {
box-shadow: 0 0 0 10px transparent;
}