update:补充工种配置页面的同步按钮

This commit is contained in:
2026-04-02 14:23:00 +08:00
parent dc049ee62b
commit ce3a583e5f
2 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
import { post } from '@/api/request';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_SYSTEM;
// 同步利元亨的工种
export const syncLyricUsersApi = () => {
return post(`${PREFIX}lyricUser/syncLyricUsers`);
};

View File

@@ -10,7 +10,7 @@
:hide-pagination="true"
>
<template #leftOptions>
<!-- <el-button type="primary">同步</el-button> -->
<el-button type="primary" @click="syncFun">同步</el-button>
<el-button type="primary" @click="openDialog('add')">新增</el-button>
</template>
</BaseTable>
@@ -53,6 +53,7 @@ import {
} from '@/api/system/systemData';
import { ElMessage } from 'element-plus';
import { cloneDeep } from 'lodash-es';
import { syncLyricUsersApi } from '@/api/system/lyricUser';
const tableData = ref<any>([]);
const isEditDialog = ref(false);
@@ -169,6 +170,15 @@ const updateDataFun = async () => {
} catch {}
};
const syncFun = async () => {
try {
const res: any = await syncLyricUsersApi();
if (res && res.code === 200) {
await getTableDataFun();
}
} catch {}
};
onMounted(async () => {
await getTableDataFun();
});