血透系统PC前端

PermissionSettings.vue 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <el-dialog class="settingDialog" title="角色权限配置" width="750px" :visible.sync="visible">
  3. <div class="roleSettings">
  4. <div class="roleName">
  5. <div class="roleNameLeft">
  6. <p>角色名称</p>
  7. <el-input placeholder="请输入内容" v-model="input" :disabled="true"></el-input>
  8. </div>
  9. <p style="color:#338AFB">删除该角色</p>
  10. </div>
  11. <div class="roleMain">
  12. <div class="roleMainLeft">
  13. <p class="roletitle">选择权限</p>
  14. <div class="roleMainLeftBox">
  15. <el-tree
  16. :props="defaultProps"
  17. :data="data"
  18. :default-checked-keys="data"
  19. node-key="id"
  20. ref="tree"
  21. default-expand-all
  22. show-checkbox
  23. >
  24. <!-- <span class="custom-tree-node" slot-scope="{ node, data }">
  25. <span>{{ data.name }}</span>
  26. </span>-->
  27. </el-tree>
  28. </div>
  29. </div>
  30. <div class="roleMainRight">
  31. <div class="hasChoose">已选择权限</div>
  32. <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  33. </div>
  34. </div>
  35. </div>
  36. </el-dialog>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. visible: false,
  43. data: [
  44. {
  45. id: 1,
  46. label: "一级 2",
  47. children: [
  48. {
  49. id: 3,
  50. label: "二级 2-1",
  51. children: [
  52. {
  53. id: 4,
  54. label: "三级 3-1-1"
  55. },
  56. {
  57. id: 5,
  58. label: "三级 3-1-2"
  59. }
  60. ]
  61. },
  62. {
  63. id: 2,
  64. label: "二级 2-2",
  65. children: [
  66. {
  67. id: 6,
  68. label: "三级 3-2-1"
  69. },
  70. {
  71. id: 7,
  72. label: "三级 3-2-2"
  73. }
  74. ]
  75. }
  76. ]
  77. }
  78. ],
  79. defaultProps: {
  80. children: "children",
  81. label: "label"
  82. }
  83. };
  84. },
  85. methods: {
  86. show() {
  87. this.visible = true;
  88. }
  89. }
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. .roleSettings {
  94. .roleName {
  95. display: flex;
  96. align-items: center;
  97. justify-content: space-between;
  98. }
  99. .roleNameLeft {
  100. display: flex;
  101. align-items: center;
  102. p {
  103. width: 100px;
  104. }
  105. }
  106. .roleMain {
  107. display: flex;
  108. justify-content: space-between;
  109. margin-top: 18px;
  110. .roleMainLeft {
  111. display: flex;
  112. .roletitle {
  113. width: 74px;
  114. }
  115. .roleMainLeftBox {
  116. width: 300px;
  117. height: 706px;
  118. overflow-y: auto;
  119. border: 1px solid rgba(234, 238, 240, 1);
  120. border-radius: 4px;
  121. padding: 20px 0 0 10px;
  122. }
  123. }
  124. .roleMainRight {
  125. width: 280px;
  126. height: 706px;
  127. overflow-y: auto;
  128. border: 1px solid rgba(235, 238, 240, 1);
  129. color: #303133;
  130. .hasChoose {
  131. height: 42px;
  132. line-height: 42px;
  133. padding-left: 20px;
  134. background: #f6f8f9;
  135. }
  136. }
  137. }
  138. }
  139. </style>
  140. <style lang="scss">
  141. .settingDialog {
  142. .el-dialog__body {
  143. max-height: 600px !important;
  144. }
  145. }
  146. </style>