制作健康预警页面

This commit is contained in:
Tao-826 2025-07-14 14:45:15 +08:00
parent 57788019d9
commit 1217eb8153
8 changed files with 344 additions and 105 deletions

96
Jenkinsfile vendored
View File

@ -1,96 +0,0 @@
// Jenkinsfile for Project A
pipeline {
agent any
parameters {
// 项目特定的默认值
string(name: 'GIT_REPO_URL', defaultValue: 'https://your-git-server.com/project-a.git', description: 'Git仓库URL')
string(name: 'GIT_BRANCH', defaultValue: 'main', description: '要拉取的Git分支')
credentials(name: 'GIT_CREDENTIALS_ID', defaultValue: 'your-git-credentials-id', description: 'Git凭证ID', required: false)
string(name: 'BUILD_COMMAND', defaultValue: 'mvn clean package -DskipTests', description: '项目A打包命令') // project-a 的打包命令
string(name: 'DOCKER_REGISTRY_URL', defaultValue: 'your-docker-registry.com', description: 'Docker镜像仓库URL')
string(name: 'DOCKER_IMAGE_NAME', defaultValue: 'project-a-app', description: 'Docker镜像名称') // project-a 的镜像名
string(name: 'IMAGE_BASE_TAG', defaultValue: '1.0', description: '基础镜像标签')
credentials(name: 'DOCKER_CREDENTIALS_ID', defaultValue: 'your-docker-registry-credentials-id', description: 'Docker镜像仓库凭证ID', required: true)
booleanParam(name: 'PUSH_LATEST_TAG', defaultValue: true, description: '是否同时推送 latest 标签?')
}
environment {
FULL_IMAGE_NAME = "${params.DOCKER_REGISTRY_URL}/${params.DOCKER_IMAGE_NAME}"
IMAGE_TAG = "" // 将在 Checkout 后动态设置
}
// tools { ... } // 如果需要
stages {
stage('1. Checkout Code') {
steps {
echo "拉取代码从 ${params.GIT_REPO_URL}, 分支: ${params.GIT_BRANCH}"
cleanWs()
checkout([
$class: 'GitSCM',
branches: [[name: params.GIT_BRANCH]],
userRemoteConfigs: [[
url: params.GIT_REPO_URL,
credentialsId: params.GIT_CREDENTIALS_ID
]],
extensions: [
[$class: 'CloneOption', shallow: true, noTags: true, depth: 1, timeout: 20],
[$class: 'PruneStaleBranch']
]
])
script {
def shortCommit = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
env.IMAGE_TAG = "${params.IMAGE_BASE_TAG}-${BUILD_NUMBER}-${shortCommit}"
echo "生成的镜像TAG: ${env.IMAGE_TAG}"
}
}
}
stage('2. Build and Package Application') {
steps {
echo "开始打包应用: ${params.BUILD_COMMAND}"
sh "${params.BUILD_COMMAND}"
echo "应用打包完成."
}
}
stage('3. Build Docker Image') {
steps {
echo "开始构建Docker镜像: ${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG}"
script {
docker.build("${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG}", "-f Dockerfile .") // 假设 Dockerfile 在根目录
}
echo "Docker镜像构建完成: ${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG}"
}
}
stage('4. Push Docker Image') {
steps {
echo "开始推送Docker镜像到 ${params.DOCKER_REGISTRY_URL}"
script {
docker.withRegistry(params.DOCKER_REGISTRY_URL, params.DOCKER_CREDENTIALS_ID) {
docker.image("${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG}").push()
echo "镜像 ${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG} 推送成功."
if (params.PUSH_LATEST_TAG) {
docker.image("${env.FULL_IMAGE_NAME}:${env.IMAGE_TAG}").push('latest')
echo "镜像 ${env.FULL_IMAGE_NAME}:latest 推送成功."
}
}
}
}
}
}
post {
always {
echo 'Pipeline 结束.'
cleanWs()
}
// success { ... }
// failure { ... }
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

View File

@ -31,13 +31,15 @@ import Home from '@/views/home/index.vue'
import personnePostPhysicalExamination from '@/views/personnePostPhysicalExamination/index.vue'
import personnelHealthMonitoring from '@/views/personnelHealthMonitoring/index.vue'
import personalHealthCenter from '@/views/personalHealthCenter/index.vue'
import healthWarning from '@/views/healthWarning/index.vue'
const currentComponent = shallowRef(null)
const staticRoutes = {
personnePostPhysicalExamination,
personnelHealthMonitoring,
personalHealthCenter
personalHealthCenter,
healthWarning
}
const route = useRoute()

View File

@ -0,0 +1,325 @@
<style scoped lang='scss'>
.layout_card1 {
:deep(.layout_card) {
display: flex;
align-items: center;
justify-content: space-between;
}
.card_round {
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.card_content {
font-size: 16px;
font-weight: 400;
display: flex;
width: 20%;
justify-content: space-between;
}
.card_content_num {
font-size: 18px;
font-weight: bold;
}
}
.layout_card2 {
padding: 20px 0;
.card_content {
display: flex;
justify-content: space-between;
}
}
.layout_title {
font-size: 18px;
font-weight: bold;
}
.layout_chart {
width: 100%;
height: 300px;
}
</style>
<template>
<div class='overall-container'>
<el-row :gutter="20" class="layout_card1">
<el-col :span="12">
<el-card body-class="layout_card">
<div class="card_content">
<div>异常总人数</div>
<div class="card_content_num">100</div>
</div>
<div class="card_round" style="background: #bbc8ef;">
<img src="@/assets/images/pages/icon_abnormal_personnel.png" alt="">
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card body-class="layout_card">
<div class="card_content">
<div>异常类型分布</div>
<div class="card_content_num">3</div>
</div>
<div class="layout_title">主要异常<span style="color: red;">心率异常</span></div>
<div class="card_round" style="background: #ffcc8d;">
<img src="@/assets/images/pages/icon_distribution.png" alt="">
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="20" class="layout_card2">
<el-col :span="12">
<el-card>
<div class="card_content">
<div class="layout_title">异常趋势分析</div>
<div>
<el-button v-for="item in timeRanges" :key="item.value"
:type="activeTimeRange === item.value ? 'primary' : ''"
@click="activeTimeRange = item.value">{{ item.text }}</el-button>
</div>
</div>
<div class="layout_chart" ref="chart1Ref"></div>
</el-card>
</el-col>
<el-col :span="12">
<el-card>
<div class="card_content">
<div class="layout_title">年龄分布分析</div>
<div>
<el-button style="opacity: 0;"></el-button>
</div>
</div>
<div class="layout_chart" ref="chart2Ref"></div>
</el-card>
</el-col>
</el-row>
<el-card>
<div class="layout_title" style="padding-bottom: 20px;">异常记录明细</div>
<div class="search-container">
<el-form class="search-container-from">
<el-form-item label="项目" class="layout-pr10">
<el-select v-model="projectState" placeholder="请选择项目" filterable class="layout-w200">
<el-option v-for="i in projectList" :key="i.Id" :label="i.AC002" :value="i.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标段" class="layout-pr10">
<el-select v-model="sectionState" placeholder="请选择标段" filterable class="layout-w200">
<el-option v-for="i in sectionList" :key="i.Id" :label="i.BC02" :value="i.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="劳务队" class="layout-pr10">
<el-select v-model="laborTeamState" placeholder="请选择劳务队" filterable class="layout-w200">
<el-option v-for="i in laborTeamList" :key="i.Id" :label="i.DC01" :value="i.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="异常类型" class="layout-pr10">
<el-select v-model="exceptionState" placeholder="请选择异常类型" filterable class="layout-w200">
<el-option v-for="i in exceptionList" :key="i.Id" :label="i.Name" :value="i.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item class="layout-pr10">
<el-button type="primary" icon="Search" @click="onSearch">查询</el-button>
</el-form-item>
<el-form-item class="layout-pr10">
<el-button type="primary" icon="ArrowUp" @click="onExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<el-table class="table-container" v-loading="tableLoading" ref="tableRef" :data="tableData" border
:height="tableHeight" width="100%">
<el-table-column label="序号" type="index" align="center" max-width="120" fixed="left" />
<el-table-column prop="A1" label="项目名称" fixed="left" align="left" min-width="180"
show-overflow-tooltip />
<el-table-column prop="A2" label="标段名称" fixed="left" align="left" min-width="180"
show-overflow-tooltip />
<el-table-column prop="A3" label="劳务队名称" fixed="left" align="left" min-width="180"
show-overflow-tooltip />
<el-table-column prop="A4" label="姓名" fixed="left" align="center" min-width="120"
show-overflow-tooltip />
<el-table-column prop="A5" label="性别" fixed="left" align="center" min-width="80"
show-overflow-tooltip />
<el-table-column prop="A6" label="年龄" align="center" min-width="80" show-overflow-tooltip />
<el-table-column prop="A7" label="异常类型" align="center" min-width="80" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.A7 === '血压异常'" color="#bbc8ef" style="color: #344875;">{{ scope.row.A7
}}</el-tag>
<el-tag v-if="scope.row.A7 === '血氧异常'" color="#b4e9e2" style="color: #63b09b;">{{ scope.row.A7
}}</el-tag>
<el-tag v-if="scope.row.A7 === '心率异常'" color="#ffcc8d" style="color: #da8122;">{{ scope.row.A7
}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="A8" label="异常值" align="center" min-width="100" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.A7 === '血压异常'">{{ scope.row.A8 }}mmHG</div>
<div v-if="scope.row.A7 === '血氧异常'">{{ scope.row.A8 }}%</div>
<div v-if="scope.row.A7 === '心率异常'">{{ scope.row.A8 }}BPM</div>
</template>
</el-table-column>
<el-table-column prop="A9" label="发生时间" align="center" min-width="150" show-overflow-tooltip />
</el-table>
<el-pagination class="layout-pagination" :current-page="currentPage" :page-size="pageSize"
:page-sizes="pageSizes" :size="size" :disabled="disabled" :background="background"
layout="total, sizes, prev, pager, next, jumper" :total="tableData.length"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</el-card>
</div>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue'
const timeRanges = [
{ text: '近7天', value: '7' },
{ text: '近30天', value: '30' },
{ text: '近90天', value: '90' }
]
const activeTimeRange = ref('7')
watch(activeTimeRange, (newVal) => {
console.log(newVal);
})
import * as echarts from 'echarts'
const chart2Ref = ref(null)
const renderChart2 = () => {
const chart2 = echarts.init(chart2Ref.value)
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params) {
return params[0].name + '异常主要区间为:' + '<br>' + params[0].value + '岁' + '-' + (params[0].value + params[1].value) + '岁'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
name: '岁',
type: 'value',
min: 18,
max: 65,
axisLine: {
show: true
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed'
}
},
label: {
show: true,
formatter: function (value) {
return value + '岁';
}
}
},
yAxis: {
type: 'category',
splitLine: { show: false },
data: ['心率', '血压', '血氧']
},
series: [
{
name: '背景',
type: 'bar',
stack: 'Total',
itemStyle: {
color: 'rgba(0,0,0,0.05)',
barBorderRadius: 4
},
data: [33, 38, 50]
},
{
name: '指标',
type: 'bar',
stack: 'Total',
label: {
show: true,
position: 'inside',
formatter: (params) => params.data.name,
color: 'white',
fontSize: 14,
fontWeight: 'bold',
borderRadius: 4,
backgroundColor: 'rgba(0,0,0,0.7)',
padding: [2, 8, 2, 8]
},
itemStyle: {
color: (params) => {
const colors = {
'心率': '#FF6B6B',
'血压': '#4ECDC4',
'血氧': '#45B7D1'
};
return colors[params.data.name] || '#999';
},
barBorderRadius: 4
},
data: [
{ value: 5, name: '心率' },
{ value: 5, name: '血压' },
{ value: 5, name: '血氧' }
]
}
]
};
chart2.setOption(option)
}
const projectList = ref([])
const sectionList = ref([])
const projectState = ref('')
const sectionState = ref('')
const laborTeamList = ref([])
const laborTeamState = ref('')
const exceptionState = ref('')
const exceptionList = ref([])
const tableLoading = ref(false)
const tableHeight = ref('55vh')
const size = ref('default')
const tableRef = ref(null)
const currentPage = ref(1)
const pageSize = ref(30)
const pageSizes = ref([30, 50, 100])
const background = ref(true)
const disabled = ref(false)
const tableData = ref([
{ A1: '项目1', A2: '标段1', A3: '劳务队1', A4: '张三', A5: '男', A6: '20', A7: '血压异常', A8: '145/95', A9: '2025-06-10 10:10:10' },
{ A1: '项目2', A2: '标段2', A3: '劳务队2', A4: '李四', A5: '男', A6: '20', A7: '血氧异常', A8: '98', A9: '2025-06-10 10:10:10' },
{ A1: '项目3', A2: '标段3', A3: '劳务队3', A4: '王五', A5: '男', A6: '20', A7: '心率异常', A8: '78', A9: '2025-06-10 10:10:10' },
])
const handleCurrentChange = () => { }
const handleSizeChange = () => { }
const onSearch = () => { }
const onExport = () => { }
onMounted(() => {
renderChart2()
})
</script>

