(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-19bb8f6e"], { "06fa": function(e, t, a) { "use strict"; a.d(t, "a", (function() { return r; })); var o = a("b775"); function r(e2) { return Object(o["a"])({ url: "/hakocompany/menu/selectMenuAll", method: "post", data: e2 }); } }, "3a22": function(e, t, a) { }, 6492: function(e, t, a) { }, "67d5": function(e, t, a) { "use strict"; a.d(t, "i", (function() { return r; })), a.d(t, "j", (function() { return n; })), a.d(t, "f", (function() { return l; })), a.d(t, "b", (function() { return s; })), a.d(t, "c", (function() { return i; })), a.d(t, "k", (function() { return c; })), a.d(t, "e", (function() { return d; })), a.d(t, "d", (function() { return u; })), a.d(t, "h", (function() { return f; })), a.d(t, "a", (function() { return h; })), a.d(t, "g", (function() { return p; })); var o = a("b775"); function r(e2) { return Object(o["a"])({ url: "/hakocompany/Role/pageList", method: "post", data: e2 }); } function n(e2) { return Object(o["a"])({ url: "/company/organizationalStructure/selectOsList", method: "post", data: e2 }); } function l(e2) { return Object(o["a"])({ url: "/company/organizationalStructure/findOsTree", method: "post", data: e2 }); } function s(e2) { return Object(o["a"])({ url: "/hakocompany/Role/create", method: "post", data: e2 }); } function i(e2) { return Object(o["a"])({ url: "/hakocompany/Role/delete", method: "post", data: e2 }); } function c(e2) { return Object(o["a"])({ url: "/hakocompany/Role/update", method: "post", data: e2 }); } function d(e2) { return Object(o["a"])({ url: "/hakocompany/RoleMenuRel/findByRoleIdAndClienId", method: "post", data: e2 }); } function u(e2) { return Object(o["a"])({ url: "/hakocompany/OrganizationRoleRel/findByRoleId", method: "post", data: e2 }); } function f(e2) { return Object(o["a"])({ url: "/company/member/pageListForRole", method: "post", data: e2 }); } function h(e2) { return Object(o["a"])({ url: "/company/MemberRoleRel/batchDelete", method: "post", data: e2 }); } function p(e2) { return Object(o["a"])({ url: "/hakocompany/account/findProjectByRole", method: "post", data: e2 }); } }, 8873: function(e, t, a) { "use strict"; a("6492"); }, "9179b": function(e, t, a) { }, "9adb": function(e, t, a) { "use strict"; a.r(t); var o = function() { var e2 = this, t2 = e2.$createElement, a2 = e2._self._c || t2; return a2("div", { staticClass: "headStys" }, [a2("div", { staticClass: "formContent" }, [a2("div", { staticClass: "container" }, [a2("el-form", { ref: "query", staticClass: "demo-form-inline", attrs: { inline: true, model: e2.query, "label-width": "100px" } }, [a2("div", { staticClass: "house-detail" }, [a2("div", { staticClass: "grid-half" }, [a2("div", { staticClass: "cell" }, [a2("el-form-item", { attrs: { prop: "roleStatus", label: "角色状态" } }, [a2("el-select", { attrs: { clearable: "", placeholder: "角色状态" }, model: { value: e2.query.roleStatus, callback: function(t3) { e2.$set(e2.query, "roleStatus", t3); }, expression: "query.roleStatus" } }, e2._l(e2.roleStatusArr, (function(e3) { return a2("el-option", { key: e3.value, attrs: { label: e3.label, value: e3.value } }); })), 1)], 1)], 1)]), e2._v(" "), a2("div", { staticClass: "grid-half" }, [a2("div", { staticClass: "cell" }, [a2("el-form-item", { attrs: { prop: "roleName", label: "角色名称" } }, [a2("el-input", { attrs: { placeholder: "角色名称", clearable: "" }, model: { value: e2.query.roleName, callback: function(t3) { e2.$set(e2.query, "roleName", t3); }, expression: "query.roleName" } })], 1)], 1)]), e2._v(" "), a2("div", { staticClass: "grid-half" }, [a2("div", { staticClass: "cell" }, [a2("el-form-item", [a2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], attrs: { type: "primary" }, on: { click: e2.onSearch } }, [e2._v("查询")])], 1), e2._v(" "), a2("el-form-item", [a2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], on: { click: function(t3) { return e2.resetForm("query"); } } }, [e2._v("重置")])], 1)], 1)])])])], 1)]), e2._v(" "), a2("div", { staticClass: "contentStys" }, [a2("div", { staticClass: "planLst" }, [a2("span", [e2._v("角色管理列表")]), e2._v(" "), a2("span", { staticClass: "addPlan" }, [a2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], staticClass: "cololr el-icon-plus", attrs: { type: "primary" }, on: { click: e2.addRoleManageClick } }, [e2._v("新增")])], 1)]), e2._v(" "), a2("div", { staticStyle: { padding: "24px" } }, [a2("el-table", { directives: [{ name: "loading", rawName: "v-loading", value: e2.listLoading, expression: "listLoading" }], attrs: { data: e2.listTable, "header-cell-style": e2.headClass, "tooltip-effect": "dark", "default-expand-all": "", border: "" } }, [a2("el-table-column", { attrs: { label: "#", align: "center", width: "50" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [a2("span", [e2._v(e2._s(t3.$index + (e2.query.pageNumber - 1) * e2.query.pageSize + 1) + "\n ")])]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "角色名称" } }), e2._v(" "), a2("el-table-column", { attrs: { prop: "createDate", align: "center", "show-overflow-tooltip": "", label: "创建时间" } }), e2._v(" "), a2("el-table-column", { attrs: { align: "center", "show-overflow-tooltip": "", label: "角色状态" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [a2("span", [0 === t3.row.roleStatus ? a2("span", [a2("el-switch", { attrs: { disabled: "" }, model: { value: e2.value1, callback: function(t4) { e2.value1 = t4; }, expression: "value1" } })], 1) : e2._e(), e2._v(" "), 1 === t3.row.roleStatus ? a2("span", [a2("el-switch", { attrs: { disabled: "" }, model: { value: e2.value2, callback: function(t4) { e2.value2 = t4; }, expression: "value2" } })], 1) : e2._e()])]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { align: "center", "show-overflow-tooltip": "", label: "角色关联人" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [t3.row.userCount > 0 ? a2("el-link", { attrs: { type: "primary" }, on: { click: function(a3) { return e2.editClick(t3.row); } } }, [e2._v(e2._s(t3.row.userCount))]) : a2("span", [e2._v("0")])]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { align: "center", "show-overflow-tooltip": "", label: "备注" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v("\n " + e2._s(t3.row.remark || "-") + "\n ")]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { align: "center", "show-overflow-tooltip": "", label: "操作人" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v("\n " + e2._s(t3.row.updateName || "-") + "\n ")]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { align: "center", "show-overflow-tooltip": "", label: "操作时间" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v("\n " + e2._s(t3.row.updateDate || "-") + "\n ")]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { label: "操作", align: "center" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [a2("el-button", { attrs: { type: "text" }, on: { click: function(a3) { return e2.copyRow(t3.row, 0); } } }, [e2._v("复制角色")]), e2._v(" "), "企业创建人" != t3.row.roleName ? a2("el-button", { attrs: { type: "text" }, on: { click: function(a3) { return e2.editRow(t3.row, 0); } } }, [e2._v("编辑")]) : e2._e(), e2._v(" "), "企业创建人" === t3.row.roleName ? a2("el-button", { attrs: { type: "text" }, on: { click: function(a3) { return e2.editRow(t3.row, 1); } } }, [e2._v("查看")]) : e2._e(), e2._v(" "), "企业创建人" != t3.row.roleName ? a2("el-button", { attrs: { type: "text" }, on: { click: function(a3) { return e2.deleteRow(t3.row); } } }, [e2._v("删除")]) : e2._e()]; } }]) })], 1)], 1), e2._v(" "), e2.addNewRole ? a2("el-dialog", { staticClass: "dialogHead", attrs: { "before-close": e2.handleClose, title: e2.title, "show-close": true, "close-on-press-escape": false, "close-on-click-modal": false, visible: e2.addNewRole, width: "45%", height: "300px" }, on: { "update:visible": function(t3) { e2.addNewRole = t3; } } }, [a2("add-role", { ref: "roleRef", attrs: { roleData: e2.addRoleData }, on: { submitForm: e2.submitForm, canceAdd: e2.handleClose } })], 1) : e2._e(), e2._v(" "), a2("editRole", { ref: "editrole", attrs: { show: e2.showEdit }, on: { close: e2.editClose, get: e2.getlistData } })], 1), e2._v(" "), a2("div", { staticClass: "pagination" }, [a2("el-pagination", { attrs: { "current-page": e2.query.pageNumber, "page-sizes": [10, 20, 30, 100], "page-size": e2.query.pageSize, layout: "total, sizes, prev, pager, next, jumper", total: e2.pageTotal }, on: { "update:currentPage": function(t3) { return e2.$set(e2.query, "pageNumber", t3); }, "update:current-page": function(t3) { return e2.$set(e2.query, "pageNumber", t3); }, "size-change": e2.handleSizeChange, "current-change": e2.handleCurrentChange } })], 1)]); }, r = [], n = (a("a450"), a("67d5")), l = function() { var e2 = this, t2 = e2.$createElement, a2 = e2._self._c || t2; return a2("div", { staticClass: "addRole" }, [a2("div", { staticClass: "form" }, [a2("el-form", { ref: "form", attrs: { "label-position": "left", rules: e2.rules, model: e2.form, "label-width": "100px" } }, [a2("el-form-item", { staticClass: "formItem", attrs: { label: "角色名称:", prop: "roleName" } }, [a2("el-input", { staticClass: "formItemInput", attrs: { type: "text", placeholder: "角色名称", disabled: "view" === e2.roleData.type }, model: { value: e2.form.roleName, callback: function(t3) { e2.$set(e2.form, "roleName", "string" === typeof t3 ? t3.trim() : t3); }, expression: "form.roleName" } })], 1), e2._v(" "), a2("el-form-item", { staticClass: "formItem", attrs: { label: "角色状态:", prop: "roleStatus" } }, [a2("el-switch", { attrs: { disabled: "view" === e2.roleData.type }, model: { value: e2.form.roleStatus, callback: function(t3) { e2.$set(e2.form, "roleStatus", t3); }, expression: "form.roleStatus" } })], 1), e2._v(" "), a2("el-form-item", { staticClass: "formItem", attrs: { label: "备注:", prop: "roleRemake" } }, [a2("el-input", { attrs: { type: "textarea", disabled: "view" === e2.roleData.type }, model: { value: e2.form.remark, callback: function(t3) { e2.$set(e2.form, "remark", t3); }, expression: "form.remark" } })], 1)], 1), e2._v(" "), a2("div", { staticClass: "tabTree" }, [a2("ul", e2._l(e2.treeMenu, (function(t3) { return a2("li", { key: t3.id, class: { active: e2.treeActiveId === t3.id }, on: { click: function(a3) { return e2.handleMenuClick(t3.id); } } }, [e2._v("\n " + e2._s(t3.text) + "\n ")]); })), 0), e2._v(" "), "view" === e2.roleData.type ? a2("div", { staticClass: "tree" }, [a2("el-tree", { ref: "conpamyMenu", attrs: { data: e2.treeData[e2.treeActiveId], props: e2.defaultProps } })], 1) : e2._e(), e2._v(" "), "add" === e2.roleData.type || "edit" === e2.roleData.type ? a2("div", { staticClass: "tree" }, [e2.treeData[e2.treeActiveId].length ? a2("el-checkbox", { on: { change: e2.handleCheckAllChange }, model: { value: e2.treeCheckAll[e2.treeActiveId], callback: function(t3) { e2.$set(e2.treeCheckAll, e2.treeActiveId, t3); }, expression: "treeCheckAll[treeActiveId]" } }, [e2._v("全选")]) : e2._e(), e2._v(" "), a2("el-tree", { ref: "organizationData", attrs: { data: e2.treeData[e2.treeActiveId], "show-checkbox": "", "node-key": "id", "default-checked-keys": e2.defaultCheckedData[e2.treeActiveId], props: e2.defaultProps }, on: { check: e2.checkInfo } })], 1) : e2._e(), e2._v(" "), a2("div", { staticClass: "btnStys" }, ["add" === e2.roleData.type || "edit" === e2.roleData.type ? a2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], attrs: { type: "primary" }, on: { click: function(t3) { return e2.submitForm("form"); } } }, [e2._v("提交")]) : e2._e(), e2._v(" "), a2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], on: { click: e2.canceAdd } }, [e2._v("取消")])], 1)])], 1)]); }, s = [], i = (a("ac67"), a("32ea"), a("c5cb"), a("2843"), a("a7e5"), a("e8b2")), c = (a("0c84"), a("b5aa"), a("3ef1")), d = (a("1bc7"), a("5821")), u = a("06fa"); function f(e2, t2) { var a2 = Object.keys(e2); if (Object.getOwnPropertySymbols) { var o2 = Object.getOwnPropertySymbols(e2); t2 && (o2 = o2.filter((function(t3) { return Object.getOwnPropertyDescriptor(e2, t3).enumerable; }))), a2.push.apply(a2, o2); } return a2; } function h(e2) { for (var t2 = 1; t2 < arguments.length; t2++) { var a2 = null != arguments[t2] ? arguments[t2] : {}; t2 % 2 ? f(Object(a2), true).forEach((function(t3) { Object(d["a"])(e2, t3, a2[t3]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(a2)) : f(Object(a2)).forEach((function(t3) { Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(a2, t3)); })); } return e2; } var p = { props: ["roleData"], data: function() { return { rules: { roleName: [{ required: true, message: "请填写角色名称", trigger: "change" }], roleStatus: [{ required: true, message: "请选择角色状态", trigger: "change" }] }, form: { roleStatus: true, roleName: "", remark: "", roleType: 2, adClientId: 1, organizationRoleRelAddReqDTO: [], roleMenuRelAddReqDTO: [] }, treeMenu: [{ id: 0, text: "企业-角色菜单分配" }, { id: 1, text: "项目-角色权限分配" }, { id: 2, text: "项目-角色菜单分配" }], treeData: { 0: [], 1: [], 2: [] }, defaultCheckedData: { 0: [], 1: [], 2: [] }, selectedData: { 0: [], 1: [], 2: [] }, treeCheckAll: { 0: false, 1: false, 2: false }, defaultProps: { children: "menuChildren", label: "menuName" }, treeActiveId: 0, contrastData: [], paramProp: { 0: { menuName: "menuName", menuId: "id", adClientId: 1 }, 1: { orgId: "id", orgName: "name", adClientId: 2 } }, defaultMenuIds: [343, 344, 345, 9, 10, 324, 325, 326, 327, 328, 329] }; }, methods: { assignment: function(e2) { JSON.parse(JSON.stringify(h({}, e2))), this.form = h({}, e2), "copy" == this.form.newType && (this.form.roleName = ""), console.log(this.form, "form"), 0 === e2.roleStatus ? this.form.roleStatus = true : this.form.roleStatus = false; }, isLeafNode: function(e2, t2, a2) { var o2 = true, r2 = function(e3, t3, a3) { for (var n2 = 0; n2 < e3.length; n2++) { var l2 = e3[n2]; if (l2.id === a3) { o2 = !(l2[t3] && l2[t3].length); break; } l2[t3] && r2(l2[t3], t3, a3); } }; return r2(e2, t2, a2), o2; }, setSelectedNode: function(e2, t2, a2) { var o2 = this, r2 = 1 === t2 ? "orgId" : "menuId", n2 = 1 === t2 ? "childs" : "menuChildren"; a2.forEach((function(a3) { var l2 = a3[r2]; o2.isLeafNode(e2[t2], n2, l2) && a3.checkeds && o2.defaultCheckedData[t2].push(l2); })); }, getEditSelectedData: (function() { var e2 = Object(c["a"])(regeneratorRuntime.mark((function e3(t3, a2) { var o2, r2, l2 = this; return regeneratorRuntime.wrap((function(e4) { while (1) switch (e4.prev = e4.next) { case 0: return Object.assign(this.defaultCheckedData, { 0: [], 1: [], 2: [] }), Object.assign(this.selectedData, { 0: [], 1: [], 2: [] }), o2 = [Object(n["e"])({ roleId: t3.id, adClientId: 1 }), Object(n["d"])({ adClientId: 1, roleId: t3.id }), Object(n["e"])({ roleId: t3.id, adClientId: 2 })], e4.next = 1, Promise.all(o2); case 1: r2 = e4.sent, 3 === r2.length && r2.forEach((function(e5, t4) { if (0 === e5.code) { var o3 = e5.data; l2.setSelectedNode(a2, t4, o3), o3.forEach((function(e6) { l2.selectedData[t4].push(e6); })); } })); case 2: case "end": return e4.stop(); } }), e3, this); }))); function t2(t3, a2) { return e2.apply(this, arguments); } return t2; })(), submitForm: function(e2) { var t2 = this, a2 = this; "企业创建人" !== this.form.roleName ? (this.form.organizationRoleRelAddReqDTO = [], this.form.roleMenuRelAddReqDTO = [], this.$refs[e2].validate((function(e3) { if (!e3) return false; if (0 != a2.defaultCheckedData[1].length) if (0 != a2.defaultCheckedData[2].length) { a2.form.roleStatus = false === a2.form.roleStatus ? 1 : 0, a2.form.organizationRoleRelAddReqDTO = a2.selectedData["1"], a2.form.roleMenuRelAddReqDTO = [].concat(Object(i["a"])(a2.selectedData["0"]), Object(i["a"])(a2.selectedData["2"])), a2.form.adOrgId = JSON.parse(window.localStorage.getItem("companyInfo")).osId; var o2 = a2.form; o2.type = a2.roleData.type, t2.$emit("submitForm", o2); } else a2.$message({ showClose: true, message: "请对项目角色菜单进行分配!", type: "error" }); else a2.$message({ showClose: true, message: "请对角色项目权限进行分配", type: "error" }); }))) : this.$message({ showClose: true, message: "企业创建人已存在", type: "error" }); }, canceAdd: function() { this.$emit("canceAdd", false); }, checkInfo: function(e2, t2) { var a2 = t2.checkedNodes, o2 = t2.halfCheckedNodes, r2 = a2.filter((function(e3) { return !e3.pid || -1 === a2.findIndex((function(t3) { return e3.pid === t3.id; })); })); this.getSelectedData(r2), this.getSelectedData(o2, true); }, handleCheckAllChange: function(e2) { this.treeCheckAll[this.treeActiveId] ? (this.$refs.organizationData.setCheckedNodes(this.treeData[this.treeActiveId]), this.getSelectedData(this.treeData[this.treeActiveId])) : (this.$refs.organizationData.setCheckedKeys([]), this.selectedData[this.treeActiveId] = []); }, getSelectedData: function(e2) { var t2 = this, a2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; a2 || (this.selectedData[this.treeActiveId] = [], this.defaultCheckedData[this.treeActiveId] = []); var o2 = 1 === this.treeActiveId ? 1 : 0, r2 = "id", n2 = 0 === o2 ? "menuId" : "orgId", l2 = function(e3) { e3.forEach((function(e4, s2) { var i2 = t2.defaultProps, c2 = e4[i2.children], d2 = t2.paramProp[o2], u2 = {}; for (var f2 in d2) if (Object.hasOwnProperty.call(d2, f2)) { var h2 = d2[f2]; u2[f2] = e4[h2], "adClientId" === f2 && (u2.adClientId = 0 === t2.treeActiveId ? 1 : 2, u2.checked = !a2, t2.form && t2.form.id && (u2.roleId = t2.form.id, u2.roleName = t2.form.roleName)); } u2[n2] = e4[r2], a2 || t2.defaultCheckedData[t2.treeActiveId].push(e4.id), t2.selectedData[t2.treeActiveId].push(u2), c2 && c2.length && !a2 && l2(c2); })); }; l2(e2); }, getInitTreeData: (function() { var e2 = Object(c["a"])(regeneratorRuntime.mark((function e3() { var t3, a2; return regeneratorRuntime.wrap((function(e4) { while (1) switch (e4.prev = e4.next) { case 0: return t3 = [Object(u["a"])({ appIdType: 1 }), Object(n["f"])({ id: JSON.parse(window.localStorage.getItem("companyInfo")).osId }), Object(u["a"])({ appIdType: 2 })], e4.next = 1, Promise.all(t3); case 1: return a2 = e4.sent, e4.abrupt("return", a2); case 2: case "end": return e4.stop(); } }), e3); }))); function t2() { return e2.apply(this, arguments); } return t2; })(), handleMenuClick: function(e2) { var t2 = this, a2 = this.roleData, o2 = a2.type; a2.val; if (e2 !== this.treeActiveId && (this.treeActiveId = e2, 1 !== e2 ? (this.defaultProps.children = "menuChildren", this.defaultProps.label = "menuName") : (this.defaultProps.children = "childs", this.defaultProps.label = "name"), "add" === o2)) { if (0 === e2) { if (0 === this.selectedData["0"].length) { var r2 = [343, 344, 345]; this.defaultCheckedData["0"] = r2, this.$nextTick((function() { t2.$refs.organizationData.setCheckedKeys(r2), t2.setTreeSelectRes(); })), this.$forceUpdate(); } } else if (2 === e2 && 0 === this.selectedData["2"].length) { var n2 = [9, 10, 324, 325, 326, 327, 328, 329]; this.defaultCheckedData["2"] = n2, this.$nextTick((function() { t2.$refs.organizationData.setCheckedKeys(n2), t2.setTreeSelectRes(); })), this.$forceUpdate(); } } }, setTreeSelectRes: function() { var e2 = this.$refs.organizationData.getCheckedNodes(); if (0 === this.treeActiveId || 2 === this.treeActiveId) { var t2 = []; e2.map((function(e3) { t2.push({ adClientId: e3.adClientId, checked: true, menuId: e3.id, menuName: e3.menuName }); })); var a2 = this.selectedData[this.treeActiveId], o2 = []; 0 === a2.length ? this.selectedData[this.treeActiveId] = t2 : (o2 = [].concat(t2, Object(i["a"])(a2)), console.log(Array.from(new Set(o2))), this.selectedData[this.treeActiveId] = o2); } } }, mounted: function() { var e2 = this.roleData, t2 = e2.type, a2 = e2.val, o2 = e2.newType, r2 = this; this.getInitTreeData().then((function(e3) { var n2 = []; if (3 === e3.length) if (e3.forEach((function(e4, t3) { 0 === e4.code && n2.push(e4.data); })), "edit" === t2 || "view" === t2) r2.assignment(a2, o2), r2.getEditSelectedData(a2, n2).then((function(e4) { r2.treeData = [].concat(n2); })); else { r2.treeData = [].concat(n2); var l2 = [343, 344, 345]; r2.defaultCheckedData["0"] = l2, r2.$nextTick((function() { r2.$refs.organizationData.setCheckedKeys(l2), r2.setTreeSelectRes(); })), r2.$forceUpdate(); } })); } }, m = p, v = (a("bb6d"), a("829d")), g = Object(v["a"])(m, l, s, false, null, "c9563678", null), b = g.exports, y = function() { var e2 = this, t2 = e2.$createElement, a2 = e2._self._c || t2; return a2("div", [a2("el-dialog", { attrs: { title: "编辑角色关联人", "before-close": e2.handleClose, "close-on-press-escape": false, "close-on-click-modal": false, visible: e2.show, width: "80%", height: "300px" }, on: { "update:visible": function(t3) { e2.show = t3; } } }, [a2("el-form", { ref: "searchForm", staticClass: "demo-form-inline", attrs: { inline: true, model: e2.searchForm } }, [a2("el-form-item", { attrs: { prop: "name" } }, [a2("el-input", { attrs: { placeholder: "姓名", clearable: "" }, model: { value: e2.searchForm.name, callback: function(t3) { e2.$set(e2.searchForm, "name", t3); }, expression: "searchForm.name" } })], 1), e2._v(" "), a2("el-form-item", { attrs: { prop: "phoneNumber" } }, [a2("el-input", { attrs: { placeholder: "手机号", clearable: "" }, model: { value: e2.searchForm.phoneNumber, callback: function(t3) { e2.$set(e2.searchForm, "phoneNumber", t3); }, expression: "searchForm.phoneNumber" } })], 1), e2._v(" "), a2("el-form-item", { attrs: { prop: "osId" } }, [a2("el-select", { attrs: { clearable: "", filterable: "", placeholder: "部门" }, model: { value: e2.searchForm.osId, callback: function(t3) { e2.$set(e2.searchForm, "osId", t3); }, expression: "searchForm.osId" } }, e2._l(e2.projectList, (function(e3) { return a2("el-option", { key: e3.id, attrs: { label: e3.name, value: e3.id } }); })), 1)], 1), e2._v(" "), a2("el-form-item", { attrs: { prop: "onJobState" } }, [a2("el-select", { attrs: { clearable: "", placeholder: "在职状态" }, model: { value: e2.searchForm.onJobState, callback: function(t3) { e2.$set(e2.searchForm, "onJobState", t3); }, expression: "searchForm.onJobState" } }, [a2("el-option", { attrs: { label: "在职", value: 1 } }), e2._v(" "), a2("el-option", { attrs: { label: "离职", value: 2 } })], 1)], 1), e2._v(" "), a2("el-form-item", { attrs: { prop: "isStop" } }, [a2("el-select", { attrs: { clearable: "", placeholder: "账号状态" }, model: { value: e2.searchForm.isStop, callback: function(t3) { e2.$set(e2.searchForm, "isStop", t3); }, expression: "searchForm.isStop" } }, [a2("el-option", { attrs: { label: "正常", value: 1 } }), e2._v(" "), a2("el-option", { attrs: { label: "暂停", value: 0 } })], 1)], 1), e2._v(" "), a2("el-form-item", [a2("el-button", { attrs: { type: "primary" }, on: { click: e2.searchClick } }, [e2._v("查询")]), e2._v(" "), a2("el-button", { on: { click: function(t3) { return e2.reset("searchForm"); } } }, [e2._v("重置")])], 1)], 1), e2._v(" "), a2("div", { staticStyle: { "margin-bottom": "15px" } }, [a2("el-button", { attrs: { size: "mini", type: "danger" }, on: { click: e2.deleteAll } }, [e2._v("批量删除")])], 1), e2._v(" "), a2("el-table", { directives: [{ name: "loading", rawName: "v-loading", value: e2.listLoading, expression: "listLoading" }], attrs: { data: e2.listTable, "header-cell-style": e2.headClass, border: "" }, on: { "selection-change": e2.handleSelectionChange } }, [a2("el-table-column", { attrs: { type: "selection", align: "center", width: "50" } }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "姓名" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v(e2._s(t3.row.name || "-"))]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "性别" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v(e2._s(1 == t3.row.sex ? "男" : 2 == t3.row.sex ? "女" : "未知"))]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "手机号" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v(e2._s(t3.row.phoneNumber || "-"))]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "部门" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v(e2._s(t3.row.departmentName || "-"))]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "岗位" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [e2._v(e2._s(t3.row.postName || "-"))]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "在职状态" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [1 === t3.row.onJobState ? a2("el-tag", { attrs: { type: "success", size: "mini" } }, [e2._v("在职")]) : e2._e(), e2._v(" "), 2 === t3.row.onJobState ? a2("el-tag", { attrs: { type: "info", size: "mini" } }, [e2._v("离职")]) : e2._e()]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "账号状态" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [0 === t3.row.isStop ? a2("el-tag", { attrs: { type: "info", size: "mini" } }, [e2._v("暂停")]) : a2("el-tag", { attrs: { type: "success", size: "mini" } }, [e2._v("正常")])]; } }]) }), e2._v(" "), a2("el-table-column", { attrs: { prop: "roleName", align: "center", "show-overflow-tooltip": "", label: "操作" }, scopedSlots: e2._u([{ key: "default", fn: function(t3) { return [a2("el-button", { attrs: { type: "text" }, on: { click: function(a3) { return e2.deleteMember(t3.row); } } }, [e2._v("删除")])]; } }]) })], 1), e2._v(" "), a2("div", { staticClass: "paginations" }, [a2("el-pagination", { attrs: { background: "", "current-page": e2.searchForm.pageNumber, "page-sizes": [10, 20, 30, 100], "page-size": e2.searchForm.pageSize, layout: "total, sizes, prev, pager, next, jumper", total: e2.pageTotal }, on: { "update:currentPage": function(t3) { return e2.$set(e2.searchForm, "pageNumber", t3); }, "update:current-page": function(t3) { return e2.$set(e2.searchForm, "pageNumber", t3); }, "size-change": e2.handleSizeChange, "current-change": e2.handleCurrentChange } })], 1)], 1)], 1); }, w = [], _ = { props: { show: { typeof: Boolean, default: false } }, data: function() { return { pageTotal: 0, searchForm: { pageSize: 10, pageNumber: 1, name: "", phoneNumber: "", osId: "", onJobState: "", isStop: "" }, roleInfo: {}, projectList: [], listLoading: false, listTable: [], selectList: [] }; }, mounted: function() { this.getProjectInfo(); }, methods: { getData: function(e2) { console.log(e2), this.roleInfo = e2, this.getList(); }, getList: function() { var e2 = this; this.listLoading = true, this.searchForm.roleId = this.roleInfo.id, Object(n["h"])(this.searchForm).then((function(t2) { 0 == t2.code && t2.data ? (e2.listTable = t2.data.records, e2.pageTotal = t2.data.rowsCount, e2.listLoading = false) : e2.listLoading = false; })).catch((function(t2) { e2.listLoading = false; })); }, handleSizeChange: function(e2) { this.searchForm.pageSize = e2, this.getList(); }, handleCurrentChange: function(e2) { this.searchForm.pageNumber = e2, this.getList(); }, getProjectInfo: function() { var e2 = this, t2 = JSON.parse(window.localStorage.getItem("companyInfo")).osId; Object(n["j"])({ id: t2, attribute: 1 }).then((function(t3) { 0 === t3.code && t3.data ? e2.projectList = t3.data : e2.projectList = []; })); }, searchClick: function() { this.getList(); }, reset: function(e2) { this.$refs[e2].resetFields(), this.getList(); }, handleSelectionChange: function(e2) { console.log(e2), this.selectList = e2; }, deleteMember: function(e2) { var t2 = this; this.$confirm("删除后该员工原先所关联的菜单都会自动解除,可能会影响正常使用,是否确认删除?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then((function() { var a2 = [e2.id]; t2.delPost(a2); })); }, deleteAll: function() { if (this.selectList.length > 0) { var e2 = []; this.selectList.forEach((function(t2) { e2.push(t2.id); })), this.delPost(e2); } else this.$message("请选择要删除的员工!"); }, delPost: function(e2) { var t2 = this, a2 = { roleId: this.roleInfo.id, userIds: e2 }; Object(n["a"])(a2).then((function(e3) { 0 == e3.code && (t2.$message({ message: "删除成功", type: "success" }), t2.getList(), t2.$emit("get")); })); }, handleClose: function() { this.$refs["searchForm"].resetFields(), this.$emit("close"); }, headClass: function() { return "text-align:center;background:#FAFAFA;"; } } }, k = _, C = (a("b8fd"), Object(v["a"])(k, y, w, false, null, "e7500956", null)), I = C.exports, S = { name: "roleManageList", components: { addRole: b, editRole: I }, data: function() { return { pageTotal: 0, listLoading: false, addNewRole: false, type: "", title: "新增角色", value1: true, value2: false, roleStatusArr: [{ value: 0, label: "启用" }, { value: 1, label: "禁用" }], listTable: [], query: { pageNumber: 1, pageSize: 10, roleName: "", roleStatus: "" }, addRoleData: { type: "add" }, showEdit: false }; }, created: function() { this.headClass(); }, mounted: function() { this.getlistData(); }, methods: { copyRow: function(e2, t2) { this.title = "新增角色信息", this.addNewRole = true, this.addRoleData.type = 0 === t2 ? "edit" : "view", e2.newType = "copy", this.$set(this.addRoleData, "val", e2); }, submitForm: function(e2) { e2.type && "edit" === e2.type ? "copy" === e2.newType ? this.createRoleInfo(e2) : this.updataMenuInfo(e2) : this.createRoleInfo(e2); }, updataMenuInfo: function(e2) { var t2 = this, a2 = JSON.parse(window.localStorage.getItem("memberInfor")); e2.updateName = a2.name, Object(n["k"])(e2).then((function(e3) { 0 == e3.code && (t2.$message({ message: "更新成功", type: "success" }), t2.getlistData()); })), this.addNewRole = false; }, createRoleInfo: function(e2) { var t2 = this; Object(n["b"])(e2).then((function(e3) { 0 == e3.code && (t2.$message({ message: "新增成功", type: "success" }), t2.getlistData()); })), this.addNewRole = false; }, deleteRow: function(e2) { var t2 = this, a2 = { id: e2.id }; this.$confirm("确定删除该数据吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "info", center: true }).then((function() { Object(n["c"])(a2).then((function(e3) { 0 == e3.code && (t2.$message({ message: "删除成功", type: "success" }), t2.getlistData()); })); })); }, addRoleManageClick: function() { this.title = "新增角色", this.addNewRole = true, this.addRoleData.type = "add"; }, editRow: function(e2, t2) { e2.newType = null, this.title = "编辑角色信息", this.addNewRole = true, this.addRoleData.type = 0 === t2 ? "edit" : "view", this.$set(this.addRoleData, "val", e2); }, handleSizeChange: function(e2) { this.query.pageSize = e2, this.getlistData(); }, handleCurrentChange: function(e2) { this.query.pageNumber = e2, this.getlistData(); }, getlistData: function() { var e2 = this; this.listLoading = true, this.query.adClientId = 1, this.query.adOrgId = JSON.parse(window.localStorage.getItem("companyInfo")).osId, Object(n["i"])(this.query).then((function(t2) { 0 == t2.code && (e2.listTable = t2.data.records, e2.pageTotal = t2.data.rowsCount); })), this.listLoading = false; }, handleClose: function() { this.addNewRole = false; }, onSearch: function() { this.query.pageNumber = 1, this.getlistData(); }, resetForm: function(e2) { this.taskDate = "", this.$refs[e2].resetFields(), this.getlistData(); }, editClick: function(e2) { this.showEdit = true, this.$nextTick((function() { this.$refs.editrole.getData(e2); })); }, editClose: function() { this.showEdit = false; }, headClass: function() { return "text-align:center;background:#FAFAFA;"; } } }, D = S, N = (a("8873"), Object(v["a"])(D, o, r, false, null, "79ed2b26", null)); t["default"] = N.exports; }, b8fd: function(e, t, a) { "use strict"; a("3a22"); }, bb6d: function(e, t, a) { "use strict"; a("9179b"); } }]);