|
@@ -56,6 +56,7 @@ import byTable from "@/components/byTable/index";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
+import { getUser } from "@/api/system/user";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
@@ -64,6 +65,7 @@ const defaultProps = {
|
|
|
label: "deptName",
|
|
|
};
|
|
|
const deptList = ref([]);
|
|
|
+const roleOptions = ref([]);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
pagination: {
|
|
@@ -199,6 +201,17 @@ const getDict = () => {
|
|
|
loading.value = false;
|
|
|
}, 200);
|
|
|
});
|
|
|
+ getUser().then(response => {
|
|
|
+ if(response.roles && response.roles.length > 0) {
|
|
|
+ response.roles = response.roles.map(item => {
|
|
|
+ item.label = item.roleName;
|
|
|
+ item.id = item.roleId
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ roleOptions.value = response.roles;
|
|
|
+ console.log(roleOptions.value);
|
|
|
+ });
|
|
|
};
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -271,7 +284,7 @@ const formConfig = computed(() => {
|
|
|
label: "角色",
|
|
|
prop: "roleIds",
|
|
|
multiple: true,
|
|
|
- data: [],
|
|
|
+ data: roleOptions.value,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|