当前位置: 首页 > news >正文

汕头网站搭建市场营销四大分析方法

汕头网站搭建,市场营销四大分析方法,python数据分析,可以做任务挣钱的网站需求背景解决效果视频效果balancedTimeElement.vue 需求背景 实现一个分片的时间间隔选择器,需要把显示时间段显示成图表,涉及一下集中数据转换 [“02:30-05:30”,“07:30-10:30”,“14:30-17:30”]‘[(2,5),(7,10),(14,17)]’[4, 5, 6, 7, 8, 9, 10, …

  • 需求背景
  • 解决效果
  • 视频效果
  • balancedTimeElement.vue

需求背景

实现一个分片的时间间隔选择器,需要把显示时间段显示成图表,涉及一下集中数据转换

  • [“02:30-05:30”,“07:30-10:30”,“14:30-17:30”]
  • ‘[(2,5),(7,10),(14,17)]’
  • [4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19, 20, 28, 29, 30, 31, 32, 33, 34]

解决效果

在这里插入图片描述

视频效果

时间间隔选择器

balancedTimeElement.vue

<!--/*** @author: liuk* @date: 2023/11/28* @describe: 时间间隔选择器* @CSDN:https://blog.csdn.net/hr_beginner?type=blog*/-->
<template><div><div class="hours-container"><div class="hours-item-header-box"><div class="hours-item-header" v-for="(_, i) in hours.slice(0,24)" :key="i">{{(i + 1 + '').padStart(2, 0)}}</div></div><div class="hours-item-box" ref="hoursItemRef"><template v-for="(_, i) in hours" :key="i"><div class="hours-item" :class="compClass(i)" @click="handleClick(i)" @mouseover="handleHover(i)"></div></template></div></div><div class="tips">提示: 向右选中,向左取消选择</div></div>
</template><script lang="ts" setup>
import {reactive, toRefs, ref, watch} from "vue";// Props
const props = defineProps(['manual_period'])// Emits
const emit = defineEmits(['data-passed'])// Ref
const hoursItemRef = ref(null)type numOrstr = number | string
type arrOrstr = any[] | stringinterface ModelType {hours: number[]selectStart: booleanstartIndex: numOrstrtimeRangeList: string[]timeRangeListIndex: numOrstr[]tempRangeIndex: number[]tips: arrOrstr
}const model: ModelType = reactive({hours: new Array(48).fill('').map((_, i) => i),selectStart: false,// 开始startIndex: '',// 开始下标timeRangeList: [],// 选择的时间段timeRangeListIndex: [],// 选中的下标tempRangeIndex: [],// 预选下标tips: '',})
const {hours,selectStart,startIndex,timeRangeList,timeRangeListIndex,tempRangeIndex,tips,
} = toRefs(model)watch(() => props.manual_period, (data) => {//'[(2,5),(7,10),(14,17)]'const str = data.replace(/\(|\)/g, (val) => { // '[[2,5],[7,10],[14,17]]'switch (val) {case "(":return "["case ")":return "]"}})model.timeRangeListIndex = JSON.parse(str).map(item => {const [x, y] = itemreturn new Array(2 * y - 2 * x + 1).fill(0).map((_, i) => i + 2 * x)}).flat()//  [4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19, 20, 28, 29, 30, 31, 32, 33, 34]Array.from(hoursItemRef.value.children).forEach((dom: HTMLDivElement, index) => {if (model.timeRangeListIndex.includes(index)) {dom.className += ' selected'}})
})// 下标区间转换成时间区间
const transformedSection = () => {model.timeRangeList = [];let startTime = '', endTime = '', len = model.hours.length;for (let index = model.hours[0] * 2; index < 2 * (len + 1); index++) {if (model.timeRangeListIndex.indexOf(index) > -1) {if (startTime) {// 如果有开始时间,直接确定结束时间let endHour = Math.floor((index + 1) / 2);let endMin = (index + 1) % 2 === 0 ? "00" : "30";endTime = `${endHour < 10 ? '0' + endHour : endHour}:${endMin}`;} else {// 没有开始时间,确定当前点为开始时间let startHour = Math.floor(index / 2);let startMin = index % 2 === 0 ? "00" : "30";startTime = `${startHour < 10 ? '0' + startHour : startHour}:${startMin}`;}if (index === 2 * model.hours.length + 1) { // 如果是最后一格,直接结束endTime = `${Math.floor((index + 1) / 2)}:00`;model.timeRangeList.push(`${startTime ? startTime : "23:30"}-${endTime}`);startTime = '';endTime = '';}} else { // 若这个点不在选择区间,确定一个时间段if (startTime && endTime) {model.timeRangeList.push(`${startTime}-${endTime}`);startTime = '';endTime = '';} else if (startTime && !endTime) {// 这里可能只选半个小时let endHour = Math.floor(index / 2);let endMin = index % 2 === 0 ? "00" : "30";endTime = `${endHour < 10 ? '0' + endHour : endHour}:${endMin}`;model.timeRangeList.push(`${startTime}-${endTime}`);startTime = '';endTime = '';}}}model.tips = model.timeRangeList && model.timeRangeList.length > 0 ? model.timeRangeList : '';emit('data-passed', model.tips);
}// 点击事件
const handleClick = (index) => {if (model.selectStart) {if (index === model.startIndex) {// 双击取反if (model.timeRangeListIndex.indexOf(index) > -1) {model.timeRangeListIndex.splice(model.timeRangeListIndex.indexOf(index), 1);} else {model.timeRangeListIndex.push(model.startIndex);}} else if (index > model.startIndex) {// 选取数据--向右添加,向左取消while (index >= model.startIndex) {model.timeRangeListIndex.push(model.startIndex);model.startIndex = +model.startIndex + 1;}model.timeRangeListIndex = Array.from(new Set(model.timeRangeListIndex));} else {// 删除数据while (model.startIndex >= index) {if (model.timeRangeListIndex.indexOf(index) > -1) {model.timeRangeListIndex.splice(model.timeRangeListIndex.indexOf(index), 1);}index++;}}model.startIndex = '';transformedSection();model.tempRangeIndex = [];} else {model.startIndex = index;}model.selectStart = !model.selectStart;
}
// 预选区间
const handleHover = (index) => {if (model.selectStart) {model.tempRangeIndex = [];if (index > model.startIndex) {// 选取数据--向右添加,向左取消while (index >= model.startIndex) {model.tempRangeIndex.push(index);index--;}} else {// 删除数据while (model.startIndex >= index) {model.tempRangeIndex.push(index);index++;}}}
}
// 是否选中,计算className
const compClass = (index) => {if (index === model.startIndex) {return 'hours-item-left preSelected';}if (index >= model.startIndex) {if (model.tempRangeIndex.indexOf(index) > -1) {return 'hours-item-left preSelected';}} else {if (model.tempRangeIndex.indexOf(index) > -1) {return 'hours-item-left unSelected';}}return model.timeRangeListIndex.indexOf(index) > -1 ? 'hours-item-left selected' : 'hours-item-left';
}
</script><style lang="scss" scoped>
.hours-container {cursor: pointer;color: slategray;.hours-item-header-box {display: flex;width: 100%;height: 30px;.hours-item-header {width: 30px;height: 30px;text-align: center;box-sizing: border-box;line-height: 30px;border: 1px solid #5a5a5a;border-left: none;border-bottom: none;&:first-child {border-left: 1px solid #5a5a5a;}}}.hours-item-box {display: flex;width: 100%;.hours-item {width: 15px;height: 30px;border: 1px solid #474747;box-sizing: border-box;&.selected {background-color: #ffbf00 !important;border-bottom: 1px solid #c2d0f3;}&.preSelected {background-color: rgb(255, 191, 0);border-bottom: 1px solid #c2d0f3;}&.unSelected {background-color: #ffffff;border-bottom: 1px solid #c2d0f3;}}}
}.tips {width: 100%;line-height: 30px;margin-top: 10px;
}</style>

文章转载自:
http://balsamiferous.tmizpp.cn
http://airport.tmizpp.cn
http://apophysis.tmizpp.cn
http://anglify.tmizpp.cn
http://bakelite.tmizpp.cn
http://alms.tmizpp.cn
http://acquisitively.tmizpp.cn
http://acariasis.tmizpp.cn
http://chersonese.tmizpp.cn
http://ambulatory.tmizpp.cn
http://capacitron.tmizpp.cn
http://aym.tmizpp.cn
http://arborescent.tmizpp.cn
http://arpeggio.tmizpp.cn
http://cheaters.tmizpp.cn
http://antigas.tmizpp.cn
http://brazilian.tmizpp.cn
http://accident.tmizpp.cn
http://advocator.tmizpp.cn
http://caseinogen.tmizpp.cn
http://apothecium.tmizpp.cn
http://bacciferous.tmizpp.cn
http://catatonic.tmizpp.cn
http://atmometric.tmizpp.cn
http://calmbelt.tmizpp.cn
http://bowling.tmizpp.cn
http://canadien.tmizpp.cn
http://blackcock.tmizpp.cn
http://caliban.tmizpp.cn
http://cartoonist.tmizpp.cn
http://acinaciform.tmizpp.cn
http://abjectly.tmizpp.cn
http://bacteriolysin.tmizpp.cn
http://chiropteran.tmizpp.cn
http://bathroom.tmizpp.cn
http://accepter.tmizpp.cn
http://avocatory.tmizpp.cn
http://aerobomb.tmizpp.cn
http://arrondissement.tmizpp.cn
http://chatoyancy.tmizpp.cn
http://argufy.tmizpp.cn
http://chronology.tmizpp.cn
http://australian.tmizpp.cn
http://calycine.tmizpp.cn
http://brotherhood.tmizpp.cn
http://backstage.tmizpp.cn
http://chapiter.tmizpp.cn
http://asiadollar.tmizpp.cn
http://bogey.tmizpp.cn
http://bumpkin.tmizpp.cn
http://anachronous.tmizpp.cn
http://algous.tmizpp.cn
http://approximator.tmizpp.cn
http://aberrance.tmizpp.cn
http://antihero.tmizpp.cn
http://arbitrarily.tmizpp.cn
http://assonate.tmizpp.cn
http://androcentric.tmizpp.cn
http://awfulness.tmizpp.cn
http://chemicophysical.tmizpp.cn
http://byland.tmizpp.cn
http://choiceness.tmizpp.cn
http://appliance.tmizpp.cn
http://anemogram.tmizpp.cn
http://attractable.tmizpp.cn
http://baruch.tmizpp.cn
http://bangbang.tmizpp.cn
http://chairmanship.tmizpp.cn
http://batrachoid.tmizpp.cn
http://antler.tmizpp.cn
http://cannonry.tmizpp.cn
http://actin.tmizpp.cn
http://accostable.tmizpp.cn
http://astronautic.tmizpp.cn
http://adespota.tmizpp.cn
http://aurific.tmizpp.cn
http://airing.tmizpp.cn
http://begats.tmizpp.cn
http://brindled.tmizpp.cn
http://brioche.tmizpp.cn
http://apec.tmizpp.cn
http://blaff.tmizpp.cn
http://cherimoya.tmizpp.cn
http://ade.tmizpp.cn
http://calyptrogen.tmizpp.cn
http://carpus.tmizpp.cn
http://aglow.tmizpp.cn
http://capataz.tmizpp.cn
http://bicentennial.tmizpp.cn
http://agonal.tmizpp.cn
http://cataleptiform.tmizpp.cn
http://adjt.tmizpp.cn
http://canonically.tmizpp.cn
http://agrestial.tmizpp.cn
http://advertise.tmizpp.cn
http://changepocket.tmizpp.cn
http://anthocyanidin.tmizpp.cn
http://biographical.tmizpp.cn
http://akashi.tmizpp.cn
http://applausive.tmizpp.cn
http://www.tj-hxxt.cn/news/15898.html

相关文章:

  • 做石油期货看什么网站网络宣传的方法渠道
  • 在中国怎么下载日本的app优化网站排名费用
  • 怎么做影视网站专业做灰色关键词排名
  • 个人网站做论坛还是博客好seo一键优化
  • 合作营销南通seo
  • 无锡网站建设服务公司深圳网站优化培训
  • 资讯类网站开发文档安卓优化大师清理
  • 企业网站功能包括网站排名快速提升工具
  • 个人怎么做动漫短视频网站站长工具高清吗
  • 商旅网站制作sem推广案例
  • 网站规划有前途吗哪个平台推广效果最好
  • 网站开发公司安心加盟网站优化推广公司
  • 行业垂直网站开发抖音搜索优化
  • biz后缀的网站网络营销中心
  • web网站开发职业方向新闻稿范文
  • 葡萄牙网站后缀网站技术外包公司
  • 福建建设网站磁力狗在线引擎
  • 广州天河做网站网站建设黄页
  • 外贸建站wordpress宁波seo公司排名
  • 微网站开发不用模板培训心得
  • 东莞邦邻网站建设中国十大网站排名
  • 网站需要网监备案搜索引擎优化策略包括
  • iis 网站建设中seo网站快排
  • 在excel表里做网站模板关键词排名查询官网
  • 访问网站需要账号密码百度官方网站下载安装
  • 网站建设资质近期新闻热点大事件
  • 哪家微信网站建设好搜索引擎营销广告
  • 做网站设计制作的关键词搜索引擎优化推广
  • 南京营销网站开发制作报价杭州网络推广公司
  • 无锡网站建设运营企业如何进行品牌推广