curve.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="table_item">
  3. <s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.code">
  4. <template #operator>
  5. <!-- 搜索区域 -->
  6. <div class="table-search">
  7. <div class="table-search-form">
  8. <a-row :gutter="10">
  9. <a-form
  10. ref="searchFormRef"
  11. name="advanced_search"
  12. layout="inline"
  13. :label-col="{ style: { width: '70px', justifyContent: 'end' } }"
  14. :model="searchFormState"
  15. class="ant-advanced-search-form"
  16. >
  17. <a-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  18. <a-form-item label="开始时间" name="searchKey">
  19. <a-date-picker
  20. v-model:value="searchFormState.searchKey"
  21. show-time
  22. format="YYYY-MM-DD HH:mm:ss"
  23. value-format="YYYY-MM-DD HH:mm:ss"
  24. style="width: 100%"
  25. />
  26. </a-form-item>
  27. </a-col>
  28. <a-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  29. <a-form-item label="结束时间" name="jssj">
  30. <a-date-picker
  31. v-model:value="searchFormState.jssj"
  32. show-time
  33. format="YYYY-MM-DD HH:mm:ss"
  34. value-format="YYYY-MM-DD HH:mm:ss"
  35. style="width: 100%"
  36. />
  37. </a-form-item>
  38. </a-col>
  39. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="12">
  40. <a-form-item label="报表类型" name="type">
  41. <a-select v-model:value="searchFormState.type" placeholder="请选择报警类型">
  42. <a-select-option value="qst">趋势图</a-select-option>
  43. </a-select>
  44. </a-form-item></a-col
  45. >
  46. <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="12">
  47. <a-form-item
  48. label="是否展示全部区间"
  49. name="isshow"
  50. :label-col="{ style: { width: '120px', justifyContent: 'end' } }"
  51. >
  52. <a-select v-model:value="searchFormState.isshow" placeholder="请选择是否展示全部区间">
  53. <a-select-option value="1">是</a-select-option>
  54. <a-select-option value="1">否</a-select-option>
  55. </a-select>
  56. </a-form-item>
  57. </a-col>
  58. </a-form>
  59. </a-row>
  60. </div>
  61. <div class="table-search-buttons">
  62. <a-button type="primary" @click="tableRef.refresh(true)">查询</a-button>
  63. <a-button class="xn-mg08" @click="reset">重置</a-button>
  64. </div>
  65. </div>
  66. </template>
  67. <template #headerCell="{ title, column }">
  68. <template v-if="column.dataIndex === 'type'">
  69. <text>{{ title }}</text>
  70. <a-select ref="select" v-model:value="value1" style="width: 250px; margin-left: 10px">
  71. <a-select-option value="1">二氧化碳浓度</a-select-option>
  72. </a-select>
  73. </template>
  74. </template>
  75. </s-table>
  76. <div class="item-right">
  77. <!-- 单位 -->
  78. <div class="unit">
  79. <unitSearch ref="unitSearchRef" />
  80. </div>
  81. <!-- 监控点 -->
  82. <div class="monitor">
  83. <monitorSearch ref="monitorSearchRef" />
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script setup>
  89. import jobApi from '@/api/dev/jobApi'
  90. import unitSearch from './unitSearch.vue'
  91. import monitorSearch from './monitorSearch.vue'
  92. const unitSearchRef = ref(null)
  93. const monitorSearchRef = ref(null)
  94. const value1 = ref('1') //选择器
  95. onMounted(() => {
  96. unitSearchRef.value.onOpen() //获取单位数据
  97. monitorSearchRef.value.onOpen() //获取监控点数据
  98. })
  99. // 搜索表单
  100. const searchFormState = ref({
  101. type: 'qst',
  102. isshow: '1'
  103. })
  104. const tableRef = ref()
  105. const columns = [
  106. {
  107. title: '采集类型',
  108. dataIndex: 'type'
  109. }
  110. ]
  111. const loadData = (parameter) => {
  112. return jobApi.jobPage(Object.assign(parameter, searchFormState.value)).then((res) => {
  113. // return res
  114. const obj = {
  115. current: 1,
  116. pages: 1,
  117. records: [],
  118. size: 10,
  119. total: 0
  120. }
  121. return obj
  122. })
  123. }
  124. </script>
  125. <style lang="less" scoped>
  126. .table_item {
  127. width: 100%;
  128. display: flex;
  129. padding: 15px 20px;
  130. .table-wrapper {
  131. width: 75%;
  132. }
  133. // 右边的搜索区域
  134. .item-right {
  135. width: 25%;
  136. padding: 5px 10px;
  137. .unit,
  138. .monitor {
  139. width: 100%;
  140. height: 350px;
  141. padding: 10px;
  142. margin-bottom: 10px;
  143. border-radius: 5px;
  144. border: 1px solid #eaeaea;
  145. overflow-y: auto;
  146. }
  147. }
  148. }
  149. // 树形结构的样式
  150. :deep(.ant-tree-treenode) {
  151. width: 100%;
  152. margin-bottom: 5px;
  153. border-radius: 5px;
  154. padding: 5px 0 !important;
  155. border: 1px solid #eaeaea;
  156. }
  157. // 分页居中显示
  158. :deep(.ant-table-pagination-right) {
  159. justify-content: center !important;
  160. }
  161. </style>