webpackJsonp([80],{

/***/ "F9s0":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "MblA":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
var stringify = __webpack_require__("mvHQ");
var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);

// EXTERNAL MODULE: ./src/api/index.js + 5 modules
var api = __webpack_require__("gyMJ");

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/rolePermissions.vue

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


/* harmony default export */ var rolePermissions = ({
  inject: ['reload'],
  name: "basetable",
  data: function data() {
    return {
      selectoption: [],
      selectoptionValue: '',
      checkList: [],
      i18n: [],
      selectstatus: false,
      isRouterAlive: true,
      query: {
        address: "",
        name: "",
        pageIndex: 1,
        pageSize: 10,
        options: []
      },
      radio: "1",
      treedata: [{
        id: "STATISTICAL_ANALYSIS",
        label: "数据汇总",
        status: 0,
        children: [{
          id: "HOME_PAGE",
          label: "首页",
          status: 0
        }, {
          id: "Datavisualization",
          label: "大屏展示",
          status: 0
        }]
      }, {
        id: "AREA_MANAGEMENT",
        label: "房源管理",
        status: 0,
        children: [{
          id: "STUDENT_DORMITORY",
          label: "房源列表",
          status: 0
        }]
      }, {
        id: "OPERATIONS_MANAGEMENT",
        label: "业务管理",
        status: 0,
        children: [{
          id: "ACCOMMODATION_OPERATION",
          label: "门锁业务",
          status: 0,
          children: [{
            id: "ACCOMMODATION_REGISTER",
            label: "入住办理",
            status: 0
          }, {
            id: "CHECK_OUT_MANAGEMENT",
            label: "退住管理",
            status: 0
          }, {
            id: "RENEWAL_HANDLING",
            label: "续住管理",
            status: 0
          }]
        }, {
          id: "DOORMAGNETICSERVICE",
          label: "门磁业务",
          status: 0,
          children: [{
            id: "LINKMAN",
            label: "接警联系人",
            status: 0
          }]
        }]
      }, {
        id: "PERSONNEL_MANAGEMENT",
        label: "人员管理",
        status: 0,
        children: [{
          id: "STUDENT_INFORMATION",
          label: "人员列表",
          status: 0
        }, {
          label: "凭证管理",
          id: "RENT_SURRENDER_MANAGEMENT",
          status: 0
        }, {
          label: "信息库",
          id: "INFORMATIONBASE",
          status: 0
        }]
      }, {
        id: "DEVICE_MANAGEMENT",
        label: "设备管理",
        status: 0,
        children: [{
          id: "DOOR_LOCK_DEVICE",
          label: "门锁设备",
          status: 0
        }, {
          id: "EQUIPMENTLIST",
          label: "门磁设备",
          status: 0
        }]
      }, {
        id: "USER_MANAGEMENT",
        label: "用户管理",
        status: 0,
        children: [{
          id: "ACCOUNT_MANAGEMENT",
          label: "登录账号",
          status: 0
        }, {
          id: "ROLE_PERMISSIONS",
          label: "角色权限",
          status: 0
        }, {
          id: "BOUND_ROLE",
          label: "绑定角色",
          status: 0
        }]
      }, {
        id: "LOG_MANAGEMENT",
        label: "日志管理",
        status: 0,
        children: [{
          id: "journal",
          label: "系统日志",
          status: 0
        }, {
          id: "DOORLOCKLOG",
          label: "门锁日志",
          status: 0,
          children: [{
            id: "UnlockRecord",
            label: "开锁记录",
            status: 0
          }, {
            id: "warningLog",
            label: "警告日志",
            status: 0
          }, {
            id: "DeviceFeedbackLog",
            label: "设备反馈日志",
            status: 0
          }]
        }, {
          id: "DOORMAGNETICLOG",
          label: "门磁日志",
          status: 0,
          children: [{
            id: "ALARMRECORD",
            label: "报警日志",
            status: 0
          }]
        }]
      }],
      defaultProps: {

        children: "children",
        label: "label"
      },
      options: [{
        value: "选项1",
        label: "超级系统管理员"
      }, {
        value: "选项2",
        label: "业务员"
      }],
      yhsflist: [{
        value: 0,
        label: "超级管理员"
      }, {
        value: 1,
        label: "高级管理员"
      }, {
        value: 2,
        label: "中级管理员"
      }, {
        value: 3,
        label: "低级管理员"
      }],
      authorities: [],
      authorities1: [],
      authoritiesName: [],
      value: "",
      tableData: [],
      multipleSelection: [],
      delList: [],
      editVisible: false,
      editVisible1: false,
      pageTotal: 0,
      form: {},
      form1: {},
      idx: -1,
      id: -1,
      userInfo: {
        type: ''
      }
    };
  },
  created: function created() {
    this.userInfo = JSON.parse(localStorage.getItem('info'));
    this.getUserID();
    this.getmenu();
    this.selectoption = JSON.parse(localStorage.getItem('selectoption'));
    this.selectoptionValue = localStorage.getItem('tenantId');
  },

  methods: {
    selectTenantId: function selectTenantId(e) {
      localStorage.setItem('tenantId', e);
      this.reload();
    },
    getmenu: function getmenu() {
      var _this = this;

      Object(api["d" /* httpGet */])('', this.$api.userInfo).then(function (res3) {
        var authorities = res3.data.authorities;
        localStorage.setItem('info', stringify_default()(res3.data));
        if (res3.data.type == 0) {
          _this.i18n = _this.$language.cn.i18n;
        } else {
          var i18n = _this.$language.cn.i18n.items;
          for (var i = 0; i < i18n.length; i++) {
            if (i18n[i].subs) {
              var Index1 = authorities.findIndex(function (item) {
                return item == i18n[i].key;
              });
              if (Index1 == -1) {
                i18n[i].status = -1;
              }
              for (var j = 0; j < i18n[i].subs.length; j++) {
                var Index = authorities.findIndex(function (item) {
                  return item == i18n[i].subs[j].key;
                });
                if (Index == -1) {
                  i18n[i].subs[j].status = -1;
                  console.log(i18n[i].subs[j]);
                } else {
                  i18n[i].status = 0;
                }
              }
            } else {
              var _Index = authorities.findIndex(function (item) {
                return item == i18n[i].key;
              });
              if (_Index == -1) {
                i18n[i].status = -1;
              }
            }
          }
          _this.i18n = _this.$language.cn.i18n;
          _this.$nextTick(function () {
            _this.i18n.items = i18n;
            console.log(_this.i18n.items);
          });
        }
      });
    },

    // 修改角色权限
    preservation: function preservation() {
      var _this2 = this;

      var data = {
        roleId: this.roleId,
        authorities: this.authorities
      };
      Object(api["g" /* httpPost */])(data, this.$api.updateRole).then(function (res) {
        if (res.code == 200) {
          _this2.$message.success("更新成功");
          _this2.isRouterAlive = false;
          _this2.$nextTick(function () {
            this.getUserID();
            this.editVisible1 = false;
            this.isRouterAlive = true;
          });
        }
      });
    },

    // 获取角色id
    getUserID: function getUserID() {
      var _this3 = this;

      var data = {
        pageNum: 1,
        pageSize: 100
      };
      Object(api["d" /* httpGet */])(data, this.$api.getRoleList).then(function (res) {
        _this3.tableData = res.data.list;
        _this3.pageTotal = res.data.total || 10;
      });
    },
    getCheckedKeys: function getCheckedKeys(e) {
      console.log(e);
    },

    // 勾选权限
    handleCheckChange: function handleCheckChange() {
      // var authoritieslist = this.$refs.tree.getCheckedNodes();
      var authoritieslist = this.checkList;
      var authorities = [],
          authoritiesName = [];
      // authoritieslist.map((li) => {
      //   authorities.push(li.id);
      //   authoritiesName.push(li.label);
      // });
      // this.authoritiesName = authoritiesName;
      this.authorities = authoritieslist;
      // console.log(this.treedata)
    },

    // 数组去重
    unique: function unique(arr) {
      var newArr = [];
      var len = arr.length;
      for (var i = 0; i < len; i++) {
        if (newArr.indexOf(arr[i]) == -1) {
          newArr.push(arr[i]);
        }
      }
      return newArr;
    },

    // 获取用户列表
    getUserList: function getUserList() {
      var _this4 = this;

      // var data={
      //   name:"zw001"
      // }
      Object(api["d" /* httpGet */])("", this.$api.getUserList).then(function (res) {
        _this4.tableData = res.data.list;
        _this4.pageTotal = res.data.total || 50;
      });
    },
    handleChange: function handleChange(value) {
      console.log(value);
    },

    // 获取 easy-mock 的模拟数据
    getData: function getData() {
      var _this5 = this;

      Object(api["g" /* httpPost */])().then(function (res) {
        _this5.tableData = res.list;
        _this5.pageTotal = res.pageTotal || 50;
      });
    },

    // 触发搜索按钮
    handleSearch: function handleSearch() {
      // this.$set(this.query, "pageIndex", 1);
      // this.getData();

    },

    // 删除操作
    handleDelete: function handleDelete(index, row) {
      var _this6 = this;

      var roleIds = [row.id];
      var data = {
        roleIds: roleIds
      };
      this.$confirm("确定要删除吗？", "提示", {
        type: "warning"
      }).then(function () {
        Object(api["g" /* httpPost */])(data, _this6.$api.deleteRole).then(function (res) {
          _this6.$message.success("删除成功");
          _this6.tableData.splice(index, 1);
        });
      }).catch(function () {});
    },

    // 多选操作
    handleSelectionChange: function handleSelectionChange(val) {
      this.authorities1 = [];
      // this.$refs.tree.setCheckedKeys([]);
      this.authorities1 = JSON.parse(val.authorities);
      this.checkList = this.authorities1 || [];
      this.roleId = val.id;
      // this.multipleSelection = val;
    },
    delAllSelection: function delAllSelection() {
      var length = this.multipleSelection.length;
      var str = "";
      this.delList = this.delList.concat(this.multipleSelection);
      for (var i = 0; i < length; i++) {
        str += this.multipleSelection[i].name + " ";
      }
      this.$message.error("\u5220\u9664\u4E86" + str);
      this.multipleSelection = [];
    },

    // 编辑操作
    handleEdit: function handleEdit(index, row) {
      this.idx = index;
      this.form = row;
      this.editVisible = true;
    },

    // 保存编辑
    saveEdit: function saveEdit() {
      this.editVisible = false;
      this.$message.success("\u4FEE\u6539\u7B2C " + (this.idx + 1) + " \u884C\u6210\u529F");
      this.$set(this.tableData, this.idx, this.form);
    },

    // 编辑操作
    handleEdit1: function handleEdit1() {
      this.editVisible1 = true;
    },

    // 保存编辑
    saveEdit1: function saveEdit1() {
      var _this7 = this;

      var data = {
        name: this.form1.name,
        type: this.value
      };
      Object(api["g" /* httpPost */])(data, this.$api.addRole).then(function (res) {
        if (res.code == 200) {
          console.log("11111111111111");
          _this7.$message.success(res.message);
          _this7.editVisible1 = false;
          _this7.isRouterAlive = false;
          _this7.$nextTick(function () {
            this.getUserID();
            this.editVisible1 = false;
            this.isRouterAlive = true;
          });
        }
      });
    },

    // 分页导航
    handlePageChange: function handlePageChange(val) {
      this.$set(this.query, "pageIndex", val);
      this.getData();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-270b84de","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/rolePermissions.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isRouterAlive)?_c('div',[_c('el-row',{staticClass:"gridBox",staticStyle:{"background":"#fff","padding":"20px"},attrs:{"gutter":20}},[_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","size":"small"},on:{"click":_vm.handleEdit1}},[_vm._v("添加角色")])],1),_vm._v(" "),_c('div',{},[_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","header-cell-class-name":"table-header","highlight-current-row":"","height":"500"},on:{"row-click":_vm.handleSelectionChange}},[(_vm.selectstatus)?_c('el-table-column',{attrs:{"type":"selection","width":"55","align":"center"}}):_vm._e(),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"id","label":"ID","width":"55","align":"center"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"角色名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"type","label":"分类"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"180","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-button',{staticClass:"red",attrs:{"type":"text","icon":"el-icon-delete"},on:{"click":function($event){return _vm.handleDelete(scope.$index, scope.row)}}},[_vm._v("\n                删除")])]}}],null,false,2919662003)})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"background":"","layout":"total, prev, pager, next","current-page":_vm.query.pageIndex,"page-size":_vm.query.pageSize,"total":_vm.pageTotal},on:{"current-change":_vm.handlePageChange}})],1)],1)]),_vm._v(" "),_c('div',{staticClass:"perverBox"},[_c('div',{staticClass:"prever"},[_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","size":"small"},on:{"click":_vm.preservation}},[_vm._v("保存设置")])],1),_vm._v(" "),_c('div',{staticClass:"treediv"},[_c('el-checkbox-group',{on:{"change":_vm.handleCheckChange},model:{value:(_vm.checkList),callback:function ($$v) {_vm.checkList=$$v},expression:"checkList"}},[_c('div',{staticClass:"elTree"},_vm._l((_vm.i18n.items),function(item,index){return _c('div',{directives:[{name:"show",rawName:"v-show",value:(item.status !=-1),expression:"item.status !=-1"}],key:index,staticClass:"treeitem"},[_c('div',{staticClass:"trli"},[_c('i',{directives:[{name:"show",rawName:"v-show",value:(item.subs),expression:"item.subs"}],staticClass:"el-icon-caret-bottom"}),_vm._v(" "),_c('el-checkbox',{attrs:{"label":item.key}},[_c('span',[_vm._v(_vm._s(item.title))])])],1),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(item.subs),expression:"item.subs"}],staticClass:"treeli1"},_vm._l((item.subs),function(item1,index){return _c('li',{directives:[{name:"show",rawName:"v-show",value:(item1.status !=-1),expression:"item1.status !=-1"}],key:index},[_c('div',{staticClass:"trli"},[_c('i',{directives:[{name:"show",rawName:"v-show",value:(item1.subs),expression:"item1.subs"}],staticClass:"el-icon-caret-bottom"}),_vm._v(" "),_c('el-checkbox',{attrs:{"label":item1.key}},[_c('span',[_vm._v(_vm._s(item1.title))])])],1),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(item1.subs),expression:"item1.subs"}],staticClass:"treeli1"},_vm._l((item1.subs),function(item2,index){return (item2.status !=-1)?_c('li',{key:index},[_c('div',{staticClass:"trli"},[_c('i',{directives:[{name:"show",rawName:"v-show",value:(item2.subs),expression:"item2.subs"}],staticClass:"el-icon-caret-bottom"}),_vm._v(" "),_c('el-checkbox',{attrs:{"label":item2.key}},[_c('span',[_vm._v(_vm._s(item2.title))])])],1)]):_vm._e()}),0)])}),0)])}),0)])],1)])]),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","visible":_vm.editVisible,"width":"30%"},on:{"update:visible":function($event){_vm.editVisible=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.editVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.saveEdit}},[_vm._v("确 定")])],1)]},proxy:true}],null,false,2750799758)},[_c('el-form',{ref:"form",attrs:{"model":_vm.form,"label-width":"70px"}},[_c('el-form-item',{attrs:{"label":"角色名称"}},[_c('el-input',{model:{value:(_vm.form.name),callback:function ($$v) {_vm.$set(_vm.form, "name", $$v)},expression:"form.name"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"类型"}},[_c('el-input',{model:{value:(_vm.form.address),callback:function ($$v) {_vm.$set(_vm.form, "address", $$v)},expression:"form.address"}})],1)],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","visible":_vm.editVisible1,"width":"30%"},on:{"update:visible":function($event){_vm.editVisible1=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.editVisible1 = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.saveEdit1}},[_vm._v("确 定")])],1)]},proxy:true}],null,false,918262190)},[_c('el-form',{ref:"form",attrs:{"model":_vm.form1,"label-width":"70px"}},[_c('el-form-item',{attrs:{"label":"角色名称"}},[_c('el-input',{model:{value:(_vm.form1.name),callback:function ($$v) {_vm.$set(_vm.form1, "name", $$v)},expression:"form1.name"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"类型"}},[_c('el-select',{attrs:{"placeholder":"请选择"},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v},expression:"value"}},_vm._l((_vm.yhsflist),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1)],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"默认权限"}},[_c('el-radio-group',{model:{value:(_vm.radio),callback:function ($$v) {_vm.radio=$$v},expression:"radio"}},[_c('el-radio',{attrs:{"label":"1"}},[_vm._v("是")]),_vm._v(" "),_c('el-radio',{attrs:{"label":"2"}},[_vm._v("否")])],1)],1)],1)],1)],1):_vm._e()}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var views_rolePermissions = (esExports);
// CONCATENATED MODULE: ./src/views/rolePermissions.vue
function injectStyle (ssrContext) {
  __webpack_require__("F9s0")
}
var normalizeComponent = __webpack_require__("VU/8")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-270b84de"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  rolePermissions,
  views_rolePermissions,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var src_views_rolePermissions = __webpack_exports__["default"] = (Component.exports);


/***/ })

});