update:补充工种配置页面的同步按钮
This commit is contained in:
9
src/api/system/lyricUser.ts
Normal file
9
src/api/system/lyricUser.ts
Normal 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`);
|
||||
};
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user