Skip to content

Commit

Permalink
v1.1.2发布
Browse files Browse the repository at this point in the history
1.修改细节
2.big页面添加声音报警
3.页面组部分件化
  • Loading branch information
liubin committed Dec 6, 2024
1 parent f92bc5f commit e6c127e
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 65 deletions.
2 changes: 1 addition & 1 deletion web_page/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "carelink_follower",
"private": true,
"version": "1.1.1",
"version": "1.1.2",
"scripts": {
"dev": "vite --mode development",
"local": "vite --mode dev_local",
Expand Down
7 changes: 4 additions & 3 deletions web_page/src/composition/useChartResize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import {ref} from 'vue'

export default function (chart) {
// const chart = ref<any>()
const _chart = chart
const sidebarElm = ref<Element>()
const appMainElm = ref<Element>()
const chartResizeHandler = () => {
if (chart) {
chart.resize()
if (_chart) {
_chart.resize()
}
}

Expand Down Expand Up @@ -81,7 +82,7 @@ export default function (chart) {
}

return {
chart,
chart: _chart,
mounted,
beforeDestroy,
activated,
Expand Down
45 changes: 44 additions & 1 deletion web_page/src/model/classes/Carelink.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Base from "@/model/classes/Base";
import dayjs from "dayjs";
import {DATE_FORMAT} from "@/model/model-type";
import {TIME_RANGE_CONFIG} from "@/views/const";
import {COLORS, TIME_RANGE_CONFIG} from "@/views/const";

export default class Carelink extends Base {
lastSG = {
Expand Down Expand Up @@ -68,3 +68,46 @@ export class SugarSetting extends Base {
}
}
}

export class InTimeBarChartData extends Base {
backgroundColor = '' //设置无背景色
title = {
text: '',
left: 'center',
textStyle: {
fontSize: 16
}
}
tooltip = {
trigger: 'item'
}
label = {
show: true, // 显示标签
position: 'inside',
formatter: '{d}%' // 设置标签格式
}
series = [
{
name: '',
type: 'pie',
radius: '50%',
data: [
{value: '', name: '框内', itemStyle: {color: COLORS[0]}},
{value: '', name: '低于', itemStyle: {color: COLORS[1]}},
{value: '', name: '高于', itemStyle: {color: COLORS[5]}}
]
}
]

constructor(title, timeInRange, obj?: any | undefined) {
super(obj)
if (obj) {
Object.assign(this, obj)
}
this.title.text = title
this.series[0].name = title
timeInRange.forEach((item, index) => {
this.series[0].data[index].value = item
})
}
}
15 changes: 9 additions & 6 deletions web_page/src/views/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export const NOTIFICATION_MAP = {
BC_SID_SG_APPROACH_LOW_LIMIT_CHECK_BG: {
text: `低探头值前报警`,
replace: '',
type: 'warning'
type: 'warning',
alarm: {
repeat: 1
}
},
BC_SID_SG_APPROACH_HIGH_LIMIT_CHECK_BG: {
text: '高探头值前报警',
Expand All @@ -161,23 +164,23 @@ export const NOTIFICATION_MAP = {
replace: 'sg',
type: 'error',
alarm: {
repeat: 1
repeat: 3
}
},
BC_SID_HIGH_SG_CHECK_BG: {
text: '高探头值报警: sg',
replace: 'sg',
type: 'error',
alarm: {
repeat: 1
repeat: 3
}
},
BC_MESSAGE_SG_UNDER_50_MG_DL: {
text: '探头值低于3: sg',
replace: 'sg',
type: 'error',
alarm: {
repeat: 1
repeat: 3
}
},
BC_SID_REPLACE_BATTERY_SOON: {
Expand Down Expand Up @@ -206,7 +209,7 @@ export const NOTIFICATION_MAP = {
replace: null,
type: 'error',
alarm: {
repeat: 1
repeat: 2
}
},
BC_SID_IF_NEW_SENSR_SELCT_START_NEW_ELSE_REWIND: {
Expand Down Expand Up @@ -234,7 +237,7 @@ export const NOTIFICATION_MAP = {
replace: null,
type: 'error',
alarm: {
repeat: 1
repeat: 2
}
},
BC_SID_BASAL_STARTED_SMART_GUARD: {
Expand Down
58 changes: 4 additions & 54 deletions web_page/src/views/index_big.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ import duration from 'dayjs/plugin/duration'
import echarts from "@/plugins/echart"
import {Msg, Tools} from '@/utils/tools'
import {SugarService} from "@/service/sugar-service";
import {COLORS, NOTIFICATION_MAP, SYSTEM_STATUS_MAP,} from "@/views/const";
import {NOTIFICATION_MAP, SYSTEM_STATUS_MAP,} from "@/views/const";
import useSugarCalc from "@/composition/useSugarCalc";
import NotificationDialog from "@/views/components/notificationDialog.vue";
import useSugarCommon from "@/composition/useSugarCommon";
import LogsDialog from "@/views/components/logsDialog.vue";
import {Log} from "@/model/classes/Carelink";
import {InTimeBarChartData, Log} from "@/model/classes/Carelink";
import useChartResize from "@/composition/useChartResize";
import Menus from "@/views/components/menus.vue";
import Trend from "@/views/components/trend.vue";
Expand Down Expand Up @@ -368,58 +368,8 @@ function refreshChart() {
//画图的参数
const charOption = computed(() => {
return {
todayTIRChart: {
backgroundColor: '', //设置无背景色
title: {
text: '今日TIR',
left: 'center'
},
tooltip: {
trigger: 'item'
},
label: {
show: true, // 显示标签
formatter: '{d}%' // 设置标签格式
},
series: [
{
name: '今日TIR',
type: 'pie',
radius: '50%',
data: [
{value: timeInRange.value[0], name: '框内', itemStyle: {color: COLORS[0]}},
{value: timeInRange.value[1], name: '低于', itemStyle: {color: COLORS[1]}},
{value: timeInRange.value[2], name: '高于', itemStyle: {color: COLORS[5]}}
]
}
]
},
todayTTIRChart: {
backgroundColor: '', //设置无背景色
title: {
text: '今日TTIR',
left: 'center'
},
tooltip: {
trigger: 'item'
},
label: {
show: true, // 显示标签
formatter: '{d}%' // 设置标签格式
},
series: [
{
name: '今日TTIR',
type: 'pie',
radius: '50%',
data: [
{value: tightTimeInRange.value[0], name: '框内', itemStyle: {color: COLORS[0]}},
{value: tightTimeInRange.value[1], name: '低于', itemStyle: {color: COLORS[4]}},
{value: tightTimeInRange.value[2], name: '高于', itemStyle: {color: COLORS[5]}}
]
}
]
}
todayTIRChart: new InTimeBarChartData('TIR', timeInRange.value),
todayTTIRChart: new InTimeBarChartData('TTIR', tightTimeInRange.value),
}
})
Expand Down

0 comments on commit e6c127e

Please sign in to comment.