role.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. const Constants = require('@/utils/Constants.js');
  2. const util = require('@/utils/util.js')
  3. const mixins = require('@/mixins/index.js')
  4. Page({
  5. mixins: [mixins],
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. // 列表区(内容)
  11. contentList: [{ name: 'sysCode', title: '角色编码' },
  12. { name: 'remarks', title: '角色说明' }],
  13. // 弹出按钮
  14. buttonList: [{ name: 'follow', title: '功能权限' }, { name: 'followTask', title: '复制新增' }, { name: 'purchase-return-repla-sup', title: '敏感数据' },
  15. { name: 'collection', title: '启用/停用' }],
  16. totallength: 234999, //视图下方提醒数量
  17. selectTotallength: 12,
  18. selectlength: 5,
  19. // 路由
  20. routeObjName: 'role',
  21. tableData: [],
  22. },
  23. toAdd() {
  24. wx.navigateTo({
  25. url: this.data.route.add.url,
  26. events: function (e) {
  27. // 回调后,在这里给页面赋值
  28. },
  29. success: function (res) {
  30. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  31. res.eventChannel.emit('params', {})
  32. }
  33. })
  34. },
  35. getData(params) {
  36. return this.excute(this.data.service, this.data.service.selectByCond, params);
  37. },
  38. /**
  39. * @desc : 详细页面
  40. * @date : 2024/2/1 15:49
  41. * @author : 于继渤
  42. */
  43. toDetail(e) {
  44. let roleId = e.detail.item.roleId
  45. this.setData({
  46. selectflag: true
  47. })
  48. wx.navigateTo({
  49. url: this.data.route.add.url,
  50. events: function (e) {
  51. // 回调后,在这里给页面赋值
  52. },
  53. success: function (res) {
  54. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  55. res.eventChannel.emit('params', { id: roleId, formMode: Constants.formMode.edit})
  56. }
  57. })
  58. },
  59. /**
  60. * 生命周期函数--监听页面加载
  61. */
  62. onLoad(options) {
  63. console.log('routeUrl', this.data.route)
  64. },
  65. /**
  66. * 生命周期函数--监听页面初次渲染完成
  67. */
  68. onReady() {
  69. },
  70. /**
  71. * 生命周期函数--监听页面显示
  72. */
  73. onShow() {
  74. },
  75. /**
  76. * 生命周期函数--监听页面隐藏
  77. */
  78. onHide() {
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload() {
  84. },
  85. /**
  86. * 页面相关事件处理函数--监听用户下拉动作
  87. */
  88. onPullDownRefresh() {
  89. },
  90. /**
  91. * 页面上拉触底事件的处理函数
  92. */
  93. onReachBottom() {
  94. },
  95. /**
  96. * 用户点击右上角分享
  97. */
  98. onShareAppMessage() {
  99. }
  100. })