version with backend

This commit is contained in:
xue jiahao
2024-12-09 14:31:24 +08:00
parent 305868f091
commit b95548e7f7
10 changed files with 133 additions and 49 deletions

View File

@@ -19,7 +19,7 @@
<q-icon name="bookmark_border"></q-icon>
</q-item-section>
<q-item-section>
<q-item-label>新バージョン保存</q-item-label>
<q-item-label>保存して新バージョン</q-item-label>
</q-item-section>
</q-item>
@@ -85,8 +85,8 @@
<action-select ref="appDg" name="model" :filter="filter" type="single" @clearFilter="onClearFilter" ></action-select>
</ShowDialog>
<!-- save version dialog -->
<ShowDialog v-model:visible="saveVersionAction" name="新バージョン保存" @close="closeSaveVersionDg" min-width="500px">
<version-input v-model="versionInfo" />
<ShowDialog v-model:visible="saveVersionAction" name="保存して新バージョン" @close="closeSaveVersionDg" min-width="500px">
<version-input v-model="versionSubmit" />
</ShowDialog>
<q-inner-loading
:showing="initLoading"
@@ -100,7 +100,7 @@
import { ref, reactive, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { IActionNode, ActionNode, IActionFlow, ActionFlow, RootAction, IActionProperty } from 'src/types/ActionTypes';
import { IAppDisplay, IManagedApp, IVersionInfo } from 'src/types/AppTypes';
import { IAppDisplay, IManagedApp, IVersionSubmit } from 'src/types/AppTypes';
import { storeToRefs } from 'pinia';
import { useFlowEditorStore } from 'stores/flowEditor';
import { useAuthStore } from 'stores/useAuthStore';
@@ -119,7 +119,7 @@ const deployLoading = ref(false);
const saveLoading = ref(false);
const initLoading = ref(true);
const drawerLeft = ref(false);
const versionInfo = ref<IVersionInfo>();
const versionSubmit = ref<IVersionSubmit>();
const $q = useQuasar();
const store = useFlowEditorStore();
const authStore = useAuthStore();
@@ -262,16 +262,18 @@ const onSaveActionProps=(props:IActionProperty[])=>{
};
const onSaveVersion = async () => {
versionInfo.value = {
id: '1' // TODO
}
versionSubmit.value = { appId: store.appInfo?.appId }
saveVersionAction.value = true;
// await onSaveAllFlow();
}
const closeSaveVersionDg = (val: 'OK'|'CANCEL') => {
const closeSaveVersionDg = async (val: 'OK'|'CANCEL') => {
if (val == 'OK') {
console.log(versionInfo.value);
await onSaveAllFlow();
await api.post('api/apps', {
'appid': versionSubmit.value?.appId,
'versionname': versionSubmit.value?.name,
'comment': versionSubmit.value?.comment
})
}
}