Browse Source

优化样式

master
LiLongLong 4 weeks ago
parent
commit
8b1d042ca1
  1. 2
      src/assets/styles/variable.scss
  2. 13
      src/components/common/DatePicker/index.vue
  3. 12
      src/components/common/SoftKeyboard/index.vue
  4. 4
      src/components/formula/FormulaConfig.vue
  5. 2
      src/components/home/HomeLogLevel.vue
  6. 2
      src/components/home/HomeOperation.vue
  7. 27
      src/components/home/HomeSetting.vue
  8. 1
      src/components/home/config.vue
  9. 2
      src/components/seal/DashboardChart.vue
  10. 2
      src/components/setting/History.vue
  11. 1
      src/components/setting/SystemDate.vue
  12. 2
      src/components/setting/User.vue
  13. 13
      src/layouts/default.vue
  14. 4
      src/views/audit/index.vue
  15. 3
      src/views/formula/index.vue
  16. 6
      src/views/home/index.vue
  17. 8
      src/views/liquid/index.vue
  18. 9
      src/views/seal/index.vue

2
src/assets/styles/variable.scss

@ -4,4 +4,4 @@ $danger-color: #DF1515;
$warn-color: #EE8223; $warn-color: #EE8223;
$info-color: #909399; $info-color: #909399;
$gradient-color: linear-gradient(185deg, rgb(175 216 255) -90%, #fff 24%); $gradient-color: linear-gradient(185deg, rgb(175 216 255) -90%, #fff 24%);
$main-container-height: calc(100vh - 14vh)
$main-container-height: calc(100vh - 17vh)

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

@ -22,7 +22,9 @@ const props = defineProps({
const emits = defineEmits(['update:modelValue', 'change']) const emits = defineEmits(['update:modelValue', 'change'])
const dateText = ref() const dateText = ref()
const hoursOptions = ref([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23])
const hoursOptions = ref(Array.from({ length: 24 }, (_, i) => i))
const minuteOptions = ref(Array.from({ length: 60 }, (_, i) => i))
const secondOptions = ref(Array.from({ length: 60 }, (_, i) => i))
// //
const selectedDate = ref<Date | null>(null) const selectedDate = ref<Date | null>(null)
const currentYear = ref(0) const currentYear = ref(0)
@ -36,7 +38,6 @@ const selectedSecond = ref('00')
// //
const displayValue = () => { const displayValue = () => {
console.log('-----------------')
if (!selectedDate.value) { if (!selectedDate.value) {
return '' return ''
} }
@ -183,7 +184,6 @@ const updateTime = () => {
// //
const confirmSelection = () => { const confirmSelection = () => {
console.log('selectedDate.value---', selectedDate.value)
if (selectedDate.value) { if (selectedDate.value) {
const dateValue = formatDate(selectedDate.value, props.format) const dateValue = formatDate(selectedDate.value, props.format)
emits('update:modelValue', dateValue) emits('update:modelValue', dateValue)
@ -351,13 +351,13 @@ onUnmounted(() => {
</el-select> </el-select>
<span class="time-separator">:</span> <span class="time-separator">:</span>
<el-select v-model="selectedMinute" @change="updateTime" class="time-select"> <el-select v-model="selectedMinute" @change="updateTime" class="time-select">
<el-option v-for="i in 60" :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" @change="updateTime" class="time-select"> <el-select v-model="selectedSecond" @change="updateTime" class="time-select">
<el-option v-for="i in 60" :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>
@ -516,7 +516,7 @@ $fontSize: 1.5rem;
margin-right: 4px; margin-right: 4px;
/* 最大高度限制,溢出滚动 */ /* 最大高度限制,溢出滚动 */
max-height: 3rem; max-height: 3rem;
width: 6rem;
width: 8rem;
border: none; border: none;
} }
} }
@ -530,6 +530,7 @@ select option {
margin-right: 12px; margin-right: 12px;
font-size: $fontSize; font-size: $fontSize;
color: #334155; color: #334155;
width: 5rem;
} }
.select-option{ .select-option{

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

@ -167,8 +167,8 @@ const handleTouchEnd = () => {
:style="{ :style="{
transform: `translate(${x}px, ${y}px)`, transform: `translate(${x}px, ${y}px)`,
transition: isDragging ? 'none' : 'transform 0.3s ease', transition: isDragging ? 'none' : 'transform 0.3s ease',
width: keyboardType === 'number' ? '50vw' : '',
height: keyboardType === 'number' ? '45vh' : '50vh',
width: keyboardType === 'number' ? '50vw' : '66vw',
height: keyboardType === 'number' ? '46vh' : '46vh',
}" }"
> >
<div> <div>
@ -195,7 +195,7 @@ const handleTouchEnd = () => {
'key-number': keyboardType === 'number', 'key-number': keyboardType === 'number',
'key-text': key !== ' ' && keyboardType === 'text', 'key-text': key !== ' ' && keyboardType === 'text',
}" }"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:4rem'"
:style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'"
@click="(e) => { @click="(e) => {
e.stopPropagation() e.stopPropagation()
handleKeyPress(key) handleKeyPress(key)
@ -247,12 +247,16 @@ const handleTouchEnd = () => {
.pinyin-container{ .pinyin-container{
display: flex; display: flex;
width: 80%; width: 80%;
height: 4rem;
height: 3rem;
padding-left: 2rem;
.pinyin-cn{ .pinyin-cn{
color: #1890ff;
padding-left: 1rem;
display: flex; display: flex;
width: 1rem; width: 1rem;
position: relative; position: relative;
gap:5px; gap:5px;
font-family: fangsong;
.cn-name{ .cn-name{
font-size: 2.5rem; font-size: 2.5rem;
} }

4
src/components/formula/FormulaConfig.vue

@ -188,7 +188,6 @@ const handleSubmit = () => {
* 根据是否有formula_id决定是添加新配方还是编辑已有配方 * 根据是否有formula_id决定是添加新配方还是编辑已有配方
*/ */
const onSaveFormula = () => { const onSaveFormula = () => {
console.log('formData.value.formula_id---', formData.value.formula_id)
if (formData.value.formula_id) { if (formData.value.formula_id) {
const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name') const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name')
onEditFormula(formulaForm.formula_id, formulaForm as Formula.FormulaItem) onEditFormula(formulaForm.formula_id, formulaForm as Formula.FormulaItem)
@ -269,7 +268,8 @@ const onEditFormula = (formula_id: string, formulaForm: Formula.FormulaItem) =>
syncSendCmd(editParams).then(() => { syncSendCmd(editParams).then(() => {
FtMessage.success('操作成功') FtMessage.success('操作成功')
formulaStore.initFormulaList() formulaStore.initFormulaList()
formData.value = formulaForm
// formData.value = formulaForm
formulaStore.updateSelectedFormulaData(formulaForm)
}) })
} }

2
src/components/home/HomeLogLevel.vue

@ -70,7 +70,7 @@ $input-height: 3rem;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24px; font-size: 24px;
.input{ .input{
width: 15vw;
width: 14vw;
height: $input-height height: $input-height
} }
.input-log{ .input-log{

2
src/components/home/HomeOperation.vue

@ -26,7 +26,7 @@ const systemStore = useSystemStore()
const curStateRemainTimeS = ref<string>('') // const curStateRemainTimeS = ref<string>('') //
const disinfectionState = ref(homeStore.disinfectionState) // const disinfectionState = ref(homeStore.disinfectionState) //
const btnStyle = { const btnStyle = {
width: '27vw',
width: '25vw',
height: '7vh', height: '7vh',
textSize: '24px', textSize: '24px',
borderRadius: '12px', borderRadius: '12px',

27
src/components/home/HomeSetting.vue

@ -4,8 +4,6 @@ import { useFormulaStore } from '@/stores/formulaStore'
import { useHomeStore } from '@/stores/homeStore' import { useHomeStore } from '@/stores/homeStore'
import { sendCmd, syncSendCmd } from 'apis/system' import { sendCmd, syncSendCmd } from 'apis/system'
// import homeChart from 'assets/images/home/home-chart.svg' // import homeChart from 'assets/images/home/home-chart.svg'
import homeRunSvg from 'assets/images/home/home-run.svg'
import homeSettingSvg from 'assets/images/home/home-setting.svg'
import BtButton from 'components/common/BTButton/index.vue' import BtButton from 'components/common/BTButton/index.vue'
import CascadingSelectModal from 'components/common/CascadingSelectModal/index.vue' import CascadingSelectModal from 'components/common/CascadingSelectModal/index.vue'
import Config from 'components/home/Config.vue' import Config from 'components/home/Config.vue'
@ -225,11 +223,7 @@ const onClose = () => {
text-color="#1989fa" text-color="#1989fa"
height="3rem" height="3rem"
@click="onSetPressure" @click="onSetPressure"
>
<template #icon>
<el-icon><Sort /></el-icon>
</template>
</BtButton>
/>
</div> </div>
<div class="home-opt-ml"> <div class="home-opt-ml">
<BtButton <BtButton
@ -241,11 +235,7 @@ const onClose = () => {
text-color="#1989fa" text-color="#1989fa"
:disabled="deviceState" :disabled="deviceState"
@click="onShowChart" @click="onShowChart"
>
<template #icon>
<el-icon><Picture /></el-icon>
</template>
</BtButton>
/>
</div> </div>
<div class="home-opt-ml"> <div class="home-opt-ml">
<BtButton <BtButton
@ -257,11 +247,7 @@ const onClose = () => {
text-color="#1989fa" text-color="#1989fa"
height="3rem" height="3rem"
@click="onDisinfectConfig" @click="onDisinfectConfig"
>
<template #icon>
<img :src="homeSettingSvg" width="12" style="margin-right: 5px" alt="">
</template>
</BtButton>
/>
<BtButton <BtButton
v-else v-else
button-text="运行参数" button-text="运行参数"
@ -271,11 +257,7 @@ const onClose = () => {
text-color="#1989fa" text-color="#1989fa"
height="3rem" height="3rem"
@click="onDisinfectConfig" @click="onDisinfectConfig"
>
<template #icon>
<img :src="homeRunSvg" width="15" alt="">
</template>
</BtButton>
/>
</div> </div>
</div> </div>
</div> </div>
@ -327,6 +309,7 @@ const onClose = () => {
bottom: 0; bottom: 0;
margin: 0.5rem; margin: 0.5rem;
gap: 5px; gap: 5px;
width: 100%;
.home-opt-flex{ .home-opt-flex{
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;

1
src/components/home/config.vue

@ -144,6 +144,7 @@ const onDefaultFormula = () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.main-content{ .main-content{
overflow: hidden; overflow: hidden;
height: $main-container-height;
background: $gradient-color; background: $gradient-color;
padding: 15px; padding: 15px;
.formula-config{ .formula-config{

2
src/components/seal/DashboardChart.vue

@ -75,6 +75,6 @@ onUnmounted(() => {
<style> <style>
canvas{ canvas{
width: 60vw !important; width: 60vw !important;
height: 60vh !important;
height: 70vh !important;
} }
</style> </style>

2
src/components/setting/History.vue

@ -115,7 +115,7 @@ const onClose = () => {
<el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange"> <el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="name" label="消毒日期" /> <el-table-column prop="name" label="消毒日期" />
<el-table-column prop="detail" label="操作" width="60">
<el-table-column prop="detail" label="操作" width="100">
<template #default="scoped"> <template #default="scoped">
<el-link type="primary" @click="showDetail(scoped.row)"> <el-link type="primary" @click="showDetail(scoped.row)">
查看 查看

1
src/components/setting/SystemDate.vue

@ -4,7 +4,6 @@ import DatePicker from '@/components/common/DatePicker/index.vue'
import { FtMessage } from '@/libs/message' import { FtMessage } from '@/libs/message'
const onChangeDate = async (value: string) => { const onChangeDate = async (value: string) => {
console.log('value---', value)
if (value) { if (value) {
const splitDate = value.split(' ') // const splitDate = value.split(' ') //
const YMD = splitDate[0].split('-') const YMD = splitDate[0].split('-')

2
src/components/setting/User.vue

@ -83,7 +83,7 @@ const handleSelectionChange = (users: User.UserItem[]) => {
<el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange"> <el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="name" label="用户名" /> <el-table-column prop="name" label="用户名" />
<el-table-column prop="detail" label="操作" width="100">
<el-table-column prop="detail" label="操作" width="150">
<template #default="scoped"> <template #default="scoped">
<el-link type="primary" @click="updatePwd(scoped.row)"> <el-link type="primary" @click="updatePwd(scoped.row)">
修改密码 修改密码

13
src/layouts/default.vue

@ -337,7 +337,7 @@ const toggleLanguage = () => {
} }
} }
.el-main { .el-main {
padding: 0 15px;
padding: 0 1px;
height: 100%; height: 100%;
position: relative; position: relative;
} }
@ -394,13 +394,13 @@ const toggleLanguage = () => {
} }
.ip-info{ .ip-info{
font-size: 1.5rem;
width: 20vw;
font-size: 1.3rem;
width: 22vw;
padding-left: 1.3vw; padding-left: 1.3vw;
} }
.alarm-info { .alarm-info {
font-size: 1.5rem; font-size: 1.5rem;
width: 55vw;
width: 53vw;
padding-left: 1.3vw; padding-left: 1.3vw;
background: #F5F5F5; background: #F5F5F5;
height: 5vh; height: 5vh;
@ -415,10 +415,11 @@ const toggleLanguage = () => {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: end;
border-radius: 5px; border-radius: 5px;
margin-left: 3vw;
padding: 1vw; padding: 1vw;
font-size: 1.5rem;
font-size: 1.3rem;
width: 22.5vw;
} }
} }
.aside-item { .aside-item {

4
src/views/audit/index.vue

@ -107,7 +107,7 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="usrName" label="操作人" width="150" /> <el-table-column prop="usrName" label="操作人" width="150" />
<el-table-column prop="behaviorinfo" label="操作内容" /> <el-table-column prop="behaviorinfo" label="操作内容" />
<el-table-column prop="date" label="操作时间" width="150" />
<el-table-column prop="date" label="操作时间" width="250" />
</el-table> </el-table>
<div class="audit-pagination"> <div class="audit-pagination">
<el-pagination layout="prev, pager, next" :total="totle" @current-change="handleCurrentChange" /> <el-pagination layout="prev, pager, next" :total="totle" @current-change="handleCurrentChange" />
@ -127,7 +127,7 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => {
margin: 2vw; margin: 2vw;
} }
.audit-pagination{ .audit-pagination{
bottom: 2rem;
bottom: 1rem;
position: absolute; position: absolute;
right: 2rem; right: 2rem;
} }

3
src/views/formula/index.vue

@ -25,6 +25,7 @@ const onAddFormula = () => {
<bt-button <bt-button
type="primary" type="primary"
button-text="新增配方" button-text="新增配方"
text-size="1.5rem"
class="formula-add-btn" class="formula-add-btn"
@click="onAddFormula" @click="onAddFormula"
> >
@ -62,7 +63,7 @@ const onAddFormula = () => {
.formula-add-btn{ .formula-add-btn{
display: flex; display: flex;
align-items: center; align-items: center;
height: 3.5rem;
height: 3rem;
border-radius: 5px; border-radius: 5px;
} }
.formula-list{ .formula-list{

6
src/views/home/index.vue

@ -132,7 +132,7 @@ const nowLiquid = computed(() => {
.home-grid-container { .home-grid-container {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
gap: 0.5rem;
} }
.home-merged-cell { .home-merged-cell {
grid-column: 1 / 2; grid-column: 1 / 2;
@ -145,7 +145,7 @@ const nowLiquid = computed(() => {
gap:1.5rem; gap:1.5rem;
.card { .card {
text-align: center; text-align: center;
height: 41.5vh;
height: 40.5vh;
width: 30.5vw; width: 30.5vw;
border: 1px solid rgb(225, 225, 225); border: 1px solid rgb(225, 225, 225);
position: relative; position: relative;
@ -184,7 +184,7 @@ const nowLiquid = computed(() => {
} }
.home-right{ .home-right{
width: 31vw;
width: 34.5vw;
background: $gradient-color; background: $gradient-color;
position: relative; position: relative;
} }

8
src/views/liquid/index.vue

@ -32,7 +32,7 @@ const disinfectionState = ref(homeStore.disinfectionState)
const sealInfo = ref(sealStore.sealInfo) const sealInfo = ref(sealStore.sealInfo)
const loading = ref(false) const loading = ref(false)
const btnStyle = { const btnStyle = {
width: '27vw',
width: '25vw',
height: '7vh', height: '7vh',
textSize: '24px', textSize: '24px',
borderRadius: '12px', borderRadius: '12px',
@ -298,7 +298,7 @@ const onStopDrainLiquid = async () => {
.liquid-surplus-title{ .liquid-surplus-title{
height: 10vh; height: 10vh;
display: flex; display: flex;
padding-left: 2rem;
padding-left: 2.5rem;
align-items: center; align-items: center;
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
@ -310,8 +310,8 @@ const onStopDrainLiquid = async () => {
} }
.liquid-input{ .liquid-input{
display: flex; display: flex;
padding-left: 2rem;
align-items: center; align-items: center;
justify-content: center;
.input{ .input{
width: 25vw; width: 25vw;
} }
@ -323,7 +323,7 @@ const onStopDrainLiquid = async () => {
margin-top: 5vh; margin-top: 5vh;
} }
.liquid-add-btn{ .liquid-add-btn{
width: 27vw;
width: 25vw;
height: 8vh; height: 8vh;
border-radius: 12px; border-radius: 12px;
color: #FFFFFF; color: #FFFFFF;

9
src/views/seal/index.vue

@ -278,7 +278,8 @@ const stopDisabled = computed(() => {
.seal-opt{ .seal-opt{
display: flex; display: flex;
gap: 2rem; gap: 2rem;
margin-left: 8rem;
margin-left: 9rem;
margin-top: -2rem;
.seal-status{ .seal-status{
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -349,10 +350,10 @@ const stopDisabled = computed(() => {
.seal-right-btn{ .seal-right-btn{
height: 30vh; height: 30vh;
grid-row: 2 / 4; grid-row: 2 / 4;
margin-top: -2rem;
margin-top: -4rem;
.seal-input{ .seal-input{
padding-left: 2rem; padding-left: 2rem;
height: 10rem;
height: 8rem;
font-size: 2.143vw; font-size: 2.143vw;
font-weight: 400; font-weight: 400;
.inflation-time{ .inflation-time{
@ -366,7 +367,7 @@ const stopDisabled = computed(() => {
} }
} }
.seal-add-btn{ .seal-add-btn{
width: 24vw;
width: 25vw;
height: 8vh; height: 8vh;
border-radius: 12px; border-radius: 12px;
color: #FFFFFF; color: #FFFFFF;

Loading…
Cancel
Save