View File

@ -75,16 +75,12 @@
</div>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" min-width="100" align="center">
<el-table-column fixed="right" label="操作" min-width="80" align="center">
<template #default="scope">
<div style="display: flex; justify-content: space-evenly;">
<el-icon style="cursor: pointer;" size="20" color="#409eff" @click="handleView(scope.row)">
<View />
</el-icon>
<el-icon style="cursor: pointer;" size="20" color="#67c23a"
@click="handleDownload(scope.row)">
<Download />
</el-icon>
</div>
</template>
</el-table-column>

View File

@ -149,9 +149,9 @@ const background = ref(true)
const disabled = ref(false)
const size = ref('default')
const tableData = ref([
{ A1: '项目1', A2: '标段1', A14: '劳务队1', A3: '张三', A4: '男', A5: '18', A6: '电工', A7: '2022-01-01', A8: '2022-01-01', A9: '145/95', A10: '80', A11: '101', A12: '37.5', A13: '异常' },
{ A1: '项目1', A2: '标段1', A14: '劳务队2', A3: '张三', A4: '男', A5: '18', A6: '电工', A7: '2022-01-01', A8: '2022-01-01', A9: '120/80', A10: '95', A11: '70', A12: '36.5', A13: '正常' },
{ A1: '项目1', A2: '标段1', A14: '劳务队1', A3: '张三', A4: '男', A5: '18', A6: '电工', A7: '2022-01-01', A8: '2022-01-01', A9: '120/80', A10: '95', A11: '59', A12: '36.5', A13: '正常' },
{ A1: '项目1', A2: '标段1', A14: '劳务队1', A3: '张三', A4: '男', A5: '20', A6: '电工', A7: '2025-06-01', A8: '2025-06-02', A9: '145/95', A10: '80', A11: '101', A12: '37.5', A13: '异常' },
{ A1: '项目2', A2: '标段2', A14: '劳务队2', A3: '张三', A4: '男', A5: '20', A6: '电工', A7: '2025-06-01', A8: '2025-06-02', A9: '120/80', A10: '95', A11: '70', A12: '36.5', A13: '正常' },
{ A1: '项目3', A2: '标段3', A14: '劳务队3', A3: '张三', A4: '男', A5: '20', A6: '电工', A7: '2025-06-01', A8: '2025-06-02', A9: '120/80', A10: '95', A11: '59', A12: '36.5', A13: '正常' },
])
const isBloodPressureNormal = (pressure) => {
if (!pressure) return false;

View File

@ -69,6 +69,18 @@ export default defineConfig(({ mode }) => {
console.log(` Path: ${proxyReq.path}`);
console.log(' Request Headers:', req.headers);
}
},
'/api/jkfzjc': {
target: env.VITE_BASE_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/lmg/, '/api'),
secure: false,
onProxyReq: (proxyReq, req, res) => {
console.log('Proxying request:');
console.log(` Method: ${req.method}`);
console.log(` Path: ${proxyReq.path}`);
console.log(' Request Headers:', req.headers);
}
}
}
},