Compare commits

...

18 Commits

Author SHA1 Message Date
418f45f997 Merge branch 'maxz-pinia' of https://dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into maxz-pinia 2023-09-24 00:12:49 +09:00
51ebe99d1c FlowEditorPage2 2023-09-24 00:12:42 +09:00
2f1f8a60fc Merge branch 'maxz-pinia' of https://dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into maxz-pinia 2023-09-23 23:56:01 +09:00
64795a80c7 actiontypes bug fix 2023-09-23 23:55:52 +09:00
94a17073dd flow add&update 2023-09-23 14:53:48 +00:00
7f7d625fdd backend merge 2023-09-23 06:38:00 +00:00
6902079866 add right panel with pinia 2023-09-23 15:19:53 +09:00
dt
f34dec1054 Merge branch 'daitian' of https://alicorn-dev@dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into daitian-pinia 2023-09-17 23:40:51 +08:00
dt
01b64f1aba Change App Selection Component 2023-09-17 23:34:24 +08:00
dt
3367ada343 Merge branch 'daitian' of https://alicorn-dev@dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into daitian-pinia 2023-09-17 21:46:21 +08:00
dt
f4ea3eaccb Merge branch 'maxz-new-step' of https://alicorn-dev@dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into daitian 2023-09-17 21:45:34 +08:00
dt
4adb8401d6 add pinia 2023-09-17 21:44:28 +08:00
dt
fce56e43c3 add pinia 2023-09-16 11:07:32 +08:00
dt
42618602f4 Replace ItemSelector with ActionSelec 2023-09-16 10:48:08 +08:00
dt
e02131846b selected change 2023-09-15 07:02:29 +08:00
dt
2c3b27d9de style change 2023-09-15 04:04:48 +08:00
dt
6ccc833f7d Remove unnecessary components, add an action bar. 2023-09-15 03:56:17 +08:00
dt
a0ecc2eee3 flow editor assembly and modification 2023-09-13 16:13:30 +08:00
22 changed files with 635 additions and 173 deletions

View File

@@ -2,7 +2,7 @@ from fastapi import Request,Depends, APIRouter, UploadFile,HTTPException,File
from app.db import Base,engine from app.db import Base,engine
from app.db.session import get_db from app.db.session import get_db
from app.db.crud import * from app.db.crud import *
from app.db.schemas import AppBase, AppEdit, App,Kintone from app.db.schemas import *
platform_router = r = APIRouter() platform_router = r = APIRouter()
@@ -64,4 +64,62 @@ async def kintone_data(
db=Depends(get_db), db=Depends(get_db),
): ):
kintone = get_kintones(db, type) kintone = get_kintones(db, type)
return kintone return kintone
@r.get(
"/actions",
response_model=t.List[Action],
response_model_exclude={"id"},
response_model_exclude_none=True,
)
async def action_data(
request: Request,
db=Depends(get_db),
):
actions = get_actions(db)
return actions
@r.get(
"/flow/{flowid}",
response_model=Flow,
response_model_exclude_none=True,
)
async def flow_details(
request: Request,
flowid: str,
db=Depends(get_db),
):
app = get_flow(db, flowid)
return app
@r.post("/flow", response_model=Flow, response_model_exclude_none=True)
async def flow_create(
request: Request,
flow: FlowBase,
db=Depends(get_db),
):
return create_flow(db, flow)
@r.put(
"/flow/{flowid}", response_model=Flow, response_model_exclude_none=True
)
async def flow_edit(
request: Request,
flow: FlowBase,
db=Depends(get_db),
):
return edit_flow(db, flow)
@r.delete(
"/flow/{flowid}", response_model=Flow, response_model_exclude_none=True
)
async def flow_delete(
request: Request,
flowid: str,
db=Depends(get_db),
):
return delete_flow(db, flowid)

View File

