UserControl 변경: class -> function

master
mjkhan21 4 months ago
parent 817f318dc5
commit 8e701ed8cb

@ -122,7 +122,7 @@ class AuthorityControl {
onActionSelect(selected) {} onActionSelect(selected) {}
async addUsers() { async addUsers() {
let userIDs = await new UserControl().selectUser(true); let userIDs = await selectUser(true);
let authID = this.authorities.dataset.getCurrent().AUTH_ID; let authID = this.authorities.dataset.getCurrent().AUTH_ID;
json.post({ json.post({
url:wctx.url("/authority/user/add.do"), url:wctx.url("/authority/user/add.do"),

@ -567,7 +567,6 @@ class Dataset {
this.onDirtiesChange(this.dirty); this.onDirtiesChange(this.dirty);
return this; return this;
} }
/**Clears the Dataset's user data. /**Clears the Dataset's user data.

@ -1,6 +1,6 @@
class UserControl extends DatasetControl { function newUserControl(doctx = "user") {
constructor(conf) { let ctrl = new DatasetControl({
super(conf || { doctx: doctx,
prefix:"user", prefix:"user",
prefixName:"사용자", prefixName:"사용자",
infoSize:"xl", infoSize:"xl",
@ -10,27 +10,7 @@ class UserControl extends DatasetControl {
REG_DT:datetimeFormat REG_DT:datetimeFormat
} }
}); });
} ctrl.changePassword = async params => {
async selectUser(multiple) {
return new Promise((resolve, reject) => {
ajax.get({
url:this.url("/select.do"),
data:{multiple:multiple},
success:resp => {
dialog.open({
title:"사용자 선택",
content:resp,
size:"xl",
getData:() => {return getSelectedUser();},
onOK:(selected) => resolve(selected)
});
}
});
});
}
changePassword(params) {
if (!params) { if (!params) {
ajax.get({ ajax.get({
url: wctx.url("/user/changePassword.do"), url: wctx.url("/user/changePassword.do"),
@ -52,5 +32,22 @@ class UserControl extends DatasetControl {
}); });
}); });
} }
} };
return ctrl;
} }
async function selectUser(multiple) {
return new Promise((resolve, reject) => {
ajax.get({
url:wctx.url("/user/select.do"),
data:{multiple:multiple},
success:resp => {
dialog.open({
title:"사용자 선택",
content:resp,
getData:() => {return getSelectedUser();},
onOK:(selected) => resolve(selected)
});
}
});
});
};
Loading…
Cancel
Save