/**
 * Created by 1 at 2022-07-28 15:24:52
 * 注册事件类【用户列表】，参看event.defaultEvent.js
 */
window.$swEvent.setup("bpm.sys.user.user.userList", {
    setup(page) {
        const {$params, $refs, $widgets, $model, $utils, $tabRouter, $api} = page || {};
        const {$$message, $$http} = $utils || {};


        // 示例
        const onBeforeSave = () => {
            $model.userCard.setFormVal("partyData", $model.userPartyList.data.list.rows);
        };

        const batchResetPwd = () => {
            const data = $refs.tbuser.getSelectIds();
            if (data.length == 0) {
                $$message.notify.warning("请选择要重置的记录！");
                return;
            }
            $$http.post("bpm/user/resetPwd", {ids: data.join(",")}).then((rt) => {
                // 8.弹出成功消息
                $$message.notify.success("操作成功");
            });
        };

        return {
            onBeforeSave,
            batchResetPwd,
        }
    }
});
