feat: update

main
dkwang 2026-11-26 10:51:19 +08:00
parent 3392a46019
commit bab0f54567
10 changed files with 90 additions and 39 deletions

View File

@ -3,12 +3,12 @@
VITE_API_BASE_URL=
# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
# 问答服务地址(本地调试指向本机后端;上线改为 http://192.168.16.49:8081)
VITE_AI_CHAT_BASE=http://localhost:8081
# 问答页面前端地址(iframe 加载用;本地开发是 Vite 5173,生产留空即与 BASE 同源)
VITE_AI_CHAT_WEB=http://localhost:5173
# 免登密钥,须与 mineru 后端 SSO_SECRET 一致。
# 问答服务地址(正式服 http://192.168.16.4:8081;如需本地调试后端可临时改回 localhost:8081)
VITE_AI_CHAT_BASE=http://192.168.16.4:8081
# 问答页面前端地址(iframe 加载用;正式服 8081 同源托管构建产物,留空即与 BASE 同源)
VITE_AI_CHAT_WEB=
# 免登密钥,须与 mineru 后端 SSO_SECRET 一致(正式服仅认此密钥)。
# 注意:本密钥会随前端打包暴露,后端已做安全边界——该通道仅能开通 viewer
# (普通问答访客)账号,无法冒充 editor/admin 等特权账号。
VITE_AI_CHAT_SECRET=yunsan-sso-dev-secret
VITE_AI_CHAT_SECRET=yunsan-sso-2356b979320df0e4fc086db277cc9bdfe9217dc9ab2f646e
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)

View File

@ -2,9 +2,9 @@
VITE_API_BASE_URL=http://10.104.10.151:8888/juntech-ysdp
# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
VITE_AI_CHAT_BASE=http://192.168.16.49:8081
VITE_AI_CHAT_BASE=http://192.168.16.4:8081
# 生产问答页面与后端同源(8081 托管构建产物),留空即可
VITE_AI_CHAT_WEB=
# 上线前改为正式密钥(与 mineru 容器 SSO_SECRET 一致);通道仅能开通 viewer 账号
VITE_AI_CHAT_SECRET=
VITE_AI_CHAT_SECRET=yunsan-sso-2356b979320df0e4fc086db277cc9bdfe9217dc9ab2f646e
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)

BIN
app.zip Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 KiB

After

Width:  |  Height:  |  Size: 608 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 KiB

View File

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

View File