@@ -115,4 +115,62 @@ def get_kintones(db: Session, type: int):
kintones = db.query(models.Kintone).filter(models.Kintone.type == type).all() kintones = db.query(models.Kintone).filter(models.Kintone.type == type).all()
if not kintones: if not kintones:
raise HTTPException(status_code=404, detail="Data not found") raise HTTPException(status_code=404, detail="Data not found")
return kintones return kintones
def get_actions(db: Session):
actions = db.query(models.Action).all()
if not actions:
raise HTTPException(status_code=404, detail="Data not found")
return actions
def create_flow(db: Session, flow: schemas.FlowBase):
db_flow = models.Flow(
flowid=flow.flowid,
appid=flow.appid,
eventid=flow.eventid,
name=flow.name,
content=flow.content
)
db.add(db_flow)
db.commit()
db.refresh(db_flow)
return db_flow
def delete_flow(db: Session, flowid: str):
flow = get_flow(db, flowid)
if not flow:
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Flow not found")
db.delete(flow)
db.commit()
return flow
def edit_flow(
db: Session, flow: schemas.FlowBase
) -> schemas.Flow:
db_flow = get_flow(db, flow.flowid)
if not db_flow:
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Flow not found")
update_data = flow.dict(exclude_unset=True)
for key, value in update_data.items():
setattr(db_flow, key, value)
db.add(db_flow)
db.commit()
db.refresh(db_flow)
return db_flow
def get_flows(db: Session, flowid: str):
flows = db.query(models.Flow).all()
if not flows:
raise HTTPException(status_code=404, detail="Data not found")
return flows
def get_flow(db: Session, flowid: str):
flow = db.query(models.Flow).filter(models.Flow.flowid == flowid).first()
if not flow:
raise HTTPException(status_code=404, detail="Data not found")
return flow

View File

@@ -1,12 +1,16 @@
from sqlalchemy import Boolean, Column, Integer, String from sqlalchemy import Boolean, Column, Integer, String, DateTime
from sqlalchemy.ext.declarative import as_declarative
from .session import Base from datetime import datetime
@as_declarative()
class Base:
id = Column(Integer, primary_key=True, index=True)
create_time = Column(DateTime, default=datetime.now)
update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now)
class User(Base): class User(Base):
__tablename__ = "user" __tablename__ = "user"
id = Column(Integer, primary_key=True, index=True)
email = Column(String(50), unique=True, index=True, nullable=False) email = Column(String(50), unique=True, index=True, nullable=False)
first_name = Column(String(100)) first_name = Column(String(100))
last_name = Column(String(100)) last_name = Column(String(100))
@@ -17,15 +21,31 @@ class User(Base):
class AppSetting(Base): class AppSetting(Base):
__tablename__ = "appsetting" __tablename__ = "appsetting"
id = Column(Integer, primary_key=True, index=True)
appid = Column(String(100), index=True, nullable=False) appid = Column(String(100), index=True, nullable=False)
setting = Column(String(1000)) setting = Column(String(1000))
class Kintone(Base): class Kintone(Base):
__tablename__ = "kintone" __tablename__ = "kintone"
id = Column(Integer, primary_key=True, index=True)
type = Column(Integer, index=True, nullable=False) type = Column(Integer, index=True, nullable=False)
name = Column(String(100), nullable=False) name = Column(String(100), nullable=False)
desc = Column(String) desc = Column(String)
content = Column(String) content = Column(String)
class Action(Base):
__tablename__ = "action"
name = Column(String(100), index=True, nullable=False)
title = Column(String(200))
subtitle = Column(String(500))
outputpoints = Column(String)
property = Column(String)
class Flow(Base):
__tablename__ = "flow"
flowid = Column(String(100), index=True, nullable=False)
appid = Column(String(100), index=True, nullable=False)
eventid = Column(String(100), index=True, nullable=False)
name = Column(String(200))
content = Column(String)

View File

@@ -1,7 +1,12 @@
from pydantic import BaseModel from pydantic import BaseModel
from datetime import datetime
import typing as t import typing as t
class Base(BaseModel):
create_time: datetime
update_time: datetime
class UserBase(BaseModel): class UserBase(BaseModel):
email: str email: str
is_active: bool = True is_active: bool = True
@@ -67,5 +72,34 @@ class Kintone(BaseModel):
desc: str = None desc: str = None
content: str = None content: str = None
class Config:
orm_mode = True
class Action(BaseModel):
id: int
name: str = None
title: str = None
subtitle: str = None
outputpoints: str = None
property: str = None
class Config:
orm_mode = True
class FlowBase(BaseModel):
flowid: str
appid: str
eventid: str
name: str = None
content: str = None
class Flow(Base):
id: int
flowid: str
appid: str
eventid: str
name: str = None
content: str = None
class Config: class Config:
orm_mode = True orm_mode = True

