提交代码

This commit is contained in:
jiangzhe 2024-05-21 14:50:01 +08:00
parent 2d0fd6f920
commit 1cb31209fb
7 changed files with 204 additions and 88 deletions

View File

@ -174,7 +174,17 @@ async function getCompleteData() {
const completePie = [{ name: '已测', value: finishNum }, { name: '未测', value: noneNum }]
completePieOption.value.series[0].data = completePie
const seriesData = [{ name: '已测', data: seriesFinishData, type: 'bar' }, { name: '未测', data: seriesNoneData, type: 'bar' }]
const seriesData = [{
name: '已测', data: seriesFinishData, type: 'bar', label: {
show: true,
position: 'top'
}
}, {
name: '未测', data: seriesNoneData, type: 'bar', label: {
show: true,
position: 'top'
},
}]
completeBarOption.value.xAxis.data = xAxisData
completeBarOption.value.series = seriesData
}
@ -224,7 +234,12 @@ async function getwarnData() {
let xAxisData = ['未见异常', '低风险', '中风险', '高风险', '重大风险']
let seriesList = [noneNum, lowNum, middleNum, highNum, majorNum]
const seriesData = [{ data: seriesList, type: 'bar' }]
const seriesData = [{
data: seriesList, type: 'bar', label: {
show: true,
position: 'top'
}
}]
warBarOption.value.xAxis.data = xAxisData
warBarOption.value.series = seriesData
}
@ -291,6 +306,19 @@ function initPieOption(name = '', data) {
type: 'pie',
radius: '50%',
data: data,
label: {
normal: {
formatter: ['{c|{c}人}', '{b|{b}}'].join('\n'),
rich: {
c: {
lineHeight: 5
},
b: {
height: 44
},
},
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,

View File

@ -202,29 +202,6 @@ const dialog = reactive<DialogOption>({
const activeName = ref('static')
const current = ref({ userId: '', nickName: '' })
const tableData = [
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
]
function handleSituation(situation: any) {
if (situation == 1) {
return '未见异常'

View File

@ -42,8 +42,12 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding" width="280">
<template #default="scope">
<el-tooltip content="测评详情" placement="top">
<el-button link type="primary" icon="View" @click="handleRecord(scope.row)"
v-hasPermi="['intervene:record:add']">测评详情</el-button>
</el-tooltip>
<el-tooltip content="处理" placement="top">
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)"
<el-button link type="primary" icon="Pointer" @click="handleUpdate(scope.row)"
v-hasPermi="['intervene:record:add']">处理</el-button>
</el-tooltip>
<el-tooltip content="干预列表" placement="top">
@ -91,13 +95,60 @@
</el-timeline-item>
</el-timeline>
</el-dialog>
<el-dialog :title="recordDialog.title" v-model="recordDialog.visible" width="800px" append-to-body>
<el-tabs v-model="activeName" class="demo-tabs">
<el-tab-pane label="静态普查记录" name="static">
<el-table :data="staticList" style="width: 100%">
<el-table-column prop="sessionName" label="场次名称" />
<el-table-column prop="scaleName" label="量表名称" />
<el-table-column label="严重度" align="center" prop="situation">
<template #default="scope">
{{ handleSituation(scope.row.situation) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="导出" placement="top">
<el-button link type="primary" icon="View" @click="handleExport(scope.row)"
v-hasPermi="['evaluation:record:export']">导出</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="staticTotal > 0" :total="staticTotal" v-model:page="staticQuery.pageNum"
v-model:limit="staticQuery.pageSize" @pagination="getStaticList" />
</el-tab-pane>
<!-- <el-tab-pane label="动态普查记录" name="dynamic">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="Date" width="180" />
<el-table-column prop="name" label="Name" width="180" />
<el-table-column prop="address" label="Address" />
</el-table>
</el-tab-pane> -->
<!-- <el-tab-pane label="预警干预记录" name="warn">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="Date" width="180" />
<el-table-column prop="name" label="Name" width="180" />
<el-table-column prop="address" label="Address" />
</el-table>
</el-tab-pane> -->
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="WarnRecord" lang="ts">
import { listWarnRecord } from '@/api/archive/warnRecord';
import { WarnRecordVO, WarnRecordQuery, WarnRecordForm } from '@/api/archive/warnRecord/types';
import { listStatistic } from '@/api/archive/information';
import { addInterveneRecord, listInterveneTimes } from '@/api/archive/interveneRecord';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -116,8 +167,13 @@ const dialog = reactive<DialogOption>({
title: ''
});
const listDialog = ref(false)
const recordDialog = reactive<DialogOption>({
visible: false,
title: '测评记录'
});
const listDialog = ref(false)
const activeName = ref('static')
const statusOptions: any[] = []
const initFormData: WarnRecordForm = {
@ -244,6 +300,41 @@ const submitForm = () => {
});
}
const staticQuery = ref({
userId: '',
pageNum: 1,
pageSize: 10
})
const staticTotal = ref(0)
const staticList = ref<any[]>([])
const current = ref({ userId: '', nickName: '' })
const handleRecord = async (row?: any) => {
staticQuery.value.userId = row.userId;
current.value.userId = row.userId
current.value.nickName = row.nickName
getStaticList()
recordDialog.visible = true;
}
async function getStaticList() {
const res = await listStatistic(staticQuery.value);
staticList.value = res.rows
staticTotal.value = res.total
}
function handleExport(row: any) {
proxy?.download('scale/evaluation/record/export', {
scaleId: row.scaleId,
scaleName: row.scaleName,
recordId: row.recordId,
userId: current.value.userId,
nickName: current.value.nickName
}, `${current.value.nickName}.docx`)
}
onMounted(() => {
getList();
});

View File

@ -8,7 +8,13 @@
<div class="main-box">
<div class="item-left">
<div class="item-left-1 boxall">
<div class="alltitle">量表使用统计</div>
<div class="alltitle">量表使用</div>
<div class="box-btn">
<el-radio-group class="custom-radio-group" v-model="leftBar1Radio" fill="#06368B">
<el-radio-button :value="1">当年</el-radio-button>
<el-radio-button :value="2">本月</el-radio-button>
</el-radio-group>
</div>
<div class="boxnav">
<v-chart :option="leftBar1Option" autoresize />
</div>
@ -16,6 +22,12 @@
<div class="item-left-2 boxall">
<div class="alltitle">年级统计</div>
<div class="box-btn">
<el-radio-group v-model="leftBar1Radio" fill="#06368B">
<el-radio-button :value="1">当年</el-radio-button>
<el-radio-button :value="2">本月</el-radio-button>
</el-radio-group>
</div>
<div class="boxnav">
<v-chart :option="leftBar2Option" autoresize />
</div>
@ -47,6 +59,12 @@
<div class="item-center-2 boxall">
<div class="alltitle">风险统计</div>
<div class="box-btn">
<el-radio-group v-model="leftBar1Radio" fill="#06368B">
<el-radio-button :value="1">当年</el-radio-button>
<el-radio-button :value="2">本月</el-radio-button>
</el-radio-group>
</div>
<div class="boxnav">
<v-chart :option="centerBar1Option" autoresize />
</div>
@ -73,54 +91,9 @@
<div class="item" v-for="(item, index) in list" :key="index">
<span>{{ item.sessionName }}</span>
<span>{{ item.value }} / {{ item.total }}</span>
<span>{{ item.expireTime }}</span>
<span>{{ parseTime(item.expireTime, '{y}-{m}-{d}') }}</span>
</div>
</vue3-seamless-scroll>
<!-- <table border="0" cellspacing="0">
<tr>
<th>字段</th>
<th>字段</th>
<th>字段</th>
<th>字段</th>
<th>字段</th>
</tr>
<tr>
<th>字段</th>
<td>8098</td>
<td>19.80%</td>
<td>22</td>
<td>368</td>
</tr>
<tr>
<th>字段</th>
<td>7506</td>
<td>6.70%</td>
<td>22</td>
<td>339</td>
</tr>
<tr>
<th>字段</th>
<td>3261</td>
<td>32.30%</td>
<td>10</td>
<td>325.7</td>
</tr>
<tr>
<th>字段</th>
<td>1993</td>
<td> 201%</td>
<td>10</td>
<td> 199</td>
</tr>
<tr>
<th>字段</th>
<td>1993</td>
<td> 201%</td>
<td>10</td>
<td> 199</td>
</tr>
</table> -->
</div>
</div>
@ -133,6 +106,12 @@
<div class="item-right-2 boxall">
<div class="alltitle">预警统计</div>
<div class="box-btn">
<el-radio-group v-model="leftBar1Radio" fill="#06368B">
<el-radio-button :value="1">当年</el-radio-button>
<el-radio-button :value="2">本月</el-radio-button>
</el-radio-group>
</div>
<div class="boxnav">
<v-chart :option="rightPie2Option" autoresize />
</div>
@ -234,7 +213,14 @@ onBeforeUnmount(() => {
clearInterval(timer);
});
const leftBar1Radio = ref(1)
const leftBar1Option = ref({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '2%',
top: '1%',
@ -253,6 +239,12 @@ const leftBar1Option = ref({
textStyle: {
color: 'rgba(255,255,255,.7)',
fontSize: '0.2rem',
},
formatter: function (value: any) {
if (value.length > 8) {
return `${value.slice(0, 8)}...`
}
return value
}
},
data: []
@ -351,7 +343,6 @@ const leftBar2Option = ref({
}
}
},
yAxis: {
type: 'value',
splitNumber: 4,
@ -764,7 +755,6 @@ const rightBar1Option = ref({
"xAxis": [
{
"type": "category",
data: [],
axisLine: {
lineStyle: {
@ -773,6 +763,7 @@ const rightBar1Option = ref({
}
},
axisLabel: {
interval: 0,
textStyle: {
color: 'rgba(255,255,255,.7)',
fontSize: '0.2rem',
@ -1000,6 +991,10 @@ li {
width: 100vw;
height: 100vh;
// ::v-deep .el-radio-button {
// background-color: red;
// }
header {
position: relative;
height: 1.25rem;
@ -1106,6 +1101,13 @@ li {
margin-top: -.1rem;
}
.box-btn {
position: absolute;
right: 0;
top: 4%;
margin-top: -.1rem;
}
.boxnav {
height: calc(100% - .5rem);
}
@ -1220,7 +1222,7 @@ li {
justify-content: space-around;
span:nth-child(1) {
flex: 0 1 50%;
flex: 0 1 60%;
}
span:nth-child(2) {
@ -1228,7 +1230,7 @@ li {
}
span:nth-child(3) {
flex: 0 1 30%;
flex: 0 1 20%;
}
}
@ -1248,7 +1250,7 @@ li {
justify-content: space-around;
span:nth-child(1) {
flex: 0 1 50%;
flex: 0 1 60%;
}
span:nth-child(2) {
@ -1256,7 +1258,7 @@ li {
}
span:nth-child(3) {
flex: 0 1 30%;
flex: 0 1 20%;
}
}
}

View File

@ -410,6 +410,12 @@ async function getPublishNumData() {
rightBarOption.value.series = seriesData
}
function initChart() {
getPublishNumData()
getWarn4AllData()
getGradeData()
}
const userNum = ref(0)
async function getUserNumData() {
const res = await getUserNum()
@ -439,12 +445,13 @@ onMounted(() => {
getEvaluationNumData()
getWarnNumData()
getInterveneNumData()
getPublishNumData()
getWarn4AllData()
getGradeData()
initChart()
})
onUnmounted(() => {
disposeChart()
})
// import { initWebSocket } from '@/utils/websocket';

View File

@ -82,7 +82,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="量表类型" align="center" prop="scaleTypeName">
<el-table-column label="量表类型" align="center" prop="scaleTypeName" width="150">
<template #default="scope">
<el-space wrap>
<el-tag type="primary" disable-transitions v-for="(item, index) in scope.row.scaleTypeName" :key="index">
@ -93,7 +93,7 @@
</el-table-column>
<el-table-column label="发布次数" align="center" prop="publishNums" />
<el-table-column label="测评时长(分钟)" align="center" prop="scaleTime" />
<el-table-column label="适合人群" align="center" prop="peopleType">
<el-table-column label="适合人群" align="center" prop="peopleType" width="150">
<template #default="scope">
<el-space wrap>
<el-tag type="primary" disable-transitions v-for="(item, index) in scope.row.peopleTypeName" :key="index">

View File

@ -33,9 +33,17 @@
<el-table v-loading="loading" :data="scalePublishList">
<el-table-column label="场次名称" align="center" prop="sessionName" />
<el-table-column label="量表名称 以逗号隔开" align="center" prop="scaleNames" />
<el-table-column label="量表名称" align="center" prop="scaleNames" />
<el-table-column label="班级名称/用户名称" align="center" prop="deptNames">
<el-table-column label="测评类型" align="center">
<template #default="scope">
<el-tag :type="scope.row.deptNames.length > 0 ? 'success' : 'primary'" disable-transitions>
{{ scope.row.deptNames.length > 0 ? '普测' : '个测' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="测评对象" align="center" prop="deptNames">
<template #default="scope">
<span>
{{ scope.row.deptNames.length > 0 ? scope.row.deptNames.join(',') : scope.row.userNames.join(',') }}
@ -43,6 +51,9 @@
</template>
</el-table-column>
<el-table-column label="测评总人数" align="center" prop="totalNum" />
<el-table-column label=" 测评完成人数" align="center" prop="completeNum" />
<el-table-column label="截止日期" align="center" prop="expireTime" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.expireTime, '{y}-{m}-{d}') }}</span>