修改同步到系统是否显示

v1.4.0
于肖磊 2025-08-11 16:48:42 +08:00
parent 12a82e0e25
commit 2e78fedd64
2 changed files with 5 additions and 3 deletions

View File

@ -22,7 +22,7 @@
<div class="mb-12 flex-row gap-10 jc-sb">
<div>导航内容</div>
<div class="flex-row gap-20 align-c">
<div v-if="!config.sync_bool" class="cr-primary c-pointer" @click="sync_sys_event"></div>
<div v-if="!config.sync_bool && !isEmpty(app_tabbar_save_url.value)" class="cr-primary c-pointer" @click="sync_sys_event"></div>
<div class="cr-primary c-pointer" @click="reset_event"></div>
</div>
</div>
@ -57,7 +57,7 @@
</div>
</template>
<script setup lang="ts">
import { cloneDeep } from 'lodash';
import { cloneDeep, isEmpty } from 'lodash';
import { get_math } from '@/utils';
import CommonAPI from '@/api/common';
import { commonStore } from '@/store';
@ -120,6 +120,7 @@ const add = () => {
});
emit('update:value', form.value);
};
const app_tabbar_save_url = computed(() => common_store.common.config.app_tabbar_save_url);
//
const sync_sys_event = () => {
const new_form = {
@ -132,7 +133,7 @@ const sync_sys_event = () => {
config: clone_form,
};
app?.appContext.config.globalProperties.$common.message_box('将数据同步到系统底部菜单,确定继续吗?', 'warning').then(() => {
CommonAPI.getDynamicApi(common_store.common.config.app_tabbar_save_url, new_data).then((res: any) => {
CommonAPI.getDynamicApi(app_tabbar_save_url.value, new_data).then((res: any) => {
ElMessage.success('同步成功');
});
});

View File

@ -89,6 +89,7 @@ const save_event = () => {
save_disabled.value = false;
}, 500);
}).catch((err) => {
ElMessage.error(err);
save_disabled.value = false;
});
};