@ -4,11 +4,13 @@
<div class="module-body">
<div class="indicator-row">
<div v-if="topLeft" class="indicator-item indicator-item-top">
<div class="indicator-title">{{ topLeft.type }}</div>
<div class="indicator-name">{{ topLeft.baseline }}</div>
<div class="indicator-value">{{ topLeft.challenge }}</div>
<div class="indicator-value">{{ topLeft.actual }}</div>
</div>
<div v-if="topRight" class="indicator-item indicator-item-top1">
<div class="indicator-title">{{ topRight.type }}</div>
<div class="indicator-name">{{ topRight.baseline }}</div>
<div class="indicator-value">{{ topRight.challenge }}</div>
<div class="indicator-value">{{ topRight.actual }}</div>
@ -16,11 +18,13 @@
</div>
<div class="indicator-row">
<div v-if="bottomLeft" class="indicator-item indicator-item-bottom">
<div class="indicator-title">{{ bottomLeft.type }}</div>
<div class="indicator-name">{{ bottomLeft.baseline }}</div>
<div class="indicator-value">{{ bottomLeft.challenge }}</div>
<div class="indicator-value">{{ bottomLeft.actual }}</div>
</div>
<div v-if="bottomRight" class="indicator-item indicator-item-bottom1">
<div class="indicator-title">{{ bottomRight.type }}</div>
<div class="indicator-name">{{ bottomRight.baseline }}</div>
<div class="indicator-value">{{ bottomRight.challenge }}</div>
<div class="indicator-value">{{ bottomRight.actual }}</div>
@ -110,6 +114,16 @@ onMounted(() => {
color: #fff;
font-style: italic;
.indicator-title {
position: absolute;
top: -30px;
bottom: 100%;
left: -80px;
margin-bottom: 30px;
font-weight: 600;
white-space: nowrap;
}
.indicator-name {
position: relative;
font-weight: 600;
@ -118,6 +132,7 @@ onMounted(() => {
.indicator-value {
position: relative;
font-weight: 600;
margin-top: 6px;
}
}

View File

@ -39,9 +39,6 @@
<script setup>
import { ref, computed, onMounted } from 'vue'
const time = ref(new Date().toLocaleString())
setInterval(() => time.value = new Date().toLocaleString(), 1000)
const list = ref([
{ id: 1, newsTitle: '上海轨道交通22号线跨江而过,崇明自此真正融入上海主城圈', issuePosttime: '2026-11-04 9:28:44', simCount: '117', newsUrl: '', status: '0' },
{ id: 2, newsTitle: '上海地铁一家老小四人瞬间滚落成一团', issuePosttime: '2026-11-04 9:09:42', simCount: '85', newsUrl: '', status: '0' },

View File

@ -9,25 +9,10 @@
<span class="txt-col">7~30</span>
<span class="txt-col">&gt;30</span>
</div>
<div class="txt-item txt-item-1">
<img src="/imgs/type1.png" alt="">
<span class="txt-label">站台门</span>
<span class="txt-col">0</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div>
<div class="txt-item txt-item-2">
<img src="/imgs/type2.png" alt="">
<span class="txt-label">火灾自动报警系统</span>
<span class="txt-col">0</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div>
<div class="txt-item txt-item-3">
<img src="/imgs/type3.png" alt="">
<span class="txt-label">给水和排水</span>
<span class="txt-col">1</span><span class="txt-col">0</span><span class="txt-col">0</span>
</div>
<div class="txt-item txt-item-4">
<img src="/imgs/type4.png" alt="">
<span class="txt-label">站内客运设备</span>
<span class="txt-col">1</span><span class="txt-col">0</span><span class="txt-col">0</span>
<div v-for="row in typeRows" :key="row.type" class="txt-item" :class="row.cls">
<img :src="row.img" alt="">
<span class="txt-label">{{ row.label }}</span>
<span class="txt-col">{{ row.le7 }}</span><span class="txt-col">{{ row.mid }}</span><span class="txt-col">{{ row.ge30 }}</span>
</div>
</div>
<div class="ellipse"></div>
@ -47,20 +32,69 @@
</template>
<script setup>
import { computed } from 'vue'
import { computed, ref, onMounted } from 'vue'
import VChart from 'vue-echarts'
import * as echarts from 'echarts'
import server from '@/utils/service'
const now = new Date()
const pad = (n) => String(n).padStart(2, '0')
const currentDate = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`
const currentYear = now.getFullYear()
const months = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
const monthLabels = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
const maintenanceData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 38, 0]
// 接口返回均为字符串,空串按 0 处理
const num = (v) => (v === '' || v == null ? 0 : Number(v) || 0)
const chartOption = computed(() => ({
// 上方分类计数表:type 编码对应页面行
const typeRows = ref([
{ type: 'ZT000000000000', label: '站台门', img: '/imgs/type1.png', cls: 'txt-item-1', le7: 0, mid: 0, ge30: 0 },
{ type: 'HB000000000000', label: '火灾自动报警系统', img: '/imgs/type2.png', cls: 'txt-item-2', le7: 0, mid: 0, ge30: 0 },
{ type: 'GP000000000000', label: '给水和排水', img: '/imgs/type3.png', cls: 'txt-item-3', le7: 0, mid: 0, ge30: 0 },
{ type: 'ZK000000000000', label: '站内客运设备', img: '/imgs/type4.png', cls: 'txt-item-4', le7: 0, mid: 0, ge30: 0 }
])
// 月度维修次数(取每月 total),无数据月份为 0
const maintenanceData = ref(new Array(12).fill(0))
const fetchErpWorkOrderCount = async () => {
try {
const response = await server.getErpWorkOrderCountList()
if (!response.data.success) return
const { erpErpWorkOrderCount, erpWorkOrderCountList } = response.data.data || {}
// 分类计数:<7 / 7~30 / >30
if (Array.isArray(erpErpWorkOrderCount)) {
typeRows.value.forEach((row) => {
const item = erpErpWorkOrderCount.find((d) => d.type === row.type)
if (item) {
row.le7 = num(item.leSevenCnt)
row.mid = num(item.sevenCnt)
row.ge30 = num(item.geSanShiCnt)
}
})
}
// 柱状图:statMonth -> 月份下标,仅取当年
const data = new Array(12).fill(0)
;(erpWorkOrderCountList || []).forEach((d) => {
if (d.statMonth && d.statMonth.startsWith(String(currentYear))) {
const m = parseInt(d.statMonth.split('-')[1], 10)
if (m >= 1 && m <= 12) data[m - 1] = num(d.total)
}
})
maintenanceData.value = data
} catch (e) {
console.error('设备维修工单统计接口请求失败:', e)
}
}
onMounted(fetchErpWorkOrderCount)
const chartOption = computed(() => {
const data = maintenanceData.value
// 数据可能超过原固定上限 160,按 20 取整动态放大
const axisMax = Math.max(160, Math.ceil(Math.max(...data) / 20) * 20)
return {
backgroundColor: 'transparent',
tooltip: {
trigger: 'axis',
@ -86,7 +120,7 @@ const chartOption = computed(() => ({
},
xAxis: {
type: 'category',
data: months,
data: monthLabels,
name: '月份',
nameLocation: 'end',
nameGap: 20,
@ -118,7 +152,7 @@ const chartOption = computed(() => ({
yAxis: {
type: 'value',
min: 0,
max: 160,
max: axisMax,
interval: 20,
name: '单位:次',
nameLocation: 'end',
@ -163,7 +197,7 @@ const chartOption = computed(() => ({
name: '维修次数',
type: 'bar',
barWidth: '35%',
data: maintenanceData.map(value => ({
data: data.map(value => ({
value,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@ -194,7 +228,8 @@ const chartOption = computed(() => ({
}
}
}]
}))
}
})
</script>
<style lang="scss" scoped>

View File

@ -26,7 +26,7 @@
<ModuleTen />
</div>
<!-- 可拖动悬浮按钮:点击弹出智能问答(iframe 免登);功能暂未开放,先隐藏 -->
<!-- 可拖动悬浮按钮:点击弹出智能问答(iframe 免登) -->
<!-- <AiChatFloat /> -->
</template>