UserControl 변경: class -> function

master
mjkhan21 4 months ago
parent 817f318dc5
commit 8e701ed8cb

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

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

@ -1,36 +1,16 @@
class UserControl extends DatasetControl {
constructor(conf) {
super(conf || {
prefix:"user",
prefixName:"사용자",
infoSize:"xl",
keymapper:info => info ? info.USER_ID : "",
dataGetter:obj => obj.userList,
formats: {
REG_DT:datetimeFormat
}
});
}
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) {
function newUserControl(doctx = "user") {
let ctrl = new DatasetControl({
doctx: doctx,
prefix:"user",
prefixName:"사용자",
infoSize:"xl",
keymapper:info => info ? info.USER_ID : "",
dataGetter:obj => obj.userList,
formats: {
REG_DT:datetimeFormat
}
});
ctrl.changePassword = async params => {
if (!params) {
ajax.get({
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