增加6中新需求
This commit is contained in:
parent
196946d5e9
commit
1c99e06680
|
@ -23,3 +23,18 @@ export const listStatistic = (query?: any): AxiosPromise<any[]> => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const statisticScale = (query?: any): AxiosPromise<any[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/scale/archive/statistic/scale',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const statisticWarn = (query?: any): AxiosPromise<any> => {
|
||||||
|
return request({
|
||||||
|
url: '/scale/archive/statistic/warn',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
|
@ -0,0 +1,122 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="测评统计" v-model="visible" width="800px" append-to-body :close-on-click-modal="false"
|
||||||
|
@close="handleClose">
|
||||||
|
<el-card>
|
||||||
|
<template #header>
|
||||||
|
图表统计
|
||||||
|
</template>
|
||||||
|
<v-chart style="height: 300px;" :option="barOption" autoresize />
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card style="margin-top: 20px;">
|
||||||
|
<template #header>
|
||||||
|
列表统计
|
||||||
|
</template>
|
||||||
|
<el-table :data="tableData">
|
||||||
|
<el-table-column prop="name" label="姓名" />
|
||||||
|
<el-table-column prop="times" label="时间">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-for="item in scope.row.times.split(',')">
|
||||||
|
{{ item }}<br>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="value" label="测评次数" />
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { statisticScale, statisticWarn } from '@/api/archive/information'
|
||||||
|
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import { use } from 'echarts/core'
|
||||||
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
|
import { PieChart, BarChart, LineChart } from "echarts/charts";
|
||||||
|
import { TitleComponent, TooltipComponent, LegendComponent, ToolboxComponent, GridComponent, VisualMapComponent } from "echarts/components";
|
||||||
|
import VChart from 'vue-echarts'
|
||||||
|
|
||||||
|
use([
|
||||||
|
CanvasRenderer,
|
||||||
|
PieChart,
|
||||||
|
BarChart,
|
||||||
|
LineChart,
|
||||||
|
TitleComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
ToolboxComponent,
|
||||||
|
GridComponent,
|
||||||
|
VisualMapComponent
|
||||||
|
]);
|
||||||
|
|
||||||
|
const visible = ref(false)
|
||||||
|
const userId = ref()
|
||||||
|
const openStatistic = (row: any) => {
|
||||||
|
userId.value = row.userId
|
||||||
|
console.log('userId:', userId.value);
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableData = ref<any[]>([])
|
||||||
|
const statisticScaleData = async () => {
|
||||||
|
const { data } = await statisticScale({ userId: userId.value })
|
||||||
|
tableData.value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
const barOption = ref({
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: ['未见异常', '低风险', '中风险', '高风险', '重大风险']
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: [],
|
||||||
|
type: 'bar'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
const statisticWarnData = async () => {
|
||||||
|
const { data: { noneNum, lowNum, middleNum, highNum, majorNum } } = await statisticWarn({ userId: userId.value })
|
||||||
|
|
||||||
|
barOption.value.series[0].data = [
|
||||||
|
noneNum, lowNum, middleNum, highNum, majorNum
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(visible, (newVal, oldVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
statisticScaleData()
|
||||||
|
statisticWarnData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
barOption.value = {
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: ['未见异常', '低风险', '中风险', '高风险', '重大风险']
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: [],
|
||||||
|
type: 'bar'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
tableData.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ openStatistic })
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -61,6 +61,10 @@
|
||||||
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="View" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['evaluation:record:view']">查看</el-button>
|
v-hasPermi="['evaluation:record:view']">查看</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<el-tooltip content="统计" placement="top">
|
||||||
|
<el-button link type="primary" icon="Histogram" @click="handleStatistic(scope.row)"
|
||||||
|
v-hasPermi="['evaluation:record:statistic']">统计</el-button>
|
||||||
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -224,6 +228,8 @@
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<Statistic ref="statisticRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -231,6 +237,7 @@
|
||||||
import { listArchive, listStatistic } from '@/api/archive/information';
|
import { listArchive, listStatistic } from '@/api/archive/information';
|
||||||
import { getEvaluationList } from '@/api/archive/warnRecord';
|
import { getEvaluationList } from '@/api/archive/warnRecord';
|
||||||
import { pageInterveneRecord } from '@/api/archive/interveneRecord';
|
import { pageInterveneRecord } from '@/api/archive/interveneRecord';
|
||||||
|
import Statistic from './components/Statistic.vue';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
|
@ -358,6 +365,11 @@ const handleUpdate = async (row?: any) => {
|
||||||
dialog.title = "查看详情";
|
dialog.title = "查看详情";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const statisticRef = ref()
|
||||||
|
const handleStatistic = (row?: any) => {
|
||||||
|
statisticRef.value?.openStatistic(row)
|
||||||
|
}
|
||||||
|
|
||||||
async function getStaticList() {
|
async function getStaticList() {
|
||||||
const res = await listStatistic(staticQuery.value);
|
const res = await listStatistic(staticQuery.value);
|
||||||
staticList.value = res.rows
|
staticList.value = res.rows
|
||||||
|
|
|
@ -69,7 +69,9 @@
|
||||||
v-hasPermi="['evaluation:record:view']">测评详情</el-button>
|
v-hasPermi="['evaluation:record:view']">测评详情</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="处理" placement="top">
|
<el-tooltip content="处理" placement="top">
|
||||||
<el-button link type="primary" icon="Pointer" @click="handleUpdate(scope.row)"
|
<el-button v-if="scope.row.readFlag == 1" link type="danger" icon="Pointer"
|
||||||
|
@click="handleUpdate(scope.row)" v-hasPermi="['intervene:record:add']">处理</el-button>
|
||||||
|
<el-button v-else link type="primary" icon="Pointer" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['intervene:record:add']">处理</el-button>
|
v-hasPermi="['intervene:record:add']">处理</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="干预列表" placement="top">
|
<el-tooltip content="干预列表" placement="top">
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
|
||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
[env.VITE_APP_BASE_API]: {
|
[env.VITE_APP_BASE_API]: {
|
||||||
target: 'http://localhost:8080/',
|
target: 'http://localhost:8070/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
ws: true,
|
ws: true,
|
||||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||||
|
|
Loading…
Reference in New Issue