|
@@ -2,9 +2,20 @@
|
|
|
<transition name="slide">
|
|
|
<div class="panel" v-if="WorkflowStore.panel.show">
|
|
|
<div class="panel-header">
|
|
|
- <h3>{{ nodeDataCpt.title }}</h3>
|
|
|
+ <h3>{{ state.nodeData.title }}</h3>
|
|
|
<div class="__hover" @click="WorkflowStore.nodePanelClose()">×</div>
|
|
|
</div>
|
|
|
+ <div class="panel-sub">
|
|
|
+ <CzrFormColumn
|
|
|
+ :span="24"
|
|
|
+ label-width="0"
|
|
|
+ v-model:param="state.nodeData.subTitle"
|
|
|
+ :transparent="true"
|
|
|
+ placeholder="副标题..."
|
|
|
+ :max-length="20"
|
|
|
+ :clearable="false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="panel-content">
|
|
|
<template v-if="nodeDataCpt.type === NodeType.Root">
|
|
|
<rootPanel :node="WorkflowStore.panel.node"/>
|
|
@@ -21,21 +32,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import {computed, getCurrentInstance, reactive, ref} from "vue";
|
|
|
+import {computed, getCurrentInstance, onMounted, reactive, ref, watch} from "vue";
|
|
|
import rootPanel from '../instance/root/panel/index.vue'
|
|
|
import answerPanel from '../instance/answer/panel/index.vue'
|
|
|
import ifElsePanel from '../instance/if-else/panel/index.vue'
|
|
|
import {useWorkflowStore} from "@/stores";
|
|
|
import {NodeType} from "@/views/workflow/types";
|
|
|
|
|
|
-
|
|
|
const WorkflowStore = useWorkflowStore()
|
|
|
const emits = defineEmits([])
|
|
|
const props = defineProps({
|
|
|
})
|
|
|
const {proxy}: any = getCurrentInstance()
|
|
|
-const state: any = reactive({})
|
|
|
-const nodeDataCpt = computed(() => WorkflowStore.panel.node?.data || {})
|
|
|
+const state: any = reactive({
|
|
|
+ nodeData: {}
|
|
|
+})
|
|
|
+const nodeDataCpt = computed(() => WorkflowStore.panel.node?.data.workflowData || {})
|
|
|
+watch(() => nodeDataCpt.value, (n) => {
|
|
|
+ if (n) {
|
|
|
+ state.nodeData = WorkflowStore.panel.node?.data.workflowData || {}
|
|
|
+ }
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -54,12 +71,15 @@ const nodeDataCpt = computed(() => WorkflowStore.panel.node?.data || {})
|
|
|
flex-direction: column;
|
|
|
border-radius: 10px 0 0 10px;
|
|
|
.panel-header {
|
|
|
- padding: 16px;
|
|
|
- border-bottom: style.$borderStyle;
|
|
|
+ padding: 16px 16px 0 16px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+ .panel-sub {
|
|
|
+ border-bottom: style.$borderStyle;
|
|
|
+ padding: 6px;
|
|
|
+ }
|
|
|
.panel-content {
|
|
|
padding: 0 16px 16px;
|
|
|
flex: 1;
|