All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.modules.sys.roleinfo.ctrl.roleinfo.user.remove.js Maven / Gradle / Ivy

There is a newer version: 5.0.2101
Show newest version
define(function (require) {
  var Config = require('config');
  var Core = require('core/core');

  var Page = require('core/page');

  // 删除用户角色
  var UserInfoRoleRemove = Page.extend(function () {

    this.renderButton = function () {
      return 'F' !== this.parent.data.roleType;
    };

    // @override
    this.submit = function (table, data) {

      var ids = data.map(function (row) {
        return row.userCode;
      });

      Core.ajax(Config.ContextPath + 'system/userrole/' + this.parent.data.roleCode + '/' + ids.join(','), {
        method: 'DELETE',
        data: {
          _method: 'DELETE',
          obtainDate: data.obtainDate
        }
      }).then(function () {
        return require('loaders/cache/loader.system').loadAll()
      }).then(function () {
        table.datagrid('reload');
      });
    };

  });

  return UserInfoRoleRemove;
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy