|
|
@@ -107,7 +107,8 @@ import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import { Search } from '@element-plus/icons-vue';
|
|
|
import { PageTitle, TablePagination } from '@/components';
|
|
|
import { DeptInfo } from '@/api/pc/organization/types';
|
|
|
-import { getDeptTree, getRoleList, getContactList, addContact, updateContact, deleteContact } from '@/api/pc/organization';
|
|
|
+import { getDeptTree, getContactList, addContact, updateContact, deleteContact } from '@/api/pc/organization';
|
|
|
+import { getWorkbenchRoleList } from '@/api/pc/system';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const currentDeptId = ref<number | null>(null);
|
|
|
const dialogVisible = ref(false);
|
|
|
@@ -169,16 +170,10 @@ const loadDeptTree = async () => {
|
|
|
// 加载角色列表
|
|
|
const loadRoleList = async () => {
|
|
|
try {
|
|
|
- roleList.value = [
|
|
|
- { roleId: 1, roleName: '管理角色' },
|
|
|
- { roleId: 2, roleName: '采购角色' },
|
|
|
- { roleId: 3, roleName: '查询角色' },
|
|
|
- { roleId: 4, roleName: '审核角色' }
|
|
|
- ];
|
|
|
- // const res = await getRoleList(queryParams);
|
|
|
- // if (res.code === 200 && res.data) {
|
|
|
- // roleList.value = res.data;
|
|
|
- // }
|
|
|
+ const res = await getWorkbenchRoleList();
|
|
|
+ if (res.data) {
|
|
|
+ roleList.value = res.data as any[];
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
console.error('获取角色列表失败:', error);
|
|
|
}
|
|
|
@@ -257,10 +252,13 @@ const handleSelectionChange = (rows: any[]) => {
|
|
|
|
|
|
const handleAdd = () => {
|
|
|
editingRow.value = null;
|
|
|
+ formData.id = null;
|
|
|
formData.contactName = '';
|
|
|
formData.phone = '';
|
|
|
formData.deptId = currentDeptId.value;
|
|
|
+ formData.deptName = '';
|
|
|
formData.roleId = null;
|
|
|
+ formData.roleName = '';
|
|
|
formData.status = '0';
|
|
|
dialogVisible.value = true;
|
|
|
};
|