Browse Source

fix: 首页样式; 日期24小时制

master
guoapeng 2 days ago
parent
commit
5b4439ada8
  1. 2
      src/components/common/FTDatetime/index.vue
  2. 64
      src/components/system/EditDate/index.vue
  3. 31
      src/views/home/index.vue

2
src/components/common/FTDatetime/index.vue

@ -96,7 +96,7 @@ onUnmounted(() => {
<el-date-picker
v-model="form.epochMilli"
:show-now="false"
format="YYYY-MM-DD hh:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
type="datetime"

64
src/components/system/EditDate/index.vue

@ -1,64 +0,0 @@
<script setup lang="ts">
import { useServerTime } from 'hooks/useServerTime'
import { FtMessage } from 'libs/message'
import { ref } from 'vue'
const props = defineProps({
datetime: {
type: Number,
default: 0,
},
})
const emits = defineEmits(['ok', 'close'])
const form = ref<{ epochMilli?: number }>({
epochMilli: props.datetime,
})
const formRef = ref()
const rules = {
epochMilli: [
{ required: true, message: '请选择时间', trigger: 'change' },
],
}
const okHandle = async () => {
try {
const valid = await formRef.value.validate()
if (!valid) {
return
}
emits('ok')
}
catch (e) {
console.log(e)
}
}
const cancel = () => {
emits('close')
}
</script>
<template>
<ft-dialog visible title="设置日期与时间" width="40%" :ok-handle="okHandle" @cancel="cancel">
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
<el-form-item label="日期与时间" prop="epochMilli">
<el-date-picker
v-model="form.epochMilli"
:show-now="false"
format="YYYY-MM-DD hh:mm:ss"
value-format="x"
style="width: 100%"
type="datetime"
placeholder="请选择日期和时间"
/>
</el-form-item>
</el-form>
</ft-dialog>
</template>
<style scoped lang="scss">
</style>

31
src/views/home/index.vue

@ -3,7 +3,6 @@ import { queryCraftList } from 'apis/crafts'
import { getSolsList } from 'apis/solution'
import { sync } from 'apis/system'
import solutionIcon from 'assets/images/solution.svg'
import solutionSelectIcon from 'assets/images/solutionSelect.svg'
import Receive from 'components/home/Receive/index.vue'
import { useSystemStore } from 'stores/systemStore'
import { computed, onMounted, ref, watch } from 'vue'
@ -101,11 +100,15 @@ const volumeChange = async (item: System.ChannelState) => {
<template lang="pug">
div.home-container(v-loading="loading")
el-card(v-for="item in channelList" :key="item.channelCode" :class="{'card-selected': item.selected }" )
div.select-icon-box(:class="{'select-icon-box-selected': item.selected }" @click.stop="() => cardClick(item)")
el-icon(color="#fff" size="16px")
Select
template(#header)
div.header-box(@click.stop="() => cardClick(item)")
p.title {{channelMap[item.channelCode]}}
el-icon(v-if="item.selected" color="#67C23A" )
CircleCheckFilled
//div.select-icon-box(:class="{'select-icon-box-selected': item.selected }" @click.stop="() => cardClick(item)")
// el-icon(color="#fff" size="16px")
// Select
div.top-box(@click.stop)
p.title {{channelMap[item.channelCode]}}
div.solution-box(@click.stop="() => receiveHandle(item)")
div.content(v-if="item.solutionName") {{`${item.solutionName}-${item.concentration}%`}}
div.content(v-else) 未领取
@ -138,9 +141,25 @@ const volumeChange = async (item: System.ChannelState) => {
grid-template-columns 1fr 1fr 1fr 1fr
gap 20px
.el-card
transform: all 0.3s;
transform: all 0.1s;
//border: 3px solid #ddd;
position relative
display flex
flex-direction column
:deep(.el-card__header)
height 70px
padding 0 15px
.header-box
font-size 18px
font-weight 500
color: #3C445C;
width 100%
height 100%
display flex
align-items center
justify-content space-between
.el-icon
font-size 25px
.card-selected
background-color #F0F7FF
border: 3px solid #2892F3;

Loading…
Cancel
Save