backend変更マージ

This commit is contained in:
xiaozhe.ma
2024-11-23 18:36:01 +09:00
10 changed files with 176 additions and 114 deletions

View File

@@ -39,26 +39,13 @@
</template>
<script setup lang="ts">
import { ref, onMounted, reactive } from 'vue';
import { ref, onMounted, watch, reactive } from 'vue';
import { api } from 'boot/axios';
import { useAuthStore } from 'stores/useAuthStore';
import { useFlowEditorStore } from 'stores/flowEditor';
import { router } from 'src/router';
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;
}
import { date } from 'quasar'
import { IManagedApp } from 'src/types/AppTypes';
interface IAppDisplay{
id:string;
@@ -69,16 +56,16 @@ interface IAppDisplay{
updatetime:string;
}
const authStore = useAuthStore();
const numberStringSorting = (a: string, b: string) => parseInt(a, 10) - parseInt(b, 10);
const columns = [
{ name: 'id', label: 'アプリID', field: 'id', align: 'left', sortable: true },
{ name: 'id', label: 'アプリID', field: 'id', align: 'left', sortable: true, sort: numberStringSorting },
{ name: 'name', label: 'アプリ名', field: 'name', align: 'left', sortable: true },
{ name: 'url', label: 'URL', field: 'url', align: 'left', sortable: true },
{ name: 'user', label: '最後更新者', field: 'user', align: 'left', sortable: true},
{ name: 'updatetime', label: '最後更新日', field: 'updatetime', align: 'left', sortable: true},
{ name: 'version', label: 'バージョン', field: 'version', align: 'left'},
{ name: 'version', label: 'バージョン', field: 'version', align: 'left', sortable: true},
{ name: 'actions', label: '操作', field: 'actions' }
];
@@ -88,20 +75,19 @@ const filter = ref('');
const rows = ref<IAppDisplay[]>([]);
const store = useFlowEditorStore();
const tenantid = ref(authStore.currentDomain.id);
const getApps = async () => {
loading.value = true;
const result = await api.get('api/apps');
rows.value = result.data.map((item:IManagedApp) => {
rows.value = result.data.map((item: IManagedApp) => {
return {
id: item.appid,
name: item.appname,
url: `${item.domainurl}/k/${item.appid}`,
user: `${item.user.first_name} ${item.user.last_name}` ,
updatetime:item.update_time,
version: item.version }
});
user: `${item.updateuser.first_name} ${item.updateuser.last_name}` ,
updatetime:date.formatDate(item.update_time, 'YYYY/MM/DD HH:mm'),
version: Number(item.version)
}
}).sort((a: IAppDisplay, b: IAppDisplay) => numberStringSorting(a.id, b.id)); // set default order
loading.value = false;
}
@@ -110,6 +96,10 @@ onMounted(async () => {
await getApps();
});
watch(() => authStore.currentDomain.id, async () => {
await getApps();
});
const addRow = () => {
return
}
@@ -127,6 +117,7 @@ const editFlow = (app:IAppDisplay) => {
appId: app.id,
name: app.name
});
router.push('/FlowChart');
store.selectFlow(undefined);
router.push('/FlowChart/' + app.id);
};
</script>