Compare commits

..

4 Commits

Author SHA1 Message Date
Mouriya
a7078b54c5 イベントに削除関数を追加し、即座に適用する 2024-05-13 01:16:09 +09:00
c426bbf793 feat: numInput属性UI追加
inputText,numInputにrules設定追加、入力ルール設定可能
2024-05-09 10:49:05 +09:00
329debaab8 Merge branch 'mvp_step2_dev' into feature-colorpicker 2024-05-07 11:56:20 +09:00
Mouriya
994a0174f5 カラーピッカーと数字入力ボックスの追加 2024-05-06 20:58:06 +09:00
17 changed files with 938 additions and 618 deletions

View File

@@ -1,48 +1,55 @@
<template> <template>
<!-- <div class="q-pa-md q-gutter-sm"> --> <!-- <div class="q-pa-md q-gutter-sm"> -->
<q-tree <q-tree :nodes="store.eventTree.screens" node-key="eventId" children-key="events" no-connectors
:nodes="store.eventTree.screens" v-model:expanded="store.expandedScreen" :dense="true" :ref="tree">
node-key="eventId" <template v-slot:header-EVENT="prop">
children-key="events" <div :ref="prop.node.eventId" class="row col items-center no-wrap event-node">
no-connectors <q-icon v-if="prop.node.eventId" name="play_circle" :color="prop.node.hasFlow ? 'green' : 'grey'" size="16px"
v-model:expanded="store.expandedScreen" class="q-mr-sm">
:dense="true" </q-icon>
:ref="tree" <div class="no-wrap" @click="onSelected(prop.node)"
> :class="selectedEvent && prop.node.eventId === selectedEvent.eventId ? 'selected-node' : ''">{{
<template v-slot:header-EVENT="prop"> prop.node.label }}</div>
<div class="row col items-start no-wrap event-node" @click="onSelected(prop.node)"> <q-space></q-space>
<q-icon v-if="prop.node.eventId" <!-- <q-icon v-if="prop.node.hasFlow" name="delete" color="negative" size="16px" class="q-mr-sm"></q-icon> -->
name="play_circle" </div>
:color="prop.node.hasFlow?'green':'grey'" </template>
size="16px" class="q-mr-sm"> <template v-slot:header-CHANGE="prop">
</q-icon> <div class="row col items-center no-wrap event-node">
<div class="no-wrap" :class="selectedEvent && prop.node.eventId===selectedEvent.eventId?'selected-node':''">{{ prop.node.label }}</div> <div class="no-wrap">{{ prop.node.label }}</div>
<q-space></q-space> <q-space></q-space>
<!-- <q-icon v-if="prop.node.hasFlow" name="delete" color="negative" size="16px" class="q-mr-sm"></q-icon> --> <q-icon name="add_circle" color="primary" size="16px" class="q-mr-sm"
@click="addChangeEvent(prop.node)"></q-icon>
</div>
</template>
<template v-slot:header-DELETABLE="prop">
<div class="row col items-center event-node">
<div class="row col items-center" @click="onSelected(prop.node)">
<q-icon v-if="prop.node.eventId" name="play_circle" :color="prop.node.hasFlow ? 'green' : 'grey'" size="16px"
class="q-mr-sm">
</q-icon>
<div>{{ prop.node.label }}</div>
</div> </div>
</template> <div>
<template v-slot:header-CHANGE="prop" > <q-btn class="q-mr-sm delete-btn" flat fab-mini icon="delete_forever" padding="none" color="negative"
<div class="row col items-start no-wrap event-node" > @click="deleteEvent(prop.node)"></q-btn>
<div class="no-wrap">{{ prop.node.label }}</div>
<q-space></q-space>
<q-icon name="add_circle" color="primary" size="16px" class="q-mr-sm" @click="addChangeEvent(prop.node)"></q-icon>
</div> </div>
</template> </div>
</q-tree> </template>
<show-dialog v-model:visible="showDialog" name="フィールド選択" @close="closeDg" widht="400px"> </q-tree>
<field-select ref="appDg" name="フィールド" type="single" :appId="store.appInfo?.appId"></field-select> <show-dialog v-model:visible="showDialog" name="フィールド選択" @close="closeDg">
</show-dialog> <field-select ref="appDg" name="フィールド" type="single" :appId="store.appInfo?.appId"></field-select>
</show-dialog>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, computed, ref } from 'vue'; import { QTree, useQuasar } from 'quasar';
import { IKintoneEvent ,IKintoneEventGroup, IKintoneEventNode, kintoneEvent} from '../../types/KintoneEvents'; import { ActionFlow, RootAction } from 'src/types/ActionTypes';
import { storeToRefs } from 'pinia';
import { useFlowEditorStore } from 'stores/flowEditor'; import { useFlowEditorStore } from 'stores/flowEditor';
import { ActionFlow, ActionNode, RootAction } from 'src/types/ActionTypes'; import { defineComponent, ref } from 'vue';
import ShowDialog from '../ShowDialog.vue'; import { IKintoneEvent, IKintoneEventGroup, IKintoneEventNode } from '../../types/KintoneEvents';
import FieldSelect from '../FieldSelect.vue'; import FieldSelect from '../FieldSelect.vue';
import { QTree } from 'quasar'; import ShowDialog from '../ShowDialog.vue';
export default defineComponent({ export default defineComponent({
name: 'EventTree', name: 'EventTree',
components: { components: {
@@ -50,6 +57,7 @@ export default defineComponent({
FieldSelect, FieldSelect,
}, },
setup(props, context) { setup(props, context) {
const $q = useQuasar();
const appDg = ref(); const appDg = ref();
const store = useFlowEditorStore(); const store = useFlowEditorStore();
const showDialog = ref(false); const showDialog = ref(false);
@@ -58,62 +66,79 @@ export default defineComponent({
// const selectedFlow = store.currentFlow; // const selectedFlow = store.currentFlow;
// const expanded=ref(); // const expanded=ref();
const selectedEvent = ref<IKintoneEvent|null>(null); const selectedEvent = ref<IKintoneEvent | null>(null);
const selectedChangeEvent=ref<IKintoneEventGroup|null>(null); const selectedChangeEvent = ref<IKintoneEventGroup | null>(null);
const isFieldChange = (node:IKintoneEventNode)=>{ const isFieldChange = (node: IKintoneEventNode) => {
return node.header=='EVENT' && node.eventId.indexOf(".change.")>-1; return node.header == 'EVENT' && node.eventId.indexOf(".change.") > -1;
} }
//フィールド値変更イベント追加 //フィールド値変更イベント追加
const closeDg = (val:string) => { const closeDg = (val: string) => {
if (val == 'OK') { if (val == 'OK') {
if(!selectedChangeEvent.value){return;} if (!selectedChangeEvent.value) { return; }
const field = appDg.value.selected[0]; const field = appDg.value.selected[0];
const eventid = `${selectedChangeEvent.value.eventId}.${field.code}`; const eventid = `${selectedChangeEvent.value.eventId}.${field.code}`;
if(store.eventTree.findEventById(eventid)){ if (store.eventTree.findEventById(eventid)) {
return; return;
} }
selectedChangeEvent.value?.events.push( selectedChangeEvent.value?.events.push({
new kintoneEvent( eventId: eventid,
field.label, label: field.name,
eventid, parentId: selectedChangeEvent.value.eventId,
selectedChangeEvent.value.eventId) header: 'DELETABLE'
); });
tree.value?.expanded?.push(selectedChangeEvent.value.eventId); tree.value?.expanded?.push(selectedChangeEvent.value.eventId);
tree.value?.expandAll(); tree.value?.expandAll();
} }
}; };
const addChangeEvent=(node:IKintoneEventGroup)=>{ const addChangeEvent = (node: IKintoneEventGroup) => {
if(store.appInfo===undefined){ if (store.appInfo === undefined) {
return; return;
} }
selectedChangeEvent.value=node; selectedChangeEvent.value = node;
showDialog.value=true; showDialog.value = true;
} }
const onSelected=(node:IKintoneEvent)=>{
if(!node.eventId){ const deleteEvent = (node: IKintoneEvent) => {
return; if (!node.eventId) {
} return;
selectedEvent.value=node; }
if(store.appInfo===undefined){ store.deleteEvent(node);
return; store.selectFlow(undefined)
}
const screen = store.eventTree.findEventById(node.parentId); $q.notify({
let flow =store.findFlowByEventId(node.eventId); type: 'positive',
let screenName=screen!==null?screen.label:""; caption: "通知",
let nodeLabel = node.label; message: `イベント ${node.label} 削除`
// if(isFieldChange(node)){ })
// screenName=nodeLabel; }
// nodeLabel=`${node.label}の値を変更したとき`;
// } const onSelected = (node: IKintoneEvent) => {
if(flow!==undefined && flow!==null ){ if (!node.eventId) {
store.selectFlow(flow); return;
}else{ }
const root = new RootAction(node.eventId,screenName,nodeLabel) selectedEvent.value = node;
const flow =new ActionFlow(root); if (store.appInfo === undefined) {
store.flows?.push(flow); return;
store.selectFlow(flow); }
selectedEvent.value.flowData=flow; const screen = store.eventTree.findEventById(node.parentId);
}
let flow = store.findFlowByEventId(node.eventId);
let screenName = screen !== null ? screen.label : "";
let nodeLabel = node.label;
// if(isFieldChange(node)){
// screenName=nodeLabel;
// nodeLabel=`${node.label}の値を変更したとき`;
// }
if (flow !== undefined && flow !== null) {
store.selectFlow(flow);
} else {
const root = new RootAction(node.eventId, screenName, nodeLabel)
const flow = new ActionFlow(root);
store.flows?.push(flow);
store.selectFlow(flow);
selectedEvent.value.flowData = flow;
}
}; };
return { return {
// eventTree, // eventTree,
@@ -125,6 +150,7 @@ export default defineComponent({
onSelected, onSelected,
selectedEvent, selectedEvent,
addChangeEvent, addChangeEvent,
deleteEvent,
closeDg, closeDg,
store store
} }
@@ -132,20 +158,25 @@ export default defineComponent({
}); });
</script> </script>
<style lang="scss"> <style lang="scss">
.nowrap{ .nowrap {
flex-wrap:nowarp; flex-wrap: nowarp;
text-wrap:nowarp; text-wrap: nowarp;
} }
.event-node{
cursor:pointer; .event-node {
cursor: pointer;
} }
.selected-node{
.selected-node {
color: $primary; color: $primary;
font-weight: bolder; font-weight: bolder;
} }
.event-node:hover{
.event-node:hover {
background-color: $light-blue-1; background-color: $light-blue-1;
} }
.delete-btn {
margin-right: 5px;
}
</style> </style>

View File

@@ -1,6 +1,5 @@
<template> <template>
<div class="q-my-md" v-bind="$attrs">
<div class="q-my-md">
<q-card flat> <q-card flat>
<q-card-section class="q-pa-none q-my-sm q-mr-md"> <q-card-section class="q-pa-none q-my-sm q-mr-md">
<!-- <div class=" q-my-none ">App Field Select</div> --> <!-- <div class=" q-my-none ">App Field Select</div> -->
@@ -128,6 +127,7 @@ interface IAppFields{
} }
export default defineComponent({ export default defineComponent({
inheritAttrs:false,
name: 'FieldInput', name: 'FieldInput',
components: { components: {
ShowDialog, ShowDialog,

View File

@@ -0,0 +1,74 @@
<template>
<div class="" v-bind="$attrs">
<q-field v-model="color" :label="displayName" labelColor="primary" :clearable="isSelected" stack-label :bottom-slots="!isSelected" >
<template v-slot:control>
<q-chip text-color="black" color="white" v-if="isSelected">
<div class="row">
<div class="col-4">
<q-avatar class="shadow-1" :style="{ background: color }" size="xs"></q-avatar>
</div>
<div class="col">
{{ color }}
</div>
</div>
</q-chip>
</template>
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer" color="primary" >
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-color no-header default-view="palette" v-model="color" />
</q-popup-proxy>
</q-icon>
</template>
<template v-slot:hint>
{{ placeholder }}
</template>
</q-field>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, ref,watchEffect } from 'vue';
export default defineComponent({
inheritAttrs:false,
name: 'ColorPicker',
components: {
},
props: {
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 color = ref(props.modelValue??"");
const isSelected = computed(()=>props.modelValue && props.modelValue!=="");
watchEffect(()=>{
emit('update:modelValue', color.value);
});
return {
color,
isSelected
};
}
});
</script>

View File

@@ -1,18 +1,20 @@
<template> <template>
<q-field v-model="tree" :label="displayName" labelColor="primary" stack-label > <div v-bind="$attrs">
<template v-slot:control > <q-field v-model="tree" :label="displayName" labelColor="primary" stack-label >
<q-card flat class="full-width"> <template v-slot:control >
<q-card-actions vertical> <q-card flat class="full-width">
<q-btn color="grey-3" text-color="black" @click="showDg()">クリックで設定{{ isSetted?'設定済み':'未設定' }}</q-btn> <q-card-actions vertical>
</q-card-actions> <q-btn color="grey-3" text-color="black" @click="showDg()">クリックで設定{{ isSetted?'設定済み':'未設定' }}</q-btn>
<q-card-section class="text-caption" > </q-card-actions>
<div v-if="!isSetted">{{ placeholder }}</div> <q-card-section class="text-caption" >
<div v-else>{{ conditionString }}</div> <div v-if="!isSetted">{{ placeholder }}</div>
</q-card-section> <div v-else>{{ conditionString }}</div>
</q-card> </q-card-section>
</template> </q-card>
</q-field> </template>
<condition-editor v-model:show="show" v-model:conditionTree="tree" @closed="onClosed"></condition-editor> </q-field>
<condition-editor v-model:show="show" v-model:conditionTree="tree" @closed="onClosed"></condition-editor>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -21,6 +23,7 @@
import ConditionEditor from '../ConditionEditor/ConditionEditor.vue' import ConditionEditor from '../ConditionEditor/ConditionEditor.vue'
export default defineComponent({ export default defineComponent({
name: 'FieldInput', name: 'FieldInput',
inheritAttrs:false,
components: { components: {
ConditionEditor ConditionEditor
}, },

View File

@@ -1,18 +1,19 @@
<template> <template>
<div v-bind="$attrs">
<q-input v-model="selectedDate" :label="displayName" :placeholder="placeholder" label-color="primary" mask="date" :rules="['date']" stack-label> <q-input v-model="selectedDate" :label="displayName" :placeholder="placeholder" label-color="primary" mask="date" :rules="['date']" stack-label>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale"> <q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-date v-model="selectedDate"> <q-date v-model="selectedDate">
<div class="row items-center justify-end"> <div class="row items-center justify-end">
<q-btn v-close-popup label="Close" color="primary" flat /> <q-btn v-close-popup label="Close" color="primary" flat />
</div> </div>
</q-date> </q-date>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -20,6 +21,7 @@ import { defineComponent, ref ,watchEffect} from 'vue';
export default defineComponent({ export default defineComponent({
name: 'DatePicker', name: 'DatePicker',
inheritAttrs:false,
props: { props: {
displayName:{ displayName:{
type: String, type: String,

View File

@@ -1,9 +1,11 @@
<template> <template>
<q-input :label="displayName" v-model="inputValue" label-color="primary" :placeholder="placeholder" stack-label> <div v-bind="$attrs">
<template v-slot:append> <q-input :label="displayName" v-model="inputValue" label-color="primary" :placeholder="placeholder" stack-label>
<q-btn round dense flat icon="add" @click="addButtonEvent()" /> <template v-slot:append>
</template> <q-btn round dense flat icon="add" @click="addButtonEvent()" />
</q-input> </template>
</q-input>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -13,6 +15,7 @@ import { IKintoneEventGroup,kintoneEvent } from 'src/types/KintoneEvents';
export default defineComponent({ export default defineComponent({
name: 'EventSetter', name: 'EventSetter',
inheritAttrs:false,
props: { props: {
displayName:{ displayName:{
type: String, type: String,

View File

@@ -1,8 +1,9 @@
<template> <template>
<q-field v-model="selectedField" :label="displayName" labelColor="primary" <div v-bind="$attrs">
:clearable="isSelected" stack-label :bottom-slots="!isSelected" > <q-field v-model="selectedField" :label="displayName" labelColor="primary" :clearable="isSelected" stack-label
<template v-slot:control > :bottom-slots="!isSelected">
<q-chip color="primary" text-color="white" v-if="isSelected"> <template v-slot:control>
<q-chip color="primary" text-color="white" v-if="isSelected">
{{ selectedField.name }} {{ selectedField.name }}
</q-chip> </q-chip>
</template> </template>
@@ -14,85 +15,87 @@
</template> </template>
<template v-slot:append> <template v-slot:append>
<q-icon name="search" class="cursor-pointer" color="primary" @click="showDg"/> <q-icon name="search" class="cursor-pointer" color="primary" @click="showDg" />
</template> </template>
</q-field> </q-field>
<show-dialog v-model:visible="show" name="フィールド一覧" @close="closeDg" widht="400px"> <show-dialog v-model:visible="show" name="フィールド一覧" @close="closeDg" widht="400px">
<field-select ref="appDg" name="フィールド" type="single" :appId="store.appInfo?.appId"></field-select> <field-select ref="appDg" name="フィールド" type="single" :appId="store.appInfo?.appId"></field-select>
</show-dialog> </show-dialog>
</template> </div>
</template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref ,watchEffect,computed} from 'vue'; import { defineComponent, ref, watchEffect, computed } from 'vue';
import ShowDialog from '../ShowDialog.vue'; import ShowDialog from '../ShowDialog.vue';
import FieldSelect from '../FieldSelect.vue'; import FieldSelect from '../FieldSelect.vue';
import { useFlowEditorStore } from 'stores/flowEditor'; import { useFlowEditorStore } from 'stores/flowEditor';
interface IField{ interface IField {
name:string, name: string,
code:string, code: string,
type:string type: string
} }
export default defineComponent({ export default defineComponent({
name: 'FieldInput', name: 'FieldInput',
components: { inheritAttrs:false,
ShowDialog, components: {
FieldSelect, ShowDialog,
}, FieldSelect,
props: { },
displayName:{ props: {
type: String, displayName: {
default: '', type: String,
}, default: '',
name:{ },
type: String, name: {
default: '', type: String,
}, default: '',
placeholder: { },
type: String, placeholder: {
default: '', type: String,
}, default: '',
hint:{ },
type: String, hint: {
default: '', type: String,
}, default: '',
modelValue: { },
type: Object, modelValue: {
default: null type: Object,
}, default: null
}, },
},
setup(props, { emit }) { setup(props, { emit }) {
const appDg = ref(); const appDg = ref();
const show = ref(false); const show = ref(false);
const selectedField = ref(props.modelValue); const selectedField = ref(props.modelValue);
const store = useFlowEditorStore(); const store = useFlowEditorStore();
const isSelected = computed(()=>{ const isSelected = computed(() => {
return selectedField.value!==null && typeof selectedField.value === 'object' && ('name' in selectedField.value) return selectedField.value !== null && typeof selectedField.value === 'object' && ('name' in selectedField.value)
});
const showDg = () => {
show.value = true;
};
const closeDg = (val:string) => {
if (val == 'OK') {
selectedField.value = appDg.value.selected[0];
}
};
watchEffect(() => {
emit('update:modelValue', selectedField.value);
});
return {
store,
appDg,
show,
showDg,
closeDg,
selectedField,
isSelected
};
}
}); });
</script>
const showDg = () => {
show.value = true;
};
const closeDg = (val: string) => {
if (val == 'OK') {
selectedField.value = appDg.value.selected[0];
}
};
watchEffect(() => {
emit('update:modelValue', selectedField.value);
});
return {
store,
appDg,
show,
showDg,
closeDg,
selectedField,
isSelected
};
}
});
</script>

View File

@@ -1,24 +1,34 @@
<template> <template>
<q-input :label="displayName" v-model="inputValue" label-color="primary" :placeholder="placeholder" stack-label> <div v-bind="$attrs">
<template v-slot:append v-if="hint!==''"> <q-input :label="displayName" v-model="inputValue" label-color="primary"
<q-icon name="help" size="22px" color="blue-8"> :placeholder="placeholder" stack-label
<q-tooltip class="bg-yellow-2 text-black shadow-4" anchor="bottom right"><div class="hint-text" v-html="hint"/></q-tooltip> :rules="rulesExp"
</q-icon> :maxlength="maxLength"
</template> >
</q-input> <template v-slot:append v-if="hint !== ''">
<q-icon name="help" size="22px" color="blue-8">
<q-tooltip class="bg-yellow-2 text-black shadow-4" anchor="bottom right">
<div class="hint-text" v-html="hint" />
</q-tooltip>
</q-icon>
</template>
</q-input>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent,ref,watchEffect } from 'vue'; import { kMaxLength } from 'buffer';
import { defineComponent, ref, watchEffect } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'InputText', name: 'InputText',
inheritAttrs: false,
props: { props: {
displayName:{ displayName: {
type: String, type: String,
default: '', default: '',
}, },
name:{ name: {
type: String, type: String,
default: '', default: '',
}, },
@@ -26,33 +36,43 @@ export default defineComponent({
type: String, type: String,
default: '', default: '',
}, },
hint:{ hint: {
type: String, type: String,
default: '', default: '',
}, },
maxLength:{
type: Number,
default:undefined
},
//例:[val=>!!val ||'入力してください']
rules:{
type:String,
default:undefined
},
modelValue: { modelValue: {
type: String, type: String,
default: '', default: '',
}, },
}, },
setup(props , { emit }) { setup(props, { emit }) {
const inputValue = ref(props.modelValue); const inputValue = ref(props.modelValue);
const rulesExp = props.rules===undefined?null : eval(props.rules);
watchEffect(() => { watchEffect(() => {
emit('update:modelValue', inputValue.value); emit('update:modelValue', inputValue.value);
}); });
return { return {
inputValue, inputValue,
showhint:ref(false) showhint: ref(false),
rulesExp
}; };
}, },
}); });
</script> </script>
<style lang="scss"> <style lang="scss">
.hint-text{ .hint-text {
white-space : always; white-space: always;
max-width: 450px; max-width: 450px;
font-size: 1.2em; font-size: 1.2em;
} }

View File

@@ -1,18 +1,22 @@
<template> <template>
<q-input :label="displayName" label-color="primary" v-model="inputValue" :placeholder="placeholder" autogrow stack-label/> <div v-bind="$attrs">
<q-input :label="displayName" label-color="primary" v-model="inputValue" :placeholder="placeholder" autogrow
stack-label />
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent,ref,watchEffect } from 'vue'; import { defineComponent, ref, watchEffect } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'MuiltInputText', name: 'MuiltInputText',
inheritAttrs: false,
props: { props: {
displayName:{ displayName: {
type: String, type: String,
default: '', default: '',
}, },
name:{ name: {
type: String, type: String,
default: '', default: '',
}, },
@@ -20,7 +24,7 @@ export default defineComponent({
type: String, type: String,
default: '', default: '',
}, },
hint:{ hint: {
type: String, type: String,
default: '', default: '',
}, },

View File

@@ -0,0 +1,87 @@
<template>
<div class="" v-bind="$attrs">
<q-input v-model.number="numValue" type="number" :label="displayName" label-color="primary" stack-label bottom-slots
:min="min"
:max="max"
:rules="rulesExp"
>
<template v-slot:hint>
{{ placeholder }}
</template>
</q-input>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, ref, watchEffect } from 'vue';
export default defineComponent({
name: 'NumInput',
inheritAttrs:false,
components: {
},
props: {
displayName: {
type: String,
default: '',
},
name: {
type: String,
default: '',
},
placeholder: {
type: String,
default: '',
},
hint: {
type: String,
default: '',
},
min:{
type:Number,
default:undefined
},
max:{
type:Number,
default:undefined
},
//[val=>!!val ||'数値を入力してください',val=>val<=100 && val>=1 || '1-100の範囲内の数値を入力してください']
rules:{
type:String,
default:undefined
},
modelValue: {
type: [Number , String],
default: undefined
},
},
setup(props, { emit }) {
const numValue = ref(props.modelValue);
const rulesExp = props.rules===undefined?null : eval(props.rules);
const isError = computed(()=>{
const val = numValue.value;
if (val === undefined) {
return false;
}
const numVal = typeof val === "string" ? parseInt(val) : val;
// Ensure parsed value is a valid number
if (isNaN(numVal)) {
return true;
}
// Check against min and max boundaries, if defined
if ((props.min !== undefined && numVal < props.min) || (props.max !== undefined && numVal > props.max)) {
return true;
}
return false;
});
watchEffect(()=>{
emit("update:modelValue",numValue.value);
});
return {
numValue,
rulesExp
};
}
});
</script>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div v-for="(item, index) in properties" :key="index" > <div v-for="(item, index) in properties" :key="index" >
<component :is="item.component" v-bind="item.props" :connectProps="connectProps(item.props)" v-model="item.props.modelValue"></component> <component :is="item.component" v-bind="item.props" :connectProps="connectProps(item.props)" v-model="item.props.modelValue"></component>
</div> </div>
</div> </div>
</template> </template>
@@ -19,6 +19,8 @@ import AppFieldSelect from './AppFieldSelect.vue';
import MuiltInputText from '../right/MuiltInputText.vue'; import MuiltInputText from '../right/MuiltInputText.vue';
import ConditionInput from '../right/ConditionInput.vue'; import ConditionInput from '../right/ConditionInput.vue';
import EventSetter from '../right/EventSetter.vue'; import EventSetter from '../right/EventSetter.vue';
import ColorPicker from './ColorPicker.vue';
import NumInput from './NumInput.vue';
import { IActionNode,IActionProperty,IProp } from 'src/types/ActionTypes'; import { IActionNode,IActionProperty,IProp } from 'src/types/ActionTypes';
export default defineComponent({ export default defineComponent({
@@ -31,7 +33,9 @@ export default defineComponent({
AppFieldSelect, AppFieldSelect,
MuiltInputText, MuiltInputText,
ConditionInput, ConditionInput,
EventSetter EventSetter,
ColorPicker,
NumInput
}, },
props: { props: {
nodeProps: { nodeProps: {

View File

@@ -1,5 +1,7 @@
<template> <template>
<div v-bind="$attrs">
<q-select v-model="selectedValue" :label="displayName" :options="options"/> <q-select v-model="selectedValue" :label="displayName" :options="options"/>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -7,6 +9,7 @@ import { defineComponent,ref,watchEffect } from 'vue';
export default defineComponent({ export default defineComponent({
name: 'SelectBox', name: 'SelectBox',
inheritAttrs:false,
props: { props: {
displayName:{ displayName:{
type: String, type: String,

View File

@@ -1,44 +1,49 @@
import { api } from 'boot/axios'; import { api } from 'boot/axios';
import { ActionFlow } from 'src/types/ActionTypes'; import { ActionFlow } from 'src/types/ActionTypes';
export class FlowCtrl export class FlowCtrl {
{ async getFlows(appId: string): Promise<ActionFlow[]> {
const flows: ActionFlow[] = [];
async getFlows(appId:string):Promise<ActionFlow[]> try {
{ const result = await api.get(`api/flows/${appId}`);
const flows:ActionFlow[]=[]; //console.info(result.data);
try{ if (!result.data || !Array.isArray(result.data)) {
const result = await api.get(`api/flows/${appId}`); return [];
//console.info(result.data);
if(!result.data || !Array.isArray(result.data)){
return [];
}
for(const flow of result.data){
flows.push(ActionFlow.fromJSON(flow.content));
}
return flows;
}catch(error){
console.error(error);
return flows;
} }
for (const flow of result.data) {
flows.push(ActionFlow.fromJSON(flow.content));
}
return flows;
} catch (error) {
console.error(error);
return flows;
}
} }
async SaveFlow(jsonData:any):Promise<boolean> async SaveFlow(jsonData: any): Promise<boolean> {
{ const result = await api.post('api/flow', jsonData);
const result = await api.post('api/flow',jsonData); console.info(result.data);
console.info(result.data) return true;
return true;
} }
/** /**
* フローを更新する * フローを更新する
* @param jsonData * @param jsonData
* @returns * @returns
*/ */
async UpdateFlow(jsonData:any):Promise<boolean> async UpdateFlow(jsonData: any): Promise<boolean> {
{ const result = await api.put('api/flow/' + jsonData.flowid, jsonData);
const result = await api.put('api/flow/' + jsonData.flowid,jsonData); console.info(result.data);
console.info(result.data) return true;
}
/**
* フローを消去する
* @param flowId
* @returns
*/
async DeleteFlow(flowId: string): Promise<boolean> {
const result = await api.delete('api/flow/' + flowId);
console.info(result.data);
return true; return true;
} }
/** /**
@@ -46,12 +51,9 @@ export class FlowCtrl
* @param appid * @param appid
* @returns * @returns
*/ */
async depoly(appid:string):Promise<boolean> async depoly(appid: string): Promise<boolean> {
{
const result = await api.post(`api/v1/createjstokintone?app=${appid}`); const result = await api.post(`api/v1/createjstokintone?app=${appid}`);
console.info(result.data); console.info(result.data);
return true; return true;
} }
} }

View File

@@ -1,118 +1,142 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { AppInfo ,IActionFlow, IActionNode} from 'src/types/ActionTypes'; import { AppInfo, IActionFlow, IActionNode } from 'src/types/ActionTypes';
import { IKintoneEvent,KintoneEventManager } from 'src/types/KintoneEvents'; import { IKintoneEvent, KintoneEventManager } from 'src/types/KintoneEvents';
import {FlowCtrl } from '../control/flowctrl'; import { FlowCtrl } from '../control/flowctrl';
export interface FlowEditorState{ export interface FlowEditorState {
flowNames1:string; flowNames1: string;
appInfo?:AppInfo; appInfo?: AppInfo;
flows?:IActionFlow[]; flows?: IActionFlow[];
selectedFlow?:IActionFlow|undefined; selectedFlow?: IActionFlow | undefined;
activeNode:IActionNode|undefined; activeNode: IActionNode | undefined;
eventTree:KintoneEventManager; eventTree: KintoneEventManager;
selectedEvent:IKintoneEvent|undefined; selectedEvent: IKintoneEvent | undefined;
expandedScreen:any[]; expandedScreen: any[];
} }
const flowCtrl=new FlowCtrl(); const flowCtrl = new FlowCtrl();
const eventTree = new KintoneEventManager(); const eventTree = new KintoneEventManager();
export const useFlowEditorStore = defineStore("flowEditor",{ export const useFlowEditorStore = defineStore('flowEditor', {
state: ():FlowEditorState => ({ state: (): FlowEditorState => ({
flowNames1: '', flowNames1: '',
appInfo:undefined, appInfo: undefined,
flows:[], flows: [],
selectedFlow:undefined, selectedFlow: undefined,
activeNode:undefined, activeNode: undefined,
eventTree:eventTree, eventTree: eventTree,
selectedEvent:undefined, selectedEvent: undefined,
expandedScreen:[] expandedScreen: [],
}), }),
getters: { getters: {
/** /**
* *
* @returns 現在編集しているフロー * @returns 現在編集しているフロー
*/ */
currentFlow():IActionFlow|undefined{ currentFlow(): IActionFlow | undefined {
return this.selectedFlow; return this.selectedFlow;
}, },
/** /**
* KintoneイベントIDから、バンドしているフローを検索する * KintoneイベントIDから、バンドしているフローを検索する
* @param state * @param state
* @returns * @returns
*/ */
findFlowByEventId(state){ findFlowByEventId(state) {
return (eventId:string)=>{ return (eventId: string) => {
return state.flows?.find((flow)=>{ return state.flows?.find((flow) => {
const root=flow.getRoot(); const root = flow.getRoot();
return root?.name===eventId return root?.name === eventId;
}); });
} };
} },
findEventById(state) {
return (eventId: string) => {
return state.eventTree.findEventById(eventId);
};
},
}, },
actions: { actions: {
setFlows(flows:IActionFlow[]){ setFlows(flows: IActionFlow[]) {
this.flows=flows; this.flows = flows;
}, },
selectFlow(flow:IActionFlow){ selectFlow(flow: IActionFlow | undefined) {
this.selectedFlow=flow; this.selectedFlow = flow;
}, },
setActiveNode(node:IActionNode){ setActiveNode(node: IActionNode) {
this.activeNode=node; this.activeNode = node;
}, },
setApp(app:AppInfo){ setApp(app: AppInfo) {
this.appInfo=app; this.appInfo = app;
}, },
/** /**
* DBからフルーを保存する * DBからフルーを保存する
* @returns * @returns
*/ */
async loadFlow(){ async loadFlow() {
if(this.appInfo===undefined) return; if (this.appInfo === undefined) return;
const actionFlows = await flowCtrl.getFlows(this.appInfo?.appId); const actionFlows = await flowCtrl.getFlows(this.appInfo?.appId);
//eventTreeにバンドする //eventTreeにバンドする
this.eventTree.bindFlows(actionFlows); this.eventTree.bindFlows(actionFlows);
if(actionFlows===undefined || actionFlows.length===0){ if (actionFlows === undefined || actionFlows.length === 0) {
this.flows=[]; this.flows = [];
this.selectedFlow=undefined; this.selectedFlow = undefined;
return; return;
} }
this.setFlows(actionFlows); this.setFlows(actionFlows);
if(actionFlows && actionFlows.length>0){ if (actionFlows && actionFlows.length > 0) {
this.selectFlow(actionFlows[0]); this.selectFlow(actionFlows[0]);
} }
const expandNames = actionFlows.map(flow=>flow.getRoot()?.title); const expandNames = actionFlows.map((flow) => flow.getRoot()?.title);
// const expandName =actionFlows[0].getRoot()?.title; // const expandName =actionFlows[0].getRoot()?.title;
this.expandedScreen=expandNames; this.expandedScreen = expandNames;
}, },
/** /**
* フローをDBに保存及び更新する * フローをDBに保存及び更新する
*/ */
async saveFlow(flow:IActionFlow){ async saveFlow(flow: IActionFlow) {
const root=flow.getRoot(); const root = flow.getRoot();
const isNew = flow.id===''; const isNew = flow.id === '';
const jsonData={ const jsonData = {
flowid: isNew ? flow.createNewId():flow.id, flowid: isNew ? flow.createNewId() : flow.id,
appid: this.appInfo?.appId, appid: this.appInfo?.appId,
eventid: root?.name, eventid: root?.name,
name: root?.subTitle, name: root?.subTitle,
content: JSON.stringify(flow) content: JSON.stringify(flow),
} };
if(isNew){ if (isNew) {
return await flowCtrl.SaveFlow(jsonData); return await flowCtrl.SaveFlow(jsonData);
}else{ } else {
return await flowCtrl.UpdateFlow(jsonData); return await flowCtrl.UpdateFlow(jsonData);
} }
}, },
deleteEvent(event: IKintoneEvent) {
const store = useFlowEditorStore();
if (event.flowData) {
const flow = event.flowData;
if (flow.id === '') {
return;
}
flowCtrl.DeleteFlow(flow.id)
eventTree.deleteEvent(event, store);
if(this.flows){
this.flows = this.flows.filter((f) => f.id !== flow.id);
}
} else {
eventTree.deleteEvent(event, store);
}
},
/** /**
* デプロイする * デプロイする
*/ */
async deploy():Promise<boolean>{ async deploy(): Promise<boolean> {
if(this.appInfo===undefined){ if (this.appInfo === undefined) {
return false; return false;
} }
return await flowCtrl.depoly(this.appInfo?.appId); return await flowCtrl.depoly(this.appInfo?.appId);
} },
},
}
}); });

View File

@@ -1,9 +1,10 @@
import {IActionFlow} from './ActionTypes'; import { useFlowEditorStore } from 'src/stores/flowEditor';
import { IActionFlow } from './ActionTypes';
export interface IKintoneEventNode { export interface IKintoneEventNode {
label: string; label: string;
header:string; header: string;
eventId:string; eventId: string;
parentId:string; parentId: string;
} }
export interface IKintoneEvent extends IKintoneEventNode { export interface IKintoneEvent extends IKintoneEventNode {
@@ -15,60 +16,64 @@ export interface IKintoneEventGroup extends IKintoneEventNode {
events: IKintoneEventNode[]; events: IKintoneEventNode[];
} }
export class kintoneEvent implements IKintoneEvent {
export class kintoneEvent implements IKintoneEvent{
eventId: string; eventId: string;
parentId:string; parentId: string;
get hasFlow(): boolean{ get hasFlow(): boolean {
return this.flowData!==undefined && this.flowData.actionNodes.length>1 return this.flowData !== undefined && this.flowData.actionNodes.length > 1;
}; }
flowData?: IActionFlow | undefined; flowData?: IActionFlow | undefined;
label: string; label: string;
get header():string{ header = 'EVENT';
return "EVENT"; constructor(label: string, eventId: string, parentId: string) {
} this.eventId = eventId;
constructor(label:string,eventId:string,parentId:string){ this.label = label;
this.eventId=eventId; this.parentId = parentId;
this.label=label;
this.parentId=parentId;
} }
} }
export class kintoneEventGroup implements IKintoneEventGroup{ export class kintoneEventGroup implements IKintoneEventGroup {
eventId: string; eventId: string;
parentId:string; parentId: string;
label: string; label: string;
events: IKintoneEventNode[]; events: IKintoneEventNode[];
get header():string{ get header(): string {
return "EVENTGROUP"; return 'EVENTGROUP';
} }
constructor(eventId:string,label:string,events:IKintoneEventNode[],parentId:string){ constructor(
this.eventId=eventId; eventId: string,
this.label=label; label: string,
this.events=events; events: IKintoneEventNode[],
this.parentId=parentId; parentId: string
) {
this.eventId = eventId;
this.label = label;
this.events = events;
this.parentId = parentId;
} }
} }
export class kintoneEventForChange implements IKintoneEventGroup {
export class kintoneEventForChange implements IKintoneEventGroup{
eventId: string; eventId: string;
parentId:string; parentId: string;
label: string; label: string;
events: IKintoneEventNode[]; events: IKintoneEventNode[];
get header():string{ get header(): string {
return "CHANGE"; return 'CHANGE';
} }
constructor(eventId:string,label:string,events:IKintoneEventNode[],parentId:string){ constructor(
this.eventId=eventId; eventId: string,
this.label=label; label: string,
this.events=events; events: IKintoneEventNode[],
this.parentId=parentId; parentId: string
) {
this.eventId = eventId;
this.label = label;
this.events = events;
this.parentId = parentId;
} }
} }
export class KintoneEventManager { export class KintoneEventManager {
public screens: IKintoneEventGroup[]; public screens: IKintoneEventGroup[];
@@ -76,28 +81,35 @@ export class KintoneEventManager {
this.screens = this.getKintoneEvents(); this.screens = this.getKintoneEvents();
} }
public bindFlows(flows:IActionFlow[]){ public bindFlows(flows: IActionFlow[]) {
this.screens=this.getKintoneEvents(); this.screens = this.getKintoneEvents();
for (const flow of flows){ for (const flow of flows) {
const eventId =flow.getRoot()?.name; const eventId = flow.getRoot()?.name;
if(eventId!==undefined){ if (eventId !== undefined) {
const eventNode = this.findEventById(eventId); const eventNode = this.findEventById(eventId);
if(eventNode!==null && eventNode.header==="EVENT"){ if (eventNode !== null && eventNode.header === 'EVENT') {
const event =eventNode as kintoneEvent; const event = eventNode as kintoneEvent;
event.flowData=flow; event.flowData = flow;
}else{ } else {
//EventGroupのIDを取得 //EventGroupのIDを取得
const lastIndex = eventId.lastIndexOf("."); const lastIndex = eventId.lastIndexOf('.');
const groupId=eventId.substring(0,lastIndex); const groupId = eventId.substring(0, lastIndex);
const eventNode = this.findEventById(groupId); const eventNode = this.findEventById(groupId);
if(eventNode && (eventNode.header==="EVENTGROUP" || eventNode.header==="CHANGE")){ if (
const groupEvent=eventNode as kintoneEventGroup; eventNode &&
const newEvent =new kintoneEvent( (eventNode.header === 'EVENTGROUP' || eventNode.header === 'CHANGE')
flow.getRoot()?.subTitle || "", ) {
eventId, const groupEvent = eventNode as kintoneEventGroup;
groupEvent.parentId
); const newEvent = {
newEvent.flowData=flow; label: flow.getRoot()?.subTitle || '',
eventId: eventId,
parentId: groupId,
header: 'DELETABLE',
hasFlow: true,
flowData: flow,
};
groupEvent.events.push(newEvent); groupEvent.events.push(newEvent);
} }
} }
@@ -106,61 +118,193 @@ export class KintoneEventManager {
} }
public findEventById(eventId: string): IKintoneEventNode | null { public findEventById(eventId: string): IKintoneEventNode | null {
const screen=this.findScreen(eventId); const screen = this.findScreen(eventId);
if(screen) {return screen;} if (screen) {
return screen;
}
for (const screen of this.screens) { for (const screen of this.screens) {
for (const event of screen.events) { for (const event of screen.events) {
if (event.eventId === eventId) { if (event.eventId === eventId) {
return event; return event;
} }
if(event.header==="EVENTGROUP"||event.header==="CHANGE"){ if (event.header === 'EVENTGROUP' || event.header === 'CHANGE') {
const eventGroup = event as IKintoneEventGroup; const eventGroup = event as IKintoneEventGroup;
const targetEvent = eventGroup.events.find((ev)=>{ const targetEvent = eventGroup.events.find((ev) => {
return ev.eventId===eventId; return ev.eventId === eventId;
}) });
if(targetEvent){ if (targetEvent) {
return targetEvent; return targetEvent;
}
} }
}
} }
} }
return null; return null;
} }
public findScreen(eventId:string):IKintoneEventGroup|undefined{ public findScreen(eventId: string): IKintoneEventGroup | undefined {
return this.screens.find(screen=>screen.eventId==eventId); return this.screens.find((screen) => screen.eventId == eventId);
} }
public getKintoneEvents():IKintoneEventGroup[]{ public deleteEvent(
event: kintoneEvent,
store: ReturnType<typeof useFlowEditorStore>
) {
if (event.header !== 'DELETABLE') {
return;
}
const parent = store.findEventById(event.parentId);
if (parent?.header !== 'CHANGE' && parent?.header !== 'EVENTGROUP') {
return;
}
const realParent = parent as kintoneEventForChange;
const index = realParent.events.findIndex(
(e) => e.eventId === event.eventId
);
if (index !== -1) {
realParent.events.splice(index, 1);
}
}
public getKintoneEvents(): IKintoneEventGroup[] {
return [ return [
new kintoneEventGroup("app.record.create","レコード追加画面",[ new kintoneEventGroup(
new kintoneEvent('レコード追加画面を表示した後','app.record.create.show',"app.record.create"), 'app.record.create',
new kintoneEvent('保存をクリックしたとき','app.record.create.submit',"app.record.create"), 'レコード追加画面',
new kintoneEvent('保存が成功したとき','app.record.create.submit.success',"app.record.create"), [
new kintoneEventForChange('app.record.create.change','フィールドの値を変更したとき',[],"app.record.create"), new kintoneEvent(
new kintoneEventGroup('app.record.create.show.customButtonClick','ボタンをクリックした',[],"app.record.create") 'レコード追加画面を表示した',
],""), 'app.record.create.show',
new kintoneEventGroup("app.record.detail","レコード詳細画面",[ 'app.record.create'
new kintoneEvent('レコード詳細画面を表示した後','app.record.detail.show',"app.record.detail"), ),
new kintoneEvent('レコードを削除するとき','app.record.detail.delete.submit',"app.record.detail"), new kintoneEvent(
new kintoneEvent('プロセス管理のアクションを実行したとき','app.record.detail.process.proceed',"app.record.detail"), '保存をクリックしたとき',
new kintoneEventGroup('app.record.detail.show.customButtonClick','ボタンをクリックした時',[],"app.record.detail"), 'app.record.create.submit',
],""), 'app.record.create'
new kintoneEventGroup("app.record.edit","レコード編集画面",[ ),
new kintoneEvent('レコード編集画面を表示した後','app.record.edit.show',"app.record.edit"), new kintoneEvent(
new kintoneEvent('保存をクリックしたとき','app.record.edit.submit',"app.record.edit"), '保存が成功したとき',
new kintoneEvent('保存が成功したとき','app.record.edit.submit.success',"app.record.edit"), 'app.record.create.submit.success',
new kintoneEventForChange('app.record.edit.change','フィールドの値を変更したとき',[],"app.record.edit"), 'app.record.create'
new kintoneEventGroup('app.record.edit.show.customButtonClick','ボタンをクリックした時',[],"app.record.edit"), ),
],""), new kintoneEventForChange(
new kintoneEventGroup("app.record.index","レコード一覧画面",[ 'app.record.create.change',
new kintoneEvent('一覧画面を表示した後', 'app.record.index.show',"app.record.index"), 'フィールドの値を変更したとき',
new kintoneEvent('インライン編集を開始したとき','app.record.index.edit.show',"app.record.index"), [],
new kintoneEvent('インライン編集の【保存】をクリックしたとき','app.record.index.edit.submit',"app.record.index"), 'app.record.create'
new kintoneEvent('インライン編集の保存が成功したとき', 'app.record.index.edit.submit.success',"app.record.index"), ),
new kintoneEventForChange('app.record.index.edit.change','インライン編集のフィールド値を変更したとき' ,[],"app.record.index"), new kintoneEventGroup(
new kintoneEventGroup('app.record.detail.show.customButtonClick','ボタンをクリックした時',[],"app.record.index"), 'app.record.create.show.customButtonClick',
],"") 'ボタンをクリックした時',
[],
'app.record.create'
),
],
''
),
new kintoneEventGroup(
'app.record.detail',
'レコード詳細画面',
[
new kintoneEvent(
'レコード詳細画面を表示した後',
'app.record.detail.show',
'app.record.detail'
),
new kintoneEvent(
'レコードを削除するとき',
'app.record.detail.delete.submit',
'app.record.detail'
),
new kintoneEvent(
'プロセス管理のアクションを実行したとき',
'app.record.detail.process.proceed',
'app.record.detail'
),
new kintoneEventGroup(
'app.record.detail.show.customButtonClick',
'ボタンをクリックした時',
[],
'app.record.detail'
),
],
''
),
new kintoneEventGroup(
'app.record.edit',
'レコード編集画面',
[
new kintoneEvent(
'レコード編集画面を表示した後',
'app.record.edit.show',
'app.record.edit'
),
new kintoneEvent(
'保存をクリックしたとき',
'app.record.edit.submit',
'app.record.edit'
),
new kintoneEvent(
'保存が成功したとき',
'app.record.edit.submit.success',
'app.record.edit'
),
new kintoneEventForChange(
'app.record.edit.change',
'フィールドの値を変更したとき',
[],
'app.record.edit'
),
new kintoneEventGroup(
'app.record.edit.show.customButtonClick',
'ボタンをクリックした時',
[],
'app.record.edit'
),
],
''
),
new kintoneEventGroup(
'app.record.index',
'レコード一覧画面',
[
new kintoneEvent(
'一覧画面を表示した後',
'app.record.index.show',
'app.record.index'
),
new kintoneEvent(
'インライン編集を開始したとき',
'app.record.index.edit.show',
'app.record.index'
),
new kintoneEvent(
'インライン編集の【保存】をクリックしたとき',
'app.record.index.edit.submit',
'app.record.index'
),
new kintoneEvent(
'インライン編集の保存が成功したとき',
'app.record.index.edit.submit.success',
'app.record.index'
),
new kintoneEventForChange(
'app.record.index.edit.change',
'インライン編集のフィールド値を変更したとき',
[],
'app.record.index'
),
new kintoneEventGroup(
'app.record.detail.show.customButtonClick',
'ボタンをクリックした時',
[],
'app.record.index'
),
],
''
),
]; ];
} }
} }

View File

@@ -2,25 +2,22 @@
"id": "", "id": "",
"actionNodes": [ "actionNodes": [
{ {
"id": "cdd696f5-7e9c-4fd7-bf8b-9cd1b1605870", "id": "c5cd772a-04be-418e-a811-3787f98a2285",
"name": "app.record.create.submit", "name": "app.record.create.show",
"title": "レコード追加画面", "title": "レコード追加画面",
"subTitle": "保存をクリックしたとき", "subTitle": "レコード追加画面を表示した後",
"inputPoint": "", "inputPoint": "",
"outputPoints": [], "outputPoints": [],
"isRoot": true, "isRoot": true,
"actionProps": [], "actionProps": [],
"ActionValue": {}, "ActionValue": {},
"nextNodeIds": [ "nextNodeIds": {
[ "": "1eb097b1-9d08-462e-97b0-6e3e1232edef"
"", }
"dfa6df09-7b3e-4848-89ad-2e9147004f31"
]
]
}, },
{ {
"id": "dfa6df09-7b3e-4848-89ad-2e9147004f31", "id": "1eb097b1-9d08-462e-97b0-6e3e1232edef",
"name": "自動採番する", "name": "属性UIテスト用",
"inputPoint": "", "inputPoint": "",
"outputPoints": [], "outputPoints": [],
"actionProps": [ "actionProps": [
@@ -31,185 +28,86 @@
"displayName": "表示名", "displayName": "表示名",
"placeholder": "表示を入力してください", "placeholder": "表示を入力してください",
"hint": "", "hint": "",
"modelValue": "文書番号を自動採番する" "modelValue": "属性UIテスト用"
} }
}, },
{ {
"component": "FieldInput", "component": "AppFieldSelect",
"props": { "props": {
"displayName": "採番項目", "displayName": "フィールド選択(複数)",
"modelValue": { "modelValue": {
"name": "文書番号", "app": {
"type": "SINGLE_LINE_TEXT", "id": "64",
"code": "文書番号", "name": "日報テスト",
"label": "文書番号", "description": "日々の業務内容、報告事項、所感などを記載していくアプリです。\n記録を行うだけでなく、あとからの振り返りやメンバー間のコミュニケーションにも活用できます。",
"noLabel": false, "createdate": "2023/07/15 10:15:03"
"required": false, },
"minLength": "", "fields": [
"maxLength": "", {
"expression": "", "name": "ステータス",
"hideExpression": false, "type": "STATUS",
"unique": false, "code": "ステータス",
"defaultValue": "" "label": "ステータス",
"enabled": false
}
]
}, },
"name": "field", "name": "selectFields",
"placeholder": "採番項目を選択してください" "placeholder": "アプリ選択後、フィールドを選んでください",
"selectType": "multiple"
} }
}, },
{ {
"component": "InputText", "component": "AppFieldSelect",
"props": { "props": {
"displayName": "フォーマット", "displayName": "フィールド選択(単一)",
"modelValue": "000000",
"name": "format",
"placeholder": "数値書式文字列を指定します"
}
},
{
"component": "InputText",
"props": {
"displayName": "前につける文字列",
"modelValue": "",
"name": "prefix",
"placeholder": "前につける文字列を入力してください"
}
},
{
"component": "InputText",
"props": {
"displayName": "後ろにつける文字列",
"modelValue": "{$format('yyyyMMdd')}",
"name": "suffix",
"placeholder": "後ろにつける文字列を入力してください"
}
},
{
"component": "InputText",
"props": {
"displayName": "結果(戻り値)",
"modelValue": "docNumber",
"name": "verName",
"placeholder": "変数名を入力してください"
}
}
],
"prevNodeId": "cdd696f5-7e9c-4fd7-bf8b-9cd1b1605870",
"nextNodeIds": [
[
"",
"b32bf329-f05a-486f-9b79-9920b57fe324"
]
]
},
{
"id": "b32bf329-f05a-486f-9b79-9920b57fe324",
"name": "条件式",
"inputPoint": "",
"outputPoints": [
"はい",
"いいえ"
],
"actionProps": [
{
"component": "InputText",
"props": {
"name": "displayName",
"displayName": "表示名",
"placeholder": "表示を入力してください",
"hint": "",
"modelValue": "条件式を設定する"
}
},
{
"component": "ConditionInput",
"props": {
"displayName": "条件",
"modelValue": "{\"index\":0,\"type\":\"root\",\"children\":[{\"index\":1,\"type\":\"condition\",\"parent\":\"root\",\"object\":{\"name\":\"部署\",\"objectType\":\"field\",\"type\":\"DROP_DOWN\",\"code\":\"ドロップダウン\",\"label\":\"部署\",\"noLabel\":false,\"required\":false,\"options\":{\"総務\":{\"label\":\"総務\",\"index\":\"2\"},\"サポート\":{\"label\":\"サポート\",\"index\":\"3\"},\"マーケティング\":{\"label\":\"マーケティング\",\"index\":\"1\"},\"営業\":{\"label\":\"営業\",\"index\":\"0\"},\"開発\":{\"label\":\"開発\",\"index\":\"4\"}},\"defaultValue\":\"\"},\"operator\":\"!=\",\"value\":\"\"},{\"index\":2,\"type\":\"condition\",\"parent\":\"root\",\"object\":{\"name\":\"所感、学び\",\"objectType\":\"field\",\"type\":\"MULTI_LINE_TEXT\",\"code\":\"文字列__複数行__0\",\"label\":\"所感、学び\",\"noLabel\":false,\"required\":false,\"defaultValue\":\"\"},\"operator\":\"!=\",\"value\":\"\"},{\"index\":3,\"type\":\"condition\",\"parent\":\"root\",\"object\":{\"name\":\"業務内容\",\"objectType\":\"field\",\"type\":\"MULTI_LINE_TEXT\",\"code\":\"文字列__複数行_\",\"label\":\"業務内容\",\"noLabel\":false,\"required\":false,\"defaultValue\":\"\"},\"operator\":\"!=\",\"value\":\"\"},{\"index\":4,\"type\":\"condition\",\"parent\":\"root\",\"object\":{\"name\":\"ステータス\",\"objectType\":\"field\",\"type\":\"STATUS\",\"code\":\"ステータス\",\"label\":\"ステータス\",\"enabled\":true},\"operator\":\"=\",\"value\":\"作成中\"}],\"parent\":null,\"logicalOperator\":\"AND\"}",
"name": "condition",
"placeholder": "条件式を設定してください"
}
},
{
"component": "InputText",
"props": {
"displayName": "結果(戻り値)",
"modelValue": "conditionResult",
"name": "verName",
"placeholder": "変数名を入力してください"
}
}
],
"prevNodeId": "dfa6df09-7b3e-4848-89ad-2e9147004f31",
"nextNodeIds": [
[
"いいえ",
"82bdcbcc-d8c1-4e2c-b38f-f736c95b193a"
]
]
},
{
"id": "82bdcbcc-d8c1-4e2c-b38f-f736c95b193a",
"name": "表示/非表示",
"inputPoint": "いいえ",
"outputPoints": [],
"actionProps": [
{
"component": "InputText",
"props": {
"name": "displayName",
"displayName": "表示名",
"placeholder": "表示を入力してください",
"hint": "",
"modelValue": "指定項目の表示・非表示を設定する"
}
},
{
"component": "FieldInput",
"props": {
"displayName": "フィールド",
"modelValue": { "modelValue": {
"name": "文書番号", "app": {
"type": "SINGLE_LINE_TEXT", "id": "58",
"code": "文書番号", "name": "日報",
"label": "文書番号", "description": "",
"noLabel": false, "createdate": "2023/07/13 19:05:26"
"required": false, },
"minLength": "", "fields": [
"maxLength": "", {
"expression": "", "name": "所感、学び",
"hideExpression": false, "type": "MULTI_LINE_TEXT",
"unique": false, "code": "文字列__複数行__0",
"defaultValue": "" "label": "所感、学び",
"noLabel": false,
"required": false,
"defaultValue": ""
}
]
}, },
"name": "field", "name": "selectField",
"placeholder": "対象項目を選択してください" "placeholder": "アプリ選択後、フィールドを選んでください",
"selectType": "single"
} }
}, },
{ {
"component": "SelectBox", "component": "ColorPicker",
"props": { "props": {
"displayName": "表示/非表示", "displayName": "色選択",
"options": [ "modelValue": "#f50000",
"表示", "name": "color",
"非表示" "placeholder": "カラーを選択してください"
],
"modelValue": "非表示",
"name": "show",
"placeholder": ""
} }
}, },
{ {
"component": "ConditionInput", "component": "NumInput",
"props": { "props": {
"displayName": "条件", "displayName": "数値入力フィールド",
"modelValue": "{\"index\":0,\"type\":\"root\",\"children\":[{\"index\":1,\"type\":\"condition\",\"parent\":\"root\",\"object\":{},\"operator\":\"=\",\"value\":\"\"}],\"parent\":null,\"logicalOperator\":\"AND\"}", "modelValue": 100,
"name": "condition", "name": "num",
"placeholder": "条件式を設定してください" "max": 100,
"min": 0,
"placeholder": "数値を入力してください"
} }
} }
], ],
"prevNodeId": "b32bf329-f05a-486f-9b79-9920b57fe324", "prevNodeId": "c5cd772a-04be-418e-a811-3787f98a2285",
"nextNodeIds": [] "nextNodeIds": {}
} }
] ]
} }

View File

@@ -2,36 +2,54 @@
{ {
"component": "InputText", "component": "InputText",
"props": { "props": {
"displayName": "ボタン名", "displayName": "文字入力",
"modelValue": "", "modelValue": "",
"name": "buttonName", "name": "str",
"placeholder": "ボタンのラベルを入力してください" "placeholder": "文字を入力してください",
"maxLength":"20",
"hint":"文字列入力<br>入力ルール指定可能。ルールの設定例:[val=>!!val||'必須入力です']",
"rules":"[val=>!!val||'必須入力です']"
} }
}, },
{ {
"component": "SelectBox", "component": "AppFieldSelect",
"props": { "props": {
"displayName": "追加位置", "displayName": "フィールド選択(複数)",
"modelValue": "", "modelValue": {},
"name": "position", "name": "selectFields",
"options":[ "placeholder": "アプリ選択後、フィールドを選んでください",
"一番右に追加する", "selectType":"multiple"
"一番左に追加する"
],
"placeholder": "追加位置を選択してください"
} }
}, },
{ {
"component": "EventSetter", "component": "AppFieldSelect",
"props": { "props": {
"displayName": "イベント名", "displayName": "フィールド選択(単一)",
"modelValue": {},
"name": "selectField",
"placeholder": "アプリ選択後、フィールドを選んでください",
"selectType":"single"
}
},
{
"component": "ColorPicker",
"props": {
"displayName": "色選択",
"modelValue": "", "modelValue": "",
"name": "eventName", "name": "color",
"connectProps":[{ "placeholder": "カラーを選択してください"
"key":"displayName", }
"propName":"buttonName" },
}], {
"placeholder": "イベント名を入力してください" "component": "NumInput",
"props": {
"displayName": "数値入力フィールド",
"modelValue": "",
"name": "num",
"max":100,
"min":0,
"placeholder": "数値を入力してください",
"rules":"[val=>!!val ||'数値を入力してください',val=>val<=100 && val>=1 || '1-100の範囲内の数値を入力してください']"
} }
} }
] ]