| 
															
																@@ -1,6 +1,6 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 <template> 
															 | 
															
															 | 
															
																 <template> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    <Codes v-model="showCodesEditForm" :role="editRole" /> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    <Edit v-model="showRoleEditForm" :role="editRole" /> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    <Codes v-model="isShowCodesEditForm" :role="editRole" /> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    <Edit v-model="isShowRoleEditForm" :role="editRole" :type="editType" /> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     <div> 
															 | 
															
															 | 
															
																     <div> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         <el-card class="box-card" v-loading="wholeLoading" element-loading-text="Loading..." style="height: 600px"> 
															 | 
															
															 | 
															
																         <el-card class="box-card" v-loading="wholeLoading" element-loading-text="Loading..." style="height: 600px"> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             <template #header> 
															 | 
															
															 | 
															
																             <template #header> 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -8,7 +8,7 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     <span>权限管理</span> 
															 | 
															
															 | 
															
																                     <span>权限管理</span> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     <div> 
															 | 
															
															 | 
															
																                     <div> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         <el-button type="default" @click="reflush()">刷新列表</el-button> 
															 | 
															
															 | 
															
																                         <el-button type="default" @click="reflush()">刷新列表</el-button> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        <el-button type="primary" @click="create()">新增角色</el-button> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        <el-button type="primary" @click="showEditDialog('create')">新增角色</el-button> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     </div> 
															 | 
															
															 | 
															
																                     </div> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 </div> 
															 | 
															
															 | 
															
																                 </div> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             </template> 
															 | 
															
															 | 
															
																             </template> 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -22,8 +22,8 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 </template> 
															 | 
															
															 | 
															
																 </template> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 <script lang="ts" setup name="underlyingRoleManage"> 
															 | 
															
															 | 
															
																 <script lang="ts" setup name="underlyingRoleManage"> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-import { ref, reactive, onMounted, h } from 'vue' 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-import { ElSwitch, ElTag, ElMessage, ElMessageBox, ElButton, TableV2FixedDir, roleTypes } from 'element-plus' 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import { ref, h } from 'vue' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+import { ElTag, ElMessage, ElMessageBox, ElButton, TableV2FixedDir } from 'element-plus' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import type { Column } from 'element-plus' 
															 | 
															
															 | 
															
																 import type { Column } from 'element-plus' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { throttle } from 'lodash' 
															 | 
															
															 | 
															
																 import { throttle } from 'lodash' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 import { init, update, newRole } from '/@/api/role' 
															 | 
															
															 | 
															
																 import { init, update, newRole } from '/@/api/role' 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -42,15 +42,19 @@ const wholeLoading = ref(false) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 /** 
															 | 
															
															 | 
															
																 /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  * 编辑权限表单的显示控制 
															 | 
															
															 | 
															
																  * 编辑权限表单的显示控制 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  */ 
															 | 
															
															 | 
															
																  */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-const showCodesEditForm = ref(false) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const isShowCodesEditForm = ref(false) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 /** 
															 | 
															
															 | 
															
																 /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  * 编辑角色表单的显示控制 
															 | 
															
															 | 
															
																  * 编辑角色表单的显示控制 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  */ 
															 | 
															
															 | 
															
																  */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-const showRoleEditForm = ref(false) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const isShowRoleEditForm = ref(false) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 /** 
															 | 
															
															 | 
															
																 /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  * 需要编辑的角色 
															 | 
															
															 | 
															
																  * 需要编辑的角色 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  */ 
															 | 
															
															 | 
															
																  */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 const editRole = ref<Role>(newRole()) 
															 | 
															
															 | 
															
																 const editRole = ref<Role>(newRole()) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+/** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ * 编辑类型 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const editType = ref<'update' | 'create'>('update') 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 /** 
															 | 
															
															 | 
															
																 /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  * 虚拟表格列信息 
															 | 
															
															 | 
															
																  * 虚拟表格列信息 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -69,7 +73,8 @@ const columns: Column<any>[] = [ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         width: 400, 
															 | 
															
															 | 
															
																         width: 400, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         cellRenderer: ({ cellData: codes_cn }) => h( 
															 | 
															
															 | 
															
																         cellRenderer: ({ cellData: codes_cn }) => h( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             'div', 
															 | 
															
															 | 
															
																             'div', 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            codes_cn?.map(cn => h(ElTag, { style: { 'margin-right': '5px' } }, cn)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            { style: { 'overflow-y': 'auto', display: 'flex' } }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            codes_cn?.map(cn => h(ElTag, { style: { 'margin-right': '5px' } }, cn)) || '暂无权限 ~ 点击权限以授权' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         ), 
															 | 
															
															 | 
															
																         ), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     }, 
															 | 
															
															 | 
															
																     }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     { 
															 | 
															
															 | 
															
																     { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -101,10 +106,10 @@ const columns: Column<any>[] = [ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ElButton, 
															 | 
															
															 | 
															
																                     ElButton, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         type: row.valid ? 'danger' : 'success', 
															 | 
															
															 | 
															
																                         type: row.valid ? 'danger' : 'success', 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        onClick: throttle(() => { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        onClick: (throttle(() => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             row.valid = !row.valid 
															 | 
															
															 | 
															
																                             row.valid = !row.valid 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             update(row) 
															 | 
															
															 | 
															
																                             update(row) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        }), 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        })), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     }, 
															 | 
															
															 | 
															
																                     }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     row.valid ? '禁用' : '启用' 
															 | 
															
															 | 
															
																                     row.valid ? '禁用' : '启用' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 ), 
															 | 
															
															 | 
															
																                 ), 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -114,8 +119,9 @@ const columns: Column<any>[] = [ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         type: 'primary', 
															 | 
															
															 | 
															
																                         type: 'primary', 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         onClick: throttle(() => { 
															 | 
															
															 | 
															
																                         onClick: throttle(() => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            showCodesEditForm.value = true 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             editRole.value = row 
															 | 
															
															 | 
															
																                             editRole.value = row 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            editType.value = 'update' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            isShowCodesEditForm.value = true 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         }), 
															 | 
															
															 | 
															
																                         }), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     }, 
															 | 
															
															 | 
															
																                     }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     '权限' 
															 | 
															
															 | 
															
																                     '权限' 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -124,10 +130,7 @@ const columns: Column<any>[] = [ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ElButton, 
															 | 
															
															 | 
															
																                     ElButton, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         type: 'primary', 
															 | 
															
															 | 
															
																                         type: 'primary', 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        onClick: throttle(() => { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            showRoleEditForm.value = true 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            editRole.value = row 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        }), 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        onClick: () => showEditDialog('update', row), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     }, 
															 | 
															
															 | 
															
																                     }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     '编辑' 
															 | 
															
															 | 
															
																                     '编辑' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 ), 
															 | 
															
															 | 
															
																                 ), 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -135,13 +138,12 @@ const columns: Column<any>[] = [ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     }, 
															 | 
															
															 | 
															
																     }, 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 ] 
															 | 
															
															 | 
															
																 ] 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-/** 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- * 创建 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- */ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-const create = throttle(() => { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    showRoleEditForm.value = true 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    editRole.value = newRole() 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+const showEditDialog = throttle((type: 'create' | 'update' = 'create', role: Role = newRole()) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    editRole.value = role 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    editType.value = type 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+    isShowRoleEditForm.value = true 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 }) 
															 | 
															
															 | 
															
																 }) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 /** 
															 | 
															
															 | 
															
																 /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  * 刷新 
															 | 
															
															 | 
															
																  * 刷新 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  */ 
															 | 
															
															 | 
															
																  */ 
															 |