index.vue 9.1 KB

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