index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="page">
  3. <uni-nav-bar :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true" title="首页" />
  4. <manager :height="height" v-if="isManager"></manager>
  5. <attach :height="height" v-else></attach>
  6. </view>
  7. </template>
  8. <script>
  9. import manager from "./manager/manager";
  10. import attach from "./attach/attach"
  11. export default {
  12. components:{
  13. manager,attach
  14. },
  15. data() {
  16. return {
  17. isManager:false,
  18. height:'',
  19. ruleList:[],
  20. roleList:[],
  21. roleBindRuleParam:{}
  22. }
  23. },
  24. onLoad() {
  25. let sysInfo = uni.getSystemInfoSync()
  26. this.height = sysInfo.windowHeight - 70 + 'px'
  27. // this.getRuleList()
  28. // this.getRoleList()
  29. },
  30. methods: {
  31. //查询规则
  32. getRuleList(){
  33. this.$api.service.getRuleList().then(res=>{
  34. console.log(res)
  35. this.ruleList = res.data.data
  36. })
  37. },
  38. //查询角色
  39. getRoleList(){
  40. this.$api.service.getRoleList().then(res=>{
  41. console.log(res)
  42. this.roleList = res.data.data
  43. })
  44. },
  45. //角色绑定规则
  46. roleBindRule(){
  47. this.$api.service.roleBindRule(this.roleBindRuleParam).then(res=>{
  48. this.getRuleList()
  49. this.getRoleList()
  50. })
  51. },
  52. }
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. @import './index.rpx.css';
  57. </style>