|
@@ -64,13 +64,25 @@ export default defineComponent({
|
|
|
selectedUser.value.key = getUserId();
|
|
selectedUser.value.key = getUserId();
|
|
|
queryTable().then((res) => {
|
|
queryTable().then((res) => {
|
|
|
userList.value.length = 0;
|
|
userList.value.length = 0;
|
|
|
- userList.value.push({ value: getUserId(), lable: getUserName() });
|
|
|
|
|
- res.forEach((e) => {
|
|
|
|
|
- e.userlist.forEach((el) => {
|
|
|
|
|
- // userList.value.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
|
|
|
|
|
- userList.value.push({ value: el.loginid, lable: el.loginname });
|
|
|
|
|
|
|
+ const id = getUserId();
|
|
|
|
|
+ const has = res.find((e) => e.roleid === id);
|
|
|
|
|
+ if (has) {
|
|
|
|
|
+ // 找到了,代表着是交易员,只能看自己和下级
|
|
|
|
|
+ has.userlist.forEach((el) => {
|
|
|
|
|
+ userList.value.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
|
|
|
|
|
+ // userList.value.push({ value: el.loginid, lable: el.loginname });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 没有找到代表着是机构,可以查看所有交易员
|
|
|
|
|
+ userList.value.push({ value: id, lable: getUserName() });
|
|
|
|
|
+ res.forEach((e) => {
|
|
|
|
|
+ userList.value.push({ value: e.roleid, lable: e.rolename });
|
|
|
|
|
+ e.userlist.forEach((el) => {
|
|
|
|
|
+ userList.value.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
|
|
|
|
|
+ // userList.value.push({ value: el.loginid, lable: el.loginname });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
return {
|
|
return {
|