dialog.detail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <DialogCom
  3. title="上报历史"
  4. :visible.sync="isShow"
  5. class="g-dialog-select-safe-check"
  6. :close-on-click-modal="false"
  7. width="55%"
  8. top="10vh"
  9. append-to-body
  10. >
  11. <div class="el-dialog-div" style="margin-bottom:20px">
  12. <g-search-table
  13. ref="st"
  14. url="/iot/sensor/data/log"
  15. method="post"
  16. :search-data="search"
  17. :pageable="true"
  18. :select="true"
  19. :select-default="selectList"
  20. :drag="false"
  21. @select="onSelect"
  22. >
  23. <!-- 搜索 -->
  24. <template slot="searchs">
  25. <el-form-item class="searchTitle" label="上报时间">
  26. <DataRangePicker
  27. v-model="search.dateRange"
  28. key="daterange"
  29. type="daterange"
  30. :clearable="timeClearable"
  31. />
  32. </el-form-item>
  33. </template>
  34. <!-- 表格 -->
  35. <template slot="columns">
  36. <el-table-column label="设备名称" align="center" prop="deviceName" width="300"/>
  37. <el-table-column label="上报时间" prop="createTime" width="300"/>
  38. <el-table-column label="上报内容" prop="info" width="300"/>
  39. </template>
  40. </g-search-table>
  41. </div>
  42. <div slot="footer" class="dialog-footer">
  43. <el-button @click="onHide">关 闭</el-button>
  44. </div>
  45. </DialogCom>
  46. </template>
  47. <script>
  48. import GSearchTable from "@/components/table/gx.search.table.vue";
  49. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  50. export default {
  51. components: {GSearchTable, DataRangePicker},
  52. data() {
  53. return {
  54. isShow: false,
  55. selectList: [],
  56. search: null,
  57. timeClearable: true,
  58. };
  59. },
  60. computed: {},
  61. watch: {
  62. orgId(newval) {
  63. this.search.orgId = newval;
  64. },
  65. dateRange(newval) {
  66. this.search.dateRange = newval;
  67. },
  68. },
  69. props: {
  70. defaultSelect: {
  71. type: Array
  72. },
  73. orgId: {},
  74. dateRange: [],
  75. },
  76. methods: {
  77. show(row) {
  78. this.search = this.initSearchData(row);
  79. this.isShow = true;
  80. this.selectList = this.defaultSelect;
  81. },
  82. onHide() {
  83. this.isShow = false;
  84. },
  85. onSelect(item) {
  86. this.selectList = item;
  87. },
  88. initSearchData(row) {
  89. let data = {"deviceStatusId": row.deviceStatusId, "orgId": row.orgId, "dateRange": []};
  90. return data;
  91. },
  92. emptySearch() {
  93. return {
  94. deviceCode: null,
  95. orgId: this.$store.getters.orgId,
  96. };
  97. },
  98. },
  99. mounted() {
  100. },
  101. };
  102. </script>
  103. <style lang="scss" scoped>
  104. .el-dialog-div {
  105. overflow: auto;
  106. }
  107. </style>