feat:データマッピングアクション変更
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
|
|||||||
<div class="q-mb-xs q-ml-md text-primary">アプリ選択</div>
|
<div class="q-mb-xs q-ml-md text-primary">アプリ選択</div>
|
||||||
|
|
||||||
<div class="q-pa-md row" style="border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 4px;">
|
<div class="q-pa-md row" style="border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 4px;">
|
||||||
<div v-if="selectedField?.app && !showSelectApp">{{ selectedField.app?.name }}</div>
|
<div v-if="selField?.app && !showSelectApp">{{ selField.app?.name }}</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div>
|
<div>
|
||||||
<q-btn outline dense label="選 択" padding="none sm" color="primary" @click="() => {
|
<q-btn outline dense label="選 択" padding="none sm" color="primary" @click="() => {
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!showSelectApp && selectedField.app?.name">
|
<div v-if="!showSelectApp && selField.app?.name">
|
||||||
<div>
|
<div>
|
||||||
<div class="row q-mb-md">
|
<div class="row q-mb-md">
|
||||||
<!-- <div class="col"> -->
|
<!-- <div class="col"> -->
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<field-select ref="fieldDlg" name="フィールド" :type="selectType" :updateSelects="updateItems"
|
<field-select ref="fieldDlg" name="フィールド" :type="selectType" :updateSelects="updateItems"
|
||||||
:appId="selectedField.app?.id" not_page :filter="fieldFilter"
|
:appId="selField.app?.id" not_page :filter="fieldFilter"
|
||||||
:selectedFields="selectedField.fields"></field-select>
|
:selFields="selField.fields"></field-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, watchEffect, computed } from 'vue';
|
import { defineComponent, ref, watchEffect, computed ,reactive} 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';
|
||||||
@@ -85,7 +85,7 @@ export default defineComponent({
|
|||||||
AppSelectBox,
|
AppSelectBox,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selectedField: {
|
selectedField: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
@@ -99,39 +99,39 @@ export default defineComponent({
|
|||||||
const appDlg = ref();
|
const appDlg = ref();
|
||||||
const fieldDlg = ref();
|
const fieldDlg = ref();
|
||||||
const showSelectApp = ref(false);
|
const showSelectApp = ref(false);
|
||||||
const selectedField = props.selectedField;
|
const selField = reactive(props.selectedField);
|
||||||
console.log(props.selectedField);
|
console.log(props.selectedField);
|
||||||
|
|
||||||
const store = useFlowEditorStore();
|
const store = useFlowEditorStore();
|
||||||
|
|
||||||
const isSelected = computed(() => {
|
const isSelected = computed(() => {
|
||||||
return selectedField !== null && typeof selectedField === 'object' && ('app' in selectedField)
|
return selField !== null && typeof selField === 'object' && ('app' in selField)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const closeAppDlg = (val: string) => {
|
const closeAppDlg = (val: string) => {
|
||||||
if (val == 'OK') {
|
if (val == 'OK') {
|
||||||
selectedField.app = appDlg.value.selected[0];
|
selField.app = appDlg.value.selected[0];
|
||||||
selectedField.fields = [];
|
selField.fields = [];
|
||||||
showSelectApp.value = false;
|
showSelectApp.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeFieldDialog = (val: string) => {
|
const closeFieldDialog = (val: string) => {
|
||||||
if (val == 'OK') {
|
if (val == 'OK') {
|
||||||
selectedField.fields = fieldDlg.value.selected;
|
selField.fields = fieldDlg.value.selected;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const updateExternalSelectAppInfo = (newAppinfo: IApp) => {
|
const updateExternalSelectAppInfo = (newAppinfo: IApp) => {
|
||||||
selectedField.app = newAppinfo
|
selField.app = newAppinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateItems = (newFields: IField[]) => {
|
const updateItems = (newFields: IField[]) => {
|
||||||
selectedField.fields = newFields
|
selField.fields = newFields
|
||||||
}
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
emit('update:modelValue', selectedField);
|
emit('update:modelValue', selField);
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -145,6 +145,7 @@ export default defineComponent({
|
|||||||
filter: ref(),
|
filter: ref(),
|
||||||
updateItems,
|
updateItems,
|
||||||
fieldFilter: ref(),
|
fieldFilter: ref(),
|
||||||
|
selField
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<template v-slot:control>
|
<template v-slot:control>
|
||||||
<q-card flat class="full-width">
|
<q-card flat class="full-width">
|
||||||
<q-card-actions vertical>
|
<q-card-actions vertical>
|
||||||
<q-btn color="grey-3" text-color="black" @click="() => { dgIsShow = true }">APP SELECT</q-btn>
|
<q-btn color="grey-3" text-color="black" @click="() => { dgIsShow = true }">アプリ選択</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
<q-card-section class="text-caption">
|
<q-card-section class="text-caption">
|
||||||
<div v-if="selectedField.app.name">
|
<div v-if="selectedField.app.name">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</q-card>
|
</q-card>
|
||||||
</template>
|
</template>
|
||||||
</q-field>
|
</q-field>
|
||||||
<show-dialog v-model:visible="dgIsShow" name="DataMapping" @close="closeDg" min-width="50vw" min-height="60vh">
|
<show-dialog v-model:visible="dgIsShow" name="データマッピング" @close="closeDg" min-width="50vw" min-height="60vh">
|
||||||
|
|
||||||
<div class="q-mx-md">
|
<div class="q-mx-md">
|
||||||
<div class="row q-col-gutter-x-xs flex-center">
|
<div class="row q-col-gutter-x-xs flex-center">
|
||||||
|
|||||||
@@ -203,10 +203,10 @@ export default defineComponent({
|
|||||||
"operator": "COUNT",
|
"operator": "COUNT",
|
||||||
"label": "カウント"
|
"label": "カウント"
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// "operator": "FIRST",
|
"operator": "FIRST",
|
||||||
// "label": "最初の値"
|
"label": "最初の値"
|
||||||
// }
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"ngrok": "ngrok http http://localhost:4173/",
|
"ngrok": "ngrok http http://localhost:4173/",
|
||||||
"vite": "vite dev",
|
"vite": "vite dev",
|
||||||
"server": "vite dev & ngrok http 4173",
|
"server": "vite dev & ngrok http 4173",
|
||||||
"watch": "vite build --watch",
|
"watch": "tsc && set \"SOURCE_MAP=true\" && vite build --watch",
|
||||||
"test": "run-p watch server"
|
"test": "run-p watch server"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
} from "../types/ActionTypes";
|
} from "../types/ActionTypes";
|
||||||
import { actionAddins } from ".";
|
import { actionAddins } from ".";
|
||||||
|
|
||||||
|
|
||||||
type DataProcessingProps = {
|
type DataProcessingProps = {
|
||||||
app: {
|
app: {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -39,9 +40,7 @@ export class DataProcessingAction implements IAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async process(
|
async process(
|
||||||
nodes: IActionNode,
|
nodes: IActionNode,event: any,context: IContext
|
||||||
event: any,
|
|
||||||
context: IContext
|
|
||||||
): Promise<IActionResult> {
|
): Promise<IActionResult> {
|
||||||
this.initActionProps(nodes);
|
this.initActionProps(nodes);
|
||||||
this.initTypedActionProps();
|
this.initTypedActionProps();
|
||||||
@@ -53,7 +52,7 @@ export class DataProcessingAction implements IAction {
|
|||||||
if (!this.dataProcessingProps) {
|
if (!this.dataProcessingProps) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await selectData(this.dataProcessingProps.conditionsQuery);
|
const data = await selectData(this.dataProcessingProps.conditionsQuery);
|
||||||
console.log("data ", data);
|
console.log("data ", data);
|
||||||
|
|
||||||
@@ -68,8 +67,9 @@ export class DataProcessingAction implements IAction {
|
|||||||
|
|
||||||
console.log("context ", context);
|
console.log("context ", context);
|
||||||
return result;
|
return result;
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
console.error(e);
|
console.error(error);
|
||||||
|
event.error=error;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,6 +208,7 @@ enum Operator {
|
|||||||
MAX = "MAX",
|
MAX = "MAX",
|
||||||
MIN = "MIN",
|
MIN = "MIN",
|
||||||
COUNT = "COUNT",
|
COUNT = "COUNT",
|
||||||
|
FIRST = "FIRST"
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CalcType {
|
enum CalcType {
|
||||||
@@ -273,4 +274,7 @@ const calcFunc: Record<string, (value: string[]) => string | null> = {
|
|||||||
? minDateTime
|
? minDateTime
|
||||||
: currentDateTime
|
: currentDateTime
|
||||||
),
|
),
|
||||||
|
[`${CalcType.STRING}_${Operator.FIRST}`]:(value: string[])=>{
|
||||||
|
return value[0];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": false,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default defineConfig({
|
|||||||
// assetFileNames:'alc_kintone_style.css'
|
// assetFileNames:'alc_kintone_style.css'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sourcemap: sourcemap,
|
sourcemap: sourcemap?'inline':false,
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 4173,
|
port: 4173,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user