【修复】条件节点前fromNodeId传值问题

【修复】部署参数默认错误问题
【测设】部分项目代码结构
【同步】前端项目代码
This commit is contained in:
chudong
2025-05-09 18:44:33 +08:00
parent 6e2fe8cf52
commit d147bc7a82
237 changed files with 8705 additions and 8741 deletions

Binary file not shown.

View File

@@ -1,5 +1,4 @@
import { Transition, type Component as ComponentType, h } from 'vue'
import { RouterView } from 'vue-router'
import CustomProvider from '@baota/naive-ui/components/customProvider'

Binary file not shown.

View File

@@ -10,6 +10,7 @@ import DnsProviderSelect from '@/components/dnsProviderSelect'
import styles from './index.module.css'
import verifyRules from './verify'
import { isArray } from '@baota/utils/type'
type StepStatus = 'process' | 'wait' | 'finish' | 'error'
@@ -63,10 +64,7 @@ export default defineComponent({
// 表单参数
const param = ref(
Object.keys(props.node.config).length > 0
? {
...props.node.config,
inputs: Array.isArray(props.node.inputs) ? props.node.inputs[0] : { fromNodeId: '', name: '' },
}
? props.node.config
: {
provider: '',
provider_id: '',
@@ -151,18 +149,20 @@ export default defineComponent({
* @returns
*/
const nextStep = async () => {
if (!param.value.provider) return message.error($t('t_19_1745735766810'))
if (!props.node.config.provider) return message.error($t('t_19_1745735766810'))
// 加载证书来源选项
certOptions.value = findApplyUploadNodesUp(props.node.id).map((item) => {
return { label: item.name, value: item.id }
})
if (!certOptions.value.length) {
message.warning($t('t_3_1745748298161'))
} else if (!(param.value.inputs && param.value.inputs.fromNodeId)) {
param.value.inputs = {} as DeployNodeInputsConfig
param.value.inputs.name = certOptions.value[0]?.label || ''
param.value.inputs.fromNodeId = certOptions.value[0]?.value || ''
} else if (!props.node.config.inputs?.fromNodeId) {
param.value.inputs = {
name: certOptions.value[0]?.label || '',
fromNodeId: certOptions.value[0]?.value || '',
} as DeployNodeInputsConfig
}
current.value++
next.value = false
@@ -195,15 +195,7 @@ export default defineComponent({
await example.value?.validate()
const tempData = param.value
const inputs = tempData.inputs
console.log(inputs, 'inputs', props.node)
updateNode(
props.node.id,
{
inputs: [inputs],
config: {},
},
false,
)
updateNode(props.node.id, { inputs: [inputs], config: {} }, false)
delete tempData.inputs
updateNodeConfig(props.node.id, {
...tempData,
@@ -221,7 +213,7 @@ export default defineComponent({
modalOptions.value.footer = false
// 如果已经选择了部署类型,则跳转到下一步
if (param.value.provider) {
if (props.node.inputs) param.value.inputs = props.node.inputs
if (props.node.inputs) param.value.inputs = props.node.inputs[0]
nextStep()
}
})

View File

@@ -27,7 +27,7 @@
/* Add triangle in bottom-right corner for selected item */
.optionCardSelected::before {
content: '';
@apply absolute -bottom-[.1rem] -right-[.1rem] w-0 h-0 z-10 text-white text-xs flex items-center justify-center;
@apply absolute -bottom-[.1rem] -right-[.1rem] w-0 h-0 z-10 text-white text-[1.2rem] flex items-center justify-center;
border-style: solid;
border-width: 0 0 20px 20px;
border-color: transparent transparent var(--n-primary-color) transparent;

View File

@@ -304,7 +304,6 @@ export const useFlowStore = defineStore('flow-store', () => {
console.warn(`Node with id ${nodeId} not found`)
return
}
console.log(nodeId, node)
// 更新原始数据
updateNodeRecursive(flowData.value.childNode, nodeId, (node, parent) => {
@@ -312,20 +311,26 @@ export const useFlowStore = defineStore('flow-store', () => {
console.warn('Cannot remove root node')
return
}
const { type, conditionNodes } = parent as BranchNodeData | ExecuteResultBranchNodeData
// 处理条件节点(分支节点、执行结果分支节点)
// console.log(type, conditionNodes, node)
// 如果当前子节点存在条件节点,需要判断删除后是否支持条件节点,则需要更新 fromNodeId
if (node.childNode?.type === EXECUTE_RESULT_BRANCH && node.childNode?.config) {
node.childNode.config.fromNodeId = parent.id
}
// console.log(node.childNode, parent)
// 条件一:当前节点为普通节点
const nodeTypeList = [CONDITION, EXECUTE_RESULT_CONDITION, BRANCH, EXECUTE_RESULT_BRANCH]
if (!nodeTypeList.includes(node.type) && parent.childNode?.id === nodeId) {
console.log(deep)
// 处理普通节点
if (deep) {
// 深度删除,直接移除
parent.childNode = undefined
} else {
console.log(parent.childNode, node.childNode)
// 非深度删除,子节点上移
if (node.childNode) {
parent.childNode = node.childNode

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "المهام الآلية",
"t_0_1744098811152": "تحذير: لقد دخلتم منطقة غير معروفة، الصفحة التي تحاول زيارتها غير موجودة، يرجى الضغط على الزر للعودة إلى الصفحة الرئيسية.",
"t_1_1744098801860": "رجوع إلى الصفحة الرئيسية",
"t_2_1744098804908": "نصيحة أمنية: إذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بالمدير على الفور",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Automated tasks",
"t_0_1744098811152": "Warning: You have entered an unknown area, the page you are visiting does not exist, please click the button to return to the homepage.",
"t_1_1744098801860": "Return Home",
"t_2_1744098804908": "Safety Tip: If you think this is an error, please contact the administrator immediately",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tareas automatizadas",
"t_0_1744098811152": "Advertencia: Ha ingresado a una zona desconocida, la página que intenta visitar no existe, por favor, haga clic en el botón para regresar a la página de inicio.",
"t_1_1744098801860": "Volver al inicio",
"t_2_1744098804908": "Consejo de seguridad: Si piensa que es un error, póngase en contacto con el administrador inmediatamente",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tâches automatisées",
"t_0_1744098811152": "Avertissement : Vous avez entré dans une zone inconnue, la page que vous visitez n'existe pas, veuillez cliquer sur le bouton pour revenir à la page d'accueil.",
"t_1_1744098801860": "Retour à l'accueil",
"t_2_1744098804908": "Avis de sécurité : Si vous pensez que c'est une erreur, veuillez contacter l'administrateur immédiatement",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自動化タスク",
"t_0_1744098811152": "警告:未知のエリアに進入しました。アクセスしようとしたページは存在しません。ボタンをクリックしてホームページに戻ってください。",
"t_1_1744098801860": "ホームに戻る",
"t_2_1744098804908": "安全注意:これが誤りだと思われる場合は、すぐに管理者に連絡してください",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "자동화 작업",
"t_0_1744098811152": "경고: 알 수 없는 영역에 진입했습니다. 방문하려는 페이지가 존재하지 않습니다. 버튼을 클릭하여 홈페이지로 돌아가세요。",
"t_1_1744098801860": "홈으로 돌아가기",
"t_2_1744098804908": "안전 유의사항: 이가 오류라면 즉시 관리자에게 연락하십시오",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tarefas automatizadas",
"t_0_1744098811152": "Aviso: Você entrou em uma área desconhecida, a página que você está visitando não existe, por favor, clique no botão para voltar para a página inicial.",
"t_1_1744098801860": "Voltar para a homepage",
"t_2_1744098804908": "Dica de Segurança: Se você acha que isso é um erro, entre em contato com o administrador imediatamente",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Автоматизированные задачи",
"t_0_1744098811152": "Предупреждение: Вы вошли в неизвестную зону, посещаемая страница не существует, пожалуйста, нажмите кнопку, чтобы вернуться на главную страницу.",
"t_1_1744098801860": "Вернуться на главную",
"t_2_1744098804908": "Совет по безопасности: Если вы считаете, что это ошибка, немедленно свяжитесь с администратором",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自动化任务",
"t_0_1744098811152": "警告:您已进入未知区域,所访问的页面不存在,请点击按钮返回首页。",
"t_1_1744098801860": "返回首页",
"t_2_1744098804908": "安全提示:如果您认为这是个错误,请立即联系管理员",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自動化任務",
"t_0_1744098811152": "警告:您已進入未知區域,所訪問的頁面不存在,請點擊按鈕返回首頁。",
"t_1_1744098801860": "返回首頁",
"t_2_1744098804908": "安全提示:如果您認為這是個錯誤,請立即聯繫管理員",

View File

@@ -37,7 +37,7 @@ export default defineComponent({
<div class="flex items-center space-x-1">
<span class="w-4 h-4 rounded-full mr-[.6rem] bg-green-500"></span>
<span class={styles.tableText}>
{$t('t_0_1745457486299')}: {overviewData.value.workflow.active}
{$t('t_0_1746782379424')}: {overviewData.value.workflow.active}
</span>
</div>
<div class="flex items-center space-x-1 mt-3">