推送日志修改
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
</Form>
|
||||
<template #footer>
|
||||
<div class="push-setting-footer">
|
||||
<div class="footer-left">
|
||||
<Button type="primary" icon="ios-people" :loading="syncingGroup" @click="handleSyncGroup">组全量同步</Button>
|
||||
<Button type="primary" icon="ios-person" :loading="syncingUser" @click="handleSyncUser">用户全量同步</Button>
|
||||
<div v-if="form.pushEnabled" class="footer-left">
|
||||
<Button type="primary" :loading="syncingGroup" @click="handleSyncGroup">组全量同步</Button>
|
||||
<Button type="primary" :loading="syncingUser" @click="handleSyncUser">用户全量同步</Button>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<Button type="primary" :loading="saving" @click="handleSave">保存</Button>
|
||||
@@ -51,6 +51,7 @@
|
||||
import { computed, ref, watch, type Ref } from 'vue';
|
||||
import { Message } from 'view-ui-plus';
|
||||
import useCurrentInstance from '@/utils/hook/useCurrentInstance';
|
||||
import MyConfirm from '@/components/MyConfirm';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
@@ -197,20 +198,31 @@ function handleSave() {
|
||||
}
|
||||
|
||||
function handleSyncGroup() {
|
||||
doSync('group/SyncGroup', syncingGroup, '组全量同步');
|
||||
triggerSync('group/SyncGroup', syncingGroup, '组全量同步');
|
||||
}
|
||||
|
||||
function handleSyncUser() {
|
||||
doSync('user/SyncUser', syncingUser, '用户全量同步');
|
||||
triggerSync('user/SyncUser', syncingUser, '用户全量同步');
|
||||
}
|
||||
|
||||
function doSync(interfacePath: string, loadingRef: Ref<boolean>, name: string) {
|
||||
async function triggerSync(interfacePath: string, loadingRef: Ref<boolean>, name: string) {
|
||||
await MyConfirm({
|
||||
msg: `确定对本应用执行「${name}」吗?`,
|
||||
info: '将向该订阅方投递一次全量数据,可在「推送日志」查看实际结果。',
|
||||
confirmText: '确定推送',
|
||||
async onOk() {
|
||||
await doSync(interfacePath, loadingRef, name);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function doSync(interfacePath: string, loadingRef: Ref<boolean>, name: string): Promise<void> {
|
||||
if (!props.appId) {
|
||||
Message.error('应用不存在');
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
loadingRef.value = true;
|
||||
(Apis as any)
|
||||
return (Apis as any)
|
||||
.Push.test({
|
||||
data: { appId: props.appId, interfacePath, targetIds: null },
|
||||
cacheFor: null,
|
||||
|
||||
Reference in New Issue
Block a user