From 371e2ee0730e065864e68493546856a03fdb15d5 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Mon, 13 May 2024 06:56:03 +0900 Subject: [PATCH 1/7] add vueuse dependencies --- frontend/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 5016fbf..3343684 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,8 +17,9 @@ }, "dependencies": { "@quasar/extras": "^1.16.4", + "@vueuse/core": "^10.9.0", "axios": "^1.4.0", - "pinia": "^2.1.6", + "pinia": "^2.1.7", "quasar": "^2.6.0", "uuid": "^9.0.0", "vue": "^3.0.0", From 64d2cadd826ec41a91e486f58cdd9c8fa39e5920 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Mon, 13 May 2024 06:56:44 +0900 Subject: [PATCH 2/7] =?UTF-8?q?2=E3=81=A4=E3=81=AE=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E8=A8=88=E7=AE=97=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ConditionObjects.vue | 11 +- frontend/src/components/FieldList.vue | 60 +++--- .../src/components/right/AppFieldSelect.vue | 8 +- .../src/components/right/ConditionInput.vue | 185 ++++++++++-------- .../src/components/right/DataProcessing.vue | 95 +++++++++ .../src/components/right/PropertyList.vue | 8 +- 6 files changed, 247 insertions(+), 120 deletions(-) create mode 100644 frontend/src/components/right/DataProcessing.vue diff --git a/frontend/src/components/ConditionObjects.vue b/frontend/src/components/ConditionObjects.vue index 3719bab..9939b08 100644 --- a/frontend/src/components/ConditionObjects.vue +++ b/frontend/src/components/ConditionObjects.vue @@ -19,7 +19,7 @@ - + @@ -30,7 +30,7 @@ + } +}; + + +export default defineComponent({ + name: 'FieldInput', + inheritAttrs: false, + components: { + ConditionEditor + }, + props: { + context: { + type: Array, + default: '', + }, + displayName: { + type: String, + default: '', + }, + name: { + type: String, + default: '', + }, + placeholder: { + type: String, + default: '', + }, + hint: { + type: String, + default: '', + }, + modelValue: { + type: String, + default: null + }, + }, + + setup(props, { emit }) { + const source = props.context.find(element => element?.props?.name === 'sources') + + if (source) { + provide('sourceFields', computed( () => source.props?.modelValue?.fields ?? [])); + } + + const appDg = ref(); + const show = ref(false); + const tree = reactive(new ConditionTree()); + if (props.modelValue && props.modelValue !== '') { + tree.fromJson(props.modelValue); + } else { + const newNode = new ConditionNode({}, Operator.Equal, '', tree.root); + tree.addNode(tree.root, newNode); + } + + const isSetted = ref(props.modelValue && props.modelValue !== ''); + + const conditionString = computed(() => { + return tree.buildConditionString(tree.root); + }); + + const showDg = () => { + show.value = true; + }; + + const onClosed = (val: string) => { + if (val == 'OK') { + const conditionJson = tree.toJson(); + isSetted.value = true; + emit('update:modelValue', conditionJson); + } + }; + + watchEffect(() => { + const conditionJson = tree.toJson(); + emit('update:modelValue', conditionJson); + }); + + return { + appDg, + isSetted, + show, + showDg, + onClosed, + tree, + conditionString + }; + } +}); + diff --git a/frontend/src/components/right/DataProcessing.vue b/frontend/src/components/right/DataProcessing.vue new file mode 100644 index 0000000..87ceb24 --- /dev/null +++ b/frontend/src/components/right/DataProcessing.vue @@ -0,0 +1,95 @@ + + + + \ No newline at end of file diff --git a/frontend/src/components/right/PropertyList.vue b/frontend/src/components/right/PropertyList.vue index 1c7357c..f19bf98 100644 --- a/frontend/src/components/right/PropertyList.vue +++ b/frontend/src/components/right/PropertyList.vue @@ -1,7 +1,7 @@ @@ -21,6 +21,7 @@ import ConditionInput from '../right/ConditionInput.vue'; import EventSetter from '../right/EventSetter.vue'; import ColorPicker from './ColorPicker.vue'; import NumInput from './NumInput.vue'; +import DataProcessing from './DataProcessing.vue'; import { IActionNode,IActionProperty,IProp } from 'src/types/ActionTypes'; export default defineComponent({ @@ -35,7 +36,8 @@ export default defineComponent({ ConditionInput, EventSetter, ColorPicker, - NumInput + NumInput, + DataProcessing }, props: { nodeProps: { @@ -50,7 +52,7 @@ export default defineComponent({ setup(props, context) { const properties=ref(props.nodeProps); const connectProps=(props:IProp)=>{ - const connProps:any={}; + const connProps:any={context:properties}; if(props && "connectProps" in props && props.connectProps!=undefined){ for(let connProp of props.connectProps){ let targetProp = properties.value.find((prop)=>prop.props.name===connProp.propName); From 61ac281134779ddac85f1618b2a9cadbeec1cdf0 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Fri, 17 May 2024 14:41:15 +0900 Subject: [PATCH 3/7] =?UTF-8?q?verName=E3=81=AE=E3=83=A9=E3=83=83=E3=83=94?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=83=BB=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7?= =?UTF-8?q?=E3=82=AF=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/main/NodeItem.vue | 2 +- frontend/src/components/right/InputText.vue | 52 ++++++++++++++------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/main/NodeItem.vue b/frontend/src/components/main/NodeItem.vue index 6474a18..0e4cb8b 100644 --- a/frontend/src/components/main/NodeItem.vue +++ b/frontend/src/components/main/NodeItem.vue @@ -205,7 +205,7 @@ export default defineComponent({ */ const varName =(node:IActionNode)=>{ const prop = node.actionProps.find((prop) => prop.props.name === "verName"); - return prop?.props.modelValue; + return prop?.props.modelValue.name; }; const copyFlow=()=>{ context.emit('copyFlow', props.actionNode); diff --git a/frontend/src/components/right/InputText.vue b/frontend/src/components/right/InputText.vue index a14e06d..b47a379 100644 --- a/frontend/src/components/right/InputText.vue +++ b/frontend/src/components/right/InputText.vue @@ -1,10 +1,7 @@