rolemenage.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- 角色管理 -->
  2. <template>
  3. <view class="rolemenage">
  4. <view class="btn-add">
  5. <image
  6. src="../../../static/images/addicon.png"
  7. class="addicon"
  8. @tap="topage('add')"
  9. ></image>
  10. </view>
  11. <view class="content">
  12. <view class="item" v-for="(item,index) in roleList" :key="index">
  13. <view class="top">
  14. <view class="expression">
  15. <text class="title">标识:</text><text class="msg">{{ item.name }}</text>
  16. </view>
  17. <view class="expression name">
  18. <text class="title">名称:</text><text class="msg">{{ item.description }}</text>
  19. </view>
  20. </view>
  21. <view class="bottom">
  22. <view class="btns">
  23. <view class="btn edit" @tap="edit(item)">编辑</view>
  24. <view class="btn dele" @tap="dele(itemid)">删除</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. name: 'rolemenage',
  34. components: {},
  35. data () {
  36. //这里存放数据
  37. return {
  38. roleList:[],
  39. mid: uni.getStorageSync('scenicMessage').id
  40. };
  41. },
  42. onShow () {
  43. this.getRoleList()
  44. },
  45. onLoad () {
  46. },
  47. //方法集合
  48. methods: {
  49. // 跳转编辑
  50. edit(data) {
  51. this.$mRouter.push({route: '/pages/index/userinfo/roleedit', query: {roledata:JSON.stringify(data)}})
  52. },
  53. // 角色列表
  54. async getRoleList () {
  55. await this.$http.get('/mrole/getList',{
  56. mid:this.mid
  57. }).then( res=>{
  58. if (res.code === 200 && res.msg==='OK') {
  59. this.roleList = res.data
  60. }
  61. })
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang='scss' scoped>
  67. .rolemenage {
  68. padding: 24upx 32upx 0;
  69. .btn-add {
  70. position: fixed;
  71. right: 33upx;
  72. top: 20upx;
  73. z-index: 100;
  74. .addicon {
  75. width: 48upx;
  76. height: 48upx;
  77. }
  78. }
  79. .content{
  80. background-color: #f1f1f1;
  81. .item{
  82. padding: 24upx 24upx 0;
  83. background-color: #fff;
  84. border-radius: 8upx;
  85. .top{
  86. border-bottom: 1px solid #e7e7e7;
  87. padding: 15upx 9upx 30upx;
  88. .expression {
  89. .title{
  90. color: #7a7c7c;
  91. }
  92. .msg {
  93. margin-left: 15upx;
  94. color: #202020;
  95. }
  96. }
  97. .name {
  98. margin-top: 24upx;
  99. }
  100. }
  101. .bottom{
  102. padding: 17upx 0;
  103. .btns{
  104. display: flex;
  105. justify-content : flex-end;
  106. .btn {
  107. width: 158upx;
  108. height: 58upx;
  109. border-radius: 6upx;
  110. font-size: 30upx;
  111. color: #7a7c7c;
  112. border: 1px solid #e7e7e7;
  113. text-align: center;
  114. line-height: 58upx;
  115. }
  116. .dele {
  117. margin-left:23upx;
  118. background-color: #ff6a5e;
  119. color: #fff;
  120. border: none;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. </style>