|
@@ -1,6 +1,16 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card>
|
|
|
+ <div ref="myChartOne" style="height: 400px;"></div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="text-align: right">
|
|
|
+ <div style="width: 100%;height: 60px;color: #1f2d3d;border: #c03639"></div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="18">
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="0">
|
|
|
<el-form-item label="" prop="modelName" style="margin-right:10px">
|
|
@@ -19,59 +29,68 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6" style="text-align: right">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="Plus"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['hl:bm:add']"
|
|
|
- >新增</el-button>
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['hl:bm:add']"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="bmList" border>
|
|
|
- <el-table-column label="模型ID" align="center" prop="modelId" width="80"/>
|
|
|
- <el-table-column label="模型名称" align="left" prop="modelName" />
|
|
|
- <el-table-column label="昨日健康度" align="center" prop="yesterdayScore" width="180"/>
|
|
|
- <el-table-column label="最近一次健康度得分" align="center" prop="lastScore" width="180"/>
|
|
|
-<!-- <el-table-column label="更新时间" align="left" prop="updateTime" width="180">-->
|
|
|
-<!-- <template #default="scope">-->
|
|
|
-<!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{mi}:{s}') }}</span>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- <el-table-column label="操作" width="480" class-name="small-padding fixed-width" align="left" >
|
|
|
+ <el-table-column label="模型ID" align="center" prop="modelId" width="80"/>
|
|
|
+ <el-table-column label="模型名称" align="left" prop="modelName"/>
|
|
|
+ <el-table-column label="昨日健康度" align="center" prop="yesterdayScore" width="180"/>
|
|
|
+ <el-table-column label="最近一次健康度得分" align="center" prop="lastScore" width="180"/>
|
|
|
+ <!-- <el-table-column label="更新时间" align="left" prop="updateTime" width="180">-->
|
|
|
+ <!-- <template #default="scope">-->
|
|
|
+ <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{mi}:{s}') }}</span>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column label="操作" width="480" class-name="small-padding fixed-width" align="left">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" icon="Position" @click="handleHealthSet(scope.row,'health')">健康度配置</el-button>
|
|
|
- <el-button link type="primary" icon="Calendar" @click="handleHealthSet(scope.row,'history')">历史健康度</el-button>
|
|
|
- <el-button link type="primary" icon="Clock" @click="handleHealthSet(scope.row,'day')">日健康度</el-button>
|
|
|
- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['hl:bm:edit']">修改</el-button>
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['hl:bm:remove']">删除</el-button>
|
|
|
+ <el-button link type="primary" icon="Position" @click="handleHealthSet(scope.row,'health')">健康度配置
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" icon="Calendar" @click="handleHealthSet(scope.row,'history')">历史健康度
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" icon="Clock" @click="handleHealthSet(scope.row,'day')">日健康度</el-button>
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['hl:bm:edit']">修改
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['hl:bm:remove']">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNum"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改业务模型对话框 -->
|
|
|
- <el-dialog :title="title" v-model="open" :width="dialogType ==='health'?'1200px':'800px'" append-to-body :style="dialogType ==='health'?'margin-top:2px!important;':''">
|
|
|
+ <el-dialog :title="title" v-model="open" :width="dialogType ==='health'?'1200px':'800px'" append-to-body
|
|
|
+ :style="dialogType ==='health'?'margin-top:2px!important;':''">
|
|
|
<add-bm-info ref="bmRef" @cancel="open = false" @success="getList" v-if="dialogType==='add'"/>
|
|
|
- <component :is="activeComponent[currentActive]" v-else-if="dialogType!=='add' && open" :modelId="modelId" :dialogType="dialogType"/>
|
|
|
+ <component :is="activeComponent[currentActive]" v-else-if="dialogType!=='add' && open" :modelId="modelId"
|
|
|
+ :dialogType="dialogType"/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name="Bm">
|
|
|
|
|
|
-import { listBm, getBm, delBm, addBm, updateBm } from "@/api/hl/bm";
|
|
|
-import addBmInfo from "./component/addBm.vue"
|
|
|
+import {addBm, delBm, listBm, updateBm} from "@/api/hl/bm";
|
|
|
import healthSetting from "./component/healthSetting.vue"
|
|
|
import historyHealth from "./component/historyHealth.vue"
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
+import * as echarts from 'echarts'
|
|
|
+
|
|
|
+const {proxy} = getCurrentInstance();
|
|
|
|
|
|
const bmList = ref([]);
|
|
|
const open = ref(false);
|
|
@@ -84,8 +103,9 @@ const total = ref(0);
|
|
|
const title = ref("");
|
|
|
const dialogType = ref("add")
|
|
|
const modelId = ref(0)
|
|
|
-const activeComponent = [healthSetting,historyHealth]
|
|
|
-const currentActive=ref(0)
|
|
|
+const activeComponent = [healthSetting, historyHealth]
|
|
|
+const currentActive = ref(0)
|
|
|
+const myChartOne=ref(null)
|
|
|
|
|
|
const data = reactive({
|
|
|
form: {},
|
|
@@ -102,24 +122,44 @@ const data = reactive({
|
|
|
updateTime: null,
|
|
|
remark: null
|
|
|
},
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {}
|
|
|
});
|
|
|
|
|
|
-const { queryParams, form, rules } = toRefs(data);
|
|
|
+const {queryParams, form, rules} = toRefs(data);
|
|
|
|
|
|
-function handleHealthSet(row,type){
|
|
|
+function handleHealthSet(row, type) {
|
|
|
modelId.value = row.modelId
|
|
|
currentActive.value = type === "health" ? 0 : 1
|
|
|
dialogType.value = type
|
|
|
open.value = true
|
|
|
- title.value = type === "health" ? "健康度配置" :(row.modelName + ((type==="day"?"日":"历史")+"健康度"))
|
|
|
+ title.value = type === "health" ? "健康度配置" : (row.modelName + ((type === "day" ? "日" : "历史") + "健康度"))
|
|
|
}
|
|
|
|
|
|
|
|
|
+function initChart() {
|
|
|
+ const myChart = echarts.init(myChartOne.value);
|
|
|
+ const option = {
|
|
|
+ // ECharts 配置项
|
|
|
+ title: {
|
|
|
+ text: 'ECharts 示例'
|
|
|
+ },
|
|
|
+ tooltip: {},
|
|
|
+ xAxis: {
|
|
|
+ data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
|
|
|
+ },
|
|
|
+ yAxis: {},
|
|
|
+ series: [{
|
|
|
+ name: '销量',
|
|
|
+ type: 'bar',
|
|
|
+ data: [5, 20, 36, 10, 10, 20]
|
|
|
+ }]
|
|
|
+ };
|
|
|
+ myChart.setOption(option)
|
|
|
+}
|
|
|
|
|
|
/** 查询业务模型列表 */
|
|
|
function getList() {
|
|
|
+ initChart();
|
|
|
loading.value = true;
|
|
|
listBm(queryParams.value).then(response => {
|
|
|
bmList.value = response.rows;
|
|
@@ -173,7 +213,7 @@ function handleSelectionChange(selection) {
|
|
|
/** 新增按钮操作 */
|
|
|
function handleAdd() {
|
|
|
reset();
|
|
|
- dialogType.value ="add"
|
|
|
+ dialogType.value = "add"
|
|
|
open.value = true;
|
|
|
title.value = "添加业务模型";
|
|
|
proxy.$nextTick(() => {
|
|
@@ -183,12 +223,12 @@ function handleAdd() {
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
function handleUpdate(row) {
|
|
|
- dialogType.value ="add"
|
|
|
- open.value = true;
|
|
|
- title.value = "修改业务模型";
|
|
|
- proxy.$nextTick(() => {
|
|
|
- proxy.$refs["bmRef"].editRow(row)
|
|
|
- })
|
|
|
+ dialogType.value = "add"
|
|
|
+ open.value = true;
|
|
|
+ title.value = "修改业务模型";
|
|
|
+ proxy.$nextTick(() => {
|
|
|
+ proxy.$refs["bmRef"].editRow(row)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** 提交按钮 */
|
|
@@ -215,12 +255,13 @@ function submitForm() {
|
|
|
/** 删除按钮操作 */
|
|
|
function handleDelete(row) {
|
|
|
const _modelIds = row.modelId || ids.value;
|
|
|
- proxy.$modal.confirm('是否确认删除业务模型编号为"' + _modelIds + '"的数据项?').then(function() {
|
|
|
+ proxy.$modal.confirm('是否确认删除业务模型编号为"' + _modelIds + '"的数据项?').then(function () {
|
|
|
return delBm(_modelIds);
|
|
|
}).then(() => {
|
|
|
getList();
|
|
|
proxy.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/** 导出按钮操作 */
|