[feature] Add id field in FlowChart page
This commit is contained in:
@@ -45,21 +45,7 @@ import { useAuthStore } from 'stores/useAuthStore';
|
|||||||
import { useFlowEditorStore } from 'stores/flowEditor';
|
import { useFlowEditorStore } from 'stores/flowEditor';
|
||||||
import { router } from 'src/router';
|
import { router } from 'src/router';
|
||||||
import { date } from 'quasar'
|
import { date } from 'quasar'
|
||||||
|
import { IManagedApp } from 'src/types/AppTypes';
|
||||||
interface IUser{
|
|
||||||
first_name:string;
|
|
||||||
last_name:string;
|
|
||||||
email:string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IManagedApp{
|
|
||||||
appid:string;
|
|
||||||
appname:string;
|
|
||||||
domainurl:string;
|
|
||||||
version:string;
|
|
||||||
user:IUser;
|
|
||||||
update_time:string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IAppDisplay{
|
interface IAppDisplay{
|
||||||
id:string;
|
id:string;
|
||||||
@@ -70,7 +56,6 @@ interface IAppDisplay{
|
|||||||
updatetime:string;
|
updatetime:string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
@@ -89,8 +74,6 @@ const filter = ref('');
|
|||||||
const rows = ref<IAppDisplay[]>([]);
|
const rows = ref<IAppDisplay[]>([]);
|
||||||
const store = useFlowEditorStore();
|
const store = useFlowEditorStore();
|
||||||
|
|
||||||
const tenantid = ref(authStore.currentDomain.id);
|
|
||||||
|
|
||||||
const getApps = async () => {
|
const getApps = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const result = await api.get('api/apps');
|
const result = await api.get('api/apps');
|
||||||
@@ -133,6 +116,6 @@ const editFlow = (app:IAppDisplay) => {
|
|||||||
appId: app.id,
|
appId: app.id,
|
||||||
name: app.name
|
name: app.name
|
||||||
});
|
});
|
||||||
router.push('/FlowChart');
|
router.push('/FlowChart/' + app.id);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -62,16 +62,22 @@
|
|||||||
</template>
|
</template>
|
||||||
<action-select ref="appDg" name="model" :filter="filter" type="single" @clearFilter="onClearFilter" ></action-select>
|
<action-select ref="appDg" name="model" :filter="filter" type="single" @clearFilter="onClearFilter" ></action-select>
|
||||||
</ShowDialog>
|
</ShowDialog>
|
||||||
|
<q-inner-loading
|
||||||
|
:showing="initLoading"
|
||||||
|
label="読み込み中..."
|
||||||
|
/>
|
||||||
</q-page>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, computed, onMounted } from 'vue';
|
import { ref, reactive, computed, onMounted } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { IActionNode, ActionNode, IActionFlow, ActionFlow, RootAction, IActionProperty } from 'src/types/ActionTypes';
|
import { IActionNode, ActionNode, IActionFlow, ActionFlow, RootAction, IActionProperty } from 'src/types/ActionTypes';
|
||||||
|
import { IManagedApp } from 'src/types/AppTypes';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useFlowEditorStore } from 'stores/flowEditor';
|
import { useFlowEditorStore } from 'stores/flowEditor';
|
||||||
import { useAuthStore } from 'stores/useAuthStore';
|
import { useAuthStore } from 'stores/useAuthStore';
|
||||||
|
import { api } from 'boot/axios';
|
||||||
|
|
||||||
import NodeItem from 'src/components/main/NodeItem.vue';
|
import NodeItem from 'src/components/main/NodeItem.vue';
|
||||||
import ShowDialog from 'components/ShowDialog.vue';
|
import ShowDialog from 'components/ShowDialog.vue';
|
||||||
@@ -81,12 +87,15 @@ import AppDisplay from 'components/left/AppDisplay.vue';
|
|||||||
import EventTree from 'components/left/EventTree.vue';
|
import EventTree from 'components/left/EventTree.vue';
|
||||||
import { FlowCtrl } from '../control/flowctrl';
|
import { FlowCtrl } from '../control/flowctrl';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
const deployLoading = ref(false);
|
const deployLoading = ref(false);
|
||||||
const saveLoading = ref(false);
|
const saveLoading = ref(false);
|
||||||
|
const initLoading = ref(true);
|
||||||
const drawerLeft = ref(false);
|
const drawerLeft = ref(false);
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useFlowEditorStore();
|
const store = useFlowEditorStore();
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
const appDg = ref();
|
const appDg = ref();
|
||||||
const prevNodeIfo = ref({
|
const prevNodeIfo = ref({
|
||||||
@@ -289,10 +298,24 @@ const onSaveAllFlow= async ()=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
|
initLoading.value = true;
|
||||||
|
if (store.appInfo === undefined && route?.params?.id !== undefined) {
|
||||||
|
const { appid, appname } = await fetchAppById(route.params.id as string);
|
||||||
|
store.setApp({
|
||||||
|
appId: appid,
|
||||||
|
name: appname
|
||||||
|
});
|
||||||
|
};
|
||||||
await store.loadFlow();
|
await store.loadFlow();
|
||||||
|
initLoading.value = false
|
||||||
drawerLeft.value = true;
|
drawerLeft.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fetchAppById = async(id: string) => {
|
||||||
|
const result = await api.get('api/apps');
|
||||||
|
return result.data.find((item: IManagedApp) => item.appid === id ) as IManagedApp;
|
||||||
|
}
|
||||||
|
|
||||||
const onClearFilter=()=>{
|
const onClearFilter=()=>{
|
||||||
filter.value='';
|
filter.value='';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const routes: RouteRecordRaw[] = [
|
|||||||
component: () => import('pages/LoginPage.vue')
|
component: () => import('pages/LoginPage.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path:'/FlowChart',
|
path:'/FlowChart/:id',
|
||||||
component:()=>import('layouts/MainLayout.vue'),
|
component:()=>import('layouts/MainLayout.vue'),
|
||||||
children:[
|
children:[
|
||||||
{path:'',component:()=>import('pages/FlowChart.vue')}
|
{path:'',component:()=>import('pages/FlowChart.vue')}
|
||||||
|
|||||||
14
frontend/src/types/AppTypes.ts
Normal file
14
frontend/src/types/AppTypes.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
interface IUser {
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
email: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IManagedApp {
|
||||||
|
appid: string;
|
||||||
|
appname: string;
|
||||||
|
domainurl: string;
|
||||||
|
version: string;
|
||||||
|
user: IUser;
|
||||||
|
update_time: string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user