index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
  4. <el-form-item label="角色名称" prop="roleName">
  5. <el-input
  6. v-model="queryParams.roleName"
  7. placeholder="请输入角色名称"
  8. clearable
  9. size="small"
  10. style="width: 240px"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="权限字符" prop="roleKey">
  15. <el-input
  16. v-model="queryParams.roleKey"
  17. placeholder="请输入权限字符"
  18. clearable
  19. size="small"
  20. style="width: 240px"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="状态" prop="status">
  25. <el-select
  26. v-model="queryParams.status"
  27. placeholder="角色状态"
  28. clearable
  29. size="small"
  30. style="width: 240px"
  31. >
  32. <el-option
  33. v-for="dict in statusOptions"
  34. :key="dict.dictValue"
  35. :label="dict.dictLabel"
  36. :value="dict.dictValue"
  37. />
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item label="创建时间">
  41. <el-date-picker
  42. v-model="dateRange"
  43. size="small"
  44. style="width: 240px;margin-top:5px;"
  45. value-format="yyyy-MM-dd"
  46. type="daterange"
  47. range-separator="-"
  48. start-placeholder="开始日期"
  49. end-placeholder="结束日期"
  50. ></el-date-picker>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  54. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  55. </el-form-item>
  56. </el-form>
  57. <el-row :gutter="10" class="mb8">
  58. <el-col :span="1.5">
  59. <el-button
  60. type="primary"
  61. plain
  62. icon="el-icon-plus"
  63. size="mini"
  64. @click="handleAdd"
  65. v-hasPermi="['system:role:add']"
  66. >新增</el-button>
  67. </el-col>
  68. <el-col :span="1.5">
  69. <el-button
  70. type="success"
  71. plain
  72. icon="el-icon-edit"
  73. size="mini"
  74. :disabled="single"
  75. @click="handleUpdate"
  76. v-hasPermi="['system:role:edit']"
  77. >修改</el-button>
  78. </el-col>
  79. <el-col :span="1.5">
  80. <el-button
  81. type="danger"
  82. plain
  83. icon="el-icon-delete"
  84. size="mini"
  85. :disabled="multiple"
  86. @click="handleDelete"
  87. v-hasPermi="['system:role:remove']"
  88. >删除</el-button>
  89. </el-col>
  90. <!-- <el-col :span="1.5">
  91. <el-button
  92. type="warning"
  93. plain
  94. icon="el-icon-download"
  95. size="mini"
  96. :loading="exportLoading"
  97. @click="handleExport"
  98. v-hasPermi="['system:role:export']"
  99. >导出</el-button>
  100. </el-col> -->
  101. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  102. </el-row>
  103. <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
  104. <el-table-column type="selection" width="55" align="center" />
  105. <el-table-column label="角色编号" prop="roleId" width="120" />
  106. <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
  107. <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
  108. <el-table-column label="显示顺序" prop="roleSort" width="100" />
  109. <el-table-column label="状态" align="center" width="100">
  110. <template slot-scope="scope">
  111. <el-switch
  112. v-model="scope.row.status"
  113. active-value="0"
  114. inactive-value="1"
  115. @change="handleStatusChange(scope.row)"
  116. ></el-switch>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="创建时间" align="center" prop="createTime" width="180">
  120. <template slot-scope="scope">
  121. <span>{{ parseTime(scope.row.createTime) }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  125. <template slot-scope="scope" v-if="scope.row.roleId !== 1">
  126. <el-button
  127. size="mini"
  128. type="text"
  129. icon="el-icon-edit"
  130. @click="handleUpdate(scope.row)"
  131. v-hasPermi="['system:role:edit']"
  132. >修改</el-button>
  133. <el-button
  134. size="mini"
  135. type="text"
  136. icon="el-icon-delete"
  137. @click="handleDelete(scope.row)"
  138. v-hasPermi="['system:role:remove']"
  139. >删除</el-button>
  140. <el-button
  141. size="mini"
  142. type="text"
  143. icon="el-icon-circle-check"
  144. @click="handleDataScope(scope.row)"
  145. v-hasPermi="['system:role:edit']"
  146. >数据权限</el-button>
  147. <!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
  148. <span class="el-dropdown-link">
  149. <i class="el-icon-d-arrow-right el-icon--right"></i>更多
  150. </span>
  151. <el-dropdown-menu slot="dropdown">
  152. <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"
  153. v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>
  154. <el-dropdown-item command="handleAuthUser" icon="el-icon-user"
  155. v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>
  156. </el-dropdown-menu>
  157. </el-dropdown> -->
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <pagination
  162. v-show="total>0"
  163. :total="total"
  164. :page.sync="queryParams.pageNum"
  165. :limit.sync="queryParams.pageSize"
  166. @pagination="getList"
  167. />
  168. <!-- 添加或修改角色配置对话框 -->
  169. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :before-close="cancel" :close-on-click-modal="false">
  170. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  171. <el-form-item label="角色名称" prop="roleName">
  172. <el-input v-model="form.roleName" placeholder="请输入角色名称" />
  173. </el-form-item>
  174. <el-form-item prop="roleKey">
  175. <span slot="label">
  176. <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
  177. <i class="el-icon-question"></i>
  178. </el-tooltip>
  179. 权限字符
  180. </span>
  181. <el-input v-model="form.roleKey" placeholder="请输入权限字符" />
  182. </el-form-item>
  183. <el-form-item label="角色顺序" prop="roleSort">
  184. <el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
  185. </el-form-item>
  186. <el-form-item label="状态">
  187. <el-radio-group v-model="form.status">
  188. <el-radio
  189. v-for="dict in statusOptions"
  190. :key="dict.dictValue"
  191. :label="dict.dictValue"
  192. >{{dict.dictLabel}}</el-radio>
  193. </el-radio-group>
  194. </el-form-item>
  195. <el-form-item label="菜单权限">
  196. <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
  197. <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
  198. <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
  199. <el-tree
  200. class="tree-border"
  201. :data="menuOptions"
  202. show-checkbox
  203. ref="menu"
  204. node-key="id"
  205. :check-strictly="!form.menuCheckStrictly"
  206. empty-text="加载中,请稍后"
  207. :props="defaultProps"
  208. ></el-tree>
  209. </el-form-item>
  210. <el-form-item label="备注">
  211. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
  212. </el-form-item>
  213. </el-form>
  214. <div slot="footer" class="dialog-footer">
  215. <el-button type="primary" @click="submitForm" v-if="!loading">确 定</el-button>
  216. <el-button :loading="loading" type="primary" v-else>提交中...</el-button>
  217. <el-button @click="cancel">取 消</el-button>
  218. </div>
  219. </el-dialog>
  220. <!-- 分配角色数据权限对话框 -->
  221. <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body >
  222. <el-form :model="form" label-width="80px">
  223. <el-form-item label="角色名称">
  224. <el-input v-model="form.roleName" :disabled="true" />
  225. </el-form-item>
  226. <el-form-item label="权限字符">
  227. <el-input v-model="form.roleKey" :disabled="true" />
  228. </el-form-item>
  229. <el-form-item label="权限范围">
  230. <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
  231. <el-option
  232. v-for="item in dataScopeOptions"
  233. :key="item.value"
  234. :label="item.label"
  235. :value="item.value"
  236. ></el-option>
  237. </el-select>
  238. </el-form-item>
  239. <el-form-item label="数据权限" v-show="form.dataScope == 2">
  240. <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
  241. <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
  242. <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
  243. <el-tree
  244. class="tree-border"
  245. :data="deptOptions"
  246. show-checkbox
  247. default-expand-all
  248. ref="dept"
  249. node-key="id"
  250. :check-strictly="!form.deptCheckStrictly"
  251. empty-text="加载中,请稍后"
  252. :props="defaultProps"
  253. ></el-tree>
  254. </el-form-item>
  255. </el-form>
  256. <div slot="footer" class="dialog-footer">
  257. <el-button type="primary" @click="submitDataScope" v-if="!loading">确 定</el-button>
  258. <el-button :loading="loading" type="primary" v-else>提交中...</el-button>
  259. <el-button @click="cancelDataScope">取 消</el-button>
  260. </div>
  261. </el-dialog>
  262. </div>
  263. </template>
  264. <script>
  265. import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from "@/api/system/role";
  266. import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
  267. import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
  268. export default {
  269. name: "Role",
  270. data() {
  271. return {
  272. // 遮罩层
  273. loading: true,
  274. // 导出遮罩层
  275. exportLoading: false,
  276. // 选中数组
  277. ids: [],
  278. // 非单个禁用
  279. single: true,
  280. // 非多个禁用
  281. multiple: true,
  282. // 显示搜索条件
  283. showSearch: true,
  284. // 总条数
  285. total: 0,
  286. // 角色表格数据
  287. roleList: [],
  288. // 弹出层标题
  289. title: "",
  290. // 是否显示弹出层
  291. open: false,
  292. // 是否显示弹出层(数据权限)
  293. openDataScope: false,
  294. menuExpand: false,
  295. menuNodeAll: false,
  296. deptExpand: true,
  297. deptNodeAll: false,
  298. // 日期范围
  299. dateRange: [],
  300. // 状态数据字典
  301. statusOptions: [],
  302. // 数据范围选项
  303. dataScopeOptions: [
  304. {
  305. value: "1",
  306. label: "全部数据权限"
  307. },
  308. {
  309. value: "2",
  310. label: "自定数据权限"
  311. },
  312. {
  313. value: "3",
  314. label: "本部门数据权限"
  315. },
  316. {
  317. value: "4",
  318. label: "本部门及以下数据权限"
  319. },
  320. {
  321. value: "5",
  322. label: "仅本人数据权限"
  323. }
  324. ],
  325. // 菜单列表
  326. menuOptions: [],
  327. // 部门列表
  328. deptOptions: [],
  329. // 查询参数
  330. queryParams: {
  331. pageNum: 1,
  332. pageSize: 10,
  333. roleName: undefined,
  334. roleKey: undefined,
  335. status: undefined
  336. },
  337. // 表单参数
  338. form: {},
  339. defaultProps: {
  340. children: "children",
  341. label: "label"
  342. },
  343. // 表单校验
  344. rules: {
  345. roleName: [
  346. { required: true, message: "角色名称不能为空", trigger: "blur" }
  347. ],
  348. roleKey: [
  349. { required: true, message: "权限字符不能为空", trigger: "blur" }
  350. ],
  351. roleSort: [
  352. { required: true, message: "角色顺序不能为空", trigger: "blur" }
  353. ]
  354. }
  355. };
  356. },
  357. created() {
  358. this.getList();
  359. this.getDicts("sys_normal_disable").then(response => {
  360. this.statusOptions = response.data;
  361. });
  362. },
  363. methods: {
  364. /** 查询角色列表 */
  365. getList() {
  366. this.loading = true;
  367. listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
  368. response => {
  369. this.roleList = response.rows;
  370. this.total = response.total;
  371. this.loading = false;
  372. }
  373. );
  374. },
  375. /** 查询菜单树结构 */
  376. getMenuTreeselect() {
  377. menuTreeselect().then(response => {
  378. this.menuOptions = response.data;
  379. });
  380. },
  381. /** 查询部门树结构 */
  382. getDeptTreeselect() {
  383. deptTreeselect().then(response => {
  384. this.deptOptions = response.data;
  385. });
  386. },
  387. // 所有菜单节点数据
  388. getMenuAllCheckedKeys() {
  389. // 目前被选中的菜单节点
  390. let checkedKeys = this.$refs.menu.getCheckedKeys();
  391. // 半选中的菜单节点
  392. let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
  393. checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
  394. return checkedKeys;
  395. },
  396. // 所有部门节点数据
  397. getDeptAllCheckedKeys() {
  398. // 目前被选中的部门节点
  399. let checkedKeys = this.$refs.dept.getCheckedKeys();
  400. // 半选中的部门节点
  401. let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
  402. checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
  403. return checkedKeys;
  404. },
  405. /** 根据角色ID查询菜单树结构 */
  406. getRoleMenuTreeselect(roleId) {
  407. return roleMenuTreeselect(roleId).then(response => {
  408. console.log(response)
  409. this.menuOptions = response.menus;
  410. return response;
  411. });
  412. },
  413. /** 根据角色ID查询部门树结构 */
  414. getRoleDeptTreeselect(roleId) {
  415. return roleDeptTreeselect(roleId).then(response => {
  416. this.deptOptions = response.depts;
  417. return response;
  418. });
  419. },
  420. // 角色状态修改
  421. handleStatusChange(row) {
  422. let text = row.status === "0" ? "启用" : "停用";
  423. this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
  424. confirmButtonText: "确定",
  425. cancelButtonText: "取消",
  426. type: "warning"
  427. }).then(function() {
  428. return changeRoleStatus(row.roleId, row.status);
  429. }).then(() => {
  430. this.msgSuccess(text + "成功");
  431. }).catch(function() {
  432. row.status = row.status === "0" ? "1" : "0";
  433. });
  434. },
  435. // 取消按钮
  436. cancel() {
  437. this.open = false;
  438. this.reset();
  439. },
  440. // 取消按钮(数据权限)
  441. cancelDataScope() {
  442. this.openDataScope = false;
  443. this.reset();
  444. },
  445. // 表单重置
  446. reset() {
  447. if (this.$refs.menu != undefined) {
  448. this.$refs.menu.setCheckedKeys([]);
  449. }
  450. this.menuExpand = false,
  451. this.menuNodeAll = false,
  452. this.deptExpand = true,
  453. this.deptNodeAll = false,
  454. this.form = {
  455. roleId: undefined,
  456. roleName: undefined,
  457. roleKey: undefined,
  458. roleSort: 0,
  459. status: "0",
  460. menuIds: [],
  461. deptIds: [],
  462. menuCheckStrictly: true,
  463. deptCheckStrictly: true,
  464. remark: undefined
  465. };
  466. this.resetForm("form");
  467. },
  468. /** 搜索按钮操作 */
  469. handleQuery() {
  470. this.queryParams.pageNum = 1;
  471. this.getList();
  472. },
  473. /** 重置按钮操作 */
  474. resetQuery() {
  475. this.dateRange = [];
  476. this.resetForm("queryForm");
  477. this.handleQuery();
  478. },
  479. // 多选框选中数据
  480. handleSelectionChange(selection) {
  481. this.ids = selection.map(item => item.roleId)
  482. this.single = selection.length!=1
  483. this.multiple = !selection.length
  484. },
  485. // 更多操作触发
  486. handleCommand(command, row) {
  487. switch (command) {
  488. case "handleDataScope":
  489. this.handleDataScope(row);
  490. break;
  491. case "handleAuthUser":
  492. this.handleAuthUser(row);
  493. break;
  494. default:
  495. break;
  496. }
  497. },
  498. // 树权限(展开/折叠)
  499. handleCheckedTreeExpand(value, type) {
  500. if (type == 'menu') {
  501. let treeList = this.menuOptions;
  502. for (let i = 0; i < treeList.length; i++) {
  503. this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
  504. }
  505. } else if (type == 'dept') {
  506. let treeList = this.deptOptions;
  507. for (let i = 0; i < treeList.length; i++) {
  508. this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
  509. }
  510. }
  511. },
  512. // 树权限(全选/全不选)
  513. handleCheckedTreeNodeAll(value, type) {
  514. if (type == 'menu') {
  515. this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
  516. } else if (type == 'dept') {
  517. this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
  518. }
  519. },
  520. // 树权限(父子联动)
  521. handleCheckedTreeConnect(value, type) {
  522. if (type == 'menu') {
  523. this.form.menuCheckStrictly = value ? true: false;
  524. } else if (type == 'dept') {
  525. this.form.deptCheckStrictly = value ? true: false;
  526. }
  527. },
  528. /** 新增按钮操作 */
  529. handleAdd() {
  530. this.reset();
  531. this.getMenuTreeselect();
  532. this.open = true;
  533. this.title = "添加角色";
  534. },
  535. /** 修改按钮操作 */
  536. handleUpdate(row) {
  537. this.reset();
  538. const roleId = row.roleId || this.ids
  539. const roleMenu = this.getRoleMenuTreeselect(roleId);
  540. getRole(roleId).then(response => {
  541. this.form = response.data;
  542. this.open = true;
  543. this.$nextTick(() => {
  544. roleMenu.then(res => {
  545. let checkedKeys = res.checkedKeys
  546. checkedKeys.forEach((v) => {
  547. this.$nextTick(()=>{
  548. this.$refs.menu.setChecked(v, true ,false);
  549. })
  550. })
  551. });
  552. });
  553. this.title = "修改角色";
  554. });
  555. },
  556. /** 选择角色权限范围触发 */
  557. dataScopeSelectChange(value) {
  558. if(value !== '2') {
  559. this.$refs.dept.setCheckedKeys([]);
  560. }
  561. },
  562. /** 分配数据权限操作 */
  563. handleDataScope(row) {
  564. this.reset();
  565. const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
  566. getRole(row.roleId).then(response => {
  567. this.form = response.data;
  568. this.openDataScope = true;
  569. this.$nextTick(() => {
  570. roleDeptTreeselect.then(res => {
  571. this.$refs.dept.setCheckedKeys(res.checkedKeys);
  572. });
  573. });
  574. this.title = "分配数据权限";
  575. });
  576. },
  577. /** 分配用户操作 */
  578. handleAuthUser: function(row) {
  579. const roleId = row.roleId;
  580. this.$router.push("/system/role-auth/user/" + roleId);
  581. },
  582. /** 提交按钮 */
  583. submitForm: function() {
  584. this.$refs["form"].validate(valid => {
  585. if (valid) {
  586. this.loading = true
  587. if (this.form.roleId != undefined) {
  588. this.form.menuIds = this.getMenuAllCheckedKeys();
  589. updateRole(this.form).then(response => {
  590. // this.loading = false
  591. // this.msgSuccess("修改成功");
  592. // this.open = false;
  593. // this.getList();
  594. });
  595. } else {
  596. this.form.menuIds = this.getMenuAllCheckedKeys();
  597. addRole(this.form).then(response => {
  598. this.loading = false
  599. this.msgSuccess("新增成功");
  600. this.open = false;
  601. this.getList();
  602. });
  603. }
  604. }
  605. });
  606. },
  607. /** 提交按钮(数据权限) */
  608. submitDataScope: function() {
  609. if (this.form.roleId != undefined) {
  610. this.form.deptIds = this.getDeptAllCheckedKeys();
  611. dataScope(this.form).then(response => {
  612. this.msgSuccess("修改成功");
  613. this.openDataScope = false;
  614. this.getList();
  615. });
  616. }
  617. },
  618. /** 删除按钮操作 */
  619. handleDelete(row) {
  620. const roleIds = row.roleId || this.ids;
  621. this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
  622. confirmButtonText: "确定",
  623. cancelButtonText: "取消",
  624. type: "warning"
  625. }).then(function() {
  626. return delRole(roleIds);
  627. }).then(() => {
  628. this.getList();
  629. this.msgSuccess("删除成功");
  630. }).catch(() => {});
  631. },
  632. /** 导出按钮操作 */
  633. handleExport() {
  634. const queryParams = this.queryParams;
  635. this.$confirm('是否确认导出所有角色数据项?', "警告", {
  636. confirmButtonText: "确定",
  637. cancelButtonText: "取消",
  638. type: "warning"
  639. }).then(() => {
  640. this.exportLoading = true;
  641. return exportRole(queryParams);
  642. }).then(response => {
  643. this.download(response.msg);
  644. this.exportLoading = false;
  645. }).catch(() => {});
  646. }
  647. }
  648. };
  649. </script>