Browse Source

Revert "fix: 代码优化;ui优化; bug修复"

This reverts commit db8f595122.
master
guoapeng 2 weeks ago
parent
commit
ad2e5904a6
  1. 2
      src/assets/styles/element.scss
  2. 3
      src/components/common/BTButton/index.vue
  3. 18
      src/components/common/CascadingSelectModal/index.vue
  4. 54
      src/components/common/DatePicker/index.vue
  5. 23
      src/components/common/SelectModal/index.vue
  6. 44
      src/components/common/SoftKeyboard/index.vue
  7. 44
      src/components/common/SoftKeyboard/moveKeyboard.vue
  8. 8
      src/components/home/Environment.vue
  9. 4
      src/components/setting/Device.vue
  10. 9
      src/components/setting/User.vue
  11. 2
      src/layouts/default.vue
  12. 17
      src/views/audit/index.vue
  13. 5
      src/views/setting/index.vue

2
src/assets/styles/element.scss

@ -1,5 +1,5 @@
:root {
--el-font-size-base: 16px;
--el-font-size-base: 18px;
// --el-button-size: 80px;
--el-color-primary: #1989fa;
//--el-button-active-bg-color: linear-gradient(90deg, #0657C0 24%, #096AE0 101%);

3
src/components/common/BTButton/index.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { useSlots } from 'vue'
import { defineEmits, defineProps, useSlots } from 'vue'
const props = defineProps({
//
@ -113,5 +113,6 @@ const handleClick = (event: MouseEvent) => {
padding-left: 5px;
}
.button{
}
</style>

18
src/components/common/CascadingSelectModal/index.vue

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { FtMessage } from 'libs/message'
import { useHomeStore } from 'stores/homeStore'
import { onBeforeMount, onMounted, ref, toRefs, watchEffect } from 'vue'
import { defineEmits, defineProps, onBeforeMount, onMounted, ref, toRefs, watchEffect } from 'vue'
const props = defineProps({
optionsLeft: {
@ -185,9 +185,7 @@ watchEffect(() => {
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow:
0 10px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
animation: fadeIn 0.2s ease-out;
}
@ -223,7 +221,7 @@ watchEffect(() => {
flex: 1;
padding: 10px 0;
max-height: 15vw;
overflow: hidden;
overflow: hidden
}
.modal-content-right{
flex: 1;
@ -334,13 +332,7 @@ watchEffect(() => {
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
</style>

54
src/components/common/DatePicker/index.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { computed, defineEmits, defineProps, onMounted, onUnmounted, ref, watch } from 'vue'
const props = defineProps({
modelValue: {
@ -105,9 +105,7 @@ onMounted(() => {
})
// props
watch(
() => props.modelValue,
(newVal) => {
watch(() => props.modelValue, (newVal) => {
if (newVal) {
const date = new Date(Number(newVal))
if (!Number.isNaN(date.getTime())) {
@ -122,9 +120,7 @@ watch(
else {
selectedDate.value = null
}
},
{ deep: true },
)
}, { deep: true })
//
const prevMonth = () => {
@ -246,9 +242,7 @@ const isSameDay = (date1: Date, date2: Date | null) => {
return false
}
return (
date1.getFullYear() === date2.getFullYear()
&& date1.getMonth() === date2.getMonth()
&& date1.getDate() === date2.getDate()
date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate()
)
}
@ -313,7 +307,9 @@ onUnmounted(() => {
<button class="nav-btn" @click="prevMonth">
<el-icon><ArrowLeft /></el-icon>
</button>
<span class="current-date"> {{ currentYear }} {{ currentMonth + 1 }} </span>
<span class="current-date">
{{ currentYear }} {{ currentMonth + 1 }}
</span>
<button class="nav-btn" @click="nextMonth">
<el-icon><ArrowRight /></el-icon>
</button>
@ -347,34 +343,19 @@ onUnmounted(() => {
时间:
</div>
<el-select v-model="selectedHour" class="time-select" @change="updateTime">
<el-option
v-for="i in hoursOptions"
:key="i"
:value="i.toString().padStart(2, '0')"
style="font-size: 20px; line-height: 2px; height: 5rem; display: flex; align-items: center"
>
<el-option v-for="i in hoursOptions" :key="i" :value="i.toString().padStart(2, '0')" style="font-size: 20px;line-height: 2px;height: 5rem;display: flex; align-items: center;">
{{ i.toString().padStart(2, '0') }}
</el-option>
</el-select>
<span class="time-separator">:</span>
<el-select v-model="selectedMinute" class="time-select" @change="updateTime">
<el-option
v-for="i in minuteOptions"
:key="i"
:value="i.toString().padStart(2, '0')"
style="font-size: 20px; line-height: 2px; height: 5rem; display: flex; align-items: center"
>
<el-option v-for="i in minuteOptions" :key="i" :value="i.toString().padStart(2, '0')" style="font-size: 20px;line-height: 2px;height: 5rem;display: flex; align-items: center;">
{{ i.toString().padStart(2, '0') }}
</el-option>
</el-select>
<span class="time-separator">:</span>
<el-select v-model="selectedSecond" class="time-select" @change="updateTime">
<el-option
v-for="i in secondOptions"
:key="i"
:value="i.toString().padStart(2, '0')"
style="font-size: 20px; line-height: 2px; height: 5rem; display: flex; align-items: center"
>
<el-option v-for="i in secondOptions" :key="i" :value="i.toString().padStart(2, '0')" style="font-size: 20px;line-height: 2px;height: 5rem;display: flex; align-items: center;">
{{ i.toString().padStart(2, '0') }}
</el-option>
</el-select>
@ -395,7 +376,7 @@ onUnmounted(() => {
<style lang="scss" scoped>
$fontSize: 1.5rem;
:deep(body) {
//--el-font-size-base: 20px;
--el-font-size-base: 20px;
}
.date-time-picker {
position: relative;
@ -439,9 +420,7 @@ $fontSize: 1.5rem;
background-color: white;
border: 1px solid #e2e8f0;
border-radius: 4px;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
z-index: 100;
padding: 12px;
}
@ -583,8 +562,7 @@ select {
gap: 10px;
}
.confirm-btn,
.cancel-btn {
.confirm-btn, .cancel-btn {
padding: 8px 16px;
border: none;
border-radius: 4px;
@ -611,13 +589,11 @@ select {
background-color: #e2e8f0;
}
.fade-enter-active,
.fade-leave-active {
.fade-enter-active, .fade-leave-active {
transition: opacity 0.2s;
}
.fade-enter-from,
.fade-leave-to {
.fade-enter-from, .fade-leave-to {
opacity: 0;
}
//

23
src/components/common/SelectModal/index.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, onMounted, ref, toRefs, watch } from 'vue'
import { computed, defineEmits, defineProps, onMounted, ref, toRefs, watch } from 'vue'
const props = defineProps({
options: {
@ -26,12 +26,9 @@ onMounted(() => {
console.log('selectedValue--', props.selectedValue)
scrollToSelectedItem()
})
watch(
() => props.options,
(newVal) => {
watch(() => props.options, (newVal) => {
options.value = newVal
},
)
})
const optionsList = ref<HTMLUListElement | null>(null)
const scrollToSelectedItem = () => {
if (!optionsList.value) {
@ -126,9 +123,7 @@ const handleCancel = () => {
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow:
0 10px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
animation: fadeIn 0.2s ease-out;
}
@ -264,14 +259,8 @@ const handleCancel = () => {
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
.select-font {
font-size: 20px;

44
src/components/common/SoftKeyboard/index.vue

@ -2,7 +2,7 @@
import pinyinDict from 'libs/pinyinDict.json'
import { useDeviceStore } from 'stores/deviceStore'
import type { Ref } from 'vue'
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
import { computed, defineEmits, defineProps, onMounted, ref, watch, watchEffect } from 'vue'
const props = defineProps<{
modelValue: string
@ -50,15 +50,12 @@ watchEffect(() => {
inputValue.value = props.modelValue
})
watch(
() => props.isVisible,
(newVal) => {
watch(() => props.isVisible, (newVal) => {
console.log('deviceStete.deviceType--2-', deviceStete.isLowCost)
if (!deviceStete.isLowCost) {
isOpen.value = newVal
}
},
)
})
const activeKey = ref('')
const keyboardLayout = computed(() => {
@ -210,12 +207,7 @@ const handleTouchEnd = () => {
v-for="(cnName, cnIndex) in cnList"
:key="cnIndex"
class="cn-name"
@click="
e => {
e.stopPropagation();
handleKeyCn(cnName);
}
"
@click="(e) => { e.stopPropagation(); handleKeyCn(cnName) }"
>
{{ cnName }}
</div>
@ -233,28 +225,12 @@ const handleTouchEnd = () => {
'key-text': key !== ' ' && keyboardType === 'text',
}"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'"
@click="
e => {
e.stopPropagation();
handleKeyPress(key);
}
"
@click="(e) => {
e.stopPropagation()
handleKeyPress(key)
}"
>
{{
key === ' '
? '空格'
: key === 'del'
? '删除'
: key === 'enter'
? '确认'
: key === 'close'
? '关闭'
: key === 'cn'
? '英文'
: key === 'en'
? '拼音'
: key
}}
{{ key === ' ' ? '空格' : key === 'del' ? '删除' : key === 'enter' ? '确认' : key === 'close' ? '关闭' : key === 'cn' ? '英文' : key === 'en' ? '拼音' : key }}
</button>
</div>
</div>
@ -345,7 +321,7 @@ const handleTouchEnd = () => {
.key-space {
margin-top: 3.5px;
width: 75vw;
width: 75vw;;
}
.key-special {

44
src/components/common/SoftKeyboard/moveKeyboard.vue

@ -1,7 +1,7 @@
<script lang="ts" setup>
import pinyinDict from 'libs/pinyinDict.json'
import type { Ref } from 'vue'
import { computed, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
import { computed, defineEmits, defineProps, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
const props = defineProps<{
modelValue: string
@ -162,12 +162,9 @@ const closeKeyboard = () => {
emits('close')
}
watch(
() => props.isVisible,
(newVal) => {
watch(() => props.isVisible, (newVal) => {
isOpen.value = newVal
},
)
})
//
const handleTouchStart = (e: TouchEvent) => {
@ -227,12 +224,7 @@ const handleTouchEnd = () => {
v-for="(cnName, cnIndex) in cnList"
:key="cnIndex"
class="cn-name"
@click="
e => {
e.stopPropagation();
handleKeyCn(cnName);
}
"
@click="(e) => { e.stopPropagation(); handleKeyCn(cnName) }"
>
{{ cnName }}
</div>
@ -250,28 +242,12 @@ const handleTouchEnd = () => {
'key-text': key !== ' ' && keyboardType === 'text',
}"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'"
@click="
e => {
e.stopPropagation();
handleKeyPress(key);
}
"
@click="(e) => {
e.stopPropagation()
handleKeyPress(key)
}"
>
{{
key === ' '
? '空格'
: key === 'del'
? '删除'
: key === 'enter'
? '确认'
: key === 'close'
? '关闭'
: key === 'cn'
? '英文'
: key === 'en'
? '拼音'
: key
}}
{{ key === ' ' ? '空格' : key === 'del' ? '删除' : key === 'enter' ? '确认' : key === 'close' ? '关闭' : key === 'cn' ? '英文' : key === 'en' ? '拼音' : key }}
</button>
</div>
</div>
@ -342,7 +318,7 @@ const handleTouchEnd = () => {
.key-space {
margin-top: 3.5px;
width: 75vw;
width: 75vw;;
}
.key-special {

8
src/components/home/Environment.vue

@ -60,7 +60,7 @@ onMounted(() => {
温度
</div>
<div class="env-row-value">
{{ !envParams.temp || envParams.temp === -1 ? '--' : roundNumber(envParams.temp, 2) }}°C
{{ envParams.temp === -1 ? '--' : roundNumber(envParams.temp, 2) }}°C
</div>
</div>
<div class="env-row">
@ -68,7 +68,7 @@ onMounted(() => {
相对湿度
</div>
<div class="env-row-value">
{{ !envParams.rh || envParams.rh === -1 ? '--' : roundNumber(envParams.rh, 2) }}%RH
{{ envParams.rh === -1 ? '--' : roundNumber(envParams.rh, 2) }}%RH
</div>
</div>
<div class="env-row odd">
@ -76,7 +76,7 @@ onMounted(() => {
相对饱和度
</div>
<div class="env-row-value">
{{ !envParams.rs || envParams.rs === -1 ? '--' : roundNumber(envParams.rs, 2) }}%RS
{{ envParams.rs === -1 ? '--' : roundNumber(envParams.rs, 2) }}%RS
</div>
</div>
<div class="env-row">
@ -84,7 +84,7 @@ onMounted(() => {
汽化过氧化氢
</div>
<div class="env-row-value">
{{ !envParams.h2o2 || envParams.h2o2 === -1 ? '--' : roundNumber(envParams.h2o2, 2) }}ppm
{{ envParams.h2o2 === -1 ? '--' : roundNumber(envParams.h2o2, 2) }}ppm
</div>
</div>
</template>

4
src/components/setting/Device.vue

@ -40,7 +40,7 @@ const screenHeight = ref(height)
<style lang="scss" scoped>
.device-ul{
background: #f6fafe;
background: #F6FAFE;
height: 4rem;
display: flex;
align-items: center;
@ -48,6 +48,6 @@ const screenHeight = ref(height)
border-radius: 10px;
margin-top: 1rem;
padding-left: 2rem;
font-size: 16px;
font-size: 1.5rem;
}
</style>

9
src/components/setting/User.vue

@ -111,16 +111,19 @@ const handleSelectionChange = (users: User.UserItem[]) => {
<style lang="scss" scoped>
.user {
height: 100%;
height: 84vh;
overflow: hidden;
padding: 10px;
background: $gradient-color;
.add-user {
margin: 10px;
//height: 12%;
display: flex;
align-items: center;
height: 50px;
}
.user-table {
height: calc(100% - 50px);
height: 73vh;
overflow: auto;
}
}
.user-opera {

2
src/layouts/default.vue

@ -400,7 +400,7 @@ const statusMap = {
display: flex;
gap: 5px;
font-size: 1.6vw;
background: rgba(0, 0, 0, 0);
background: white;
transition: background-color 0.5s;
}
.menu-tags {

17
src/views/audit/index.vue

@ -98,10 +98,14 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
<div class="dashboard-container">
<main class="main-content">
<div class="audit-export">
<bt-button type="primary" button-text="导出" @click="onExportRecord" />
<bt-button
type="primary"
button-text="导出"
@click="onExportRecord"
/>
</div>
<div class="audit-table">
<el-table :data="tableData" style="width: 100%" height="100%" @selection-change="handleSelectionChange">
<el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="usrName" label="操作人" width="250" />
<el-table-column prop="behaviorinfo" label="操作内容" />
@ -122,17 +126,18 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
background: $gradient-color;
box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15);
.audit-export{
height: 50px;
padding: 0 10px;
padding: 2vw;
display: flex;
align-items: center;
height: 12%;
}
.audit-table{
max-height: 67vh;
overflow: auto;
height: calc(100% - 100px);
height: 76%;
}
.audit-pagination{
height: 50px;
height: 12%;
display: flex;
align-items: center;
float: right;

5
src/views/setting/index.vue

@ -40,9 +40,9 @@ const selectItem = (menuCode: string) => {
<div v-if="selectedMenuCode === 'defaultFormula'">
<FormulaConfig type="setting" />
</div>
<template v-if="selectedMenuCode === 'user'">
<div v-if="selectedMenuCode === 'user'">
<User />
</template>
</div>
<div v-if="selectedMenuCode === 'date'">
<SystemDate />
</div>
@ -76,7 +76,6 @@ const selectItem = (menuCode: string) => {
background: $gradient-color;
border-radius: 10px;
overflow: hidden;
padding: 10px;
}
}
.menu-container {

Loading…
Cancel
Save