index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="left-section">
  3. <div class="card">
  4. <div class="card-header">
  5. <div>综合值守</div>
  6. </div>
  7. <div class="card-content">
  8. <div style="line-height: 60px">值班时间:{{ comprehensiveDutyState.data.time }}</div>
  9. <div style="line-height: 60px">带班领导:{{ comprehensiveDutyState.data.classLeader }}</div>
  10. <div style="line-height: 60px">值班时间:{{ comprehensiveDutyState.data.operatorOnDuty }}</div>
  11. </div>
  12. </div>
  13. <div class="card">
  14. <div class="card-header">
  15. <div>巡查消息</div>
  16. <div class="more" @click="showInspectionNewsState">查看更多</div>
  17. </div>
  18. <div class="card-content">
  19. <table class="table">
  20. <thead>
  21. <tr class="tr">
  22. <td v-for="(item, index) in inspectionNewsState.columns" :key="index" class="td">{{ item.label }}</td>
  23. </tr>
  24. </thead>
  25. <tr v-for="(item, index) in inspectionNewsState.listData" :key="index" class="tr">
  26. <td class="td">{{ item.name }}</td>
  27. <td class="td">{{ item.type }}</td>
  28. <td class="td">{{ item.address }}</td>
  29. <td class="td">{{ item.time }}</td>
  30. <td class="td">{{ item.result }}</td>
  31. <td class="td">{{ item.img }}</td>
  32. </tr>
  33. </table>
  34. </div>
  35. </div>
  36. <div class="card" style="height: 820px">
  37. <div class="card-header">
  38. <div>事件接报</div>
  39. <div class="more" @click="showMoreEventManageList">查看更多</div>
  40. </div>
  41. <div class="card-content" style="height: 100%">
  42. <table class="table">
  43. <thead>
  44. <tr class="tr">
  45. <td v-for="(item, index) in eventManageState.columns" :key="index" class="td">{{ item.label }}</td>
  46. </tr>
  47. </thead>
  48. <tr v-for="(item, index) in eventList" :key="index" class="tr">
  49. <td class="td">
  50. <div @click="handleView(item.event_id)">{{ item.event_title }}</div>
  51. </td>
  52. <td class="td">
  53. <dict-tag :options="mm_event_type" :value="item.event_type" />
  54. </td>
  55. <td class="td">{{ item.address }}</td>
  56. <td class="td">{{ item.event_time }}</td>
  57. <td class="td">
  58. <dict-tag :options="mm_event_state" :value="item.event_status" />
  59. </td>
  60. <td class="td">
  61. <div v-if="item.event_status === '0' || item.event_status === '1' || item.event_status === '2' || item.event_status === '3'" class="flex">
  62. <div @click="enterCommand(item)">进入指挥</div>
  63. </div>
  64. </td>
  65. </tr>
  66. </table>
  67. </div>
  68. </div>
  69. </div>
  70. <!--巡查消息弹窗-->
  71. <Dialog v-model="inspectionNewsState.showListDialog" title="巡查消息列表" width="70%"></Dialog>
  72. <!--事件接报弹窗-->
  73. <EventManage v-model="eventManageState.showListDialog" />
  74. </template>
  75. <script lang="ts" setup name="LeftSection">
  76. import Dialog from '@/components/Dialog/index.vue';
  77. import EventManage from '@/views/routineCommandMap/LeftSection/EventManage.vue';
  78. import { ref, reactive, toRefs } from 'vue';
  79. import { getEvent } from '@/api/duty/eventing';
  80. import eventDetails from '../eventing/eventDetails.vue';
  81. const eventList = ref([]);
  82. const loading = ref(true);
  83. const total = ref(0);
  84. const router = useRouter();
  85. const eventId = ref('');
  86. const proxy = getCurrentInstance()?.proxy;
  87. const { mm_event_type, mm_event_level, mm_event_state, region } = toRefs<any>(
  88. proxy?.useDict('mm_event_type', 'mm_event_level', 'mm_event_state', 'region')
  89. );
  90. // 综合值守
  91. const comprehensiveDutyState = reactive({
  92. data: {
  93. // 值班时间
  94. time: '08:30-17:30',
  95. // 带班领导
  96. classLeader: '张珊珊',
  97. // 值班人员
  98. operatorOnDuty: '王珊珊'
  99. }
  100. });
  101. const eventDetailsState = reactive({
  102. show: false,
  103. title: ''
  104. });
  105. //查看事件详情
  106. const handleView = (id: string) => {
  107. // 查看事件详情逻辑
  108. eventId.value = id;
  109. eventDetailsState.title = '查看事件';
  110. eventDetailsState.show = true;
  111. };
  112. // 巡查消息
  113. const inspectionNewsState = reactive({
  114. showListDialog: false,
  115. columns: [
  116. { label: '巡检任务', key: 'task' },
  117. { label: '巡检类型', key: 'type' },
  118. { label: '巡检地点', key: 'address' },
  119. { label: '巡检时间', key: 'time' },
  120. { label: '巡检结果', key: 'result' },
  121. { label: '巡检图像', key: 'img' }
  122. ],
  123. listData: []
  124. });
  125. // 显示更多巡查消息
  126. const showInspectionNewsState = () => {
  127. inspectionNewsState.showListDialog = true;
  128. };
  129. const initFormData = {
  130. event_id: '',
  131. event_title: '', // 事件标题
  132. event_type: '', // 事件类型
  133. event_status: '', // 事件状态
  134. address: '', // 事件地点
  135. event_time: '' // 上报时间
  136. };
  137. // 表单数据
  138. const data = reactive({
  139. form: { ...initFormData },
  140. queryParams: {
  141. page: 1,
  142. page_size: 10
  143. },
  144. event_levelSelection: [],
  145. event_statusSelection: [],
  146. regionSelection: []
  147. });
  148. const { queryParams, form } = toRefs(data);
  149. const getList = () => {
  150. loading.value = true;
  151. getEvent(queryParams.value)
  152. .then((res) => {
  153. eventList.value = res.data;
  154. total.value = res.total;
  155. })
  156. .finally(() => {
  157. loading.value = false;
  158. });
  159. };
  160. // 事件接报
  161. const eventManageState = reactive({
  162. columns: [
  163. { label: '事件名称', key: 'event_title' },
  164. { label: '事件类型', key: 'event_type' },
  165. { label: '地点', key: 'address' },
  166. { label: '上报时间', key: 'report_time' },
  167. { label: '事件状态', key: 'event_status' },
  168. { label: '操作', key: 'operate' }
  169. ],
  170. showListDialog: false,
  171. // showDetailDialog: false,
  172. });
  173. // 显示事件管理列表弹窗
  174. const showMoreEventManageList = () => {
  175. eventManageState.showListDialog = true;
  176. };
  177. // 进入应急态界面
  178. const enterCommand = (item) => {
  179. if (item) {
  180. // 查看事件详情逻辑
  181. console.log('进入指挥', item);
  182. router.push({
  183. path: '/emergencyCommandMap',
  184. query: { event_id: item.event_id }
  185. });
  186. }
  187. };
  188. // const enterCommand = () => {
  189. // router.push('/emergencyCommandMap');
  190. // };
  191. // 初始化数据
  192. const initData = () => {
  193. // 综合值守数据
  194. comprehensiveDutyState.data = {
  195. time: '08:30-17:30',
  196. classLeader: '张珊珊',
  197. operatorOnDuty: '林珊珊、张珊珊'
  198. };
  199. // 巡查消息数据
  200. inspectionNewsState.listData = [
  201. { name: '巡检任务1', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' },
  202. { name: '巡检任务2', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' },
  203. { name: '巡检任务3', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' },
  204. { name: '巡检任务4', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' },
  205. { name: '巡检任务5', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' },
  206. { name: '巡检任务6', type: '城市隐患巡查', address: '油城十路', time: '2024-7-11 16:00:21', result: '正常', img: '' }
  207. ];
  208. };
  209. // 加载完成事件
  210. onMounted(() => {
  211. initData();
  212. getList();
  213. });
  214. </script>
  215. <style lang="scss" scoped>
  216. .left-section {
  217. width: 1965px;
  218. height: 100%;
  219. display: flex;
  220. flex-direction: column;
  221. font-size: 36px;
  222. }
  223. .card {
  224. width: 100%;
  225. background-color: #ffffff;
  226. border-radius: 26px;
  227. padding: 46px 69px;
  228. margin-bottom: 69px;
  229. animation-name: slide;
  230. .card-header {
  231. width: 100%;
  232. margin-bottom: 20px;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. }
  237. &:last-child {
  238. margin-bottom: 0;
  239. }
  240. &:nth-child(1) {
  241. animation-duration: 0.5s; // 新增
  242. }
  243. &:nth-child(2) {
  244. height: 667.5px;
  245. animation-duration: 1s; // 新增
  246. }
  247. &:nth-child(3) {
  248. height: 667.5px;
  249. animation-duration: 1.5s; // 新增
  250. }
  251. }
  252. .table {
  253. table-layout: fixed;
  254. border-collapse: collapse;
  255. width: 100%;
  256. thead {
  257. .td {
  258. background-color: #fafafa;
  259. border: 5px solid #ebebeb;
  260. }
  261. }
  262. .tr {
  263. .td {
  264. width: auto;
  265. font-size: 28px;
  266. padding: 10px 5px;
  267. border-bottom: 5px solid #ebebeb;
  268. overflow: hidden;
  269. text-overflow: ellipsis;
  270. white-space: nowrap;
  271. }
  272. }
  273. }
  274. .more {
  275. color: #1890ff;
  276. cursor: pointer;
  277. }
  278. @keyframes slide {
  279. 0% {
  280. transform: translateX(-100%);
  281. }
  282. 80% {
  283. transform: translateX(92px);
  284. }
  285. 100% {
  286. transform: translateX(0);
  287. }
  288. }
  289. </style>