vue 日程表组件_vue 会议日程列表
会议列表.png
选择日期:
type="date"
placeholder="请选择日期"
v-model="pickerDate"
>
会议室列表
{{weekInfo.weekDay[index]}} {{item}} |
{{item}} |
{{item}} |
{{item.mrName}}
|
import { getCurrentWeeks, getCurrentWeeksNum, getMtInfoByDate, getMtrmDetails, stopUse } from '../../utils/apis/meetRoomApi'
import { formateDate, getWeekNum, getWeekDay } from '../../utils/publicFun'
export default {
name: 'meetRoom',
data () {
return {
choseDate: '',
pickerDate: '',
singleWidth: 0,
showDetailWin: false,
totalWidth: 0,
weekInfo: {
weekDay: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
weeKMD: [],
weekYMD: [],
weekNum: 0,
currentWeekDay: '',
currentYear: ''
},
timeLine: [],
mtrmData: [],
currentMtItemId: ''
}
},
created () {
this.getWeekData()
},
mounted () {
this.createTimeLine()
},
methods: {
getWeekData () {
getCurrentWeeks().then(res => {
if (res.status === 200) {
this.setWeekData(res)
}
})
},
getWeekDateByNum (weekNum) {
getCurrentWeeksNum({
weekNum: weekNum
}).then(res => {
if (res.status === 200) {
this.setWeekData(res)
}
})
},
setWeekData (res) {
this.weekInfo.weeKMD = res.data.weekMD
this.weekInfo.weekYMD = res.data.weekYmd
this.weekInfo.weekNum = res.data.weekNum
this.weekInfo.currentWeekDay = res.data.weekDay
this.weekInfo.currentYear = res.data.year
for (let i = 0; i < this.weekInfo.weekDay.length; i++) {
if (this.weekInfo.weekDay[i] === this.weekInfo.currentWeekDay) {
this.choseDate = this.weekInfo.weekYMD[i]
}
}
this.getMtrmWork()
},
createTimeLine () {
for (let i = 0; i < 25; i++) {
if (i < 10) {
this.timeLine.push('0' + i + ':00')
} else {
this.timeLine.push(i + ':00')
}
}
this.totalWidth = this.$refs.totalWidth.offsetWidth
this.singleWidth = this.totalWidth / (this.timeLine.length - 1)
},
// 切换周数
changeWeekNum (method) {
if (method === 1) {
this.weekInfo.weekNum = this.weekInfo.weekNum - 1
} else {
this.weekInfo.weekNum = this.weekInfo.weekNum + 1
}
this.getWeekDateByNum(this.weekInfo.weekNum)
},
// 根据日期拿取会议室数据
getMtrmWork () {
getMtInfoByDate({
creatorName: '',
time: this.choseDate
}).then(res => {
if (res.status === 200) {
for (let i in res.data) {
for (let j in res.data[i].meetingWorks) {
res.data[i].meetingWorks[j].startDis = this.getHourDis(this.choseDate + ' 00:00:00', res.data[i].meetingWorks[j].startTime)
res.data[i].meetingWorks[j].mtLemgth = this.getHourDis(res.data[i].meetingWorks[j].startTime, res.data[i].meetingWorks[j].endTime)
}
}
this.mtrmData = res.data
}
})
},
getHourDis (start, end) {
let timeDis = new Date(end).getTime() - new Date(start).getTime()
return timeDis / 3600 / 1000
},
showDetail (item, meItem) {
this.currentMtItemId = meItem.mrCode
getMtrmDetails({
id: item.id
}).then(res => {
if (res.data.code === 200) {
this.showDetailWin = true
} else {
this.$message({
message: res.data.message,
type: 'error'
})
}
})
},
getTodayData (item, weekDay) {
this.choseDate = item
this.weekInfo.currentWeekDay = weekDay
this.getMtrmWork()
},
stopUseMeeting () {
stopUse({
id: this.currentMtItemId
}).then(res => {
if (res.data.code === 200) {
this.showDetailWin = false
this.$message({
message: '操作成功',
type: 'success'
})
this.getMtrmWork()
} else {
this.showDetailWin = false
this.$message({
message: res.data.message,
type: 'fail'
})
}
}).catch(res => {
this.$message({
message: '操作失败',
type: 'fail'
})
})
},
closeModal () {
this.showDetailWin = false
}
},
watch: {
pickerDate: function (res) {
getCurrentWeeksNum({
weekNum: getWeekNum(res)
}).then(res1 => {
if (res1.status === 200) {
this.weekInfo.weeKMD = res1.data.weekMD
this.weekInfo.weekNum = res1.data.weekNum
this.choseDate = formateDate(res, 'Y-m-d')
this.weekInfo.currentWeekDay = getWeekDay(res)
this.getMtrmWork()
}
})
}
}
}
#sys-mtroom {
height: 100%;
.lengeds {
text-align: right;
margin-top: 15px;
.lenged {
width: 11px;
height: 13px;
display: inline-block;
margin: 0px 5px;
position: relative;
bottom: -1px;
}
}
.mtr-finshed {
background: #b3b3b3;
border-left: solid 1px #b3b3b3;
border-right: solid 1px #b3b3b3;
}
.mtr-using {
background: #ff8c01;
border-left: solid 1px #ff8c01;
border-right: solid 1px #ff8c01;
}
.mtr-await {
background: #4bb994;
border-left: solid 1px #4bb994;
border-right: solid 1px #4bb994;
}
.right-btn {
font-size: 16px;
margin-left: 15px;
font-weight: bold;
position: relative;
top: 5px;
}
.date-list {
position: relative;
width: 95%;
margin: 0px auto;
height: 50px;
table {
width: calc(100% - 60px);
margin: 0px auto;
text-align: center;
border: 1px solid #e9eaee;
height: 52px;
cursor: pointer;
td:nth-child(2n) {
background: #f3f6fb;
}
.date-active {
background: #24b4ce !important;
color: #fff;
}
}
}
.time-list {
border-top: 1px solid #e9eaee;
border-left: 1px solid #e9eaee;
height: 20px;
width: calc(95% - 60px);
margin: 15px auto;
table-layout: fixed;
.hours-point {
height: 18px;
border-right: 1px solid #e9eaee;
position: relative;
span {
position: absolute;
bottom: -20px;
left: -20px;
}
.minte-point {
width: 100%;
table-layout: fixed;
td {
height: 10px;
border-right: 1px solid #e9eaee;
}
td:nth-child(4) {
border: none;
}
}
}
}
.mtrm-data-list {
margin: 10px auto;
width: calc(95% - 56px);
border-top: 1px solid #e9eaee;
border-left: 1px solid #e9eaee;
table-layout: fixed;
overflow-x: hidden;
tr:nth-child(2n) {
background: #f3f6fb;
.mtrm-name {
background: #1c93a7;
}
}
td {
height: 130px;
position: relative;
border-right: 1px solid #e9eaee;
border-bottom: 1px solid #e9eaee;
cursor: pointer;
.mtrm-name {
position: absolute;
width: 20px;
height: 130px;
left: -38px;
text-align: center;
top: 0px;
display: table;
padding: 0px 8px;
background: #24b4ce;
color: #fff;
z-index: 99;
div {
vertical-align: middle;
display: table-cell;
span {
display: inline-block;
width: 20px;
overflow: hidden;
}
}
}
.overPal {
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
// white-space: nowrap;
}
.moz{
display: -webkit-box;
-webkit-line-clamp: 2; //设置显示3行
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.mtrm-box {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
z-index: 9;
color: #fff;
text-align: center;
box-sizing: border-box;
overflow: hidden;
table {
height: 100%;
width: calc(100% + 2px);
vertical-align: middle;
border: none;
}
}
.mtrm-box:hover {
box-shadow: 0px 0px 4px #fff;
opacity: 0.9;
}
}
}
.left-btn-icon,
.right-btn-icon {
top: 0px;
position: absolute;
height: 50px;
width: 20px;
border: 1px solid #e9eaee;
cursor: pointer;
color: #B3B3B3;
text-align: center;
line-height: 50px;
}
.p-modal-table td {
height: 30px;
}
}
vue 日程表组件_vue 会议日程列表相关推荐
- vue手风琴组件_Vue 2的Badger手风琴组件
vue手风琴组件 Vue-Badger手风琴 (vue-badger-accordion) Badger-Accordion Component for Vue 2.0. Vue 2.0的Badge- ...
- vue 幻灯片组件_vue.js的幻灯片组件
vue 幻灯片组件 Vue幻灯片放映 (vue-slideshows) a slideshow component for vue.js. vue.js的幻灯片组件. 安装 (Installation ...
- vue 手风琴组件_Vue 使用Element-ui table组件实现手风琴效果
利用Element-UI提供的表格组件做成手风琴效果, 即同时只能有一个行展开 效果展示 手风琴效果 版本说明 "vue": "^2.6.11", " ...
- vue 手风琴组件_vue 手风琴组件
1.创建组件 SqueezeBox.vue {{item.name}}{{item.show}} {{a.name}} {{b.name}} export default { data () { re ...
- vue 拓扑组件_vue.js生成S型拓扑图
1.前端代码 new Vue({ el: '#app', data: { }, mounted() { this.init() }, methods: { init() { axios.get(sit ...
- vue饼图组件_vue写一个图表组件(1)----饼图
话不多说,先上最终效果图: 上面的饼图的实现,使用的插件为百度echarts,该插件的功能可是非常的强大呢,下面便来说说怎么实现的吧 import echarts from 'echarts' exp ...
- vue 拓扑组件_Vue 集成 vis-network 实现网络拓扑图的方法_心病_前端开发者
vis. https://visjs.org/ vs code 下安装命令 npm install vis-network 在 const vis = require("vis-netwo ...
- 【day 08】vue父子组件通信
props实现父子组件通信 Song.vue Singer.vue ==>父组件 SectionList.vue ==>子组件 SectionList 需要 标题+列表数据 爸爸传什么数据 ...
- vue变量传值_vue组件与组件之间传值
目录 一.父组件向子组件传值 二.子组件向父组件传值 三.兄弟组件之间的传值 如上图所示,2是1的子组件,1是3的父组件,2和3是兄弟组件 一.父组件向子组件传值: html代码: <div i ...
- vue路由+ elementUI表格组件:loop文章列表页enter内容页(vue路由传参userid)- 代码篇
elementUI表格组件,response.data.newsLists列表如何循环出来?如何点击传参numId,并进入对应的内容页? 本文意图: 使用官方table组件:实现API调用:文章遍历. ...
最新文章
- 在c#中调用windows脚本的方法
- SAP MM 如何看一个Inbound Delivery单据相关的IDoc?
- 【转】基于Android Fragment功能的例子
- 设置普通用户加入域配额
- outdated: 17.2D Texture Font
- 读未来产品的设计(1)
- DNS_ARP_DHCP协议
- php 2010excel,PHPExcel在php5.2.10上的bug
- 小米电视双十一大降价:55寸仅1399元
- String---Double 不依赖地域性的转换
- 年度回忆录(2011.07----2011.12)
- 第 7 章 本地方法栈
- LeetCode33. 搜索旋转排序数组(二分查找)
- Windows Server 2012 NIC Teaming
- [Js-Java SE]文件/文件夹复制(递归)
- 华为NP课程笔记22-防火墙
- 如何将成绩用C语言分,如何利用C语言实现简单的分数化简
- Golang的基础数据类型
- 汇编——dosbox的debug常用指令
- 小技巧丨累了困了学不下去的时候该怎么办?
热门文章
- 详解AVL树(平衡二叉树)
- 激荡三十年:1978-2008 之序
- VMware安装和卸载时出现无法访问你试图使用的功能所在的网络位置该怎么办(Windows Installer CleanUp)
- 软件项目风险控制-公益讲座视频,供大家学习参考。
- xp重启计算机的快捷键,重启电脑的快捷键是什么?
- redis 删除操作命令
- 2017公共DNS服务器评估报告——公共DNS推荐(摘录)
- 计算机文件夹无法排序,win7系统怎么无法排序磁盘文件夹?手动排序方法
- 高德离线数据api_高德开放平台数据开放情况和调用实验
- PaddleWeekly | 这是属于技术宅的七夕特别篇