Browse Source

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

master
guoapeng 2 weeks ago
parent
commit
db8f595122
  1. 2
      src/assets/styles/element.scss
  2. 13
      src/components/common/BTButton/index.vue
  3. 20
      src/components/common/CascadingSelectModal/index.vue
  4. 84
      src/components/common/DatePicker/index.vue
  5. 25
      src/components/common/SelectModal/index.vue
  6. 80
      src/components/common/SoftKeyboard/index.vue
  7. 70
      src/components/common/SoftKeyboard/moveKeyboard.vue
  8. 8
      src/components/home/Environment.vue
  9. 6
      src/components/setting/Device.vue
  10. 9
      src/components/setting/User.vue
  11. 2
      src/layouts/default.vue
  12. 25
      src/views/audit/index.vue
  13. 5
      src/views/setting/index.vue

2
src/assets/styles/element.scss

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

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

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

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

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

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

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineEmits, defineProps, onMounted, onUnmounted, ref, watch } from 'vue'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -105,22 +105,26 @@ onMounted(() => {
}) })
// props // props
watch(() => props.modelValue, (newVal) => {
if (newVal) {
const date = new Date(Number(newVal))
if (!Number.isNaN(date.getTime())) {
selectedDate.value = date
currentYear.value = date.getFullYear()
currentMonth.value = date.getMonth()
selectedHour.value = date.getHours().toString().padStart(2, '0')
selectedMinute.value = date.getMinutes().toString().padStart(2, '0')
selectedSecond.value = date.getSeconds().toString().padStart(2, '0')
watch(
() => props.modelValue,
(newVal) => {
if (newVal) {
const date = new Date(Number(newVal))
if (!Number.isNaN(date.getTime())) {
selectedDate.value = date
currentYear.value = date.getFullYear()
currentMonth.value = date.getMonth()
selectedHour.value = date.getHours().toString().padStart(2, '0')
selectedMinute.value = date.getMinutes().toString().padStart(2, '0')
selectedSecond.value = date.getSeconds().toString().padStart(2, '0')
}
} }
}
else {
selectedDate.value = null
}
}, { deep: true })
else {
selectedDate.value = null
}
},
{ deep: true },
)
// //
const prevMonth = () => { const prevMonth = () => {
@ -242,7 +246,9 @@ const isSameDay = (date1: Date, date2: Date | null) => {
return false return false
} }
return ( 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()
) )
} }
@ -307,9 +313,7 @@ onUnmounted(() => {
<button class="nav-btn" @click="prevMonth"> <button class="nav-btn" @click="prevMonth">
<el-icon><ArrowLeft /></el-icon> <el-icon><ArrowLeft /></el-icon>
</button> </button>
<span class="current-date">
{{ currentYear }} {{ currentMonth + 1 }}
</span>
<span class="current-date"> {{ currentYear }} {{ currentMonth + 1 }} </span>
<button class="nav-btn" @click="nextMonth"> <button class="nav-btn" @click="nextMonth">
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</button> </button>
@ -343,19 +347,34 @@ onUnmounted(() => {
时间: 时间:
</div> </div>
<el-select v-model="selectedHour" class="time-select" @change="updateTime"> <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') }} {{ i.toString().padStart(2, '0') }}
</el-option> </el-option>
</el-select> </el-select>
<span class="time-separator">:</span> <span class="time-separator">:</span>
<el-select v-model="selectedMinute" class="time-select" @change="updateTime"> <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') }} {{ i.toString().padStart(2, '0') }}
</el-option> </el-option>
</el-select> </el-select>
<span class="time-separator">:</span> <span class="time-separator">:</span>
<el-select v-model="selectedSecond" class="time-select" @change="updateTime"> <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') }} {{ i.toString().padStart(2, '0') }}
</el-option> </el-option>
</el-select> </el-select>
@ -376,7 +395,7 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
$fontSize: 1.5rem; $fontSize: 1.5rem;
:deep(body) { :deep(body) {
--el-font-size-base: 20px;
//--el-font-size-base: 20px;
} }
.date-time-picker { .date-time-picker {
position: relative; position: relative;
@ -420,7 +439,9 @@ $fontSize: 1.5rem;
background-color: white; background-color: white;
border: 1px solid #e2e8f0; border: 1px solid #e2e8f0;
border-radius: 4px; 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; z-index: 100;
padding: 12px; padding: 12px;
} }
@ -535,7 +556,7 @@ select option {
width: 5rem; width: 5rem;
} }
.select-option{
.select-option {
max-height: 3rem; max-height: 3rem;
} }
@ -562,7 +583,8 @@ select {
gap: 10px; gap: 10px;
} }
.confirm-btn, .cancel-btn {
.confirm-btn,
.cancel-btn {
padding: 8px 16px; padding: 8px 16px;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
@ -589,15 +611,17 @@ select {
background-color: #e2e8f0; background-color: #e2e8f0;
} }
.fade-enter-active, .fade-leave-active {
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s; transition: opacity 0.2s;
} }
.fade-enter-from, .fade-leave-to {
.fade-enter-from,
.fade-leave-to {
opacity: 0; opacity: 0;
} }
// //
:deep(.el-select__wrapper){
:deep(.el-select__wrapper) {
height: 3rem; height: 3rem;
font-size: 20px; font-size: 20px;
} }

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

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

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

@ -2,7 +2,7 @@
import pinyinDict from 'libs/pinyinDict.json' import pinyinDict from 'libs/pinyinDict.json'
import { useDeviceStore } from 'stores/deviceStore' import { useDeviceStore } from 'stores/deviceStore'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { computed, defineEmits, defineProps, onMounted, ref, watch, watchEffect } from 'vue'
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
const props = defineProps<{ const props = defineProps<{
modelValue: string modelValue: string
@ -22,11 +22,11 @@ const cnList = ref<string[]>([])
const pinyinMap: Record<string, string[]> = pinyinDict const pinyinMap: Record<string, string[]> = pinyinDict
const pinyinValue = ref('') const pinyinValue = ref('')
// //
const isDragging = ref(false)//
const startX = ref(0)// X
const startY = ref(0)// Y
const x = ref(0)// X
const y = ref(-50)// Y
const isDragging = ref(false) //
const startX = ref(0) // X
const startY = ref(0) // Y
const x = ref(0) // X
const y = ref(-50) // Y
const keyboardRef = ref() as Ref<HTMLDivElement> // DOM const keyboardRef = ref() as Ref<HTMLDivElement> // DOM
onMounted(() => { onMounted(() => {
@ -50,12 +50,15 @@ watchEffect(() => {
inputValue.value = props.modelValue inputValue.value = props.modelValue
}) })
watch(() => props.isVisible, (newVal) => {
console.log('deviceStete.deviceType--2-', deviceStete.isLowCost)
if (!deviceStete.isLowCost) {
isOpen.value = newVal
}
})
watch(
() => props.isVisible,
(newVal) => {
console.log('deviceStete.deviceType--2-', deviceStete.isLowCost)
if (!deviceStete.isLowCost) {
isOpen.value = newVal
}
},
)
const activeKey = ref('') const activeKey = ref('')
const keyboardLayout = computed(() => { const keyboardLayout = computed(() => {
@ -201,13 +204,18 @@ const handleTouchEnd = () => {
> >
<div> <div>
<div v-if="keyboardType === 'text'" class="pinyin-container"> <div v-if="keyboardType === 'text'" class="pinyin-container">
<span v-if="pinyinValue" style="font-size:12px">拼音{{ pinyinValue }}</span>
<span v-if="pinyinValue" style="font-size: 12px">拼音{{ pinyinValue }}</span>
<div v-if="cnList && cnList.length" class="pinyin-cn"> <div v-if="cnList && cnList.length" class="pinyin-cn">
<div <div
v-for="(cnName, cnIndex) in cnList" v-for="(cnName, cnIndex) in cnList"
:key="cnIndex" :key="cnIndex"
class="cn-name" class="cn-name"
@click="(e) => { e.stopPropagation(); handleKeyCn(cnName) }"
@click="
e => {
e.stopPropagation();
handleKeyCn(cnName);
}
"
> >
{{ cnName }} {{ cnName }}
</div> </div>
@ -225,12 +233,28 @@ const handleTouchEnd = () => {
'key-text': key !== ' ' && keyboardType === 'text', 'key-text': key !== ' ' && keyboardType === 'text',
}" }"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'" :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> </button>
</div> </div>
</div> </div>
@ -258,7 +282,7 @@ const handleTouchEnd = () => {
.keyboard-header { .keyboard-header {
margin-bottom: 10px; margin-bottom: 10px;
position: absolute; position: absolute;
float:right;
float: right;
} }
.keyboard-header button { .keyboard-header button {
@ -273,20 +297,20 @@ const handleTouchEnd = () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.pinyin-container{
.pinyin-container {
display: flex; display: flex;
width: 80%; width: 80%;
height: 4rem; height: 4rem;
padding-left: 2rem; padding-left: 2rem;
.pinyin-cn{
.pinyin-cn {
color: #1890ff; color: #1890ff;
padding-left: 1rem; padding-left: 1rem;
display: flex; display: flex;
width: 1rem; width: 1rem;
position: relative; position: relative;
gap:5px;
gap: 5px;
//font-family: fangsong; //font-family: fangsong;
.cn-name{
.cn-name {
font-size: 2.5rem; font-size: 2.5rem;
} }
} }
@ -321,7 +345,7 @@ const handleTouchEnd = () => {
.key-space { .key-space {
margin-top: 3.5px; margin-top: 3.5px;
width: 75vw;;
width: 75vw;
} }
.key-special { .key-special {
@ -333,7 +357,7 @@ const handleTouchEnd = () => {
transform: scale(0.95); transform: scale(0.95);
} }
.key-number{
.key-number {
width: 30vw; width: 30vw;
height: 6vh; height: 6vh;
margin: 5px; margin: 5px;
@ -344,7 +368,7 @@ const handleTouchEnd = () => {
height: 5vh; height: 5vh;
margin: 5px; margin: 5px;
} }
.input-w{
.input-w {
width: 20%; width: 20%;
height: 4rem; height: 4rem;
font-size: 2rem; font-size: 2rem;
@ -357,7 +381,7 @@ const handleTouchEnd = () => {
left: 0; left: 0;
width: 90%; width: 90%;
border-radius: 16px; border-radius: 16px;
box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
overflow: hidden; overflow: hidden;
z-index: 9999; z-index: 9999;
/* 让拖动更顺滑 */ /* 让拖动更顺滑 */

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

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import pinyinDict from 'libs/pinyinDict.json' import pinyinDict from 'libs/pinyinDict.json'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { computed, defineEmits, defineProps, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
import { computed, nextTick, onMounted, ref, watch, watchEffect } from 'vue'
const props = defineProps<{ const props = defineProps<{
modelValue: string modelValue: string
@ -21,11 +21,11 @@ const cnList = ref<string[]>([])
const pinyinMap: Record<string, string[]> = pinyinDict const pinyinMap: Record<string, string[]> = pinyinDict
const pinyinValue = ref('') const pinyinValue = ref('')
// //
const isDragging = ref(false)//
const startX = ref(0)// X
const startY = ref(0)// Y
const x = ref(0)// X
const y = ref(0)// Y
const isDragging = ref(false) //
const startX = ref(0) // X
const startY = ref(0) // Y
const x = ref(0) // X
const y = ref(0) // Y
const inputX = ref(0) const inputX = ref(0)
const inputY = ref(0) const inputY = ref(0)
const keyboardRef = ref() as Ref<HTMLDivElement> // DOM const keyboardRef = ref() as Ref<HTMLDivElement> // DOM
@ -162,9 +162,12 @@ const closeKeyboard = () => {
emits('close') emits('close')
} }
watch(() => props.isVisible, (newVal) => {
isOpen.value = newVal
})
watch(
() => props.isVisible,
(newVal) => {
isOpen.value = newVal
},
)
// //
const handleTouchStart = (e: TouchEvent) => { const handleTouchStart = (e: TouchEvent) => {
@ -218,13 +221,18 @@ const handleTouchEnd = () => {
> >
<div> <div>
<div v-if="keyboardType === 'text'" class="pinyin-container"> <div v-if="keyboardType === 'text'" class="pinyin-container">
<span v-if="pinyinValue" style="font-size:12px">拼音{{ pinyinValue }}</span>
<span v-if="pinyinValue" style="font-size: 12px">拼音{{ pinyinValue }}</span>
<div v-if="cnList && cnList.length" class="pinyin-cn"> <div v-if="cnList && cnList.length" class="pinyin-cn">
<div <div
v-for="(cnName, cnIndex) in cnList" v-for="(cnName, cnIndex) in cnList"
:key="cnIndex" :key="cnIndex"
class="cn-name" class="cn-name"
@click="(e) => { e.stopPropagation(); handleKeyCn(cnName) }"
@click="
e => {
e.stopPropagation();
handleKeyCn(cnName);
}
"
> >
{{ cnName }} {{ cnName }}
</div> </div>
@ -242,12 +250,28 @@ const handleTouchEnd = () => {
'key-text': key !== ' ' && keyboardType === 'text', 'key-text': key !== ' ' && keyboardType === 'text',
}" }"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'" :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> </button>
</div> </div>
</div> </div>
@ -274,20 +298,20 @@ const handleTouchEnd = () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.pinyin-container{
.pinyin-container {
display: flex; display: flex;
width: 80%; width: 80%;
height: 3rem; height: 3rem;
padding-left: 2rem; padding-left: 2rem;
.pinyin-cn{
.pinyin-cn {
color: #1890ff; color: #1890ff;
padding-left: 1rem; padding-left: 1rem;
display: flex; display: flex;
width: 1rem; width: 1rem;
position: relative; position: relative;
gap:5px;
gap: 5px;
//font-family: fangsong; //font-family: fangsong;
.cn-name{
.cn-name {
font-size: 2.5rem; font-size: 2.5rem;
} }
} }
@ -318,7 +342,7 @@ const handleTouchEnd = () => {
.key-space { .key-space {
margin-top: 3.5px; margin-top: 3.5px;
width: 75vw;;
width: 75vw;
} }
.key-special { .key-special {
@ -330,7 +354,7 @@ const handleTouchEnd = () => {
transform: scale(0.95); transform: scale(0.95);
} }
.key-number{
.key-number {
width: 30vw; width: 30vw;
height: 6vh; height: 6vh;
margin: 5px; margin: 5px;
@ -344,7 +368,7 @@ const handleTouchEnd = () => {
.keyboard-container { .keyboard-container {
border-radius: 16px; border-radius: 16px;
box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
overflow: hidden; overflow: hidden;
z-index: 9999; z-index: 9999;
/* 让拖动更顺滑 */ /* 让拖动更顺滑 */

8
src/components/home/Environment.vue

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

6
src/components/setting/Device.vue

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

9
src/components/setting/User.vue

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

2
src/layouts/default.vue

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

25
src/views/audit/index.vue

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

5
src/views/setting/index.vue

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

Loading…
Cancel
Save