|
@@ -1,14 +1,17 @@
|
|
|
<template>
|
|
|
<div class="table-content">
|
|
|
- <div v-for="(notification, index) in notifications" :key="index" class="tr">
|
|
|
- <div class="td">
|
|
|
- <div class="unit-date">
|
|
|
- <span class="unit">{{ notification.unit }}</span>
|
|
|
- <span class="date">{{ notification.date }}</span>
|
|
|
- <span class="status" :class="statusClasses[notification.status]">{{ notification.status }}</span>
|
|
|
- <button @click="updateTask(index)">更新</button>
|
|
|
+ <div v-for="(item, index) in dataList" :key="index" class="box1">
|
|
|
+ <div :class="item.processing_status === '已完成' ? 'success-icon' : 'processing-icon'"></div>
|
|
|
+ <div class="box2">
|
|
|
+ <div class="box-header">
|
|
|
+ <div class="header-left">
|
|
|
+ <div class="box-title">{{ item.unit_name }}</div>
|
|
|
+ <div class="time">{{ item.update_time }}</div>
|
|
|
+ <div :class="item.processing_status === '已完成' ? 'success' : 'processing'">{{ item.processing_status }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="btn" @click="updateTask">更新</div>
|
|
|
</div>
|
|
|
- <div class="content">{{ notification.content }}</div>
|
|
|
+ <div class="box-content">{{ item.task_description }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -16,43 +19,29 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
-import { selectTask, updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty'; // 确保API路径正确
|
|
|
+import { selectTask, updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty';
|
|
|
+import { parseTime } from '@/utils/ruoyi';
|
|
|
|
|
|
const props = defineProps<{
|
|
|
eventId?: string; // 使用可选属性
|
|
|
}>();
|
|
|
|
|
|
-const notifications = ref([]);
|
|
|
-const statusClasses = reactive({
|
|
|
- '已完成': 'success',
|
|
|
- '处理中': 'processing'
|
|
|
-});
|
|
|
+const dataList = ref([]);
|
|
|
|
|
|
// 请求数据
|
|
|
const fetchData = async () => {
|
|
|
- try {
|
|
|
- if (!props.eventId) {
|
|
|
- console.error('eventId 未找到');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- const response = await selectTask({ eventId: props.eventId });
|
|
|
-
|
|
|
- if (response.code === 200) {
|
|
|
- console.log('查询成功:', response.data);
|
|
|
- updateTaskList(response.data);
|
|
|
- } else {
|
|
|
- console.error('查询失败:', response.msg);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('请求失败:', error);
|
|
|
- }
|
|
|
+ selectTask({ eventId: props.eventId }).then((res) => {
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ item.update_time = parseTime(item.update_time);
|
|
|
+ });
|
|
|
+ dataList.value = res.data;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 更新任务
|
|
|
const updateTask = async (index) => {
|
|
|
try {
|
|
|
- const task = notifications.value[index];
|
|
|
+ const task = dataList.value[index];
|
|
|
const response = await updateTaskRegistration(task);
|
|
|
|
|
|
if (response.code === 200) {
|
|
@@ -78,85 +67,91 @@ onMounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.tabs {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start; /* 选项卡靠左对齐 */
|
|
|
- padding: 0 0;
|
|
|
- background: rgba(0, 0, 0, 0.3);
|
|
|
- .active {
|
|
|
- border-bottom: 3px solid #00e8ff;
|
|
|
+.table-content {
|
|
|
+ height: 600px;
|
|
|
+ overflow-y: auto;
|
|
|
+ .box1 {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
- li {
|
|
|
- cursor: pointer;
|
|
|
- padding: 20px;
|
|
|
- font-size: 36px;
|
|
|
- color: #fff;
|
|
|
- &:hover {
|
|
|
- background-color: rgba(0, 0, 0, 0.5);
|
|
|
+ .box2 {
|
|
|
+ width: 1642px;
|
|
|
+ background-image: url('@/assets/images/taskTracking/box1.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 1642px 377px;
|
|
|
+ background-position: bottom left;
|
|
|
+ padding: 20px 20px 20px 60px;
|
|
|
+ margin-top: 20px;
|
|
|
+ position: relative;
|
|
|
+ &:first-child {
|
|
|
+ margin-top: 0;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.custom-table {
|
|
|
- width: 100%;
|
|
|
- .table-content {
|
|
|
- height: 600px;
|
|
|
- overflow-y: auto;
|
|
|
- .tr {
|
|
|
+ .box-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .header-left {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- .td {
|
|
|
- flex: 1;
|
|
|
- padding: 10px;
|
|
|
- font-size: 36px;
|
|
|
- .unit-date {
|
|
|
- display: flex;
|
|
|
- align-items: center; /* 确保垂直居中 */
|
|
|
- justify-content: space-between; /* 使 status 靠右对齐 */
|
|
|
- span {
|
|
|
- white-space: nowrap;
|
|
|
- &.unit {
|
|
|
- font-size: 36px; /* 调整字体大小 */
|
|
|
- margin-right: 5px; /* 减小单位与日期之间的间距 */
|
|
|
- }
|
|
|
- &.date {
|
|
|
- font-size: 36px; /* 调整字体大小 */
|
|
|
- margin-right: auto; /* 使用 auto 推动 status 靠右 */
|
|
|
- }
|
|
|
- &.status {
|
|
|
- font-size: 36px; /* 调整字体大小 */
|
|
|
- text-align: right; /* 可选:如果需要进一步对齐内部文本 */
|
|
|
- }
|
|
|
- &.error {
|
|
|
- color: #ff4d4f; /* 发送失败时使用红色 */
|
|
|
- }
|
|
|
- &.success {
|
|
|
- color: #fff; /* 发送成功时使用黑色 */
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .content {
|
|
|
- margin-top: 10px;
|
|
|
- font-size: 36px; /* 内容字体大小 */
|
|
|
- line-height: 1.5; /* 增加行高以适应较大的字体 */
|
|
|
- }
|
|
|
+ .box-title {
|
|
|
+ font-size: 38px;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ color: #ffffff;
|
|
|
+ background-image: url('@/assets/images/taskTracking/titleBox.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 311px 56px;
|
|
|
+ background-position: bottom left;
|
|
|
+ padding-left: 50px;
|
|
|
}
|
|
|
+ .time {
|
|
|
+ font-size: 32px;
|
|
|
+ color: #00e8ff;
|
|
|
+ margin-left: 70px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .success,
|
|
|
+ .processing,
|
|
|
+ .btn {
|
|
|
+ width: 154px;
|
|
|
+ height: 56px;
|
|
|
+ line-height: 56px;
|
|
|
+ font-size: 32px;
|
|
|
+ color: #ffffff;
|
|
|
+ border-radius: 10px;
|
|
|
+ text-align: center;
|
|
|
+ margin-left: 30px;
|
|
|
+ }
|
|
|
+ .success {
|
|
|
+ background-color: #38c95a;
|
|
|
+ }
|
|
|
+ .processing {
|
|
|
+ background-color: #ffb000;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ background-color: #247dff;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.duty-card {
|
|
|
- width: 2601px;
|
|
|
- height: 879px;
|
|
|
- background: url('@/assets/images/emergencyCommandMap/videoBox1.png') no-repeat 100% 100%;
|
|
|
- position: relative;
|
|
|
- color: #fff;
|
|
|
- .card-content {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- padding-top: 10px; /* 减小顶部填充 */
|
|
|
- padding-left: 100px;
|
|
|
- width: 2500px;
|
|
|
+ .box-content {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 38px;
|
|
|
+ line-height: 98px;
|
|
|
+ }
|
|
|
+ .success-icon {
|
|
|
+ margin-right: -50px;
|
|
|
+ margin-top: 15px;
|
|
|
+ z-index: 1;
|
|
|
+ width: 123px;
|
|
|
+ height: 79px;
|
|
|
+ background: url('@/assets/images/taskTracking/success.png') no-repeat;
|
|
|
+ }
|
|
|
+ .processing-icon {
|
|
|
+ margin-right: -50px;
|
|
|
+ margin-top: 15px;
|
|
|
+ z-index: 1;
|
|
|
+ width: 123px;
|
|
|
+ height: 79px;
|
|
|
+ background: url('@/assets/images/taskTracking/success.png') no-repeat;
|
|
|
}
|
|
|
}
|
|
|
</style>
|