index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="content">
  3. <web-view :src="src"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. id: null,
  11. title: null,
  12. option: {},
  13. show: false,
  14. page: 1,
  15. limit: 10,
  16. recordList: [],
  17. src: null
  18. }
  19. },
  20. onLoad(options) {
  21. this.id = options.id
  22. this.title = options.title
  23. //const randomId=this.GetQueryString('randomId')
  24. //const printArea=this.GetQueryString('printArea')
  25. //const printAreaValue=this.GetQueryString('printAreaValue')
  26. this.src = `/static/webview/report-wv.html?id=${this.id}`
  27. // this.getReportTable()
  28. },
  29. onReady() {
  30. setTimeout(() => {
  31. uni.setNavigationBarTitle({
  32. title: this.title
  33. });
  34. }, 500)
  35. },
  36. methods: {
  37. //返回按钮
  38. handelBack() {
  39. uni.switchTab({
  40. url: '/pages/reportForm/index'
  41. });
  42. },
  43. //报表详情
  44. getReportTable() {
  45. uni.$http.get('/reportTable/getReportTableById', {
  46. id: this.id
  47. }).then(res => {
  48. console.log(res, 'res');
  49. if (res.data.code === 200) {
  50. // this.title=res.data.data.reportTableName
  51. }
  52. })
  53. },
  54. GetQueryString(name) {
  55. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  56. console.log('777777')
  57. var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
  58. console.log('8888888')
  59. var context = "";
  60. if (r != null)
  61. context = decodeURIComponent(r[2]);
  62. reg = null;
  63. r = null;
  64. return context == null || context == "" || context == "undefined" ? "" : context;
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. ::v-deep .luckysheet_info_detail_back {
  71. display: none !important;
  72. }
  73. ::v-deep .u-button {
  74. width: 160rpx;
  75. height: 60rpx
  76. }
  77. .btn {
  78. position: absolute;
  79. left: 50%;
  80. bottom: 2%;
  81. margin-left: -80rpx;
  82. }
  83. .uni-td {
  84. width: 600rpx;
  85. overflow: hidden;
  86. text-overflow: ellipsis;
  87. }
  88. </style>