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. 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: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, 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: { yAxis: {
type: 'value', type: 'value',

8
src/components/setting/SystemDate.vue

@ -25,7 +25,7 @@ const onChangeDate = async (value: string) => {
day, day,
}, },
} }
syncSendCmd(dateParams)
await syncSendCmd(dateParams)
const HMS = splitDate[1].split(':') const HMS = splitDate[1].split(':')
// //
@ -65,7 +65,7 @@ onMounted(() => {
:key="systemTime" :key="systemTime"
v-model="systemTime" v-model="systemTime"
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
@change="(val) => onChangeDate(val)"
@change="val => onChangeDate(val)"
/> />
</div> </div>
</div> </div>
@ -73,11 +73,11 @@ onMounted(() => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.date-main{
.date-main {
margin: 2rem; margin: 2rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
.date-com{
.date-com {
font-size: 1.5rem; font-size: 1.5rem;
display: flex; display: flex;
align-items: center; align-items: center;

2
src/stores/systemStore.ts

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

8
src/views/home/index.vue

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

2
src/views/login/index.vue

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

Loading…
Cancel
Save