Merge branch 'dev' of http://222.212.85.86:8222/bdzl2/bxztApp into dev
This commit is contained in:
commit
f518081cb6
@ -21,7 +21,11 @@
|
|||||||
<div class="panel left-panel">
|
<div class="panel left-panel">
|
||||||
<div class="panel-title">气象预警信息</div>
|
<div class="panel-title">气象预警信息</div>
|
||||||
<div class="panel-content">
|
<div class="panel-content">
|
||||||
<div class="warning-content-container">{{ warningData.warningContent }}</div>
|
<div class="warning-content-container">
|
||||||
|
<div>{{ warningData.warningContent }}</div>
|
||||||
|
<div>生效时间:2025-11-13 00:31:30.0</div>
|
||||||
|
<div>失效时间:2025-11-14 06:00:00.0</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -26,57 +26,47 @@
|
|||||||
:popper-append-to-body="false"
|
:popper-append-to-body="false"
|
||||||
class="filter-select"
|
class="filter-select"
|
||||||
clearable
|
clearable
|
||||||
|
@change="fetchData"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option v-for="item in regionOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
v-for="item in regionOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-item">
|
<!-- <div class="filter-item">
|
||||||
<span class="filter-label">类型</span>
|
<span class="filter-label">类型</span>
|
||||||
<el-select
|
<el-select :teleported="false" v-model="filterForm.type" placeholder="请选择" class="filter-select" clearable @change="fetchData">
|
||||||
:teleported="false"
|
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
v-model="filterForm.type"
|
|
||||||
placeholder="请选择"
|
|
||||||
class="filter-select"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in typeOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue';
|
import { ref, computed, watch } from 'vue'
|
||||||
import { Close } from '@element-plus/icons-vue';
|
import { Close } from '@element-plus/icons-vue'
|
||||||
import { regionOptions, typeOptions } from '../component/index.js';
|
import { regionOptions, typeOptions, formatDateTime } from '../component/index.js'
|
||||||
import BaseDialog from '../component/baseDialog.vue';
|
import BaseDialog from '../component/baseDialog.vue'
|
||||||
|
import { request } from '@/utils/request'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
dispatchDateRange: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:visible', 'close']);
|
const emit = defineEmits(['update:visible', 'close'])
|
||||||
|
|
||||||
// 筛选表单
|
// 筛选表单
|
||||||
const filterForm = ref({
|
const filterForm = ref({
|
||||||
region: '',
|
region: '',
|
||||||
type: '',
|
type: '',
|
||||||
});
|
})
|
||||||
|
|
||||||
// 影响区域选项
|
// 影响区域选项
|
||||||
// 已从 index.js 导入
|
// 已从 index.js 导入
|
||||||
@ -85,7 +75,7 @@ const filterForm = ref({
|
|||||||
// 已从 index.js 导入
|
// 已从 index.js 导入
|
||||||
|
|
||||||
// 表格高度
|
// 表格高度
|
||||||
const tableHeight = ref(300);
|
const tableHeight = ref(300)
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const tableColumns = ref([
|
const tableColumns = ref([
|
||||||
@ -96,104 +86,137 @@ const tableColumns = ref([
|
|||||||
{ prop: 'type', label: '类型', width: '120px' },
|
{ prop: 'type', label: '类型', width: '120px' },
|
||||||
{ prop: 'role', label: '角色', width: '120px' },
|
{ prop: 'role', label: '角色', width: '120px' },
|
||||||
{ prop: 'dispatchTime', label: '调度时间', width: '160px' },
|
{ prop: 'dispatchTime', label: '调度时间', width: '160px' },
|
||||||
]);
|
])
|
||||||
|
|
||||||
// 表格数据
|
// 表格数据
|
||||||
const tableData = ref([
|
const tableData = ref([])
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
district: '柏梓镇',
|
|
||||||
name: '赵海浪',
|
|
||||||
phone: '18623520681',
|
|
||||||
type: '交通主管部门',
|
|
||||||
role: '一般人员(路长履职)',
|
|
||||||
dispatchTime: '2025-08-11 04:53:42',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
district: '柏梓镇',
|
|
||||||
name: '赵海浪',
|
|
||||||
phone: '18623520681',
|
|
||||||
type: '公路机构',
|
|
||||||
role: '一般人员(路长履职)',
|
|
||||||
dispatchTime: '2025-08-11 04:53:42',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
district: '万州区',
|
|
||||||
name: '王鑫',
|
|
||||||
phone: '18623520682',
|
|
||||||
type: '养护站',
|
|
||||||
role: '站长',
|
|
||||||
dispatchTime: '2025-08-10 14:30:00',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
district: '沙坪坝区',
|
|
||||||
name: '李华',
|
|
||||||
phone: '18623520683',
|
|
||||||
type: '护路员',
|
|
||||||
role: '一般人员',
|
|
||||||
dispatchTime: '2025-08-09 09:15:30',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 分页
|
// 分页
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1)
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10)
|
||||||
const total = ref(36);
|
const total = ref(36)
|
||||||
|
|
||||||
const totalPages = computed(() => Math.ceil(total.value / pageSize.value));
|
const totalPages = computed(() => Math.ceil(total.value / pageSize.value))
|
||||||
|
|
||||||
const visiblePages = computed(() => {
|
const visiblePages = computed(() => {
|
||||||
const pages = [];
|
const pages = []
|
||||||
const maxVisible = 5;
|
const maxVisible = 5
|
||||||
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2));
|
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2))
|
||||||
let end = Math.min(totalPages.value, start + maxVisible - 1);
|
let end = Math.min(totalPages.value, start + maxVisible - 1)
|
||||||
|
|
||||||
if (end - start + 1 < maxVisible) {
|
if (end - start + 1 < maxVisible) {
|
||||||
start = Math.max(1, end - maxVisible + 1);
|
start = Math.max(1, end - maxVisible + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = start; i <= end; i++) {
|
for (let i = start; i <= end; i++) {
|
||||||
pages.push(i);
|
pages.push(i)
|
||||||
}
|
}
|
||||||
return pages;
|
return pages
|
||||||
});
|
})
|
||||||
|
|
||||||
// 关闭对话框
|
// 关闭对话框
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false)
|
||||||
emit('close');
|
emit('close')
|
||||||
};
|
}
|
||||||
|
|
||||||
// 分页操作
|
// 分页操作
|
||||||
const handleSizeChange = val => {
|
const handleSizeChange = (val) => {
|
||||||
pageSize.value = val;
|
pageSize.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
const handleCurrentChange = val => {
|
const handleCurrentChange = (val) => {
|
||||||
currentPage.value = val;
|
currentPage.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const fetchData = () => {
|
const fetchData = async () => {
|
||||||
console.log('获取第', currentPage.value, '页数据');
|
try {
|
||||||
// 实际项目中调用API获取数据
|
const res = await request({
|
||||||
};
|
url: '/snow-ops-platform/weather-warning/scheduling-county-record',
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
offset: (currentPage.value - 1) * pageSize.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
start: formatDateTime(props.dispatchDateRange?.[0]),
|
||||||
|
end: formatDateTime(props.dispatchDateRange?.[1]),
|
||||||
|
countyId: filterForm.value.region,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.total > 0 && res.data) {
|
||||||
|
const data = res.data
|
||||||
|
tableData.value = data.map((item, index) => {
|
||||||
|
// 解析 command 字段中的 JSON 数据
|
||||||
|
let commandData = {}
|
||||||
|
try {
|
||||||
|
if (item.command) {
|
||||||
|
commandData = JSON.parse(item.command)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析 command 字段失败:', e)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据 type 映射类型和角色
|
||||||
|
const typeMap = {
|
||||||
|
'phone-based-confirmation': '电话确认',
|
||||||
|
'video-conference': '视频会议',
|
||||||
|
'scheduling-county': '调度区县',
|
||||||
|
}
|
||||||
|
const district = regionOptions.value.find((option) => option.value === item.countyId)?.label || '-'
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: (currentPage.value - 1) * pageSize.value + index + 1,
|
||||||
|
district: district,
|
||||||
|
name: commandData.userName || '-',
|
||||||
|
phone: commandData.userPhone || '-',
|
||||||
|
type: commandData.type || '-',
|
||||||
|
role: commandData.role || '一般人员',
|
||||||
|
dispatchTime: item.createdAt || '-',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
total.value = res.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取调度区县详情数据失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
currentPage.value = 1;
|
filterForm.value.region = ''
|
||||||
fetchData();
|
filterForm.value.type = ''
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
|
currentPage.value = 1
|
||||||
|
fetchData()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
)
|
||||||
|
|
||||||
|
// 监听dispatchDateRange变化
|
||||||
|
watch(
|
||||||
|
() => props.dispatchDateRange,
|
||||||
|
() => {
|
||||||
|
if (props.visible) {
|
||||||
|
filterForm.value.region = ''
|
||||||
|
filterForm.value.type = ''
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
|
currentPage.value = 1
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true },
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -18,19 +18,8 @@
|
|||||||
<div class="filter-row">
|
<div class="filter-row">
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span class="filter-label">影响区域</span>
|
<span class="filter-label">影响区域</span>
|
||||||
<el-select
|
<el-select :teleported="false" v-model="filterForm.region" placeholder="请选择" class="filter-select" clearable @change="fetchData">
|
||||||
:teleported="false"
|
<el-option v-for="item in regionOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
v-model="filterForm.region"
|
|
||||||
placeholder="请选择"
|
|
||||||
class="filter-select"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in regionOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -44,34 +33,47 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from 'vue';
|
import { ref, computed, watch } from 'vue'
|
||||||
import { Close } from '@element-plus/icons-vue';
|
import { Close } from '@element-plus/icons-vue'
|
||||||
import { regionOptions } from '../component/index.js';
|
import { regionOptions, formatDateTime } from '../component/index.js'
|
||||||
import BaseDialog from '../component/baseDialog.vue';
|
import BaseDialog from '../component/baseDialog.vue'
|
||||||
|
import { request } from '@/utils/request'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
dispatchDateRange: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => props.dispatchDateRange,
|
||||||
|
(newVal) => {
|
||||||
|
console.log(newVal, '调度日期范围')
|
||||||
|
|
||||||
|
fetchData()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
const emit = defineEmits({
|
const emit = defineEmits({
|
||||||
'update:visible': value => typeof value === 'boolean',
|
'update:visible': (value) => typeof value === 'boolean',
|
||||||
close: () => true,
|
close: () => true,
|
||||||
dispatchClick: item => item !== undefined,
|
dispatchClick: (item) => item !== undefined,
|
||||||
});
|
})
|
||||||
|
|
||||||
// 筛选表单
|
// 筛选表单
|
||||||
const filterForm = ref({
|
const filterForm = ref({
|
||||||
region: '',
|
region: '',
|
||||||
});
|
})
|
||||||
|
|
||||||
// 影响区域选项
|
// 影响区域选项
|
||||||
// 已从 index.js 导入
|
// 已从 index.js 导入
|
||||||
|
|
||||||
// 表格高度
|
// 表格高度
|
||||||
const tableHeight = ref(300);
|
const tableHeight = ref(300)
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const tableColumns = ref([
|
const tableColumns = ref([
|
||||||
@ -79,99 +81,106 @@ const tableColumns = ref([
|
|||||||
{ prop: 'region', label: '影响区域', width: '' },
|
{ prop: 'region', label: '影响区域', width: '' },
|
||||||
{ prop: 'dispatchCount', label: '调度数', width: '', slot: 'dispatchCount' },
|
{ prop: 'dispatchCount', label: '调度数', width: '', slot: 'dispatchCount' },
|
||||||
{ prop: 'lastDispatchTime', label: '最近调度时间', width: '' },
|
{ prop: 'lastDispatchTime', label: '最近调度时间', width: '' },
|
||||||
]);
|
])
|
||||||
|
|
||||||
// 表格数据
|
// 表格数据
|
||||||
const tableData = ref([
|
const tableData = ref([])
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
region: '重庆市',
|
|
||||||
dispatchCount: 1,
|
|
||||||
lastDispatchTime: '2025-08-11 04:53:42',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
region: '万州区',
|
|
||||||
dispatchCount: 1,
|
|
||||||
lastDispatchTime: '2025-08-11 04:53:42',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
region: '沙坪坝区',
|
|
||||||
dispatchCount: 3,
|
|
||||||
lastDispatchTime: '2025-08-10 16:20:15',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
region: '渝中区',
|
|
||||||
dispatchCount: 2,
|
|
||||||
lastDispatchTime: '2025-08-09 11:45:30',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 分页
|
// 分页
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1)
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10)
|
||||||
const total = ref(36);
|
const total = ref(36)
|
||||||
|
|
||||||
const totalPages = computed(() => Math.ceil(total.value / pageSize.value));
|
const totalPages = computed(() => Math.ceil(total.value / pageSize.value))
|
||||||
|
|
||||||
const visiblePages = computed(() => {
|
const visiblePages = computed(() => {
|
||||||
const pages = [];
|
const pages = []
|
||||||
const maxVisible = 5;
|
const maxVisible = 5
|
||||||
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2));
|
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2))
|
||||||
let end = Math.min(totalPages.value, start + maxVisible - 1);
|
let end = Math.min(totalPages.value, start + maxVisible - 1)
|
||||||
|
|
||||||
if (end - start + 1 < maxVisible) {
|
if (end - start + 1 < maxVisible) {
|
||||||
start = Math.max(1, end - maxVisible + 1);
|
start = Math.max(1, end - maxVisible + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = start; i <= end; i++) {
|
for (let i = start; i <= end; i++) {
|
||||||
pages.push(i);
|
pages.push(i)
|
||||||
}
|
}
|
||||||
return pages;
|
return pages
|
||||||
});
|
})
|
||||||
|
|
||||||
// 关闭对话框
|
// 关闭对话框
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false)
|
||||||
emit('close');
|
emit('close')
|
||||||
};
|
}
|
||||||
|
|
||||||
// 点击调度数
|
// 点击调度数
|
||||||
const handleDispatchClick = item => {
|
const handleDispatchClick = (item) => {
|
||||||
emit('dispatchClick', item);
|
emit('dispatchClick', item)
|
||||||
};
|
}
|
||||||
|
|
||||||
// 分页操作
|
// 分页操作
|
||||||
const handleSizeChange = val => {
|
const handleSizeChange = (val) => {
|
||||||
pageSize.value = val;
|
pageSize.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
const handleCurrentChange = val => {
|
const handleCurrentChange = (val) => {
|
||||||
currentPage.value = val;
|
currentPage.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
const handleFilterChange = () => {
|
||||||
|
currentPage.value = 1
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const fetchData = () => {
|
const fetchData = async () => {
|
||||||
console.log('获取第', currentPage.value, '页数据');
|
try {
|
||||||
// 实际项目中调用API获取数据
|
const res = await request({
|
||||||
};
|
url: '/snow-ops-platform/weather-warning/scheduling-county',
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
start: formatDateTime(props.dispatchDateRange?.[0]),
|
||||||
|
end: formatDateTime(props.dispatchDateRange?.[1]),
|
||||||
|
countyId: filterForm.value.region,
|
||||||
|
offset: (currentPage.value - 1) * pageSize.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.total > 0 && res.data) {
|
||||||
|
const data = res.data
|
||||||
|
tableData.value = data.map((item, index) => {
|
||||||
|
const region = item.qxmc || regionOptions.value.find((option) => option.value === item.countyId)?.label || '-'
|
||||||
|
return {
|
||||||
|
id: (currentPage.value - 1) * pageSize.value + index + 1,
|
||||||
|
region: region,
|
||||||
|
dispatchCount: item.count || 0,
|
||||||
|
lastDispatchTime: item.lastTime || '-',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
total.value = res.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取调度区县数据失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
currentPage.value = 1
|
||||||
currentPage.value = 1;
|
// 重置筛选表单
|
||||||
// 重置筛选表单
|
filterForm.value.region = ''
|
||||||
filterForm.value.region = '';
|
fetchData()
|
||||||
fetchData();
|
},
|
||||||
}
|
)
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -139,12 +139,7 @@
|
|||||||
<span class="timeline-value highlight">{{ item.sceneDesc }}</span>
|
<span class="timeline-value highlight">{{ item.sceneDesc }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="timeline-images" v-if="item.images && item.images.length > 0">
|
<div class="timeline-images" v-if="item.images && item.images.length > 0">
|
||||||
<div
|
<div v-for="(img, imgIndex) in item.images" :key="imgIndex" class="timeline-image" @click="previewImage(img)">
|
||||||
v-for="(img, imgIndex) in item.images"
|
|
||||||
:key="imgIndex"
|
|
||||||
class="timeline-image"
|
|
||||||
@click="previewImage(img)"
|
|
||||||
>
|
|
||||||
<img :src="img" alt="现场图片" />
|
<img :src="img" alt="现场图片" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -168,11 +163,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onMounted } from 'vue';
|
import { ref, watch, onMounted } from 'vue'
|
||||||
import { Close } from '@element-plus/icons-vue';
|
import { Close } from '@element-plus/icons-vue'
|
||||||
import baseDialog from '../component/baseDialog.vue';
|
import baseDialog from '../component/baseDialog.vue'
|
||||||
import { request } from '@/utils/request';
|
import { request } from '@/utils/request'
|
||||||
import { formatDateTime } from '../component/index.js';
|
import { formatDateTime } from '../component/index.js'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -183,11 +178,11 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('props.eventData', props.eventData);
|
console.log('props.eventData', props.eventData)
|
||||||
});
|
})
|
||||||
const emit = defineEmits(['update:visible', 'close']);
|
const emit = defineEmits(['update:visible', 'close'])
|
||||||
|
|
||||||
// 事件基本信息
|
// 事件基本信息
|
||||||
const eventInfo = ref({
|
const eventInfo = ref({
|
||||||
@ -201,55 +196,56 @@ const eventInfo = ref({
|
|||||||
roadPosition: '',
|
roadPosition: '',
|
||||||
stakeRange: '',
|
stakeRange: '',
|
||||||
discoverTime: '',
|
discoverTime: '',
|
||||||
});
|
})
|
||||||
|
|
||||||
// 填报动态信息
|
// 填报动态信息
|
||||||
const feedbackList = ref([]);
|
const feedbackList = ref([])
|
||||||
|
|
||||||
// 获取事件详情
|
// 获取事件详情
|
||||||
const fetchEventDetail = async () => {
|
const fetchEventDetail = async () => {
|
||||||
try {
|
try {
|
||||||
const gl1SjId = props.eventData?.gl1SjId;
|
const gl1SjId = props.eventData?.gl1SjId
|
||||||
if (!gl1SjId) {
|
if (!gl1SjId) {
|
||||||
console.warn('gl1SjId 不存在');
|
console.warn('gl1SjId 不存在')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/snow-ops-platform/sm-event/detail-by-sjid',
|
// url: '/snow-ops-platform/sm-event/detail-by-sjid',
|
||||||
|
url: '/snow-ops-platform/sm-event/detail',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
sjid: gl1SjId + '',
|
gl1SjId: gl1SjId + '',
|
||||||
// sjid: '00092c5f0c054c67b0ad00071dd94630',
|
// gl1SjId: '2fd1225c892a4e9396f006fe8ebaac53',
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|
||||||
if (res && res.code === '00000') {
|
if (res && res.code === '00000') {
|
||||||
// 映射事件基本信息 - 根据API文档字段映射
|
// 映射事件基本信息 - 根据API文档字段映射
|
||||||
const data = res.data || {};
|
const data = res.data || {}
|
||||||
eventInfo.value = {
|
eventInfo.value = {
|
||||||
// eventType: 事件类型
|
// eventType: 事件类型
|
||||||
eventType: data.eventType || '-',
|
eventType: data.gl1Sjlx || '-',
|
||||||
// eventLevel: 事件等级 -> 路况类型
|
// eventLevel: 事件等级 -> 路况类型
|
||||||
roadConditionType: data.eventLevel || '-',
|
roadConditionType: data.gl1Lklx || '-',
|
||||||
// isBlocked: 根据eventDesc或其他字段判断是否阻断
|
// isBlocked: 根据eventDesc或其他字段判断是否阻断
|
||||||
isBlocked: data.eventDesc?.includes('阻断') ? '是' : '否',
|
isBlocked: data.eventDesc?.includes('阻断') ? '是' : '否',
|
||||||
// district: 所属区域 -> 上报区县
|
// district: 所属区域 -> 上报区县
|
||||||
reportCounty: data.district || '-',
|
reportCounty: data.qxmc || '-',
|
||||||
// detailAddress: 详细地址 -> 阻断点小地名
|
// detailAddress: 详细地址 -> 阻断点小地名
|
||||||
blockLocation: data.detailAddress || '-',
|
blockLocation: data.gl1Wz || '-',
|
||||||
// eventNo: 事件编号 -> 线路编码
|
// eventNo: 事件编号 -> 线路编码
|
||||||
routeCode: data.eventNo || '-',
|
routeCode: data.gl1Lxbh || '-',
|
||||||
// eventDesc: 事件描述 -> 处理措施
|
// eventDesc: 事件描述 -> 处理措施
|
||||||
handleMeasure: data.eventDesc || '-',
|
handleMeasure: data.gl1Clcs || '-',
|
||||||
// detailAddress: 详细地址 -> 路况位置
|
// detailAddress: 详细地址 -> 路况位置
|
||||||
roadPosition: data.detailAddress || '-',
|
roadPosition: data.gl1Lxmc || '-',
|
||||||
// stakeRange 需要单独处理
|
// stakeRange 桩号范围
|
||||||
stakeRange: formatStakeRangeFromData(data),
|
stakeRange: data.gl1Qdzh + '-' + data.gl1Zdzh || '-',
|
||||||
// occurTime: 发生时间 -> 发现时间
|
// occurTime: 发生时间 -> 发现时间
|
||||||
discoverTime: formatDateTime(data.occurTime) || '-',
|
discoverTime: data.gl1Fxsj || '-',
|
||||||
};
|
}
|
||||||
console.log('eventInfo', eventInfo.value);
|
console.log('eventInfo', eventInfo.value)
|
||||||
// 映射填报动态信息 - 根据API文档字段映射
|
// 映射填报动态信息 - 根据API文档字段映射
|
||||||
if (data.handleList && Array.isArray(data.handleList)) {
|
if (data.handleList && Array.isArray(data.handleList)) {
|
||||||
feedbackList.value = data.handleList.map((item, index) => ({
|
feedbackList.value = data.handleList.map((item, index) => ({
|
||||||
@ -257,84 +253,85 @@ const fetchEventDetail = async () => {
|
|||||||
isFirst: index === 0,
|
isFirst: index === 0,
|
||||||
reportType: index === 0 ? '首报' : '续报',
|
reportType: index === 0 ? '首报' : '续报',
|
||||||
// disposeTime: 处置时间
|
// disposeTime: 处置时间
|
||||||
reportTime: formatDateTime(item.disposeTime) || '-',
|
reportTime: formatDateTime(item.gl1Cjsj) || '-',
|
||||||
// handleMeasure: 需要额外字段,暂用disposeDesc替代
|
// handleMeasure: 需要额外字段,暂用disposeDesc替代
|
||||||
handleMeasure: item.disposeDesc?.substring(0, 10) || '-',
|
handleMeasure: item.gl1Clcs || '-',
|
||||||
// expectStartTime: 预计开始时间
|
// expectStartTime: 预计开始时间
|
||||||
estimatedRecoverTime: formatDateTime(item.expectStartTime) || '-',
|
estimatedRecoverTime: formatDateTime(item.gl1Yjhfsj) || '-',
|
||||||
// actualStartTime: 实际开始时间
|
// actualStartTime: 实际开始时间
|
||||||
actualRecoverTime: formatDateTime(item.actualStartTime) || '-',
|
actualRecoverTime: formatDateTime(item.gl1Sjhfsj) || '-',
|
||||||
// disposer: 处置人
|
// disposer: 处置人
|
||||||
reporter: item.disposer || '-',
|
reporter: item.gl1Lxrxm || '-',
|
||||||
// contactPhone: 联系电话
|
// contactPhone: 联系电话
|
||||||
contactPhone: item.contactPhone || '-',
|
contactPhone: item.gl1Lxdh || '-',
|
||||||
// disposeDesc: 处置情况描述
|
// disposeDesc: 处置情况描述
|
||||||
sceneDesc: item.disposeDesc || '-',
|
sceneDesc: item.gl1Xcqkms || '-',
|
||||||
}));
|
images: item.gl1Zjtp ? [item.gl1Zjtp] : [],
|
||||||
|
}))
|
||||||
} else {
|
} else {
|
||||||
feedbackList.value = [];
|
feedbackList.value = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取事件详情失败:', error);
|
console.error('获取事件详情失败:', error)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 格式化路况位置
|
// 格式化路况位置
|
||||||
const formatRoadPosition = data => {
|
const formatRoadPosition = (data) => {
|
||||||
const parts = [];
|
const parts = []
|
||||||
if (data.gl1Qxmc) parts.push(data.gl1Qxmc);
|
if (data.gl1Qxmc) parts.push(data.gl1Qxmc)
|
||||||
if (data.gl1Zddxdm) parts.push(data.gl1Zddxdm);
|
if (data.gl1Zddxdm) parts.push(data.gl1Zddxdm)
|
||||||
if (data.gl1Lxbh) parts.push(data.gl1Lxbh);
|
if (data.gl1Lxbh) parts.push(data.gl1Lxbh)
|
||||||
return parts.length > 0 ? parts.join('') : '-';
|
return parts.length > 0 ? parts.join('') : '-'
|
||||||
};
|
}
|
||||||
|
|
||||||
// 格式化桩号范围(旧版字段)
|
// 格式化桩号范围(旧版字段)
|
||||||
const formatStakeRange = data => {
|
const formatStakeRange = (data) => {
|
||||||
const start = data.gl1Qdzh || '';
|
const start = data.gl1Qdzh || ''
|
||||||
const end = data.gl1Zdzh || '';
|
const end = data.gl1Zdzh || ''
|
||||||
if (start && end) return `${start}-${end}`;
|
if (start && end) return `${start}-${end}`
|
||||||
if (start) return start;
|
if (start) return start
|
||||||
if (end) return end;
|
if (end) return end
|
||||||
return '-';
|
return '-'
|
||||||
};
|
}
|
||||||
|
|
||||||
// 格式化桩号范围(API文档字段)- API文档中暂无桩号字段,从detailAddress中尝试解析或返回'-'
|
// 格式化桩号范围(API文档字段)- API文档中暂无桩号字段,从detailAddress中尝试解析或返回'-'
|
||||||
const formatStakeRangeFromData = data => {
|
const formatStakeRangeFromData = (data) => {
|
||||||
// API文档中未提供桩号字段,暂从detailAddress解析或返回'-'
|
// API文档中未提供桩号字段,暂从detailAddress解析或返回'-'
|
||||||
// 如果后续API提供了桩号字段,可以在这里更新
|
// 如果后续API提供了桩号字段,可以在这里更新
|
||||||
return '-';
|
return '-'
|
||||||
};
|
}
|
||||||
|
|
||||||
// 图片预览
|
// 图片预览
|
||||||
const previewVisible = ref(false);
|
const previewVisible = ref(false)
|
||||||
const previewImageUrl = ref('');
|
const previewImageUrl = ref('')
|
||||||
|
|
||||||
const previewImage = url => {
|
const previewImage = (url) => {
|
||||||
previewImageUrl.value = url;
|
previewImageUrl.value = url
|
||||||
previewVisible.value = true;
|
previewVisible.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
const closePreview = () => {
|
const closePreview = () => {
|
||||||
previewVisible.value = false;
|
previewVisible.value = false
|
||||||
previewImageUrl.value = '';
|
previewImageUrl.value = ''
|
||||||
};
|
}
|
||||||
|
|
||||||
// 关闭对话框
|
// 关闭对话框
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false)
|
||||||
emit('close');
|
emit('close')
|
||||||
};
|
}
|
||||||
|
|
||||||
// 监听eventData变化
|
// 监听eventData变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
fetchEventDetail();
|
fetchEventDetail()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -62,12 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 图片预览组件 -->
|
<!-- 图片预览组件 -->
|
||||||
<el-image-viewer
|
<el-image-viewer v-if="previewVisible" :url-list="hazardData.photos" :initial-index="previewIndex" @close="previewVisible = false" />
|
||||||
v-if="previewVisible"
|
|
||||||
:url-list="hazardData.photos"
|
|
||||||
:initial-index="previewIndex"
|
|
||||||
@close="previewVisible = false"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 风险描述 -->
|
<!-- 风险描述 -->
|
||||||
<div class="info-block">
|
<div class="info-block">
|
||||||
@ -97,13 +92,13 @@
|
|||||||
<span class="responsibility-phone">{{ hazardData.trafficDept.phone }}</span>
|
<span class="responsibility-phone">{{ hazardData.trafficDept.phone }}</span>
|
||||||
<span class="responsibility-frequency">{{ hazardData.trafficDept.frequency }}</span>
|
<span class="responsibility-frequency">{{ hazardData.trafficDept.frequency }}</span>
|
||||||
<div class="action-btns">
|
<div class="action-btns">
|
||||||
<div class="action-btn" @click="handleVideo(hazardData.trafficDept)" title="视频">
|
<div class="action-btn" @click="handleVideo(hazardData.trafficDept, '交通主管部门责任人')" title="视频">
|
||||||
<el-icon><VideoCamera /></el-icon>
|
<el-icon><VideoCamera /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleVoice(hazardData.trafficDept)" title="语音">
|
<div class="action-btn" @click="handleVoice(hazardData.trafficDept, '交通主管部门责任人')" title="语音">
|
||||||
<el-icon><Microphone /></el-icon>
|
<el-icon><Microphone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleCall(hazardData.trafficDept)" title="电话">
|
<div class="action-btn" @click="handleCall(hazardData.trafficDept, '交通主管部门责任人')" title="电话">
|
||||||
<el-icon><Phone /></el-icon>
|
<el-icon><Phone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -115,13 +110,13 @@
|
|||||||
<span class="responsibility-phone">{{ hazardData.roadOrg.phone }}</span>
|
<span class="responsibility-phone">{{ hazardData.roadOrg.phone }}</span>
|
||||||
<span class="responsibility-frequency">{{ hazardData.roadOrg.frequency }}</span>
|
<span class="responsibility-frequency">{{ hazardData.roadOrg.frequency }}</span>
|
||||||
<div class="action-btns">
|
<div class="action-btns">
|
||||||
<div class="action-btn" @click="handleVideo(hazardData.roadOrg)" title="视频">
|
<div class="action-btn" @click="handleVideo(hazardData.roadOrg, '公路机构责任人')" title="视频">
|
||||||
<el-icon><VideoCamera /></el-icon>
|
<el-icon><VideoCamera /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleVoice(hazardData.roadOrg)" title="语音">
|
<div class="action-btn" @click="handleVoice(hazardData.roadOrg, '公路机构责任人')" title="语音">
|
||||||
<el-icon><Microphone /></el-icon>
|
<el-icon><Microphone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleCall(hazardData.roadOrg)" title="电话">
|
<div class="action-btn" @click="handleCall(hazardData.roadOrg, '公路机构责任人')" title="电话">
|
||||||
<el-icon><Phone /></el-icon>
|
<el-icon><Phone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -133,13 +128,13 @@
|
|||||||
<span class="responsibility-phone">{{ hazardData.maintenance.phone }}</span>
|
<span class="responsibility-phone">{{ hazardData.maintenance.phone }}</span>
|
||||||
<span class="responsibility-frequency">{{ hazardData.maintenance.frequency }}</span>
|
<span class="responsibility-frequency">{{ hazardData.maintenance.frequency }}</span>
|
||||||
<div class="action-btns">
|
<div class="action-btns">
|
||||||
<div class="action-btn" @click="handleVideo(hazardData.maintenance)" title="视频">
|
<div class="action-btn" @click="handleVideo(hazardData.maintenance, '养护站责任人')" title="视频">
|
||||||
<el-icon><VideoCamera /></el-icon>
|
<el-icon><VideoCamera /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleVoice(hazardData.maintenance)" title="语音">
|
<div class="action-btn" @click="handleVoice(hazardData.maintenance, '养护站责任人')" title="语音">
|
||||||
<el-icon><Microphone /></el-icon>
|
<el-icon><Microphone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleCall(hazardData.maintenance)" title="电话">
|
<div class="action-btn" @click="handleCall(hazardData.maintenance, '养护站责任人')" title="电话">
|
||||||
<el-icon><Phone /></el-icon>
|
<el-icon><Phone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -156,13 +151,13 @@
|
|||||||
<span class="responsibility-name" style="width: 100px">{{ hazardData.roadKeeper.phone }}</span>
|
<span class="responsibility-name" style="width: 100px">{{ hazardData.roadKeeper.phone }}</span>
|
||||||
<span class="responsibility-frequency">{{ hazardData.roadKeeper.frequency }}</span>
|
<span class="responsibility-frequency">{{ hazardData.roadKeeper.frequency }}</span>
|
||||||
<div class="action-btns">
|
<div class="action-btns">
|
||||||
<div class="action-btn" @click="handleVideo(hazardData.roadKeeper)" title="视频">
|
<div class="action-btn" @click="handleVideo(hazardData.roadKeeper, '护路员')" title="视频">
|
||||||
<el-icon><VideoCamera /></el-icon>
|
<el-icon><VideoCamera /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleVoice(hazardData.roadKeeper)" title="语音">
|
<div class="action-btn" @click="handleVoice(hazardData.roadKeeper, '护路员')" title="语音">
|
||||||
<el-icon><Microphone /></el-icon>
|
<el-icon><Microphone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn" @click="handleCall(hazardData.roadKeeper)" title="电话">
|
<div class="action-btn" @click="handleCall(hazardData.roadKeeper, '护路员')" title="电话">
|
||||||
<el-icon><Phone /></el-icon>
|
<el-icon><Phone /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -332,11 +327,13 @@ const previewPhoto = (index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 视频通话
|
// 视频通话
|
||||||
const handleVideo = (item) => {
|
const handleVideo = (item, type) => {
|
||||||
console.log('视频通话:', item)
|
console.log('视频通话:', item)
|
||||||
let videoParams = {
|
let videoParams = {
|
||||||
...item,
|
...item,
|
||||||
id: hazardData.value.id,
|
id: hazardData.value.id,
|
||||||
|
type: type,
|
||||||
|
role: getRolefn(type),
|
||||||
}
|
}
|
||||||
openVideoConference(videoParams)
|
openVideoConference(videoParams)
|
||||||
// emit('video', {
|
// emit('video', {
|
||||||
@ -346,11 +343,13 @@ const handleVideo = (item) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 语音通话
|
// 语音通话
|
||||||
const handleVoice = (item) => {
|
const handleVoice = (item, type) => {
|
||||||
console.log('语音通话:', item)
|
console.log('语音通话:', item)
|
||||||
let voiceParams = {
|
let voiceParams = {
|
||||||
...item,
|
...item,
|
||||||
id: hazardData.value.id,
|
id: hazardData.value.id,
|
||||||
|
type: type,
|
||||||
|
role: getRolefn(type),
|
||||||
}
|
}
|
||||||
openVoiceConference(voiceParams)
|
openVoiceConference(voiceParams)
|
||||||
// emit('voice', {
|
// emit('voice', {
|
||||||
@ -360,14 +359,28 @@ const handleVoice = (item) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 拨打电话
|
// 拨打电话
|
||||||
const handleCall = (item) => {
|
const handleCall = (item, type) => {
|
||||||
console.log('拨打电话:', item)
|
console.log('拨打电话:', item)
|
||||||
emit('call', {
|
emit('call', {
|
||||||
...item,
|
...item,
|
||||||
id: hazardData.value.id,
|
id: hazardData.value.id,
|
||||||
|
type: type,
|
||||||
|
role: getRolefn(type),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const getRolefn = (item) => {
|
||||||
|
if (item == '交通主管部门责任人') {
|
||||||
|
return '责任人'
|
||||||
|
} else if (item == '公路机构责任人') {
|
||||||
|
return '责任人'
|
||||||
|
} else if (item == '养护站责任人') {
|
||||||
|
return '站长'
|
||||||
|
} else if (item == '护路员') {
|
||||||
|
return '一般人员'
|
||||||
|
} else {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
}
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
|
|||||||
@ -26,12 +26,7 @@
|
|||||||
clearable
|
clearable
|
||||||
@change="handleFilterChange"
|
@change="handleFilterChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option v-for="item in regionOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
v-for="item in districtOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -40,56 +35,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch, inject } from 'vue'
|
||||||
import BaseDialog from '../component/baseDialog.vue';
|
import BaseDialog from '../component/baseDialog.vue'
|
||||||
import { request } from '@/utils/request';
|
import { request } from '@/utils/request'
|
||||||
|
import { formatDateTime, regionOptions } from '../component/index'
|
||||||
|
// 注入日期范围
|
||||||
|
const getdateRange = inject('getdateRange', ref([]))
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
dispatchDateRange: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:visible', 'close']);
|
const emit = defineEmits(['update:visible', 'close'])
|
||||||
|
|
||||||
// 筛选表单
|
// 筛选表单
|
||||||
const filterForm = ref({
|
const filterForm = ref({
|
||||||
district: '',
|
district: '',
|
||||||
});
|
})
|
||||||
|
|
||||||
// 区县选项
|
|
||||||
const districtOptions = ref([
|
|
||||||
{ label: '万州区', value: 'wanzhou' },
|
|
||||||
{ label: '黔江区', value: 'qianjiang' },
|
|
||||||
{ label: '涪陵区', value: 'fuling' },
|
|
||||||
{ label: '渝中区', value: 'yuzhong' },
|
|
||||||
{ label: '大渡口区', value: 'dadukou' },
|
|
||||||
{ label: '江北区', value: 'jiangbei' },
|
|
||||||
{ label: '沙坪坝区', value: 'shapingba' },
|
|
||||||
{ label: '九龙坡区', value: 'jiulongpo' },
|
|
||||||
{ label: '南岸区', value: 'nanan' },
|
|
||||||
{ label: '北碚区', value: 'beibei' },
|
|
||||||
{ label: '渝北区', value: 'yubei' },
|
|
||||||
{ label: '巴南区', value: 'banan' },
|
|
||||||
{ label: '长寿区', value: 'changshou' },
|
|
||||||
{ label: '江津区', value: 'jiangjin' },
|
|
||||||
{ label: '合川区', value: 'hechuan' },
|
|
||||||
{ label: '永川区', value: 'yongchuan' },
|
|
||||||
{ label: '南川区', value: 'nanchuan' },
|
|
||||||
{ label: '綦江区', value: 'qijiang' },
|
|
||||||
{ label: '大足区', value: 'dazu' },
|
|
||||||
{ label: '璧山区', value: 'bishan' },
|
|
||||||
{ label: '铜梁区', value: 'tongliang' },
|
|
||||||
{ label: '潼南区', value: 'tongnan' },
|
|
||||||
{ label: '荣昌区', value: 'rongchang' },
|
|
||||||
{ label: '开州区', value: 'kaizhou' },
|
|
||||||
{ label: '梁平区', value: 'liangping' },
|
|
||||||
{ label: '武隆区', value: 'wulong' },
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 表格高度
|
// 表格高度
|
||||||
const tableHeight = ref(300);
|
const tableHeight = ref(300)
|
||||||
|
|
||||||
// 表格列配置 - 不设置宽度,由数据自动控制
|
// 表格列配置 - 不设置宽度,由数据自动控制
|
||||||
const tableColumns = ref([
|
const tableColumns = ref([
|
||||||
@ -98,80 +69,97 @@ const tableColumns = ref([
|
|||||||
{ prop: 'inspectTime', label: '抽查时间' },
|
{ prop: 'inspectTime', label: '抽查时间' },
|
||||||
{ prop: 'inspectedPerson', label: '被抽查人' },
|
{ prop: 'inspectedPerson', label: '被抽查人' },
|
||||||
{ prop: 'contactPhone', label: '联系电话' },
|
{ prop: 'contactPhone', label: '联系电话' },
|
||||||
]);
|
])
|
||||||
|
|
||||||
// 表格数据
|
// 表格数据
|
||||||
const tableData = ref([]);
|
const tableData = ref([])
|
||||||
|
|
||||||
// 分页
|
// 分页
|
||||||
const currentPage = ref(1);
|
const currentPage = ref(1)
|
||||||
const pageSize = ref(10);
|
const pageSize = ref(10)
|
||||||
const total = ref(0);
|
const total = ref(0)
|
||||||
|
|
||||||
// 关闭对话框
|
// 关闭对话框
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false)
|
||||||
emit('close');
|
emit('close')
|
||||||
};
|
}
|
||||||
|
|
||||||
// 分页操作
|
// 分页操作
|
||||||
const handleSizeChange = val => {
|
const handleSizeChange = (val) => {
|
||||||
pageSize.value = val;
|
pageSize.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
const handleCurrentChange = val => {
|
const handleCurrentChange = (val) => {
|
||||||
currentPage.value = val;
|
currentPage.value = val
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
// 筛选条件改变时触发
|
// 筛选条件改变时触发
|
||||||
const handleFilterChange = () => {
|
const handleFilterChange = () => {
|
||||||
currentPage.value = 1;
|
currentPage.value = 1
|
||||||
fetchData();
|
fetchData()
|
||||||
};
|
}
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/snow-ops-platform/inspection/personnel-list',
|
url: '/snow-ops-platform/weather-warning/spot-check',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
pageNum: currentPage.value,
|
offset: (currentPage.value - 1) * pageSize.value,
|
||||||
pageSize: pageSize.value,
|
limit: pageSize.value,
|
||||||
districtCode: filterForm.value.district,
|
start: formatDateTime(props.dispatchDateRange?.[0]),
|
||||||
|
end: formatDateTime(props.dispatchDateRange?.[1]),
|
||||||
|
countyId: filterForm.value.district,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
console.log(res, '抽查人次数据')
|
||||||
|
|
||||||
|
if (res.total > 0 && res.data) {
|
||||||
|
const data = res.data
|
||||||
|
tableData.value = data.map((item, index) => {
|
||||||
|
// 解析 command 字段中的 JSON 数据
|
||||||
|
let commandData = {}
|
||||||
|
try {
|
||||||
|
if (item.command) {
|
||||||
|
commandData = JSON.parse(item.command)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析 command 字段失败:', e)
|
||||||
|
}
|
||||||
|
const district = regionOptions.value.find((option) => option.value === item.countyId)?.label || '-'
|
||||||
|
|
||||||
if (res.code === '00000' && res.data) {
|
|
||||||
const data = res.data;
|
|
||||||
tableData.value = data.records.map((item, index) => {
|
|
||||||
return {
|
return {
|
||||||
id: currentPage.value * pageSize.value - (pageSize.value - index - 1),
|
id: currentPage.value * pageSize.value - (pageSize.value - index - 1),
|
||||||
district: item.districtName || '-',
|
district: district,
|
||||||
inspectTime: item.inspectTime || '-',
|
inspectTime: formatDateTime(item.createdAt) || '-',
|
||||||
inspectedPerson: item.inspectedPerson || '-',
|
inspectedPerson: commandData.userName || '-',
|
||||||
contactPhone: item.contactPhone || '-',
|
contactPhone: commandData.userPhone || '-',
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
total.value = data.total;
|
total.value = data.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取抽查人次数据失败:', error);
|
console.error('获取抽查人次数据失败:', error)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
currentPage.value = 1;
|
currentPage.value = 1
|
||||||
fetchData();
|
fetchData()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -65,18 +65,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 照片 -->
|
<!-- 照片 -->
|
||||||
<div class="section" v-if="photoList.length > 0">
|
<div class="section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<span class="title-icon">▍</span>
|
<span class="title-icon">▍</span>
|
||||||
照片
|
照片
|
||||||
</div>
|
</div>
|
||||||
<div class="photo-list">
|
<div class="photo-list">
|
||||||
<div
|
<div v-for="(photo, index) in photoList" :key="index" class="photo-item" @click="previewImage(photo)">
|
||||||
v-for="(photo, index) in photoList"
|
|
||||||
:key="index"
|
|
||||||
class="photo-item"
|
|
||||||
@click="previewImage(photo)"
|
|
||||||
>
|
|
||||||
<img :src="photo" alt="照片" />
|
<img :src="photo" alt="照片" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -117,10 +112,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail-row">
|
<div class="detail-row">
|
||||||
<span class="detail-label">是否发现问题:</span>
|
<span class="detail-label">是否发现问题:</span>
|
||||||
<span
|
<span class="detail-value" :class="record.hasProblem ? 'status-yes' : 'status-no'">
|
||||||
class="detail-value"
|
|
||||||
:class="record.hasProblem ? 'status-yes' : 'status-no'"
|
|
||||||
>
|
|
||||||
{{ record.hasProblem ? '是' : '否' }}
|
{{ record.hasProblem ? '是' : '否' }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -145,10 +137,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue'
|
||||||
import { Close } from '@element-plus/icons-vue';
|
import { Close } from '@element-plus/icons-vue'
|
||||||
import baseDialog from '../component/baseDialog.vue';
|
import baseDialog from '../component/baseDialog.vue'
|
||||||
import { request } from '@/utils/request';
|
import { request } from '@/utils/request'
|
||||||
|
import { getImageUrlList } from '../component/index.js'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -163,9 +156,9 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:visible', 'close']);
|
const emit = defineEmits(['update:visible', 'close'])
|
||||||
|
|
||||||
// 基本信息
|
// 基本信息
|
||||||
const basicInfo = ref({
|
const basicInfo = ref({
|
||||||
@ -176,18 +169,18 @@ const basicInfo = ref({
|
|||||||
location: '',
|
location: '',
|
||||||
riskDesc: '',
|
riskDesc: '',
|
||||||
discoverTime: '',
|
discoverTime: '',
|
||||||
});
|
})
|
||||||
watch(
|
watch(
|
||||||
() => props.item,
|
() => props.item,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
// 当弹窗打开时获取数据
|
// 当弹窗打开时获取数据
|
||||||
getAffectedObjectTypeId(props.item);
|
getAffectedObjectTypeId(props.item)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
)
|
||||||
// 照片列表
|
// 照片列表
|
||||||
const photoList = ref([]);
|
const photoList = ref([])
|
||||||
|
|
||||||
// 动态记录
|
// 动态记录
|
||||||
const dynamicRecords = ref([
|
const dynamicRecords = ref([
|
||||||
@ -207,82 +200,79 @@ const dynamicRecords = ref([
|
|||||||
// hasProblem: false,
|
// hasProblem: false,
|
||||||
// image: null,
|
// image: null,
|
||||||
// },
|
// },
|
||||||
]);
|
])
|
||||||
|
|
||||||
// 状态样式
|
// 状态样式
|
||||||
const getStatusClass = status => {
|
const getStatusClass = (status) => {
|
||||||
if (status === '未回应') return 'status-unresponse';
|
if (status === '未回应') return 'status-unresponse'
|
||||||
if (status === '已回应') return 'status-response';
|
if (status === '已回应') return 'status-response'
|
||||||
return '';
|
return ''
|
||||||
};
|
}
|
||||||
|
|
||||||
// 图片预览
|
// 图片预览
|
||||||
const previewVisible = ref(false);
|
const previewVisible = ref(false)
|
||||||
const previewImageUrl = ref('');
|
const previewImageUrl = ref('')
|
||||||
|
|
||||||
const previewImage = url => {
|
const previewImage = (url) => {
|
||||||
previewImageUrl.value = url;
|
previewImageUrl.value = url
|
||||||
previewVisible.value = true;
|
previewVisible.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
const closePreview = () => {
|
const closePreview = () => {
|
||||||
previewVisible.value = false;
|
previewVisible.value = false
|
||||||
previewImageUrl.value = '';
|
previewImageUrl.value = ''
|
||||||
};
|
}
|
||||||
|
|
||||||
// 关闭对话框
|
// 关闭对话框
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false)
|
||||||
emit('close');
|
emit('close')
|
||||||
};
|
}
|
||||||
const leveltext = level => {
|
const leveltext = (level) => {
|
||||||
if (level.includes('一') || level.includes('1')) return '一类';
|
if (level.includes('一') || level.includes('1')) return '一类'
|
||||||
if (level.includes('二') || level.includes('2')) return '二类';
|
if (level.includes('二') || level.includes('2')) return '二类'
|
||||||
if (level.includes('三') || level.includes('3')) return '三类';
|
if (level.includes('三') || level.includes('3')) return '三类'
|
||||||
if (level.includes('四') || level.includes('4')) return '四类';
|
if (level.includes('四') || level.includes('4')) return '四类'
|
||||||
if (level.includes('五') || level.includes('5')) return '五类';
|
if (level.includes('五') || level.includes('5')) return '五类'
|
||||||
if (level.includes('9')) return '未评定';
|
if (level.includes('9')) return '未评定'
|
||||||
return '未评定';
|
return '未评定'
|
||||||
};
|
}
|
||||||
// 点击遮罩关闭已由base-dialog组件处理
|
// 点击遮罩关闭已由base-dialog组件处理
|
||||||
// 处理影响点类型数据
|
// 处理影响点类型数据
|
||||||
const getAffectedObjectTypeId = data => {
|
const getAffectedObjectTypeId = (data) => {
|
||||||
let pointType = props.item.pointType;
|
let pointType = props.item.pointType
|
||||||
|
basicInfo.value = {}
|
||||||
|
photoList.value = []
|
||||||
|
dynamicRecords.value = []
|
||||||
if (!data) {
|
if (!data) {
|
||||||
basicInfo.value = {};
|
return
|
||||||
photoList.value = [];
|
|
||||||
dynamicRecords.value = [];
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (pointType === '桥梁') {
|
if (pointType === '桥梁') {
|
||||||
// 更新基本信息 - 根据数据库字段映射
|
// 更新基本信息 - 根据数据库字段映射
|
||||||
basicInfo.value = {
|
basicInfo.value = {
|
||||||
district: data.GL1_QXMC || '-', // 区县名称
|
district: data.GL1_QXMC || '-', // 区县名称
|
||||||
level: leveltext(data.GL1_JSZKPJDJ) || '未评定', // 技术状况评级等级
|
level: leveltext(data.GL1_JSZKPJDJ) || '未评定', // 技术状况评级等级
|
||||||
levelClass:
|
levelClass: data.GL1_JSZKPJDJ === '一类' || data.GL1_JSZKPJDJ === '二类' ? 'level-normal' : 'level-serious', // 一二类为一般,三四五类为重大
|
||||||
data.GL1_JSZKPJDJ === '一类' || data.GL1_JSZKPJDJ === '二类'
|
|
||||||
? 'level-normal'
|
|
||||||
: 'level-serious', // 一二类为一般,三四五类为重大
|
|
||||||
roadCode: data.GL1_LXBH || '-', // 路线编号
|
roadCode: data.GL1_LXBH || '-', // 路线编号
|
||||||
location: data.GL1_QLMC || '-', // 桥梁名称作为位置
|
location: data.GL1_QLMC || '-', // 桥梁名称作为位置
|
||||||
riskDesc: data.GL1_DQBH || '-', // 当前病害
|
riskDesc: data.GL1_DQBH || '-', // 当前病害
|
||||||
discoverTime: data.GL1_JSZKPDRQ || '-', // 技术状况评定日期
|
discoverTime: data.GL1_JSZKPDRQ || '-', // 技术状况评定日期
|
||||||
};
|
}
|
||||||
// 更新照片列表 - 使用桥梁照片字段
|
// 更新照片列表 - 使用桥梁照片字段
|
||||||
const photos = [];
|
const photos = []
|
||||||
if (data.GL1_QLZMZFJ) {
|
if (data.GL1_QLZMZFJ) {
|
||||||
photos.push(data.GL1_QLZMZFJ); // 桥梁正面照附件
|
photos.push(data.GL1_QLZMZFJ) // 桥梁正面照附件
|
||||||
}
|
}
|
||||||
if (data.GL1_QLLMZFJ) {
|
if (data.GL1_QLLMZFJ) {
|
||||||
photos.push(data.GL1_QLLMZFJ); // 桥梁立面照附件
|
photos.push(data.GL1_QLLMZFJ) // 桥梁立面照附件
|
||||||
}
|
}
|
||||||
if (data.GL1_QLDXZFJ) {
|
if (data.GL1_QLDXZFJ) {
|
||||||
photos.push(data.GL1_QLDXZFJ); // 桥梁典型照附件
|
photos.push(data.GL1_QLDXZFJ) // 桥梁典型照附件
|
||||||
}
|
}
|
||||||
if (data.GL1_QLZP) {
|
if (data.GL1_QLZP) {
|
||||||
photos.push(data.GL1_QLZP); // 桥梁照片
|
photos.push(data.GL1_QLZP) // 桥梁照片
|
||||||
}
|
}
|
||||||
photoList.value = photos.length > 0 ? photos : [];
|
photoList.value = photos.length > 0 ? photos : []
|
||||||
|
|
||||||
// 更新动态记录 - 桥梁信息没有巡查记录,使用基础信息展示
|
// 更新动态记录 - 桥梁信息没有巡查记录,使用基础信息展示
|
||||||
// dynamicRecords.value = [
|
// dynamicRecords.value = [
|
||||||
@ -300,22 +290,19 @@ const getAffectedObjectTypeId = data => {
|
|||||||
basicInfo.value = {
|
basicInfo.value = {
|
||||||
district: data.GL1_QXMC || '-', // 区县名称
|
district: data.GL1_QXMC || '-', // 区县名称
|
||||||
level: leveltext(data.GL1_FXDJ) || '未评定', // 风险等级
|
level: leveltext(data.GL1_FXDJ) || '未评定', // 风险等级
|
||||||
levelClass:
|
levelClass: data.GL1_FXDJ?.includes('一级') || data.GL1_FXDJ?.includes('二级') ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
||||||
data.GL1_FXDJ?.includes('一级') || data.GL1_FXDJ?.includes('二级')
|
|
||||||
? 'level-normal'
|
|
||||||
: 'level-serious', // 一二级为一般,三四五级为重大
|
|
||||||
roadCode: data.GL1_LXBM || '-', // 路线编码
|
roadCode: data.GL1_LXBM || '-', // 路线编码
|
||||||
location: data.GL1_BPGC || '-', // 边坡概况
|
location: data.GL1_BPGC || '-', // 边坡概况
|
||||||
riskDesc: data.GL1_JCSSSZ || '-', // 监测设施设置
|
riskDesc: data.GL1_JCSSSZ || '-', // 监测设施设置
|
||||||
discoverTime: data.GL1_ZRRXM || '-', // 责任人姓名
|
discoverTime: data.GL1_ZRRXM || '-', // 责任人姓名
|
||||||
};
|
}
|
||||||
|
|
||||||
// 更新照片列表 - 边坡照片字段
|
// 更新照片列表 - 边坡照片字段
|
||||||
const photos = [];
|
const photos = []
|
||||||
if (data.GL1_ZRLXFS) {
|
if (data.GL1_ZRLXFS) {
|
||||||
photos.push(data.GL1_ZRLXFS); // 责任人联系方式(可能包含图片URL)
|
photos.push(data.GL1_ZRLXFS) // 责任人联系方式(可能包含图片URL)
|
||||||
}
|
}
|
||||||
photoList.value = photos.length > 0 ? photos : [];
|
photoList.value = photos.length > 0 ? photos : []
|
||||||
|
|
||||||
// 更新动态记录 - 边坡信息展示
|
// 更新动态记录 - 边坡信息展示
|
||||||
// dynamicRecords.value = [
|
// dynamicRecords.value = [
|
||||||
@ -333,29 +320,28 @@ const getAffectedObjectTypeId = data => {
|
|||||||
basicInfo.value = {
|
basicInfo.value = {
|
||||||
district: data.GL1_QXMC || '-', // 区县名称
|
district: data.GL1_QXMC || '-', // 区县名称
|
||||||
level: leveltext(data.GL1_PDDJ) || '未评定', // 评定等级
|
level: leveltext(data.GL1_PDDJ) || '未评定', // 评定等级
|
||||||
levelClass:
|
levelClass: data.GL1_PDDJ === '一级' || data.GL1_PDDJ === '二级' ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
||||||
data.GL1_PDDJ === '一级' || data.GL1_PDDJ === '二级' ? 'level-normal' : 'level-serious', // 一二级为一般,三四五级为重大
|
|
||||||
roadCode: data.GL1_LXBH || '-', // 路线编号
|
roadCode: data.GL1_LXBH || '-', // 路线编号
|
||||||
location: data.GL1_SDMC || '-', // 隧道名称作为位置
|
location: data.GL1_SDMC || '-', // 隧道名称作为位置
|
||||||
riskDesc: data.GL1_BHMS || '-', // 病害描述
|
riskDesc: data.GL1_BHMS || '-', // 病害描述
|
||||||
discoverTime: data.GL1_PDRQ || '-', // 评定日期
|
discoverTime: data.GL1_PDRQ || '-', // 评定日期
|
||||||
};
|
}
|
||||||
|
|
||||||
// 更新照片列表 - 使用隧道照片字段
|
// 更新照片列表 - 使用隧道照片字段
|
||||||
const photos = [];
|
const photos = []
|
||||||
if (data.GL1_SDJDKFJS) {
|
if (data.GL1_SDJDKFJS) {
|
||||||
photos.push(data.GL1_SDJDKFJS); // 隧道进洞口照片
|
photos.push(data.GL1_SDJDKFJS) // 隧道进洞口照片
|
||||||
}
|
}
|
||||||
if (data.GL1_SDCDKFJS) {
|
if (data.GL1_SDCDKFJS) {
|
||||||
photos.push(data.GL1_SDCDKFJS); // 隧道出洞口照片
|
photos.push(data.GL1_SDCDKFJS) // 隧道出洞口照片
|
||||||
}
|
}
|
||||||
if (data.GL1_SDDXZP) {
|
if (data.GL1_SDDXZP) {
|
||||||
photos.push(data.GL1_SDDXZP); // 隧道典型照片
|
photos.push(data.GL1_SDDXZP) // 隧道典型照片
|
||||||
}
|
}
|
||||||
if (data.GL1_TP) {
|
if (data.GL1_TP) {
|
||||||
photos.push(data.GL1_TP); // 图片
|
photos.push(data.GL1_TP) // 图片
|
||||||
}
|
}
|
||||||
photoList.value = photos.length > 0 ? photos : [];
|
photoList.value = photos.length > 0 ? photos : []
|
||||||
|
|
||||||
// 更新动态记录 - 隧道信息展示
|
// 更新动态记录 - 隧道信息展示
|
||||||
// dynamicRecords.value = [
|
// dynamicRecords.value = [
|
||||||
@ -371,18 +357,22 @@ const getAffectedObjectTypeId = data => {
|
|||||||
} else if (pointType === '路段') {
|
} else if (pointType === '路段') {
|
||||||
// 更新基本信息 - 根据路段数据库字段映射
|
// 更新基本信息 - 根据路段数据库字段映射
|
||||||
basicInfo.value = {
|
basicInfo.value = {
|
||||||
district: data.rawData.GL1_QXMC || '-', // 起点名称(区县)
|
district: data.rawData.COUNTY_NAME || '-', // 起点名称(区县)
|
||||||
level: data.rawData.GL1_FXDJ || '未评定', // 技术等级
|
level: data.rawData.GL1_FXDJ || '未评定', // 技术等级
|
||||||
levelClass: data.rawData.GL1_FXDJ, // 一二级为一般,三四五级为重大
|
levelClass: data.rawData.GL1_FXDJ, // 一二级为一般,三四五级为重大
|
||||||
roadCode: data.rawData.GL1_LXBH || '-', // 路线编号
|
roadCode: data.rawData.GL1_LXBH || '-', // 路线编号
|
||||||
location: data.pointLocation, // 起点到终点
|
location: data.pointLocation, // 起点到终点
|
||||||
riskDesc: data.rawData.GL1_FXMS || '-', // 风险点
|
riskDesc: data.rawData.GL1_FXMS || '-', // 风险点
|
||||||
discoverTime: data.rawData.GL1_SBSJ || '-', // 发现时间
|
discoverTime: data.rawData.GL1_SBSJ || '-', // 发现时间
|
||||||
};
|
}
|
||||||
|
const photos = []
|
||||||
// 更新照片列表 - 路段一般没有照片
|
// 更新照片列表 - 路段一般没有照片
|
||||||
photoList.value = [];
|
if (getImageUrlList(data.item?.RISK_POINT?.GL1_TP).length > 0) {
|
||||||
|
photos.push(...getImageUrlList(data.item?.RISK_POINT?.GL1_TP || '')) // 图片
|
||||||
|
}
|
||||||
|
photoList.value = photos.length > 0 ? photos : []
|
||||||
|
|
||||||
|
console.log('照片列表:', photos)
|
||||||
// 更新动态记录 - 路段信息展示
|
// 更新动态记录 - 路段信息展示
|
||||||
// dynamicRecords.value = [
|
// dynamicRecords.value = [
|
||||||
// {
|
// {
|
||||||
@ -395,58 +385,58 @@ const getAffectedObjectTypeId = data => {
|
|||||||
// },
|
// },
|
||||||
// ];
|
// ];
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 获取影响点详情数据
|
// 获取影响点详情数据
|
||||||
const getAffectedObjectDetail = async () => {
|
const getAffectedObjectDetail = async () => {
|
||||||
try {
|
try {
|
||||||
let id = '';
|
let id = ''
|
||||||
let apiUrl = '';
|
let apiUrl = ''
|
||||||
const pointType = props.item?.pointType;
|
const pointType = props.item?.pointType
|
||||||
|
|
||||||
if (pointType === '桥梁') {
|
if (pointType === '桥梁') {
|
||||||
id = props.item?.rawData?.GL1_ZJ || '';
|
id = props.item?.rawData?.GL1_ZJ || ''
|
||||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/bridge/${id}`;
|
apiUrl = `/snow-ops-platform/weather-warning/affected-object/bridge/${id}`
|
||||||
} else if (pointType === '边坡') {
|
} else if (pointType === '边坡') {
|
||||||
id = props.item?.rawData?.GL1_ID || '';
|
id = props.item?.rawData?.GL1_ID || ''
|
||||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/slope/${id}`;
|
apiUrl = `/snow-ops-platform/weather-warning/affected-object/slope/${id}`
|
||||||
} else if (pointType === '隧道') {
|
} else if (pointType === '隧道') {
|
||||||
id = props.item?.rawData?.GL1_ZJ || '';
|
id = props.item?.rawData?.GL1_ZJ || ''
|
||||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/tunnel/${id}`;
|
apiUrl = `/snow-ops-platform/weather-warning/affected-object/tunnel/${id}`
|
||||||
} else if (pointType === '路段') {
|
} else if (pointType === '路段') {
|
||||||
id = props.item?.rawData?.GL1ZJ || '';
|
id = props.item?.rawData?.GL1ZJ || ''
|
||||||
apiUrl = `/snow-ops-platform/weather-warning/affected-object/road-section/${id}`;
|
apiUrl = `/snow-ops-platform/weather-warning/affected-object/road-section/${id}`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!id || !apiUrl) {
|
if (!id || !apiUrl) {
|
||||||
console.warn('未找到影响点ID或API地址');
|
console.warn('未找到影响点ID或API地址')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: apiUrl,
|
url: apiUrl,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
})
|
||||||
|
|
||||||
console.log('影响点详情数据:', res);
|
console.log('影响点详情数据:', res)
|
||||||
if (res.code === '00000') {
|
if (res.code === '00000') {
|
||||||
getAffectedObjectTypeId(res.data || {});
|
getAffectedObjectTypeId(res.data || {})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取影响点详情数据失败:', error);
|
console.error('获取影响点详情数据失败:', error)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
newVal => {
|
(newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
// 当弹窗打开时获取数据
|
// 当弹窗打开时获取数据
|
||||||
// getAffectedObjectDetail();
|
// getAffectedObjectDetail();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -209,7 +209,6 @@ import Icon3 from '../../../assets/xiangying/未选中3@2x.png'
|
|||||||
import Icon4 from '../../../assets/xiangying/未选中4@2x.png'
|
import Icon4 from '../../../assets/xiangying/未选中4@2x.png'
|
||||||
|
|
||||||
import { formatDateTime } from '../component/index.js'
|
import { formatDateTime } from '../component/index.js'
|
||||||
onMounted(() => {})
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -332,7 +331,7 @@ const impactData = ref([
|
|||||||
{ name: '影响桥梁', count: 0, icon: Icon0, type: '桥梁' },
|
{ name: '影响桥梁', count: 0, icon: Icon0, type: '桥梁' },
|
||||||
{ name: '影响隧道', count: 0, icon: Icon2, type: '隧道' },
|
{ name: '影响隧道', count: 0, icon: Icon2, type: '隧道' },
|
||||||
{ name: '影响边坡', count: 0, icon: Icon1, type: '边坡' },
|
{ name: '影响边坡', count: 0, icon: Icon1, type: '边坡' },
|
||||||
{ name: '影响项目', count: 0, icon: Icon3, type: '驻地' },
|
{ name: '影响驻地', count: 0, icon: Icon3, type: '驻地' },
|
||||||
])
|
])
|
||||||
// 顶部卡片数据
|
// 顶部卡片数据
|
||||||
const loadBarChartData = async () => {
|
const loadBarChartData = async () => {
|
||||||
@ -367,6 +366,9 @@ const loadBarChartData = async () => {
|
|||||||
|
|
||||||
// 转换英文name为中文
|
// 转换英文name为中文
|
||||||
const convertedData = data.map((item) => {
|
const convertedData = data.map((item) => {
|
||||||
|
if (item.extension == '项目') {
|
||||||
|
item.extension = '驻地'
|
||||||
|
}
|
||||||
const name = nameMap[item.name] || item.name
|
const name = nameMap[item.name] || item.name
|
||||||
return { ...item, name }
|
return { ...item, name }
|
||||||
})
|
})
|
||||||
@ -396,11 +398,6 @@ const getColumnsByType = (type) => {
|
|||||||
边坡: roadColumns,
|
边坡: roadColumns,
|
||||||
驻地: projectColumns,
|
驻地: projectColumns,
|
||||||
}
|
}
|
||||||
// { name: '影响路段', count: 0, icon: Icon4, type: '路段' },
|
|
||||||
// { name: '影响桥梁', count: 0, icon: Icon0, type: '桥梁' },
|
|
||||||
// { name: '影响隧道', count: 0, icon: Icon2, type: '隧道' },
|
|
||||||
// { name: '影响边坡', count: 0, icon: Icon1, type: '边坡' },
|
|
||||||
// { name: '影响项目', count: 0, icon: Icon3, type: '驻地' },
|
|
||||||
return typeMap[type] || bridgeColumns
|
return typeMap[type] || bridgeColumns
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,8 +465,8 @@ const handleSearch = () => {
|
|||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
const handleDetail = (item) => {
|
const handleDetail = (item) => {
|
||||||
emit('detail', item)
|
emit('detail', { ...item, warningId: props.handleImpactItem.warningId })
|
||||||
emit('itemClick', item)
|
emit('itemClick', { ...item, warningId: props.handleImpactItem.warningId })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分页操作
|
// 分页操作
|
||||||
@ -489,7 +486,7 @@ const handleFilterChange = () => {
|
|||||||
}
|
}
|
||||||
// 获取时间参数
|
// 获取时间参数
|
||||||
|
|
||||||
const getTimeParams = () => {
|
const getTimeParams = (type) => {
|
||||||
console.log('原始时间范围:', props.handleImpactItem)
|
console.log('原始时间范围:', props.handleImpactItem)
|
||||||
let countyId = ''
|
let countyId = ''
|
||||||
console.log('区域:', filterForm.value)
|
console.log('区域:', filterForm.value)
|
||||||
@ -498,10 +495,7 @@ const getTimeParams = () => {
|
|||||||
countyId = item.value || ''
|
countyId = item.value || ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let obj = {
|
||||||
return {
|
|
||||||
// start: `${year}-${month}-01 00:00:00`,
|
|
||||||
// end: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
|
||||||
start: formatDateTime(props.getdateRange[0] ? props.getdateRange[0] : props.handleImpactItem.dateRange?.[0] || ''),
|
start: formatDateTime(props.getdateRange[0] ? props.getdateRange[0] : props.handleImpactItem.dateRange?.[0] || ''),
|
||||||
end: formatDateTime(props.getdateRange[1] ? props.getdateRange[1] : props.handleImpactItem.dateRange?.[1] || ''),
|
end: formatDateTime(props.getdateRange[1] ? props.getdateRange[1] : props.handleImpactItem.dateRange?.[1] || ''),
|
||||||
limit: pageSize.value,
|
limit: pageSize.value,
|
||||||
@ -510,6 +504,15 @@ const getTimeParams = () => {
|
|||||||
riskLevel: filterForm.value.pointLevel || '',
|
riskLevel: filterForm.value.pointLevel || '',
|
||||||
roadTypes: filterForm.value.roadType || '',
|
roadTypes: filterForm.value.roadType || '',
|
||||||
}
|
}
|
||||||
|
if (type === '路段' || type === '驻地') {
|
||||||
|
obj.warningId = props.handleImpactItem.warningId || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj
|
||||||
|
// {
|
||||||
|
// // start: `${year}-${month}-01 00:00:00`,
|
||||||
|
// // end: `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`,
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// 处理数据为统一格式
|
// 处理数据为统一格式
|
||||||
const processUnifiedData = (item, type) => {
|
const processUnifiedData = (item, type) => {
|
||||||
@ -757,7 +760,7 @@ const processDataByType = (item, type) => {
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
console.log('获取第', currentPage.value, '页数据, 类型:', cardType.value)
|
console.log('获取第', currentPage.value, '页数据, 类型:', cardType.value)
|
||||||
try {
|
try {
|
||||||
const timeParams = getTimeParams()
|
const timeParams = getTimeParams(cardTypeVal.value)
|
||||||
|
|
||||||
// 根据 cardType 获取对应的 API URL
|
// 根据 cardType 获取对应的 API URL
|
||||||
const apiUrl = getApiUrlByType(cardTypeVal.value)
|
const apiUrl = getApiUrlByType(cardTypeVal.value)
|
||||||
@ -816,26 +819,30 @@ watch(
|
|||||||
total.value = 0
|
total.value = 0
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
cardType.value = '0'
|
cardType.value = '0'
|
||||||
loadBarChartData()
|
|
||||||
console.log('影响点情况=========newVal:', newVal)
|
console.log('影响点情况=========newVal:', newVal)
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
filterForm.value.region = newVal.countyName
|
filterForm.value.region = newVal.countyName
|
||||||
currentPage.value = 1
|
currentPage.value = 1
|
||||||
fetchData()
|
|
||||||
} else {
|
} else {
|
||||||
filterForm.value = {
|
filterForm.value = {
|
||||||
district: '',
|
district: '',
|
||||||
type: '',
|
type: '',
|
||||||
roadConditionType: '',
|
roadConditionType: '',
|
||||||
roadType: '',
|
roadType: '',
|
||||||
|
pointType: '',
|
||||||
}
|
}
|
||||||
|
cardType.value = '0'
|
||||||
}
|
}
|
||||||
|
fetchData()
|
||||||
|
loadBarChartData()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
|
tableColumns.value = bridgeColumns
|
||||||
|
|
||||||
// if (newVal) {
|
// if (newVal) {
|
||||||
// filterForm.value = {
|
// filterForm.value = {
|
||||||
// pointType: '',
|
// pointType: '',
|
||||||
@ -844,9 +851,9 @@ watch(
|
|||||||
// }
|
// }
|
||||||
// tableData.value = []
|
// tableData.value = []
|
||||||
// cardType.value = '0'
|
// cardType.value = '0'
|
||||||
loadBarChartData()
|
// loadBarChartData()
|
||||||
// currentPage.value = 1
|
// currentPage.value = 1
|
||||||
// fetchData()
|
//
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@ -84,13 +84,11 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['update:visible', 'close'])
|
const emit = defineEmits(['update:visible', 'close'])
|
||||||
|
|
||||||
// 统计数值
|
// 统计数值
|
||||||
const nationalRoadMileage = ref(345)
|
|
||||||
const ruralRoadMileage = ref(4333)
|
|
||||||
|
|
||||||
// 里程数据
|
// 里程数据
|
||||||
const mileageData = ref([
|
const mileageData = ref([
|
||||||
{ name: '国省道', value: 345, icon: IconNational, type: 'national' },
|
{ name: '国省道', value: 0, icon: IconNational, type: 'national' },
|
||||||
{ name: '农村公路', value: 4333, icon: IconRuralRoad, type: 'rural' },
|
{ name: '农村公路', value: 0, icon: IconRuralRoad, type: 'rural' },
|
||||||
])
|
])
|
||||||
|
|
||||||
// 当前选中卡片类型
|
// 当前选中卡片类型
|
||||||
@ -183,7 +181,36 @@ const fetchData = async () => {
|
|||||||
console.error('获取巡查里程列表数据失败:', error)
|
console.error('获取巡查里程列表数据失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 获取巡查统计数据
|
||||||
|
const getInspectionStats = async () => {
|
||||||
|
try {
|
||||||
|
let params = {
|
||||||
|
start: '',
|
||||||
|
end: '',
|
||||||
|
}
|
||||||
|
if (props.getdateRange && props.getdateRange.length === 2) {
|
||||||
|
params.start = formatDateTime(props.getdateRange[0])
|
||||||
|
params.end = formatDateTime(props.getdateRange[1])
|
||||||
|
}
|
||||||
|
const res = await request({
|
||||||
|
url: '/snow-ops-platform/yhWgxc/weather-warning/inspection-stats',
|
||||||
|
method: 'GET',
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
console.log('巡查统计数据:', res)
|
||||||
|
if (res.code == '00000' && res.data) {
|
||||||
|
const data = res.data
|
||||||
|
// 更新巡查公路里程
|
||||||
|
mileageData.value[0].value = data.nationalProvincialRoadMileage || '0'
|
||||||
|
mileageData.value[1].value = data.ruralRoadMileage || '0'
|
||||||
|
} else {
|
||||||
|
mileageData.value[0].value = '0'
|
||||||
|
mileageData.value[1].value = '0'
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取巡查统计数据失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
@ -193,6 +220,7 @@ watch(
|
|||||||
currentPage.value = 1
|
currentPage.value = 1
|
||||||
// fetchStatsData()
|
// fetchStatsData()
|
||||||
fetchData()
|
fetchData()
|
||||||
|
getInspectionStats()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
@click="handleClick(item.type)"
|
@click="handleClick(item.type)"
|
||||||
class="stat-card"
|
class="stat-card"
|
||||||
:style="{
|
:style="{
|
||||||
backgroundImage: `url(${cardType === item.type ? selectedIcon : unselectedIcon})`,
|
backgroundImage: `url(${cardType == item.type ? selectedIcon : unselectedIcon})`,
|
||||||
backgroundSize: '100% 100%',
|
backgroundSize: '100% 100%',
|
||||||
backgroundPosition: 'center',
|
backgroundPosition: 'center',
|
||||||
}"
|
}"
|
||||||
@ -43,13 +43,27 @@
|
|||||||
<div class="filter-row">
|
<div class="filter-row">
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span class="filter-label">影响点等级</span>
|
<span class="filter-label">影响点等级</span>
|
||||||
<el-select :teleported="false" v-model="filterForm.pointLevel" placeholder="影响点等级" class="filter-select">
|
<el-select
|
||||||
|
:teleported="false"
|
||||||
|
v-model="filterForm.pointLevel"
|
||||||
|
placeholder="影响点等级"
|
||||||
|
clearable
|
||||||
|
class="filter-select"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
>
|
||||||
<el-option v-for="option in pointLevelOptions" :key="option.value" :label="option.label" :value="option.value" />
|
<el-option v-for="option in pointLevelOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-item">
|
<div class="filter-item">
|
||||||
<span class="filter-label">是否回应</span>
|
<span class="filter-label">是否回应</span>
|
||||||
<el-select :teleported="false" v-model="filterForm.isResponded" placeholder="是否回应" class="filter-select">
|
<el-select
|
||||||
|
:teleported="false"
|
||||||
|
v-model="filterForm.isResponded"
|
||||||
|
placeholder="是否回应"
|
||||||
|
clearable
|
||||||
|
class="filter-select"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
>
|
||||||
<el-option v-for="option in isRespondedOptions" :key="option.value" :label="option.label" :value="option.value" />
|
<el-option v-for="option in isRespondedOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@ -67,7 +81,7 @@
|
|||||||
<!-- 交通主管部门负责人列插槽 -->
|
<!-- 交通主管部门负责人列插槽 -->
|
||||||
<template #trafficDept="{ row }">
|
<template #trafficDept="{ row }">
|
||||||
<div class="person-info">
|
<div class="person-info">
|
||||||
<div class="person-name center">
|
<div class="person-name center" v-if="row.trafficDept.name != '-'">
|
||||||
<span style="margin-right: 5px">{{ row.trafficDept.name }}</span>
|
<span style="margin-right: 5px">{{ row.trafficDept.name }}</span>
|
||||||
<img class="response-icon" :src="row.trafficDept.isResponded ? row.trafficDept.img : row.trafficDept.img" alt />
|
<img class="response-icon" :src="row.trafficDept.isResponded ? row.trafficDept.img : row.trafficDept.img" alt />
|
||||||
</div>
|
</div>
|
||||||
@ -78,7 +92,7 @@
|
|||||||
<!-- 公路机构责任人列插槽 -->
|
<!-- 公路机构责任人列插槽 -->
|
||||||
<template #roadOrg="{ row }">
|
<template #roadOrg="{ row }">
|
||||||
<div class="person-info">
|
<div class="person-info">
|
||||||
<div class="person-name center">
|
<div class="person-name center" v-if="row.roadOrg.name != '-'">
|
||||||
<span style="margin-right: 5px">{{ row.roadOrg.name }}</span>
|
<span style="margin-right: 5px">{{ row.roadOrg.name }}</span>
|
||||||
<img :src="row.roadOrg.img" class="response-icon" alt="" />
|
<img :src="row.roadOrg.img" class="response-icon" alt="" />
|
||||||
</div>
|
</div>
|
||||||
@ -89,7 +103,7 @@
|
|||||||
<!-- 养护站负责人列插槽 -->
|
<!-- 养护站负责人列插槽 -->
|
||||||
<template #maintenance="{ row }">
|
<template #maintenance="{ row }">
|
||||||
<div class="person-info">
|
<div class="person-info">
|
||||||
<div class="person-name center">
|
<div class="person-name center" v-if="row.maintenance.name != '-'">
|
||||||
<span style="margin-right: 5px">{{ row.maintenance.name }}</span>
|
<span style="margin-right: 5px">{{ row.maintenance.name }}</span>
|
||||||
<img :src="row.maintenance.img" class="response-icon" alt="" />
|
<img :src="row.maintenance.img" class="response-icon" alt="" />
|
||||||
</div>
|
</div>
|
||||||
@ -100,7 +114,7 @@
|
|||||||
<!-- 护路员列插槽 -->
|
<!-- 护路员列插槽 -->
|
||||||
<template #roadKeeper="{ row }">
|
<template #roadKeeper="{ row }">
|
||||||
<div class="person-info">
|
<div class="person-info">
|
||||||
<div class="person-name center">
|
<div class="person-name center" v-if="row.roadKeeper.name != '-'">
|
||||||
<span style="margin-right: 5px">{{ row.roadKeeper.name }}</span>
|
<span style="margin-right: 5px">{{ row.roadKeeper.name }}</span>
|
||||||
<img :src="row.roadKeeper.img" class="response-icon" alt="" />
|
<img :src="row.roadKeeper.img" class="response-icon" alt="" />
|
||||||
</div>
|
</div>
|
||||||
@ -108,6 +122,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- 路长列插槽 -->
|
||||||
|
<template #generalStaff="{ row }">
|
||||||
|
<div class="person-info">
|
||||||
|
<div class="person-name center" v-if="row.generalStaff.name != '-'">
|
||||||
|
<span style="margin-right: 5px">{{ row.generalStaff.name }}</span>
|
||||||
|
<img :src="row.generalStaff.img" class="response-icon" alt="" />
|
||||||
|
</div>
|
||||||
|
<span class="person-phone">{{ row.generalStaff.phone }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 回应状态列插槽 -->
|
<!-- 回应状态列插槽 -->
|
||||||
<!-- <template #responseStatusData="{ row }">
|
<!-- <template #responseStatusData="{ row }">
|
||||||
<span class="response-status" :class="row.responseClass">{{
|
<span class="response-status" :class="row.responseClass">{{
|
||||||
@ -286,7 +311,9 @@ const fetchData = async () => {
|
|||||||
end: '',
|
end: '',
|
||||||
offset: (currentPage.value - 1) * pageSize.value,
|
offset: (currentPage.value - 1) * pageSize.value,
|
||||||
limit: pageSize.value,
|
limit: pageSize.value,
|
||||||
warningId: props.responseStatusData.warningId,
|
warningId: props.responseStatusData.warningId || '',
|
||||||
|
riskLevel: filterForm.value.pointLevel || '',
|
||||||
|
isResponded: filterForm.value.isResponded,
|
||||||
}
|
}
|
||||||
if (props.dispatchDateRange && props.dispatchDateRange.length > 0) {
|
if (props.dispatchDateRange && props.dispatchDateRange.length > 0) {
|
||||||
params.start = formatDateTime(props.dispatchDateRange[0]) || ''
|
params.start = formatDateTime(props.dispatchDateRange[0]) || ''
|
||||||
@ -306,6 +333,7 @@ const fetchData = async () => {
|
|||||||
const roadKeeperEvent = item.events?.find((e) => e.noticeRoles?.includes('护路员')) || {}
|
const roadKeeperEvent = item.events?.find((e) => e.noticeRoles?.includes('护路员')) || {}
|
||||||
const roadOrgEvent = item.events?.find((e) => e.noticeRoles?.includes('公路机构')) || {}
|
const roadOrgEvent = item.events?.find((e) => e.noticeRoles?.includes('公路机构')) || {}
|
||||||
const maintenanceEvent = item.events?.find((e) => e.noticeRoles?.includes('养护站')) || {}
|
const maintenanceEvent = item.events?.find((e) => e.noticeRoles?.includes('养护站')) || {}
|
||||||
|
const generalStaffEvent = item.events?.find((e) => e.noticeRoles?.includes('路长')) || {}
|
||||||
|
|
||||||
// 获取最新的催告时间
|
// 获取最新的催告时间
|
||||||
const lastNoticeTime = item.events?.[0]?.lastNoticeTime || ''
|
const lastNoticeTime = item.events?.[0]?.lastNoticeTime || ''
|
||||||
@ -343,8 +371,10 @@ const fetchData = async () => {
|
|||||||
isResponded: roadKeeperEvent.replyState === 'read',
|
isResponded: roadKeeperEvent.replyState === 'read',
|
||||||
},
|
},
|
||||||
generalStaff: {
|
generalStaff: {
|
||||||
name: item.GL1_QLGCS || '-',
|
name: generalStaffEvent.noticeName || '-',
|
||||||
phone: item.GL1_QLGCSDH || '-',
|
phone: generalStaffEvent.noticePhone || '-',
|
||||||
|
img: generalStaffEvent.replyState === 'read' ? respondedIcon : notRespondedIcon,
|
||||||
|
isResponded: generalStaffEvent.replyState === 'read',
|
||||||
},
|
},
|
||||||
|
|
||||||
urgeTime: {
|
urgeTime: {
|
||||||
@ -353,7 +383,10 @@ const fetchData = async () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
total.value = res.data.length
|
total.value = res.total || 0
|
||||||
|
}else{
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取通知实体数据失败:', error)
|
console.error('获取通知实体数据失败:', error)
|
||||||
@ -386,12 +419,38 @@ const handleSearch = () => {
|
|||||||
fetchData()
|
fetchData()
|
||||||
loadBarChartData()
|
loadBarChartData()
|
||||||
}
|
}
|
||||||
|
const handleFilterChange = () => {
|
||||||
|
console.log(filterForm.value)
|
||||||
|
|
||||||
|
filterForm.value.pointLevel = filterForm.value.pointLevel || ''
|
||||||
|
filterForm.value.isResponded = filterForm.value.isResponded
|
||||||
|
currentPage.value = 1
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
|
|
||||||
// 监听visible变化
|
// 监听visible变化
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
|
filterForm.value = {
|
||||||
|
pointType: '',
|
||||||
|
pointLevel: '',
|
||||||
|
region: '',
|
||||||
|
}
|
||||||
|
tableData.value = []
|
||||||
|
cardType.value = '路段'
|
||||||
|
currentPage.value = 1
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
|
fetchData()
|
||||||
|
loadBarChartData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => cardType.value,
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
tableData.value = []
|
||||||
currentPage.value = 1
|
currentPage.value = 1
|
||||||
fetchData()
|
fetchData()
|
||||||
loadBarChartData()
|
loadBarChartData()
|
||||||
@ -404,7 +463,6 @@ watch(
|
|||||||
() => props.dispatchDateRange,
|
() => props.dispatchDateRange,
|
||||||
() => {
|
() => {
|
||||||
if (props.visible) {
|
if (props.visible) {
|
||||||
currentPage.value = 1
|
|
||||||
fetchData()
|
fetchData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -413,7 +471,7 @@ watch(
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 初始化加载顶部卡片数据
|
// 初始化加载顶部卡片数据
|
||||||
loadBarChartData()
|
// loadBarChartData()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -248,10 +248,16 @@ const getLevelClass = (riskLevel) => {
|
|||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
if (newVal) {
|
currentPage.value = 1
|
||||||
currentPage.value = 1
|
filterForm.value.warningLevel = ''
|
||||||
fetchData()
|
filterForm.value.region = ''
|
||||||
}
|
filterForm.value.isEnded = ''
|
||||||
|
filterForm.value.isResponded = ''
|
||||||
|
filterForm.value.district = ''
|
||||||
|
filterForm.value.countyId = ''
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
|
fetchData()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -261,6 +267,14 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
if (props.visible) {
|
if (props.visible) {
|
||||||
currentPage.value = 1
|
currentPage.value = 1
|
||||||
|
filterForm.value.warningLevel = ''
|
||||||
|
filterForm.value.region = ''
|
||||||
|
filterForm.value.isEnded = ''
|
||||||
|
filterForm.value.isResponded = ''
|
||||||
|
filterForm.value.district = ''
|
||||||
|
filterForm.value.countyId = ''
|
||||||
|
tableData.value = []
|
||||||
|
total.value = 0
|
||||||
fetchData()
|
fetchData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -85,7 +85,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:visible', 'close', 'impactClick'])
|
const emit = defineEmits(['update:visible', 'close', 'impactClick', 'impactClickItem'])
|
||||||
|
|
||||||
// 日期范围器
|
// 日期范围器
|
||||||
const dateRange = ref([])
|
const dateRange = ref([])
|
||||||
@ -224,6 +224,7 @@ const fetchWarningData = async () => {
|
|||||||
endTime: item.endTime || '-',
|
endTime: item.endTime || '-',
|
||||||
impactCount: item.affectedCount || 0,
|
impactCount: item.affectedCount || 0,
|
||||||
warningId: item.warningId || '',
|
warningId: item.warningId || '',
|
||||||
|
...item,
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
|
|||||||
@ -17,10 +17,9 @@
|
|||||||
:dataList="centerCardDataList"
|
:dataList="centerCardDataList"
|
||||||
@close="closeCenterCard"
|
@close="closeCenterCard"
|
||||||
@itemClick="handleCenterCardItemClick"
|
@itemClick="handleCenterCardItemClick"
|
||||||
@click="handleCenterCardClick"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<hazardPointSituationDialog v-model:visible="hazardPointSituationDialogVisible" :data="{}" @close="closeHazardPointSituationDialog" />
|
<hazardPointSituationDialog :data="{}" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -1738,15 +1737,14 @@ const handleHazardItemClick = async (item, flag) => {
|
|||||||
const riskLevel = riskLevelMap[item.label] || ''
|
const riskLevel = riskLevelMap[item.label] || ''
|
||||||
await getRiskPointData(riskLevel, item, flag)
|
await getRiskPointData(riskLevel, item, flag)
|
||||||
}
|
}
|
||||||
|
const flag = ref(true)
|
||||||
// 监听 dateRange 变化,重新加载数据
|
// 监听 dateRange 变化,重新加载数据
|
||||||
watch(
|
watch(
|
||||||
() => props.dateRange,
|
() => props.dateRange,
|
||||||
async (newVal, oldVal) => {
|
async (newVal, oldVal) => {
|
||||||
console.log('dateRange 变化:', newVal, oldVal)
|
console.log('dateRange 变化:', newVal, oldVal)
|
||||||
// 先重新加载受影响区县数据
|
// 先重新加载受影响区县数据
|
||||||
clearProjectMarkers() // 清除项目标记
|
await clearProjectMarkers() // 清除项目标记
|
||||||
|
|
||||||
await getAffectedCountyData()
|
await getAffectedCountyData()
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
@ -1767,7 +1765,7 @@ watch(
|
|||||||
// 组件挂载时加载地图
|
// 组件挂载时加载地图
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 获取受影响对象数据
|
// 获取受影响对象数据
|
||||||
getAffectedCountyData()
|
// getAffectedCountyData()
|
||||||
|
|
||||||
// 检查 Leaflet 是否已加载
|
// 检查 Leaflet 是否已加载
|
||||||
if (typeof window.L === 'undefined') {
|
if (typeof window.L === 'undefined') {
|
||||||
@ -2078,7 +2076,7 @@ defineExpose({
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
.center-info-card {
|
.center-info-card {
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
// box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
|||||||
@ -172,36 +172,23 @@ export const formatDateTime = (date) => {
|
|||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录用户操作日志(使用 fetch keepalive 确保页面切换后请求仍能完成)
|
// 记录用户操作日志
|
||||||
export const logUserOperation = (type, command) => {
|
export const logUserOperation = async (type, command) => {
|
||||||
try {
|
const data = { type, command }
|
||||||
const data = { type, command }
|
|
||||||
|
|
||||||
// 使用 fetch 的 keepalive 选项确保页面卸载后请求仍能完成
|
const res = await request({
|
||||||
fetch('/snow-ops-platform/weather-warning/users/logs', {
|
url: '/snow-ops-platform/weather-warning/users/logs',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
data: data,
|
||||||
'Content-Type': 'application/json',
|
})
|
||||||
},
|
console.log('日志请求完成:', res)
|
||||||
body: JSON.stringify(data),
|
if (res.code === '00000') {
|
||||||
keepalive: true, // 关键:确保页面切换后请求仍能完成
|
ElMessage.success('操作日志记录成功')
|
||||||
})
|
} else {
|
||||||
.then((response) => {
|
ElMessage.error(res.message || '操作日志记录失败')
|
||||||
console.log('日志请求完成:', response.status)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('日志请求失败:', error)
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log('日志已触发发送:', data)
|
|
||||||
return true
|
|
||||||
} catch (error) {
|
|
||||||
console.error('记录操作日志失败:', error)
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 打开视频会议
|
// 打开视频会议
|
||||||
export const openVideoConference = async (item) => {
|
export const openVideoConference = async (item) => {
|
||||||
console.log('打开视频会议:', item)
|
console.log('打开视频会议:', item)
|
||||||
@ -229,6 +216,8 @@ export const openVideoConference = async (item) => {
|
|||||||
userName: item.name,
|
userName: item.name,
|
||||||
userPhone: item.phone,
|
userPhone: item.phone,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
type: item.type,
|
||||||
|
role: item.role,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
text: '打开视频会议',
|
text: '打开视频会议',
|
||||||
}
|
}
|
||||||
@ -270,6 +259,8 @@ export const openVoiceConference = async (item) => {
|
|||||||
userName: item.name,
|
userName: item.name,
|
||||||
userPhone: item.phone,
|
userPhone: item.phone,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
role: item.role,
|
||||||
|
type: item.type,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
text: '打开语音通话',
|
text: '打开语音通话',
|
||||||
}
|
}
|
||||||
@ -297,6 +288,8 @@ export const opencallConference = async (item) => {
|
|||||||
userName: item.name,
|
userName: item.name,
|
||||||
userPhone: item.phone,
|
userPhone: item.phone,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
role: item.role,
|
||||||
|
type: item.type,
|
||||||
userId: '',
|
userId: '',
|
||||||
text: '拨打电话',
|
text: '拨打电话',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -199,10 +199,15 @@
|
|||||||
<controlSituationDialog v-model:visible="dialogVisible.controlSituation" @close="closeDialog('controlSituation')" />
|
<controlSituationDialog v-model:visible="dialogVisible.controlSituation" @close="closeDialog('controlSituation')" />
|
||||||
|
|
||||||
<!-- 调度详情对话框 -->
|
<!-- 调度详情对话框 -->
|
||||||
<dispatchDetailDialog v-model:visible="dialogVisible.dispatchDetail" @close="closeDialog('dispatchDetail')" />
|
<dispatchDetailDialog
|
||||||
|
:dispatchDateRange="dispatchDateRange"
|
||||||
|
v-model:visible="dialogVisible.dispatchDetail"
|
||||||
|
@close="closeDialog('dispatchDetail')"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 调度区县情况对话框 -->
|
<!-- 调度区县情况对话框 -->
|
||||||
<dispatchDistrictDialog
|
<dispatchDistrictDialog
|
||||||
|
:dispatchDateRange="dispatchDateRange"
|
||||||
v-model:visible="dialogVisible.dispatchDistrict"
|
v-model:visible="dialogVisible.dispatchDistrict"
|
||||||
@close="closeDialog('dispatchDistrict')"
|
@close="closeDialog('dispatchDistrict')"
|
||||||
@dispatchClick="openDialog('dispatchDetail')"
|
@dispatchClick="openDialog('dispatchDetail')"
|
||||||
@ -240,7 +245,11 @@
|
|||||||
<offlineHelpDialog v-model:visible="dialogVisible.offlineHelp" @close="closeDialog('offlineHelp')" />
|
<offlineHelpDialog v-model:visible="dialogVisible.offlineHelp" @close="closeDialog('offlineHelp')" />
|
||||||
|
|
||||||
<!-- 抽查人次对话框 -->
|
<!-- 抽查人次对话框 -->
|
||||||
<imageInspectionDialog v-model:visible="dialogVisible.imageInspection" @close="closeDialog('imageInspection')" />
|
<imageInspectionDialog
|
||||||
|
v-model:visible="dialogVisible.imageInspection"
|
||||||
|
:dispatchDateRange="dispatchDateRange"
|
||||||
|
@close="closeDialog('imageInspection')"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 巡查里程对话框 -->
|
<!-- 巡查里程对话框 -->
|
||||||
<patrolMileageDialog v-model:visible="dialogVisible.patrolMileage" :getdateRange="getdateRange" @close="closeDialog('patrolMileage')" />
|
<patrolMileageDialog v-model:visible="dialogVisible.patrolMileage" :getdateRange="getdateRange" @close="closeDialog('patrolMileage')" />
|
||||||
@ -595,6 +604,7 @@ const handleCenterCardClick = (item) => {
|
|||||||
title: getCardTitleByType(item.type),
|
title: getCardTitleByType(item.type),
|
||||||
dataList: item.data,
|
dataList: item.data,
|
||||||
}
|
}
|
||||||
|
if (item.type == 'second') return
|
||||||
chongqingMapRef.value.openCenterCard(cardData)
|
chongqingMapRef.value.openCenterCard(cardData)
|
||||||
|
|
||||||
// 如果数据中包含区县信息,定位到第一个区县
|
// 如果数据中包含区县信息,定位到第一个区县
|
||||||
@ -672,6 +682,16 @@ const mapBase = useMapBase(mapStore)
|
|||||||
* 组件挂载后初始化地图
|
* 组件挂载后初始化地图
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 首先尝试从 URL 获取 token
|
||||||
|
const urlParams = new URLSearchParams(window.location.search)
|
||||||
|
const urlToken = urlParams.get('token')
|
||||||
|
console.log('从 URL 获取的 token:', urlToken)
|
||||||
|
if (urlToken) {
|
||||||
|
// 更新本地存储
|
||||||
|
localStorage.setItem('token', urlToken)
|
||||||
|
sessionStorage.setItem('token', urlToken)
|
||||||
|
console.log('从 URL 获取并更新 token 成功')
|
||||||
|
}
|
||||||
// 加载地图业务底图 并 聚焦中心点
|
// 加载地图业务底图 并 聚焦中心点
|
||||||
mapBase.loadBaseData()
|
mapBase.loadBaseData()
|
||||||
fetchRoadConditionOptions() // 获取路况类型选项
|
fetchRoadConditionOptions() // 获取路况类型选项
|
||||||
|
|||||||
@ -148,24 +148,26 @@ const setRefreshLeftData = inject('setRefreshLeftData')
|
|||||||
// 注入日期范围
|
// 注入日期范围
|
||||||
const getdateRange = inject('getdateRange', ref([]))
|
const getdateRange = inject('getdateRange', ref([]))
|
||||||
|
|
||||||
|
const flag = ref(true)
|
||||||
// 监听日期范围变化,当获取到数据时重新加载
|
// 监听日期范围变化,当获取到数据时重新加载
|
||||||
watch(
|
watch(
|
||||||
() => getdateRange.value,
|
() => getdateRange.value,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
console.log('left.vue 日期范围变化:', newVal)
|
console.log('left.vue 日期范围变化:', newVal)
|
||||||
dateRange.value = JSON.parse(JSON.stringify(newVal))
|
dateRange.value = newVal
|
||||||
|
// dispatchLoadLoad() // 加载调度清单
|
||||||
|
// scheduleStatisticsByCountyLoad() // 加载调度统计
|
||||||
init()
|
init()
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init()
|
// init()
|
||||||
|
|
||||||
// 注册刷新函数给父组件
|
// 注册刷新函数给父组件
|
||||||
if (setRefreshLeftData) {
|
// if (setRefreshLeftData) {
|
||||||
setRefreshLeftData(init)
|
// setRefreshLeftData(init)
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
const init = () => {
|
const init = () => {
|
||||||
roadTypeLoad() // 加载路段类型
|
roadTypeLoad() // 加载路段类型
|
||||||
@ -200,11 +202,13 @@ const handleStatClick = (item) => {
|
|||||||
emit('openResponseStatus')
|
emit('openResponseStatus')
|
||||||
emit('dispatchDateRange', dateRange.value)
|
emit('dispatchDateRange', dateRange.value)
|
||||||
} else if (item.label === '调度区县数') {
|
} else if (item.label === '调度区县数') {
|
||||||
|
emit('dispatchDateRange', dateRange.value)
|
||||||
emit('openDispatchDistrict')
|
emit('openDispatchDistrict')
|
||||||
} else if (item.label === '线下帮扶数') {
|
} else if (item.label === '线下帮扶数') {
|
||||||
emit('openOfflineHelp')
|
emit('openOfflineHelp')
|
||||||
} else if (item.label === '抽查人次') {
|
} else if (item.label === '抽查人次') {
|
||||||
emit('openImageInspection')
|
emit('openImageInspection')
|
||||||
|
emit('dispatchDateRange', dateRange.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,6 +340,7 @@ watch(
|
|||||||
(newVal) => {
|
(newVal) => {
|
||||||
console.log('left.vue 调度响应变化:', newVal)
|
console.log('left.vue 调度响应变化:', newVal)
|
||||||
dispatchLoadLoad()
|
dispatchLoadLoad()
|
||||||
|
scheduleStatisticsByCountyLoad() // 加载调度统计
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
)
|
)
|
||||||
@ -681,37 +686,37 @@ const districtData = ref([])
|
|||||||
const responseStats = ref([
|
const responseStats = ref([
|
||||||
{
|
{
|
||||||
label: '叫应总数',
|
label: '叫应总数',
|
||||||
value: '15',
|
value: '0',
|
||||||
iconClass: 'icon-call',
|
iconClass: 'icon-call',
|
||||||
img: imgCall,
|
img: imgCall,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '已回应数',
|
label: '已回应数',
|
||||||
value: '9',
|
value: '0',
|
||||||
iconClass: 'icon-reply',
|
iconClass: 'icon-reply',
|
||||||
img: imgReply,
|
img: imgReply,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '回应率',
|
label: '回应率',
|
||||||
value: '100%',
|
value: '0%',
|
||||||
iconClass: 'icon-rate',
|
iconClass: 'icon-rate',
|
||||||
img: imgRate,
|
img: imgRate,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '调度区县数',
|
label: '调度区县数',
|
||||||
value: '21',
|
value: '0',
|
||||||
iconClass: 'icon-district',
|
iconClass: 'icon-district',
|
||||||
img: imgDistrict,
|
img: imgDistrict,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '线下帮扶数',
|
label: '线下帮扶数',
|
||||||
value: '12',
|
value: '0',
|
||||||
iconClass: 'icon-help',
|
iconClass: 'icon-help',
|
||||||
img: imgHelp,
|
img: imgHelp,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '抽查人次',
|
label: '抽查人次',
|
||||||
value: '23',
|
value: '0',
|
||||||
iconClass: 'icon-check',
|
iconClass: 'icon-check',
|
||||||
img: imgCheck,
|
img: imgCheck,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -745,18 +745,22 @@ const init = () => {
|
|||||||
|
|
||||||
// 组件挂载时获取数据并注册刷新函数
|
// 组件挂载时获取数据并注册刷新函数
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init()
|
// init()
|
||||||
// 注册刷新函数到父组件
|
// 注册刷新函数到父组件
|
||||||
if (setRefreshRightData) {
|
// if (setRefreshRightData) {
|
||||||
setRefreshRightData(init)
|
// setRefreshRightData(init)
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
|
const flag = ref(true)
|
||||||
watch(
|
watch(
|
||||||
() => getdateRange.value,
|
() => getdateRange.value,
|
||||||
(newVal) => {
|
(newVal, oldVal) => {
|
||||||
|
if (flag.value) {
|
||||||
|
flag.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dateRange.value = JSON.parse(JSON.stringify(newVal))
|
||||||
console.log('right.vue 日期范围变化:', newVal)
|
console.log('right.vue 日期范围变化:', newVal)
|
||||||
dateRange.value = newVal
|
|
||||||
init()
|
init()
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true },
|
{ deep: true, immediate: true },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user