Browse Source

fix: 时间自动加8小时

master
guoapeng 2 weeks ago
parent
commit
96fcd33af6
  1. 2
      src/components/home/LineChart.vue
  2. 4
      src/components/setting/SystemDate.vue
  3. 2
      src/stores/systemStore.ts
  4. 8
      src/views/home/index.vue
  5. 2
      src/views/login/index.vue

2
src/components/home/LineChart.vue

@ -75,7 +75,7 @@ watch(
xAxis: {
type: 'category',
boundaryGap: false,
data: newValue.data?.map(item => formatDateTime('HH:mm:ss', item.timestamp)),
data: newValue.data?.map(item => formatDateTime('HH:mm:ss', item.timestamp + 8 * 60 * 60 * 1000)),
},
yAxis: {
type: 'value',

4
src/components/setting/SystemDate.vue

@ -25,7 +25,7 @@ const onChangeDate = async (value: string) => {
day,
},
}
syncSendCmd(dateParams)
await syncSendCmd(dateParams)
const HMS = splitDate[1].split(':')
//
@ -65,7 +65,7 @@ onMounted(() => {
:key="systemTime"
v-model="systemTime"
format="YYYY-MM-DD HH:mm:ss"
@change="(val) => onChangeDate(val)"
@change="val => onChangeDate(val)"
/>
</div>
</div>

2
src/stores/systemStore.ts

@ -138,7 +138,7 @@ export const useSystemStore = defineStore(
fnName: 'getTime',
}
const res = await sendCmd(timeParams)
systemTime.value = res.time
systemTime.value = res.time + 8 * 60 * 60 * 1000
}
return {

8
src/views/home/index.vue

@ -132,7 +132,12 @@ const deviceType = computed(() => {
<HomeOperation />
</div>
<!-- 消毒设置 -->
<div class="bottom">
<div
class="bottom"
:style="{
justifyContent: deviceType === deviceStore.deviceTypeMap.PipeDM ? 'space-between' : 'space-evenly',
}"
>
<PressureControl />
<HomeSetting />
</div>
@ -147,7 +152,6 @@ const deviceType = computed(() => {
<style lang="scss" scoped>
.bottom {
display: flex;
justify-content: space-between;
}
$input-height: 3rem;
.home {

2
src/views/login/index.vue

@ -214,7 +214,7 @@ const loginHandle = async () => {
margin-top: 4rem;
}
.login-box {
::v-deep .el-form-item__error {
:deep(.el-form-item__error) {
color: #f56c6c;
font-size: 14px;
font-weight: 600;

Loading…
Cancel
Save