mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-22 13:36:23 +08:00
chore: 调整倒计时组件
This commit is contained in:
parent
d0260041ce
commit
4a75cc4d11
@ -15,24 +15,17 @@ export const FontWeightObject = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const option = {
|
export const option = {
|
||||||
// 数据说明
|
flipperBgColor: '#ee6600FF',
|
||||||
timeSize: 24,
|
flipperTextColor: '#336600FF',
|
||||||
timeLineHeight: 50,
|
flipperWidth: 60,
|
||||||
timeTextIndent: 2,
|
flipperHeight: 100,
|
||||||
timeColor: '#E6F7FF',
|
flipperRadius: 10,
|
||||||
fontWeight: 'normal',
|
flipperSpeed: 600
|
||||||
|
|
||||||
//阴影
|
|
||||||
showShadow: true,
|
|
||||||
hShadow: 0,
|
|
||||||
vShadow: 0,
|
|
||||||
blurShadow: 8,
|
|
||||||
colorShadow: '#0075ff'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||||
public key = CountDownConfig.key
|
public key = CountDownConfig.key
|
||||||
public attr = { ...chartInitConfig, w: 300, h: 200, zIndex: -1 }
|
public attr = { ...chartInitConfig, w: 500, h: 200, zIndex: -1 }
|
||||||
public chartConfig = cloneDeep(CountDownConfig)
|
public chartConfig = cloneDeep(CountDownConfig)
|
||||||
public option = cloneDeep(option)
|
public option = cloneDeep(option)
|
||||||
}
|
}
|
||||||
|
@ -1,53 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<CollapseItem name="内容" :expanded="true">
|
<collapse-item name="翻牌" :expanded="true">
|
||||||
<SettingItemBox name="字体">
|
<setting-item-box name="尺寸">
|
||||||
<SettingItem name="大小">
|
<setting-item name="宽度">
|
||||||
<n-input-number v-model:value="optionData.timeSize" size="small" :min="1"></n-input-number>
|
<n-input-number v-model:value="optionData.flipperWidth" size="small" :min="1"></n-input-number>
|
||||||
</SettingItem>
|
</setting-item>
|
||||||
<SettingItem name="粗细">
|
<setting-item name="高度">
|
||||||
<n-select v-model:value="optionData.fontWeight" size="small" :options="fontWeightOptions" />
|
<n-input-number v-model:value="optionData.flipperHeight" size="small" :min="1"></n-input-number>
|
||||||
</SettingItem>
|
</setting-item>
|
||||||
</SettingItemBox>
|
</setting-item-box>
|
||||||
<SettingItemBox name="间距">
|
|
||||||
<SettingItem name="字距">
|
|
||||||
<n-input-number v-model:value="optionData.timeTextIndent" size="small" :min="1"></n-input-number>
|
|
||||||
</SettingItem>
|
|
||||||
<SettingItem name="行距">
|
|
||||||
<n-input-number v-model:value="optionData.timeLineHeight" size="small" :min="1"></n-input-number>
|
|
||||||
</SettingItem>
|
|
||||||
</SettingItemBox>
|
|
||||||
|
|
||||||
<SettingItemBox name="颜色">
|
<setting-item-box name="样式">
|
||||||
<SettingItem name="时间">
|
<setting-item name="背景色">
|
||||||
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.timeColor"></n-color-picker>
|
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.flipperBgColor"></n-color-picker>
|
||||||
</SettingItem>
|
</setting-item>
|
||||||
</SettingItemBox>
|
<setting-item name="字体色">
|
||||||
<SettingItemBox name="阴影">
|
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.flipperTextColor"></n-color-picker>
|
||||||
<SettingItem>
|
</setting-item>
|
||||||
<n-space>
|
<setting-item name="圆角">
|
||||||
<n-switch v-model:value="optionData.showShadow" size="small" />
|
<n-input-number v-model:value="optionData.flipperRadius" size="small" :min="0"></n-input-number>
|
||||||
<n-text>展示阴影</n-text>
|
</setting-item>
|
||||||
</n-space>
|
<setting-item name="翻牌速度">
|
||||||
</SettingItem>
|
<n-input-number
|
||||||
<SettingItem name="x">
|
v-model:value="optionData.flipperSpeed"
|
||||||
<n-input-number v-model:value="optionData.hShadow" size="small"></n-input-number
|
size="small"
|
||||||
></SettingItem>
|
:min="100"
|
||||||
<SettingItem name="y">
|
:max="900"
|
||||||
<n-input-number v-model:value="optionData.vShadow" size="small"></n-input-number
|
:step="100"
|
||||||
></SettingItem>
|
></n-input-number>
|
||||||
<SettingItem name="模糊">
|
</setting-item>
|
||||||
<n-input-number v-model:value="optionData.blurShadow" size="small"></n-input-number
|
</setting-item-box>
|
||||||
></SettingItem>
|
</collapse-item>
|
||||||
<SettingItem name="颜色">
|
|
||||||
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.colorShadow"></n-color-picker
|
|
||||||
></SettingItem>
|
|
||||||
</SettingItemBox>
|
|
||||||
</CollapseItem>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType } from 'vue'
|
import { PropType } from 'vue'
|
||||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||||
import { option, FontWeightEnum, FontWeightObject } from './config'
|
import { option } from './config'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
optionData: {
|
optionData: {
|
||||||
@ -55,14 +42,4 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const fontWeightOptions = [
|
|
||||||
{
|
|
||||||
label: FontWeightEnum.NORMAL,
|
|
||||||
value: FontWeightObject[FontWeightEnum.NORMAL]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: FontWeightEnum.BOLD,
|
|
||||||
value: FontWeightObject[FontWeightEnum.BOLD]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,9 +1,73 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="go-decorates-more-countdown">
|
<div class="go-decorates-more-countdown">
|
||||||
<div>剩余时间</div>
|
|
||||||
<n-countdown :duration="50000" :active="true" />
|
<n-countdown :duration="50000" :active="true" />
|
||||||
<flipper :front-text="9" ref="flipperRef" />
|
<n-space :gap="10">
|
||||||
<div>。</div>
|
<flipper
|
||||||
|
:front-text="9"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef"
|
||||||
|
/>
|
||||||
|
<flipper
|
||||||
|
:front-text="9"
|
||||||
|
:back-text="8"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef2"
|
||||||
|
/>
|
||||||
|
<flipper
|
||||||
|
:front-text="8"
|
||||||
|
:back-text="7"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef3"
|
||||||
|
/>
|
||||||
|
<flipper
|
||||||
|
:front-text="7"
|
||||||
|
:back-text="7"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef4"
|
||||||
|
/>
|
||||||
|
<flipper
|
||||||
|
:front-text="6"
|
||||||
|
:back-text="5"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef5"
|
||||||
|
/>
|
||||||
|
<flipper
|
||||||
|
:front-text="5"
|
||||||
|
:back-text="4"
|
||||||
|
:width="flipperWidth"
|
||||||
|
:height="flipperHeight"
|
||||||
|
:front-color="flipperTextColor"
|
||||||
|
:back-color="flipperBgColor"
|
||||||
|
:radius="flipperRadius"
|
||||||
|
:duration="flipperSpeed"
|
||||||
|
ref="flipperRef6"
|
||||||
|
/>
|
||||||
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -24,18 +88,9 @@ let boxShadow = ref('none')
|
|||||||
|
|
||||||
const { w, h } = toRefs(props.chartConfig.attr)
|
const { w, h } = toRefs(props.chartConfig.attr)
|
||||||
|
|
||||||
let {
|
let { flipperBgColor, flipperTextColor, flipperWidth, flipperHeight, flipperRadius, flipperSpeed } = toRefs(
|
||||||
timeColor,
|
props.chartConfig.option
|
||||||
timeSize,
|
)
|
||||||
timeLineHeight,
|
|
||||||
timeTextIndent,
|
|
||||||
fontWeight,
|
|
||||||
showShadow,
|
|
||||||
hShadow,
|
|
||||||
vShadow,
|
|
||||||
blurShadow,
|
|
||||||
colorShadow
|
|
||||||
} = toRefs(props.chartConfig.option)
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
props.chartConfig.option,
|
props.chartConfig.option,
|
||||||
@ -58,7 +113,7 @@ let interval = 0
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const interval = window.setInterval(() => {
|
const interval = window.setInterval(() => {
|
||||||
COUNT--
|
COUNT--
|
||||||
if (COUNT === 0) window.clearInterval(interval)
|
if (COUNT <= 1) window.clearInterval(interval)
|
||||||
const flipperCON: any = flipperRef.value
|
const flipperCON: any = flipperRef.value
|
||||||
flipperCON?.flipDown(COUNT, COUNT - 1)
|
flipperCON?.flipDown(COUNT, COUNT - 1)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@ -73,5 +128,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore)
|
|||||||
@include go('decorates-more-countdown') {
|
@include go('decorates-more-countdown') {
|
||||||
width: v-bind('`${w}px`');
|
width: v-bind('`${w}px`');
|
||||||
height: v-bind('`${h}px`');
|
height: v-bind('`${h}px`');
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user