index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <DragWindow
  3. v-if="show"
  4. @onClose="$emit('update:show', false)"
  5. title="预警记录(0000条)"
  6. v-model:layout="state.layout"
  7. close
  8. expend
  9. >
  10. <div class="warning" v-if="show" v-loading="state.loading">
  11. <CusForm
  12. labelWidth="60px"
  13. class="__cus-form_map"
  14. @handleEnter="onSearch()"
  15. >
  16. <CusFormColumn
  17. :span="20"
  18. labelWidth="0px"
  19. v-model:param="state.text"
  20. />
  21. <el-col :span="4" style="display: flex;">
  22. <div class="search-btn" @click="onSearch()" style="margin-left: auto">
  23. <el-icon color="#FFFFFF">
  24. <Search />
  25. </el-icon>
  26. </div>
  27. <div class="search-btn" @click="onReset()">
  28. <el-icon color="#FFFFFF">
  29. <Refresh />
  30. </el-icon>
  31. </div>
  32. </el-col>
  33. </CusForm>
  34. <div class="new-msg">xx条新预警,点击<span class="__hover">刷新列表</span></div>
  35. <div class="list">
  36. <div class="list-content">
  37. <template v-for="item in state.query.result.data">
  38. <div class="item">
  39. <div class="target">
  40. <SvgIcon name="warning" color="#FF0D0D"/>
  41. 船名号
  42. <SvgIcon name="focus" color="#6899FA" class="__hover" style="margin-left: auto"/>
  43. </div>
  44. <div class="target">
  45. <SvgIcon name="warning" color="#FF0D0D"/>
  46. 批次号
  47. <SvgIcon name="focus" color="#6899FA" class="__hover" style="margin-left: auto"/>
  48. </div>
  49. <div class="info">
  50. <div class="info-img">
  51. <img src="@/assets/images/web/tools-warning.png"/>
  52. </div>
  53. <div class="info-detail">
  54. <div class="info-item">预警名称:</div>
  55. <div class="info-item">预警时间:</div>
  56. <div class="info-item">预警区域:查看区域</div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. </div>
  62. <div class="list-page __cus-page_map">
  63. <CusPage
  64. :page-num="state.query.page.pageNum"
  65. :page-size="state.query.page.pageSize"
  66. :page-sizes="[10, 20, 30]"
  67. :total="state.query.result.total"
  68. @page="onPage"
  69. />
  70. </div>
  71. </div>
  72. </div>
  73. </DragWindow>
  74. </template>
  75. <script setup lang="ts">
  76. import {computed, getCurrentInstance, markRaw, onMounted, reactive, ref, watch} from "vue";
  77. import DragWindow from '../components/drag-window.vue'
  78. import { Search, Refresh } from "@element-plus/icons-vue";
  79. const {proxy} = getCurrentInstance()
  80. const props = defineProps({
  81. show: {},
  82. mapFunc: {}
  83. })
  84. const state: any = reactive({
  85. layout: {
  86. width: 400,
  87. left: 85,
  88. top: 110
  89. },
  90. query: {
  91. loading: false,
  92. page: {
  93. pageNum: 1,
  94. pageSize: 10
  95. },
  96. form: {},
  97. formReal: {},
  98. result: {
  99. total: 0,
  100. data: [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},]
  101. }
  102. },
  103. })
  104. watch(() => props.show, (n) => {
  105. if (n) {
  106. initData()
  107. }
  108. })
  109. const initData = () => {
  110. state.loading = true
  111. setTimeout(() => {
  112. state.loading = false
  113. }, 1000)
  114. }
  115. const onPage = (pageNum, pageSize) => {
  116. state.query.page = {
  117. pageNum: pageNum,
  118. pageSize: pageSize
  119. }
  120. const params = {
  121. page: state.query.page.pageNum,
  122. size: state.query.page.pageSize,
  123. }
  124. // 添加表单参数
  125. for (const [k, v] of Object.entries(state.query.formReal)) {
  126. if (proxy.$util.isValue(v)) {
  127. params[k] = v
  128. }
  129. }
  130. state.query.loading = true
  131. // sysIndexFindIndexByPage(proxy.$util.formatGetParam(params)).then(res => {
  132. // state.query.result.total = res.data.totalElements
  133. // state.query.result.data = res.data.content
  134. // state.query.loading = false
  135. // })
  136. }
  137. const onSearch = () => {
  138. state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
  139. onPage(1, state.query.page.pageSize)
  140. }
  141. const onReset = () => {
  142. state.query.page = {
  143. pageNum: 1,
  144. pageSize: 10
  145. }
  146. state.query.form = {}
  147. onSearch()
  148. }
  149. onMounted(() => {
  150. initData()
  151. })
  152. </script>
  153. <style lang="scss" scoped>
  154. $mapHeight: var(--easy-map-height);
  155. .warning {
  156. height: calc($mapHeight - 250px);
  157. padding: 12px 10px;
  158. display: flex;
  159. flex-direction: column;
  160. .__cus-form_map {
  161. margin-bottom: 10px;
  162. .search-btn {
  163. width: 28px;
  164. height: 28px;
  165. background: #0062e9;
  166. border-radius: 4px 4px 4px 4px;
  167. margin-left: 5px;
  168. cursor: pointer;
  169. text-align: center;
  170. line-height: 33px;
  171. }
  172. }
  173. .new-msg {
  174. font-weight: 400;
  175. font-size: 14px;
  176. color: #FFFFFF;
  177. >span {
  178. color: #1CFEFF;
  179. }
  180. }
  181. .list {
  182. flex: 1;
  183. overflow: hidden;
  184. display: flex;
  185. flex-direction: column;
  186. .list-content {
  187. flex: 1;
  188. overflow-y: auto;
  189. gap: 10px;
  190. display: flex;
  191. flex-direction: column;
  192. .item {
  193. background-color: rgba(67,123,250,0.01);
  194. box-shadow: inset 0px 0px 10px 0px rgba(64,122,255,0.45);
  195. border-radius: 2px;
  196. border: 1px solid rgba(50,136,255,0.6);
  197. padding: 10px;
  198. display: flex;
  199. flex-direction: column;
  200. .target {
  201. display: flex;
  202. align-items: center;
  203. font-weight: 400;
  204. font-size: 14px;
  205. color: #6899FA;
  206. background-color: rgba(23,40,75,0.5);
  207. border-radius: 0px 35px 35px 0px;
  208. padding: 4px 6px;
  209. &:not(&:first-child) {
  210. margin-top: 8px;
  211. }
  212. }
  213. .info {
  214. display: flex;
  215. margin-top: 8px;
  216. .info-img {
  217. width: 88px;
  218. height: 58px;
  219. margin-right: 10px;
  220. >img {
  221. width: 100%;
  222. height: 100%;
  223. }
  224. }
  225. .info-detail {
  226. font-weight: 400;
  227. font-size: 12px;
  228. color: #FFFFFF;
  229. line-height: 20px;
  230. }
  231. }
  232. }
  233. }
  234. .list-page {
  235. display: flex;
  236. justify-content: flex-end;
  237. }
  238. }
  239. }
  240. </style>