😎增加前端同步民政部行政区划调用

This commit is contained in:
zuohuaijun 2024-12-17 17:32:21 +08:00
parent 85bcd500ac
commit 56e39efae4

View File

@ -81,7 +81,7 @@
<script lang="ts" setup name="sysRegion">
import { nextTick, onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { ElMessageBox, ElMessage, ElNotification } from 'element-plus';
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
import { Local } from '/@/utils/storage';
@ -242,7 +242,7 @@ const handleNodeChange = async (node: any) => {
};
//
const handleCommand = (command: string) => {
const handleCommand = async (command: string) => {
if (command === 'amap') {
state.title = '同步高德地图';
syncGdParamRef.value?.openDialog();
@ -253,11 +253,26 @@ const handleCommand = (command: string) => {
state.title = '同步国家地名信息库';
syncMcaParamRef.value?.openDialog();
} else if (command === 'mzb') {
state.title = '同步民政部行政区划';
// state.title = '';
// syncTdtParamRef.value?.openDialog();
await syncMzbRegion();
} else ElMessage.error(`菜单选择有误`);
};
//
const syncMzbRegion = async () => {
ElNotification({
title: '提示',
message: '努力同步中...',
type: 'success',
position: 'bottom-right',
});
options.loading = true;
await getAPI(SysRegionApi).apiSysRegionSyncRegionMzbPost();
options.loading = false;
ElMessage.success('生成成功');
};
//
const genOrg = (row: any) => {
state.title = '生成/更新系统组织架构';