Browse Source

fix: 时间自动加8小时

master
guoapeng 2 weeks ago
parent
commit
96fcd33af6
  1. 2
      src/components/home/LineChart.vue
  2. 8
      src/components/setting/SystemDate.vue
  3. 8
      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',

8
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>
@ -73,11 +73,11 @@ onMounted(() => {
</template>
<style lang="scss" scoped>
.date-main{
.date-main {
margin: 2rem;
display: flex;
justify-content: center;
.date-com{
.date-com {
font-size: 1.5rem;
display: flex;
align-items: center;

8
src/stores/systemStore.ts

@ -20,7 +20,7 @@ export const useSystemStore = defineStore(
const log = systemLogList.value.find(log => log.uuid === item.uuid)
if (!log) {
if (item.type === 'AppCheckPointCheckFailEvent' && item.errCheckPoints) {
// 传感器检测失败弹窗事件
// 传感器检测失败弹窗事件
item.errCheckPoints.forEach((errCheckPoint) => {
const log: System.SystemLog = {
name: `${errCheckPoint.ecodeInfo}(${errCheckPoint.ecode})`,
@ -32,7 +32,7 @@ export const useSystemStore = defineStore(
})
}
if (item.type === 'AppWarningPromoptEvent') {
// 报警事件
// 报警事件
const log: System.SystemLog = {
name: item.description || '',
status: 'warn',
@ -43,7 +43,7 @@ export const useSystemStore = defineStore(
insertLog(log)
}
if (item.type === 'AppPromoptEvent') {
// 普通弹窗事件
// 普通弹窗事件
const log: System.SystemLog = {
name: item.message || '',
status: 'check',
@ -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