feat: update
parent
3392a46019
commit
bab0f54567
|
|
@ -3,12 +3,12 @@
|
||||||
VITE_API_BASE_URL=
|
VITE_API_BASE_URL=
|
||||||
|
|
||||||
# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
|
# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
|
||||||
# 问答服务地址(本地调试指向本机后端;上线改为 http://192.168.16.49:8081)
|
# 问答服务地址(正式服 http://192.168.16.4:8081;如需本地调试后端可临时改回 localhost:8081)
|
||||||
VITE_AI_CHAT_BASE=http://localhost:8081
|
VITE_AI_CHAT_BASE=http://192.168.16.4:8081
|
||||||
# 问答页面前端地址(iframe 加载用;本地开发是 Vite 5173,生产留空即与 BASE 同源)
|
# 问答页面前端地址(iframe 加载用;正式服 8081 同源托管构建产物,留空即与 BASE 同源)
|
||||||
VITE_AI_CHAT_WEB=http://localhost:5173
|
VITE_AI_CHAT_WEB=
|
||||||
# 免登密钥,须与 mineru 后端 SSO_SECRET 一致。
|
# 免登密钥,须与 mineru 后端 SSO_SECRET 一致(正式服仅认此密钥)。
|
||||||
# 注意:本密钥会随前端打包暴露,后端已做安全边界——该通道仅能开通 viewer
|
# 注意:本密钥会随前端打包暴露,后端已做安全边界——该通道仅能开通 viewer
|
||||||
# (普通问答访客)账号,无法冒充 editor/admin 等特权账号。
|
# (普通问答访客)账号,无法冒充 editor/admin 等特权账号。
|
||||||
VITE_AI_CHAT_SECRET=yunsan-sso-dev-secret
|
VITE_AI_CHAT_SECRET=yunsan-sso-2356b979320df0e4fc086db277cc9bdfe9217dc9ab2f646e
|
||||||
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
|
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
VITE_API_BASE_URL=http://10.104.10.151:8888/juntech-ysdp
|
VITE_API_BASE_URL=http://10.104.10.151:8888/juntech-ysdp
|
||||||
|
|
||||||
# ===== mineru_ai_chat 智能问答(iframe 免登集成) =====
|
# ===== 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 托管构建产物),留空即可
|
# 生产问答页面与后端同源(8081 托管构建产物),留空即可
|
||||||
VITE_AI_CHAT_WEB=
|
VITE_AI_CHAT_WEB=
|
||||||
# 上线前改为正式密钥(与 mineru 容器 SSO_SECRET 一致);通道仅能开通 viewer 账号
|
# 上线前改为正式密钥(与 mineru 容器 SSO_SECRET 一致);通道仅能开通 viewer 账号
|
||||||
VITE_AI_CHAT_SECRET=
|
VITE_AI_CHAT_SECRET=yunsan-sso-2356b979320df0e4fc086db277cc9bdfe9217dc9ab2f646e
|
||||||
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
|
VITE_AI_CHAT_TITLE=AI问答(快速查询应急方案)
|
||||||
|
|
|
||||||
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 |
|
|
@ -206,6 +206,10 @@ var server = {
|
||||||
|
|
||||||
getErpExecPlanCountList() {
|
getErpExecPlanCountList() {
|
||||||
return ysdpPost('/api/getErpExecPlanCountList/v1')
|
return ysdpPost('/api/getErpExecPlanCountList/v1')
|
||||||
|
},
|
||||||
|
|
||||||
|
getErpWorkOrderCountList() {
|
||||||
|
return ysdpPost('/api/getErpWorkOrderCountList/v1')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@
|
||||||
<div class="module-body">
|
<div class="module-body">
|
||||||
<div class="indicator-row">
|
<div class="indicator-row">
|
||||||
<div v-if="topLeft" class="indicator-item indicator-item-top">
|
<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-name">{{ topLeft.baseline }}</div>
|
||||||
<div class="indicator-value">{{ topLeft.challenge }}</div>
|
<div class="indicator-value">{{ topLeft.challenge }}</div>
|
||||||
<div class="indicator-value">{{ topLeft.actual }}</div>
|
<div class="indicator-value">{{ topLeft.actual }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="topRight" class="indicator-item indicator-item-top1">
|
<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-name">{{ topRight.baseline }}</div>
|
||||||
<div class="indicator-value">{{ topRight.challenge }}</div>
|
<div class="indicator-value">{{ topRight.challenge }}</div>
|
||||||
<div class="indicator-value">{{ topRight.actual }}</div>
|
<div class="indicator-value">{{ topRight.actual }}</div>
|
||||||
|
|
@ -16,11 +18,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="indicator-row">
|
<div class="indicator-row">
|
||||||
<div v-if="bottomLeft" class="indicator-item indicator-item-bottom">
|
<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-name">{{ bottomLeft.baseline }}</div>
|
||||||
<div class="indicator-value">{{ bottomLeft.challenge }}</div>
|
<div class="indicator-value">{{ bottomLeft.challenge }}</div>
|
||||||
<div class="indicator-value">{{ bottomLeft.actual }}</div>
|
<div class="indicator-value">{{ bottomLeft.actual }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="bottomRight" class="indicator-item indicator-item-bottom1">
|
<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-name">{{ bottomRight.baseline }}</div>
|
||||||
<div class="indicator-value">{{ bottomRight.challenge }}</div>
|
<div class="indicator-value">{{ bottomRight.challenge }}</div>
|
||||||
<div class="indicator-value">{{ bottomRight.actual }}</div>
|
<div class="indicator-value">{{ bottomRight.actual }}</div>
|
||||||
|
|
@ -110,6 +114,16 @@ onMounted(() => {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
|
||||||
|
.indicator-title {
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
bottom: 100%;
|
||||||
|
left: -80px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.indicator-name {
|
.indicator-name {
|
||||||
position: relative;
|
position: relative;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|
@ -118,6 +132,7 @@ onMounted(() => {
|
||||||
.indicator-value {
|
.indicator-value {
|
||||||
position: relative;
|
position: relative;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
|
|
||||||
const time = ref(new Date().toLocaleString())
|
|
||||||
setInterval(() => time.value = new Date().toLocaleString(), 1000)
|
|
||||||
|
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{ id: 1, newsTitle: '上海轨道交通22号线跨江而过,崇明自此真正融入上海主城圈', issuePosttime: '2026-11-04 9:28:44', simCount: '117', newsUrl: '', status: '0' },
|
{ 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' },
|
{ id: 2, newsTitle: '上海地铁一家老小四人瞬间滚落成一团', issuePosttime: '2026-11-04 9:09:42', simCount: '85', newsUrl: '', status: '0' },
|
||||||
|
|
|
||||||
|
|
@ -9,25 +9,10 @@
|
||||||
<span class="txt-col">7~30</span>
|
<span class="txt-col">7~30</span>
|
||||||
<span class="txt-col">>30</span>
|
<span class="txt-col">>30</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="txt-item txt-item-1">
|
<div v-for="row in typeRows" :key="row.type" class="txt-item" :class="row.cls">
|
||||||
<img src="/imgs/type1.png" alt="">
|
<img :src="row.img" alt="">
|
||||||
<span class="txt-label">站台门</span>
|
<span class="txt-label">{{ row.label }}</span>
|
||||||
<span class="txt-col">0</span><span class="txt-col">0</span><span class="txt-col">0</span>
|
<span class="txt-col">{{ row.le7 }}</span><span class="txt-col">{{ row.mid }}</span><span class="txt-col">{{ row.ge30 }}</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ellipse"></div>
|
<div class="ellipse"></div>
|
||||||
|
|
@ -47,20 +32,69 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed, ref, onMounted } from 'vue'
|
||||||
import VChart from 'vue-echarts'
|
import VChart from 'vue-echarts'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
|
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())}`
|
||||||
const currentYear = now.getFullYear()
|
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',
|
backgroundColor: 'transparent',
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|
@ -86,7 +120,7 @@ const chartOption = computed(() => ({
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: months,
|
data: monthLabels,
|
||||||
name: '月份',
|
name: '月份',
|
||||||
nameLocation: 'end',
|
nameLocation: 'end',
|
||||||
nameGap: 20,
|
nameGap: 20,
|
||||||
|
|
@ -118,7 +152,7 @@ const chartOption = computed(() => ({
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 160,
|
max: axisMax,
|
||||||
interval: 20,
|
interval: 20,
|
||||||
name: '单位:次',
|
name: '单位:次',
|
||||||
nameLocation: 'end',
|
nameLocation: 'end',
|
||||||
|
|
@ -163,7 +197,7 @@ const chartOption = computed(() => ({
|
||||||
name: '维修次数',
|
name: '维修次数',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: '35%',
|
barWidth: '35%',
|
||||||
data: maintenanceData.map(value => ({
|
data: data.map(value => ({
|
||||||
value,
|
value,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
|
@ -194,7 +228,8 @@ const chartOption = computed(() => ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}))
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<ModuleTen />
|
<ModuleTen />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 可拖动悬浮按钮:点击弹出智能问答(iframe 免登);功能暂未开放,先隐藏 -->
|
<!-- 可拖动悬浮按钮:点击弹出智能问答(iframe 免登) -->
|
||||||
<!-- <AiChatFloat /> -->
|
<!-- <AiChatFloat /> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue