main
dkwang 2026-11-04 13:33:17 +08:00
parent 4f011e0831
commit 2609019d40
4 changed files with 70 additions and 32 deletions

View File

@ -202,6 +202,10 @@ var server = {
cleanApiCache() { cleanApiCache() {
return ysdpPost('/api/cleanApiCache') return ysdpPost('/api/cleanApiCache')
},
getErpExecPlanCountList() {
return ysdpPost('/api/getErpExecPlanCountList/v1')
} }
} }

View File

@ -48,34 +48,64 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref, onMounted } from 'vue'
import server from '@/utils/service'
const now = new Date() const now = new Date()
const pad = (n) => String(n).padStart(2, '0') const pad = (n) => String(n).padStart(2, '0')
const currentDate = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}` const currentDate = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`
// 接口返回均为字符串,空串按 0 处理
const num = (v) => (v === '' || v == null ? 0 : Number(v) || 0)
const totalData = ref({ const totalData = ref({
label: '施工总数', label: '施工总数',
value: 51 value: 0
}) })
const otherData = ref([ const otherData = ref([
{ label: '跨线', value: 2, style: { top: '10%', left: '6%' } }, { label: '跨线', key: 'crossLineCnt', value: 0, style: { top: '10%', left: '6%' } },
{ label: '重大', value: 2, style: { top: '28%', left: '12%' } }, { label: '重大', key: 'majorCnt', value: 0, style: { top: '28%', left: '12%' } },
{ label: '动车', value: 3, style: { top: '15%', right: '28%' } }, { label: '动车', key: 'trainCnt', value: 0, style: { top: '15%', right: '28%' } },
{ label: '停电', value: 2, style: { top: '27%', right: '14%' } }, { label: '停电', key: 'powerOffCnt', value: 0, style: { top: '27%', right: '14%' } },
{ label: '过夜车', value: 3, style: { top: '45%', right: '5%' } }, { label: '过夜车', key: 'overnightCarCnt', value: 0, style: { top: '45%', right: '5%' } },
{ label: '正线留车', value: 0, style: { top: '12%', right: '4%' } }, { label: '正线留车', key: 'stayCarCnt', value: 0, style: { top: '12%', right: '4%' } },
{ label: '施工关联', value: 0, style: { top: '48%', left: '6%' } }, { label: '施工关联', key: 'relateConstructCnt', value: 0, style: { top: '48%', left: '6%' } },
{ label: '突破天窗', value: 0, style: { top: '14%', left: '32%' } } { label: '突破天窗', key: 'breakSkylightCnt', value: 0, style: { top: '14%', left: '32%' } }
]) ])
const tableData = ref([ const tableData = ref([])
{ line: '3 号线', color: '#FBD61D', total: 1, kuaxian: 0, zhongda: 1, dongche: 0, tingdian: 0, guoyeche: 0, zhengxian: 0, shigong: 0, tupo: 0 },
{ line: '4 号线', color: '#451E83', total: 10, kuaxian: 1, zhongda: 1, dongche: 2, tingdian: 0, guoyeche: 0, zhengxian: 0, shigong: 0, tupo: 0 }, // erpExecPlanCountList 字段 -> 表格列映射
{ line: '7 号线', color: '#ED7010', total: 38, kuaxian: 1, zhongda: 0, dongche: 0, tingdian: 2, guoyeche: 3, zhengxian: 0, shigong: 0, tupo: 0 }, const fetchErpExecPlanCount = async () => {
{ line: '15 号线', color: '#C4AF8C', total: 2, kuaxian: 0, zhongda: 0, dongche: 1, tingdian: 0, guoyeche: 0, zhengxian: 0, shigong: 0, tupo: 0 } try {
]) const response = await server.getErpExecPlanCountList()
if (!response.data.success) return
const { erpExecPlanCount, erpExecPlanCountList } = response.data.data || {}
if (erpExecPlanCount) {
totalData.value.value = num(erpExecPlanCount.totalCnt)
otherData.value.forEach((item) => {
item.value = num(erpExecPlanCount[item.key])
})
}
tableData.value = (erpExecPlanCountList || []).map((r) => ({
line: `${num(r.lineNo)} 号线`,
total: num(r.totalCnt),
kuaxian: num(r.crossLineCnt),
zhongda: num(r.majorCnt),
dongche: num(r.trainCnt),
tingdian: num(r.powerOffCnt),
guoyeche: num(r.overnightCarCnt),
zhengxian: num(r.stayCarCnt),
shigong: num(r.relateConstructCnt),
tupo: num(r.breakSkylightCnt)
}))
} catch (e) {
console.error('施工统计接口请求失败:', e)
}
}
onMounted(fetchErpExecPlanCount)
const getLineBgColor = (lineName) => { const getLineBgColor = (lineName) => {
const colors = { const colors = {

View File

@ -43,15 +43,15 @@ const time = ref(new Date().toLocaleString())
setInterval(() => time.value = new Date().toLocaleString(), 1000) setInterval(() => time.value = new Date().toLocaleString(), 1000)
const list = ref([ const list = ref([
{ id: 1, newsTitle: '假日出行,遇地铁门灯闪烁、蜂鸣器响,请停止上下车!', issuePosttime: '2026-09-28 10:10:15', simCount: '53', newsUrl: '', status: '0' }, { id: 1, newsTitle: '上海轨道交通22号线跨江而过,崇明自此真正融入上海主城圈', issuePosttime: '2026-11-04 9:28:44', simCount: '117', newsUrl: '', status: '0' },
{ id: 2, newsTitle: '震惊7号线车次的密集程度,简直是首尾相连速度', issuePosttime: '2026-09-28 09:32:25', simCount: '46', newsUrl: '', status: '0' }, { id: 2, newsTitle: '上海地铁一家老小四人瞬间滚落成一团', issuePosttime: '2026-11-04 9:09:42', simCount: '85', newsUrl: '', status: '0' },
{ id: 3, newsTitle: '转发微博###在上海坐地铁,听到了禁止饮食的广播,还有点惊讶。查了一下北上广的地铁规定,车厢里,北京和广州是禁止吃,但可以喝,上海是吃喝都不让。但是站内和月台上都是让吃喝的。 看了下原因,除了影响其他乘客外,还有一个原因是防止引来老鼠咬坏电缆。 好像地铁里也没见过吃东西的,喝水喝饮料的的有,也没人说啥。', issuePosttime: '2026-09-28 09:09:15', simCount: '42', newsUrl: '', status: '0' }, { id: 3, newsTitle: '上海地铁新版纸质票出站不用塞票,你会用吗?', issuePosttime: '2026-11-04 14:02:03', simCount: '44', newsUrl: '', status: '0' },
{ id: 4, newsTitle: '#上海地铁站已经这么发达了 ? 豫园站6号口(14号线费区外)新设“地铁迎客厅”,可以租赁翻译机、自助退税、“入境通EasyGo”体验、现金提取、外币兑换等功能 #媒体原创', issuePosttime: '2026-09-28 10:15:55', simCount: '31', newsUrl: '', status: '0' }, { id: 4, newsTitle: '上海市民将价值10万元金项链忘在地铁车厢,警方帮助寻回', issuePosttime: '2026-11-04 7:41:15', simCount: '31', newsUrl: '', status: '0' },
{ id: 5, newsTitle: '15号线一直有一股学校洗衣机的味道[融化]', issuePosttime: '2026-09-28 08:34:45', simCount: '22', newsUrl: '', status: '0' }, { id: 5, newsTitle: '车门不是电梯门,不会弹开为你等', issuePosttime: '2026-11-04 12:37:00', simCount: '26', newsUrl: '', status: '0' },
{ id: 6, newsTitle: '世赛叠加中秋!上海地铁临时调整:多线延时运营、定点加开!', issuePosttime: '2026-09-28 08:19:00', simCount: '19', newsUrl: '', status: '0' }, { id: 6, newsTitle: '世赛叠加中秋!上海地铁临时调整:多线延时运营、定点加开!', issuePosttime: '2026-11-04 8:19:00', simCount: '19', newsUrl: '', status: '0' },
{ id: 7, newsTitle: '地铁2号线是联通两个机场和一个高铁站的远行必走线路,大多数时候在世纪大道站乘客只能手提重重的行李箱上下楼梯,不知道这样安排有什么用意,地铁工作人员都是不坐地铁奔赴机场和高铁站的所以不知道普通人出行的艰难吗?@上海地铁shmetro#上海地铁世纪大道##上海地铁##上海·世纪大道(地铁站)[地点]#', issuePosttime: '2026-09-28 07:36:35', simCount: '17', newsUrl: '', status: '0' }, { id: 7, newsTitle: '地铁2号线是联通两个机场和一个高铁站的远行必走线路,大多数时候在世纪大道站乘客只能手提重重的行李箱上下楼梯,不知道这样安排有什么用意,地铁工作人员都是不坐地铁奔赴机场和高铁站的所以不知道普通人出行的艰难吗?@上海地铁shmetro#上海地铁世纪大道##上海地铁##上海·世纪大道(地铁站)[地点]#', issuePosttime: '2026-11-04 07:36:35', simCount: '17', newsUrl: '', status: '0' },
{ id: 8, newsTitle: '今天早上进上海地铁11号线 突然有点穿越时空隧道的感觉 这个设计的有点东西[good]', issuePosttime: '2026-09-28 07:08:51', simCount: '14', newsUrl: '', status: '0' }, { id: 8, newsTitle: '今天早上进上海地铁11号线 突然有点穿越时空隧道的感觉 这个设计的有点东西[good]', issuePosttime: '2026-11-04 07:08:51', simCount: '14', newsUrl: '', status: '0' },
{ id: 9, newsTitle: '上海地铁豫园站近日新设了9幅“诗歌进地铁”系列灯箱,这是上海地铁与上海市翻译家协会合作推出的独属于这座城市的“诗意”。', issuePosttime: '2026-09-28 09:00:00', simCount: '9', newsUrl: '', status: '0' } { id: 9, newsTitle: '上海地铁豫园站近日新设了9幅“诗歌进地铁”系列灯箱,这是上海地铁与上海市翻译家协会合作推出的独属于这座城市的“诗意”。', issuePosttime: '2026-11-04 09:00:00', simCount: '9', newsUrl: '', status: '0' }
]) ])
const processedList = computed(() => list.value.map((item, index) => ({ ...item, originalIndex: index }))) const processedList = computed(() => list.value.map((item, index) => ({ ...item, originalIndex: index })))

View File

@ -12,22 +12,22 @@
<div class="txt-item txt-item-1"> <div class="txt-item txt-item-1">
<img src="/imgs/type1.png" alt=""> <img src="/imgs/type1.png" alt="">
<span class="txt-label">站台门</span> <span class="txt-label">站台门</span>
<span class="txt-col">2</span><span class="txt-col">8</span><span class="txt-col">1</span> <span class="txt-col">0</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div> </div>
<div class="txt-item txt-item-2"> <div class="txt-item txt-item-2">
<img src="/imgs/type2.png" alt=""> <img src="/imgs/type2.png" alt="">
<span class="txt-label">火灾自动报警系统</span> <span class="txt-label">火灾自动报警系统</span>
<span class="txt-col">3</span><span class="txt-col">7</span><span class="txt-col">0</span> <span class="txt-col">0</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div> </div>
<div class="txt-item txt-item-3"> <div class="txt-item txt-item-3">
<img src="/imgs/type3.png" alt=""> <img src="/imgs/type3.png" alt="">
<span class="txt-label">给水和排水</span> <span class="txt-label">给水和排水</span>
<span class="txt-col">1</span><span class="txt-col">7</span><span class="txt-col">2</span> <span class="txt-col">1</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div> </div>
<div class="txt-item txt-item-4"> <div class="txt-item txt-item-4">
<img src="/imgs/type4.png" alt=""> <img src="/imgs/type4.png" alt="">
<span class="txt-label">站内客运设备</span> <span class="txt-label">站内客运设备</span>
<span class="txt-col">2</span><span class="txt-col">8</span><span class="txt-col">0</span> <span class="txt-col">1</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div> </div>
</div> </div>
<div class="ellipse"></div> <div class="ellipse"></div>
@ -58,7 +58,7 @@ const currentYear = now.getFullYear()
const months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] const months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
const maintenanceData = [145, 142, 138, 148, 143, 140, 146, 144, 139, 147, 141, 145] const maintenanceData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 38, 0]
const chartOption = computed(() => ({ const chartOption = computed(() => ({
backgroundColor: 'transparent', backgroundColor: 'transparent',
@ -251,11 +251,15 @@ const chartOption = computed(() => ({
.txt-header { .txt-header {
top: 32px; top: 32px;
left: 220px; // 与数据行同起点同宽度:空 label flex 撑开后,三列表头自动落到数值列位置
padding-left: 48px; left: 40px;
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: rgba(150, 210, 255, 0.85); color: rgba(150, 210, 255, 0.85);
.txt-label {
flex: 1;
}
} }
.txt-item { .txt-item {