role_details.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div>
  3. <div class="container normal-panel mb-16">
  4. <el-button v-if="tool.checkAuth($route.name,'update')" size="small" icon="el-icon-edit" @click="$router.replace({path:'/roleEdit',query:{id:roleid}})">编 辑</el-button>
  5. <onDel v-if="tool.checkAuth($route.name,'delete')" :data="{roleid:roleid}"></onDel>
  6. </div>
  7. <div class="container normal-panel mb-16">
  8. <p class="normal-title mb-16">角色信息</p>
  9. <el-row>
  10. <el-form :inline="true" :model="form" ref="form" size="small" label-position="left" class="demo-form-inline">
  11. <el-col :span="8">
  12. <el-form-item label="角色名称:">
  13. <!-- <el-input v-model="form.rolename" placeholder="输入角色名称"></el-input> -->
  14. <p>{{form.rolename}}</p>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="8">
  18. <el-form-item label="角色描述:">
  19. <!-- <el-input v-model="form.remarks" placeholder="输入角色描述"></el-input> -->
  20. <p>{{form.remarks}}</p>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="8">
  24. <el-form-item label="角色类型:">
  25. <p>{{form.usertypename}}</p>
  26. </el-form-item>
  27. </el-col>
  28. </el-form>
  29. </el-row>
  30. </div>
  31. <div class="container normal-panel mb-16">
  32. <p class="normal-title mb-16">角色授权</p>
  33. <el-row :gutter="20">
  34. <el-col :span="12">
  35. <tableLayout :layout="tablecols" :data="roleMainInfo.apps" height="500px" :custom="false" @rowClick="appoptionselect">
  36. </tableLayout>
  37. </el-col>
  38. <el-col :span="12">
  39. <el-row :gutter="40">
  40. <el-col :span="12">
  41. <p class="title">功能</p>
  42. <div class="flex-align-center flex-between option-item" v-for="item in appoptions" :key="item.index">
  43. <p>{{item.optionname}}</p>
  44. </div>
  45. </el-col>
  46. <el-col :span="12">
  47. <p class="title">隐藏字段</p>
  48. <div class="flex-align-center flex-between option-item" v-for="item in hiddenfields" :key="item.index">
  49. <p>{{item.fieldname}}</p>
  50. </div>
  51. </el-col>
  52. </el-row>
  53. </el-col>
  54. </el-row>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import onDel from './delete_role.vue'
  60. export default {
  61. components:{
  62. onDel
  63. },
  64. data () {
  65. return{
  66. form:{
  67. "roleid":0,
  68. "rolename":"",
  69. "remarks":""
  70. },
  71. roleMainInfo:{},
  72. tablecols:[],
  73. appoptions:[],
  74. hiddenfields:[],
  75. roleid:0,
  76. active_systemappid:''
  77. }
  78. },
  79. created() {
  80. },
  81. methods:{
  82. async roleMain () {
  83. const res = await this.$api.requested({
  84. "classname": "webmanage.role.role",
  85. "method": "query_roleMain",
  86. "content": {
  87. "roleid":this.roleid
  88. }
  89. })
  90. this.form = {
  91. "roleid":res.data.roleid,
  92. "rolename":res.data.rolename,
  93. "remarks":res.data.remarks,
  94. "usertype":res.data.usertype,
  95. "usertypename":res.data.usertypename
  96. }
  97. this.roleMainInfo = res.data
  98. //显示默认授权信息,一般默认信息为第一条数据
  99. this.appoptionselect(res.data.apps[0])
  100. },
  101. async appoptionselect (row) {
  102. this.active_systemappid = row.systemappid
  103. this.appoptions = row.options
  104. this.hiddenfields = row.hiddenfields
  105. },
  106. },
  107. mounted () {
  108. // 获取应用表结构
  109. this.tablecols = this.tool.tabelCol(this.$route.name).detailsAppsTable.tablecols
  110. this.roleid = this.$route.query.id
  111. this.roleid !== '0'?this.roleMain():''
  112. }
  113. }
  114. </script>
  115. <style>
  116. </style>
  117. <style scoped>
  118. .mb-16{
  119. margin-bottom:16px
  120. }
  121. .title{
  122. height: 20px;
  123. line-height: 20px;
  124. font-size: 14px;
  125. text-indent: 7px;
  126. font-weight: bold;
  127. color: #333333;
  128. margin-bottom: 20px;
  129. border-left: 4px solid #3874F6;
  130. }
  131. .option-item{
  132. color:#333333;
  133. font-size: 14px;
  134. border-bottom:1px solid #f1f2f3;
  135. line-height: 35px;
  136. }
  137. </style>