View File

@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"@quasar/extras": "^1.16.4", "@quasar/extras": "^1.16.4",
"axios": "^1.4.0", "axios": "^1.4.0",
"pinia": "^2.1.6",
"quasar": "^2.6.0", "quasar": "^2.6.0",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vue": "^3.0.0", "vue": "^3.0.0",
@@ -4079,6 +4080,56 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/pinia": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.6.tgz",
"integrity": "sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==",
"dependencies": {
"@vue/devtools-api": "^6.5.0",
"vue-demi": ">=0.14.5"
},
"funding": {
"url": "https://github.com/sponsors/posva"
},
"peerDependencies": {
"@vue/composition-api": "^1.4.0",
"typescript": ">=4.4.4",
"vue": "^2.6.14 || ^3.3.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
},
"typescript": {
"optional": true
}
}
},
"node_modules/pinia/node_modules/vue-demi": {
"version": "0.14.6",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz",
"integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/postcss": { "node_modules/postcss": {
"version": "8.4.25", "version": "8.4.25",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz",
@@ -4955,7 +5006,7 @@
"version": "4.9.5", "version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true, "devOptional": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"

View File

@@ -15,6 +15,7 @@
"dependencies": { "dependencies": {
"@quasar/extras": "^1.16.4", "@quasar/extras": "^1.16.4",
"axios": "^1.4.0", "axios": "^1.4.0",
"pinia": "^2.1.6",
"quasar": "^2.6.0", "quasar": "^2.6.0",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vue": "^3.0.0", "vue": "^3.0.0",

View File

@@ -1,73 +0,0 @@
<template>
<div class="q-py-md">
<q-list>
<q-expansion-item
group="somegroup"
label="レコードを追加画面"
default-opened
>
<q-card-section>
<q-checkbox v-model="setting.v1" label="追加画面表示した時" />
<q-checkbox v-model="setting.v2" label="保存をクリックした時" />
<q-checkbox v-model="setting.v3" label="保存成功した時" />
</q-card-section>
</q-expansion-item>
<q-expansion-item group="somegroup" label="レコード編集画面">
<q-card>
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem,
eius reprehenderit eos corrupti commodi magni quaerat ex numquam,
dolorum officiis modi facere maiores architecto suscipit iste
eveniet doloribus ullam aliquid.
</q-card-section>
</q-card>
</q-expansion-item>
<q-expansion-item group="somegroup" label="レコード詳細画面">
<q-card>
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem,
eius reprehenderit eos corrupti commodi magni quaerat ex numquam,
dolorum officiis modi facere maiores architecto suscipit iste
eveniet doloribus ullam aliquid.
</q-card-section>
</q-card>
</q-expansion-item>
<q-expansion-item group="somegroup" label="レコード一覧画面">
<q-card class="bg-teal-2">
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem,
eius reprehenderit eos corrupti commodi magni quaerat ex numquam,
dolorum officiis modi facere maiores architecto suscipit iste
eveniet doloribus ullam aliquid.
</q-card-section>
</q-card>
</q-expansion-item>
</q-list>
</div>
<q-btn @click="clear" label="clear"/>
</template>
<script setup lang="ts">
import { ref, Ref } from 'vue';
interface Setting {
v1: boolean;
v2: boolean;
v3: boolean;
}
const setting: Ref<Setting> = ref({
v1: true,
v2: true,
v3: false,
});
let clear = () => {
setting.value.v1 = false
setting.value.v2 = false
setting.value.v3 = false
}
</script>

View File

@@ -1,12 +1,13 @@
<template> <template>
<div class="q-py-md"> <div class="q-py-md">
<q-tree :nodes="LeftDataBus.root" node-key="label"> <q-tree
<template #header-rg="p"> no-connectors
<ControlPanelTreeRadio selected-color="primary"
:node="p.node" default-expand-all
:dataBus="LeftDataBus" :nodes="LeftDataBus.root"
></ControlPanelTreeRadio> v-model:selected="flowNames1"
</template> node-key="label"
>
</q-tree> </q-tree>
</div> </div>
</template> </template>
@@ -16,9 +17,13 @@ import {
LeftDataBus, LeftDataBus,
setControlPanelE, setControlPanelE,
} from 'components/flowEditor/left/DataBus'; } from 'components/flowEditor/left/DataBus';
import ControlPanelTreeRadio from './ControlPanelTreeRadio.vue'; import { ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useFlowEditorStore } from 'stores/flowEditor';
// 应该在page中用网络请求获取值并初始化组件 // 应该在page中用网络请求获取值并初始化组件
// 然后在page中执行setControlPane设置databus // 然后在page中执行setControlPane设置databus
const store = useFlowEditorStore();
const { flowNames1 } = storeToRefs(store);
setControlPanelE(); setControlPanelE();
</script> </script>

View File

@@ -1,23 +0,0 @@
<template>
<q-radio v-model="model" :val="node.value" :label="node.label" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { LeftData, ControlPanelData } from 'components/flowEditor/left/DataBus';
const props = defineProps(['node', 'dataBus']);
const node = computed(() => props.node as ControlPanelData);
const model = computed({
get() {
return (props.dataBus as LeftData).data?.get(node.value.group ?? 'n');
},
set(newValue) {
(props.dataBus as LeftData).data?.set(
node.value.group ?? 'n',
newValue ?? ''
);
},
});
</script>

View File

@@ -1,36 +1,42 @@
<template> <template>
<div class="ItemSelector q-pa-sm"> <div
<div class="row"> class="row"
<div class="col-auto"> style="
<q-icon name="widgets" color="primary" size="2.5em" /> border-radius: 2px;
</div> box-shadow: rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset,
<div class="col flex"> rgba(0, 0, 0, 0.3) 0px 0px 0px 1px;
<div class="q-pa-sm flex" style="align-items: center">{{title}}</div> "
</div> >
<div class="col-auto flex"> <q-icon
<div class="flex" style="align-items: center"> class="self-center q-ma-sm"
<q-btn name="widgets"
class="q-px-sm" color="grey-9"
color="white" style="font-size: 2em"
size="sm" />
text-color="black"
label="変 更" <div class="col-7 self-center ellipsis">
dense {{ actName }}
/> </div>
</div>
</div> <div class="self-center">
<q-btn
outline
dense
label="変 更"
padding="none sm"
color="primary"
></q-btn>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script>
import { ref } from 'vue'; import { computed } from 'vue';
const title = ref('勤怠管理') export default {
props: ['actName'],
setup(props) {
const actName = computed(() => props.actName);
},
};
</script> </script>
<style lang="sass">
.ItemSelector
border: 0.15em solid rgba(#999, .4)
border-radius: 0.4em
</style>

View File

@@ -0,0 +1,22 @@
import { api } from 'boot/axios';
export class FlowCtrl
{
async SaveFlow(jsonData:any):Promise<boolean>
{
const result = await api.post('http://127.0.0.1:8000/api/flow',jsonData);
console.info(result.data)
return true;
}
async UpdateFlow(jsonData:any):Promise<boolean>
{
const result = await api.put('http://127.0.0.1:8000/api/flow/' + jsonData.flowid,jsonData);
console.info(result.data)
return true;
}
}

View File

@@ -59,7 +59,7 @@ const essentialLinks: EssentialLinkProps[] = [
title: 'フローエディター', title: 'フローエディター',
caption: 'flowChart', caption: 'flowChart',
icon: 'account_tree', icon: 'account_tree',
link: '/#/flowChart', link: '/#/flowEditor2',
target:'_self' target:'_self'
}, },
{ {

View File

@@ -50,7 +50,7 @@ const saibanProps:IActionProperty[]=[{
actionFlow.addNode(new ActionNode('自動採番','文書番号を自動採番する','',[],saibanProps)); actionFlow.addNode(new ActionNode('自動採番','文書番号を自動採番する','',[],saibanProps));
actionFlow.addNode(new ActionNode('入力データ取得','電話番号を取得する','')); actionFlow.addNode(new ActionNode('入力データ取得','電話番号を取得する',''));
const branchNode = actionFlow.addNode(new ActionNode('条件分岐','電話番号入力形式チャック','',['はい','いいえ'] )); const branchNode = actionFlow.addNode(new ActionNode('条件分岐','電話番号入力形式チャック','',['はい','いいえ'] ));
actionFlow.addNode(new ActionNode('入力データ取得','住所を取得する',''),branchNode,'はい'); // actionFlow.addNode(new ActionNode('入力データ取得','住所を取得する',''),branchNode,'はい');
actionFlow.addNode(new ActionNode('エラー表示','エラー表示して保存しない',''),branchNode,'いいえ' ); actionFlow.addNode(new ActionNode('エラー表示','エラー表示して保存しない',''),branchNode,'いいえ' );
// ref関数を使ってtemplateとバインド // ref関数を使ってtemplateとバインド

View File

@@ -1,37 +1,122 @@
<template> <template>
<q-page> <div>
<div class="q-pa-md"> <div class="q-ma-md">
<div class="q-gutter-sm row items-start"> <div class="q-gutter-xs row items-start">
<q-breadcrumbs> <q-breadcrumbs class="q-pt-xs q-mr-sm" active-color="black">
<q-breadcrumbs-el icon="home" to="/" /> <q-breadcrumbs-el icon="home" />
<q-breadcrumbs-el :label="title" icon="rule" /> <q-breadcrumbs-el :label="actName" />
</q-breadcrumbs> <q-breadcrumbs-el
</div> v-for="flowName in flowNames"
<div class="q-pa-md"> :key="flowName"
<div class="row"> :label="flowName"
<div class="col-2 column"> />
<ItemSelector />
<div class="col-auto"><ControlPanel /></div>
</div>
<!-- <div class="col">
</div> --> <q-breadcrumbs-el :label="flowNames1" />
</div> </q-breadcrumbs>
<q-separator vertical class="q-mr-xs" />
<q-btn
unelevated
class="q-py-sm"
padding="none md none sm"
color="blue-1"
text-color="primary"
size="md"
@click="drawerLeft = !drawerLeft"
label="変 更"
icon="expand_more"
dense
/>
<q-space />
<q-btn
class="q-px-sm q-mr-sm"
color="white"
size="sm"
text-color="black"
label="キャンセル"
dense
/>
<q-btn
class="q-px-sm"
color="primary"
size="sm"
label="保存する"
dense
/>
</div> </div>
</div> </div>
</q-page> <q-layout
container
style="height: 91.5dvb"
class="shadow-2 rounded-borders"
>
<q-drawer side="left" overlay bordered v-model="drawerLeft">
<div class="q-pa-sm fixed-right">
<q-btn
flat
round
color="primary"
icon="close"
@click="drawerLeft = !drawerLeft"
/>
</div>
<div class="q-mt-lg q-pa-sm">
<q-card-section>
<div class="flex-center">
<div class="row q-pl-md">
<p class="text-h6">アクション選択</p>
</div>
<ItemSelector :actName="actName" />
</div>
</q-card-section>
</div>
<q-separator />
<div class="q-mt-md q-pa-sm">
<q-card-section>
<p class="text-h6 q-pl-md q-mb-none">フロー選択</p>
<ControlPanel />
</q-card-section>
</div>
<q-separator />
<q-card-actions align="right">
<div class="q-pa-sm">
<q-btn
flat
color="primary"
size="md"
@click="drawerLeft = !drawerLeft"
label="ジャンプ"
dense
/>
</div>
</q-card-actions>
</q-drawer>
<FlowChartTest />
</q-layout>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import ItemSelector from 'components/flowEditor/left/ItemSelector.vue'; import FlowChartTest from 'pages/FlowChartTest.vue';
import ControlPanel from 'components/flowEditor/left/ControlPanelC.vue'; import ControlPanel from 'components/flowEditor/left/ControlPanelC.vue';
interface FlowEditorPageProps { import ItemSelector from 'components/flowEditor/left/ItemSelector.vue';
title: string; import { ref } from 'vue';
} import { storeToRefs } from 'pinia';
import { useFlowEditorStore } from 'stores/flowEditor';
const actName = ref('勤怠管理 - 4');
const flowNames = ref(['レコードを追加画面', '保存をクリックした時']);
const drawerLeft = ref(false);
const store = useFlowEditorStore();
const { flowNames1 } = storeToRefs(store);
const props = withDefaults(defineProps<FlowEditorPageProps>(), {
title: 'FlowEditor',
});
</script> </script>
<style lang="sass"></style> <style lang="sass"></style>

View File

@@ -0,0 +1,117 @@
<template>
<div >
<div class="q-ma-md">
<div class="q-gutter-xs row items-start">
<q-btn
size="md"
@click="drawerLeft = !drawerLeft"
icon="keyboard_double_arrow_right"
round
/>
<q-space />
<q-btn
color="white"
size="sm"
text-color="black"
label="キャンセル"
dense
/>
<q-btn
class="q-px-sm"
color="primary"
size="sm"
label="保存する"
@click="save()"
dense
/>
</div>
</div>
<q-layout
container
class="flow-container shadow-2 rounded-borders"
>
<q-drawer side="left" overlay bordered v-model="drawerLeft">
<div class="q-pa-sm fixed-right">
<q-btn
flat
round
color="primary"
icon="close"
@click="drawerLeft = !drawerLeft"
/>
</div>
<div class="q-mt-lg q-pa-sm">
<q-card-section>
<div class="flex-center">
<ItemSelector :actName="actName" />
</div>
</q-card-section>
</div>
<q-separator />
<div class="q-mt-md q-pa-sm">
<q-card-section>
<ControlPanel />
</q-card-section>
</div>
<q-separator />
<q-card-actions align="right">
<div class="q-pa-sm">
<q-btn
flat
color="primary"
size="md"
@click="drawerLeft = !drawerLeft"
label="ジャンプ"
dense
/>
</div>
</q-card-actions>
</q-drawer>
<FlowChartTest />
</q-layout>
</div>
</template>
<script setup lang="ts">
import FlowChartTest from 'pages/FlowChartTest.vue';
import ControlPanel from 'components/flowEditor/left/ControlPanelC.vue';
import ItemSelector from 'components/flowEditor/left/ItemSelector.vue';
import { ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useFlowEditorStore } from 'stores/flowEditor';
import { FlowCtrl } from '../control/flowctrl'
const flowCtrl = new FlowCtrl();
const actName = ref('勤怠管理 - 4');
const drawerLeft = ref(false);
const store = useFlowEditorStore();
const { flowNames1 } = storeToRefs(store);
let isNew = ref(true);
const save = () =>{
if(isNew.value)
{
flowCtrl.SaveFlow({appid:'1',flowid:'flow123',eventid:'event123',name:'test',content:'[]'});
isNew.value = false;
}
else
{
flowCtrl.UpdateFlow({appid:'1',flowid:'flow123',eventid:'event123',name:'test',content:'[{"a":"b"}]'});
}
}
</script>
<style lang="scss">
.flow-toolbar{
opacity: 50%;
}
.flow-container{
height: calc(91.5dvb - 50px);
overflow: hidden;
}
</style>

View File

@@ -11,6 +11,7 @@ const routes: RouteRecordRaw[] = [
{ path: 'flow', component: () => import('pages/testFlow.vue') }, { path: 'flow', component: () => import('pages/testFlow.vue') },
{ path: 'flowchart', component: () => import('pages/FlowChartTest.vue') }, { path: 'flowchart', component: () => import('pages/FlowChartTest.vue') },
{ path: 'flowEditor', component: () => import('pages/FlowEditorPage.vue') }, { path: 'flowEditor', component: () => import('pages/FlowEditorPage.vue') },
{ path: 'flowEditor2', component: () => import('pages/FlowEditorPage2.vue') },
{ path: 'right', component: () => import('pages/testRight.vue') }, { path: 'right', component: () => import('pages/testRight.vue') },
], ],
}, },

View File

@@ -0,0 +1,25 @@
import { defineStore } from 'pinia';
export const useFlowEditorStore = defineStore('flowEditor', {
state: () => ({
counter: 0,
flowNames: [],
flowNames1: ''
}),
getters: {
doubleCount(state) {
return state.counter * 2;
}
},
actions: {
increment() {
this.counter++;
},
setDefaultFlow() {
this.counter++
}
}
});

View File

@@ -0,0 +1,32 @@
import { store } from 'quasar/wrappers'
import { createPinia } from 'pinia'
import { Router } from 'vue-router';
/*
* When adding new properties to stores, you should also
* extend the `PiniaCustomProperties` interface.
* @see https://pinia.vuejs.org/core-concepts/plugins.html#typing-new-store-properties
*/
declare module 'pinia' {
export interface PiniaCustomProperties {
readonly router: Router;
}
}
/*
* If not building with SSR mode, you can
* directly export the Store instantiation;
*
* The function below can be async too; either use
* async/await or return a Promise which resolves
* with the Store instance.
*/
export default store((/* { ssrContext } */) => {
const pinia = createPinia()
// You can add Pinia plugins here
// pinia.use(SomePiniaPlugin)
return pinia
})

10
frontend/src/stores/store-flag.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/* eslint-disable */
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
import "quasar/dist/types/feature-flag";
declare module "quasar/dist/types/feature-flag" {
interface QuasarFeatureFlags {
store: true;
}
}

View File

@@ -0,0 +1,19 @@
import { defineStore } from 'pinia';
export const useCounterStore = defineStore('counter', {
state: () => ({
counter: 0
}),
getters: {
doubleCount (state) {
return state.counter * 2;
}
},
actions: {
increment () {
this.counter++;
}
}
});

View File

@@ -291,6 +291,7 @@ reconnectOrRemoveNextNodes(targetNode: IActionNode): void {
//二つ以上の場合 //二つ以上の場合
for(const [point,nextid] of nextNodeIds){ for(const [point,nextid] of nextNodeIds){
const nextNode = this.findNodeById(nextid); const nextNode = this.findNodeById(nextid);
if(!nextNode) return;
if(!this.connectNodes(prevNode,nextNode,point)){ if(!this.connectNodes(prevNode,nextNode,point)){
this.removeAllNext(nextid); this.removeAllNext(nextid);
this.removeFromActionNodes(nextid); this.removeFromActionNodes(nextid);

View File

@@ -2149,6 +2149,14 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1:
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
pinia@^2.0.0, pinia@^2.1.6:
version "2.1.6"
resolved "https://registry.npmjs.org/pinia/-/pinia-2.1.6.tgz"
integrity sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==
dependencies:
"@vue/devtools-api" "^6.5.0"
vue-demi ">=0.14.5"
postcss-selector-parser@^6.0.9: postcss-selector-parser@^6.0.9:
version "6.0.13" version "6.0.13"
resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz" resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz"
@@ -2662,7 +2670,7 @@ type-is@~1.6.18:
media-typer "0.3.0" media-typer "0.3.0"
mime-types "~2.1.24" mime-types "~2.1.24"
typescript@^4.5.4, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta": typescript@^4.5.4, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.4.4:
version "4.9.5" version "4.9.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz" resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
@@ -2734,6 +2742,11 @@ vary@~1.1.2:
optionalDependencies: optionalDependencies:
fsevents "~2.3.2" fsevents "~2.3.2"
vue-demi@>=0.14.5:
version "0.14.6"
resolved "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz"
integrity sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==
vue-eslint-parser@^9.3.0: vue-eslint-parser@^9.3.0:
version "9.3.1" version "9.3.1"
resolved "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz" resolved "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz"
@@ -2754,7 +2767,7 @@ vue-router@^4.0.0, vue-router@^4.0.12:
dependencies: dependencies:
"@vue/devtools-api" "^6.5.0" "@vue/devtools-api" "^6.5.0"
vue@^3.0.0, vue@^3.2.0, vue@^3.2.25, vue@^3.2.29, vue@3.3.4: "vue@^2.6.14 || ^3.3.0", vue@^3.0.0, "vue@^3.0.0-0 || ^2.6.0", vue@^3.2.0, vue@^3.2.25, vue@^3.2.29, vue@3.3.4:
version "3.3.4" version "3.3.4"
resolved "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz" resolved "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz"
integrity sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw== integrity sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==