Commit 4293c384 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/luochao/confucius into master

parents 32d8576d e85db7e0
var websock = null;
var global_callback = null;
//webSocket连接端口
var serverPort = '10086';
/**
* 初始化weosocket
*/
function initWebSocket() {
//ws地址
var wsuri = "ws://192.168.20.8:" + serverPort;
websock = new WebSocket(wsuri);
websock.onmessage = function (e) {
websocketonmessage(e);
}
websock.onclose = function (e) {
websocketclose(e);
}
websock.onopen = function () {
websocketOpen();
}
//连接发生错误的回调方法
websock.onerror = function () {
console.log("WebSocket连接发生错误");
}
}
/**
* 实际调用发送消息的方法
* @param {*} postData 参数
* @param {*} callback 回调函数
*/
function sendSock(postData, callback) {
global_callback = callback;
if (websock.readyState === websock.OPEN) {
//若是ws开启状态
websocketsend(postData)
} else if (websock.readyState === websock.CONNECTING) {
// 若是 正在开启状态,则等待1s后重新调用
setTimeout(function () {
sendSock(postData, callback);
}, 1000);
} else {
// 若未开启 ,则等待1s后重新调用
setTimeout(function () {
sendSock(postData, callback);
}, 1000);
}
}
/**
* 数据接收
*/
function websocketonmessage(e) {
global_callback(e);
}
/**
* 数据发送
* @param {*} agentData
*/
function websocketsend(agentData) {
websock.send(JSON.stringify(agentData));
}
/**
* 关闭
*/
function websocketclose(e) {
console.log("connection closed (" + e.code + ")");
}
/**
* 连接
*/
function websocketOpen(e) {
console.log("连接成功");
}
initWebSocket();
export {
sendSock
}
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
margin: 20px; margin: 20px;
padding-left: 20px; padding-left: 20px;
font-size: 12px; font-size: 12px;
color:#000;
} }
.lessStuInnerList { .lessStuInnerList {
...@@ -157,21 +158,28 @@ ...@@ -157,21 +158,28 @@
.classQue .commonLessName { .classQue .commonLessName {
color: #fff; color: #fff;
} }
.el-select-dropdown,.el-picker-panel{
z-index:9999!important;
}
.lesson_Form .el-calendar__header{
display:none;
}
</style> </style>
<template> <template>
<div v-if="!isShowSign"> <div v-if="!isShowSign">
<div class="lesson_Form"> <div class="lesson_Form">
<div class="calenderHeader"> <div class="calenderHeader">
<div> <div>
<el-radio-group v-model="checkedDays" size="mini"> <el-radio-group v-model="checkedType" size="mini">
<!-- <el-radio-button label="日"></el-radio-button> --> <!-- <el-radio-button label="日"></el-radio-button>
<el-radio-button label="月"></el-radio-button> <el-radio-button label="月"></el-radio-button>
<!-- <el-radio-button style="margin-left:20px;border-left:1px solid #DCDFE6;" label="今天"></el-radio-button> --> <el-radio-button style="margin-left:20px;border-left:1px solid #DCDFE6;" label="今天"></el-radio-button> -->
<el-radio-button :label="1">列表模式</el-radio-button>
<el-radio-button :label="2">日历模式</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div> <div>
<q-btn color="accent q-px-md" class="q-mr-md" icon="add" size="12px" label="新增日程" @click="addNew()"> <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增日程" @click="addNew()">
<q-popup-proxy> <q-popup-proxy>
<q-banner v-if="isShowMenu"> <q-banner v-if="isShowMenu">
<div class="calenderDialog"> <div class="calenderDialog">
...@@ -222,6 +230,95 @@ ...@@ -222,6 +230,95 @@
</q-btn> </q-btn>
</div> </div>
</div> </div>
<div style="text-align:right;margin:12px 20px 8px 0">
<el-date-picker
v-model="comMsg.QMonth"
type="month"
size="small"
 value-format="yyyy-MM"
@change="getClassPlan()"
placeholder="选择月">
</el-date-picker>
</div>
<template v-if="checkedType===1">
<q-table style="margin:20px;" :pagination="msg" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="calendarData" :columns="columns" row-key="name">
<template v-slot:body-cell-TimeList="props">
<q-td auto-width :props="props">
<div v-for="(item,index) in props.row.TimeList">
{{index+1}}节课 {{item.StartTime}}-{{item.EndTime}}
</div>
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:15%;">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="getInfo(props.row)">
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="calenderDialog">
<div style="margin:10px 0 15px 0;">{{props.row.ClassDateStr}}课程安排</div>
<q-select filled stack-label option-value="TId" option-label="TeacherName"
v-model="addMsg.TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师"
:dense="false" class="col-6 q-pb-lg" emit-value map-options />
<q-input filled v-model="addMsg.ClassDate" class="col-6 q-pb-lg" mask="date" label="上课时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy3" transition-show="scale" transition-hide="scale">
<q-date v-model="addMsg.ClassDate" @input=' () => $refs.qDateProxy3[0].hide()' />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-toggle size="md" label="更多设置" left-label color="primary" :false-value="0" :true-value="1"
v-model="isSetMoreTwo" />
<template v-if="isSetMoreTwo==1">
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="addMsg.ClassRoomId" ref="ClassRoomId" :options="ClassRoomList" label="关联教室"
:dense="false" class="col-6 q-pb-lg" emit-value map-options />
<div style="display:flex;justify-content:flex-end;margin-bottom:20px;">
<q-btn @click="addStep()" size="10px" round color="primary"
icon="iconfont icon-img_haha" />
</div>
<div class="row wrap" style="position:relative;"
v-for="(subItem,subIndex) in addMsg.PlanTimeList">
<div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="subItem.StartTime"
ref="StartTime" class="col-6 q-pr-lg q-pb-lg" label=""
:rules="[val => !!val || '请填写开始时间']" />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="20" :dense="false" v-model="subItem.EndTime"
ref="EndTime" class="col-6 q-pr-lg q-pb-lg" label=""
:rules="[val => !!val || '请填写开始时间']" />
</div>
<div class="delBtnStyle">
<i @click="delStep(subIndex)" class="iconfont icon-guanbi"></i>
</div>
</div>
</template>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="isShowEdit=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important"
@click="saveSteps" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
<q-btn flat size="xs" icon="iconfont icon-View" color="accent" style="font-weight:400" label="查看"
@click.stop="getClicked(props.row)"></q-btn>
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除"
@click.stop="delInfo(props.row)"></q-btn>
</q-td>
</template>
<template v-slot:bottom>
</template>
</q-table>
</template>
<template v-else>
<el-calendar v-model="value" id="calendar"> <el-calendar v-model="value" id="calendar">
<!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法--> <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
<template slot="dateCell" slot-scope="{date, data}"> <template slot="dateCell" slot-scope="{date, data}">
...@@ -309,6 +406,7 @@ ...@@ -309,6 +406,7 @@
</div> </div>
</template> </template>
</el-calendar> </el-calendar>
</template>
</div> </div>
</div> </div>
<div v-else> <div v-else>
...@@ -316,7 +414,7 @@ ...@@ -316,7 +414,7 @@
<div class="Show_SignBack"> <div class="Show_SignBack">
<span @click="isShowSign=false" style="cursor:pointer;"><i class="iconfont icon-zuo1"></i>返回</span> <span @click="isShowSign=false" style="cursor:pointer;"><i class="iconfont icon-zuo1"></i>返回</span>
</div> </div>
<div class="StudentInfo_List"> <div class="StudentInfo_List" style="color:#000;">
<div> <div>
<div>授课老师</div> <div>授课老师</div>
<div>{{dayObj.TeacherName}}</div> <div>{{dayObj.TeacherName}}</div>
...@@ -335,8 +433,37 @@ ...@@ -335,8 +433,37 @@
</div> </div>
</div> </div>
<div class="lessStudentList"> <div class="lessStudentList">
<div class="lessStuTitle">学生签到情况</div> <div class="lessStuTitle">
<div class="lessStuInnerList"> 学生签到情况
</div>
<q-table :pagination="msg" no-data-label="暂无相关数据" flat
class="sticky-column-table" separator="none" hide-bottom :data="dayObj.GuestList" :columns="columns2">
<template v-slot:body-cell-GuestName="props">
<q-td auto-width :props="props" style="width:25%;">
<div style="display:flex;align-items:center;">
<q-avatar size="sm" style="margin:0 5px 5px 0" v-if="props.row.UserIcon">
<img :src="props.row.UserIcon" />
</q-avatar>
<q-avatar size="sm" color="teal-10" style="margin:5px 0 5px 0" text-color="white" v-if="!props.row.UserIcon">
{{props.row.GuestName[0]}}</q-avatar><span style="margin-left:5px;">{{props.row.GuestName}}</span>
</div>
</q-td>
</template>
<template v-slot:body-cell-IsCheck="props">
<q-td auto-width :props="props">
<el-select v-model="props.row.IsCheck" style="width:80px;" size="small" placeholder="小时">
<el-option label="出勤" :value="0"></el-option>
<el-option label="缺勤" :value="1"></el-option>
</el-select>
</q-td>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:15%;">
<el-input v-model="props.row.StudyNum" size="small" @keyup.native="checkInteger(props.row,'StudyNum')"></el-input>
</q-td>
</template>
</q-table>
<div class="lessStuInnerList" style="display:none;">
<div class="lessList" v-for="(item,index) in dayObj.GuestList" :key="index" :class="{'classQue':isShowSignBtn&&item.IsCheck==0,'classChu':isShowSignBtn&& <div class="lessList" v-for="(item,index) in dayObj.GuestList" :key="index" :class="{'classQue':isShowSignBtn&&item.IsCheck==0,'classChu':isShowSignBtn&&
item.IsCheck==1}" @click="changeStatus(item)"> item.IsCheck==1}" @click="changeStatus(item)">
<q-avatar size="md" style="margin:12px 0 5px 0" v-if="item.UserIcon"> <q-avatar size="md" style="margin:12px 0 5px 0" v-if="item.UserIcon">
...@@ -357,7 +484,7 @@ ...@@ -357,7 +484,7 @@
</div> </div>
</div> </div>
<!--&&isSigned--> <!--&&isSigned-->
<q-card-actions align="right" class="bg-white" v-if="isShowSignBtn" style="margin-right:45px;"> <q-card-actions align="right" class="bg-white" v-if="isShowSignBtn" style="margin:20px 10px 100px 0;">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="isShowSign=false" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="isShowSign=false" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important" @click="saveSign()" /> <q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important" @click="saveSign()" />
</q-card-actions> </q-card-actions>
...@@ -392,6 +519,7 @@ ...@@ -392,6 +519,7 @@
calendarData: [], calendarData: [],
value: new Date(), value: new Date(),
checkedDays: '月', checkedDays: '月',
checkedType: 1,
TeacherList: [], //老师下拉数据 TeacherList: [], //老师下拉数据
addMsg: { addMsg: {
ClassPlanId: 0, ClassPlanId: 0,
...@@ -425,7 +553,76 @@ ...@@ -425,7 +553,76 @@
dayObj: {}, dayObj: {},
isShowSignBtn: false, //是否显示签到提交按钮 isShowSignBtn: false, //是否显示签到提交按钮
comChecked: {}, //点击选中复制 comChecked: {}, //点击选中复制
isSigned: true isSigned: true,
columns:[{
name: 'RoomName',
label: '校区名称',
field: 'RoomName',
align: 'left',
},{
name: 'ClassDateStr',
label: '上课日期',
field: 'ClassDateStr',
align: 'left'
},
{
name: 'TeacherName',
label: '老师',
field: 'TeacherName',
align: 'left'
},
{
name: 'TimeList',
label: '上课时间',
field: 'TimeList',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId',
align: 'center'
}
],
msg:{
rowsPerPage: 100
},
comMsg:{
ClassId: 0,
QMonth: ''
},
columns2: [{
name: 'GuestName',
label: '学生姓名',
field: 'GuestName',
align: 'left'
},
{
name: 'SexStr',
label: '性别',
field: 'SexStr',
align: 'left',
},
{
name: 'Mobile',
label: '电话',
field: 'Mobile',
align: 'left'
},
{
name: 'IsCheck',
label: '是否出勤',
field: 'IsCheck',
align: 'left'
},
{
name: 'optioned',
label: '学习时间',
field: 'QuestionId',
align: 'center'
}
],
} }
}, },
created() { created() {
...@@ -435,27 +632,35 @@ ...@@ -435,27 +632,35 @@
} }
}, },
mounted() { mounted() {
this.initData(); //this.initData();
var d = new Date();
this.comMsg.QMonth = d.getFullYear() + '-' + (d.getMonth() + 1);
this.GetTeacherList();
this.getClassRoomList();
this.addMsg.TeacherId = this.setingObj.Teacher_Id;
this.addMsg.ClassDate = this.setingObj.OpenTime;
this.getClassPlan();
}, },
methods: { methods: {
initData() { initData() {
this.$nextTick(() => { this.$nextTick(() => {
// 点击上个月 // 点击上个月
let prevBtn1 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(1)'); let prevBtn1 = document.querySelector('.el-button-group>button:nth-child(1)');
prevBtn1.addEventListener('click', () => { prevBtn1.addEventListener('click', () => {
var d = new Date(this.value); var d = new Date(this.value);
var datetime = d.getFullYear() + '-' + (d.getMonth() + 1); var datetime = d.getFullYear() + '-' + (d.getMonth() + 1);
this.getClassPlan(datetime); this.getClassPlan(datetime);
}) })
// 点击今天 // 点击今天
let prevBtn2 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(2)'); let prevBtn2 = document.querySelector('.el-button-group>button:nth-child(2)');
prevBtn2.addEventListener('click', () => { prevBtn2.addEventListener('click', () => {
var d = new Date(this.value); var d = new Date(this.value);
var datetime = d.getFullYear() + '-' + (d.getMonth() + 1); var datetime = d.getFullYear() + '-' + (d.getMonth() + 1);
this.getClassPlan(datetime); this.getClassPlan(datetime);
}) })
// 点击下个月 // 点击下个月
let prevBtn3 = document.querySelector('.el-calendar__button-group .el-button-group>button:nth-child(3)'); let prevBtn3 = document.querySelector('.el-button-group>button:nth-child(3)');
prevBtn3.addEventListener('click', () => { prevBtn3.addEventListener('click', () => {
var d = new Date(this.value); var d = new Date(this.value);
var datetime = d.getFullYear() + '-' + (d.getMonth() + 1); var datetime = d.getFullYear() + '-' + (d.getMonth() + 1);
...@@ -479,14 +684,13 @@ ...@@ -479,14 +684,13 @@
} }
}, },
//获取班级上课计划列表 //获取班级上课计划列表
getClassPlan(datetime) { getClassPlan() {
var msg = { this.comMsg.ClassId = this.setingObj.ClassId;
ClassId: this.setingObj.ClassId, quertClassPlan(this.comMsg).then(res => {
QMonth: datetime
};
quertClassPlan(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.calendarData = res.Data; this.calendarData = res.Data;
this.value = this.comMsg.QMonth;
this.$forceUpdate();
} }
}) })
}, },
...@@ -509,6 +713,19 @@ ...@@ -509,6 +713,19 @@
//点击新增 //点击新增
addNew() { addNew() {
this.isShowMenu = true; this.isShowMenu = true;
var d = new Date();
var seperator1 = "-";
var year = d.getFullYear();
var month = d.getMonth() + 1;
var strDate = d.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
this.addMsg.ClassDate = currentdate;
this.addMsg.ClassPlanId = 0; this.addMsg.ClassPlanId = 0;
this.addMsg.PlanTimeList = [{ this.addMsg.PlanTimeList = [{
ClassTimeId: 0, ClassTimeId: 0,
...@@ -537,7 +754,7 @@ ...@@ -537,7 +754,7 @@
this.isShowEdit = false; this.isShowEdit = false;
var d = new Date(this.value); var d = new Date(this.value);
var datetime = d.getFullYear() + '-' + (d.getMonth() + 1); var datetime = d.getFullYear() + '-' + (d.getMonth() + 1);
this.getClassPlan(datetime); this.getClassPlan();
} }
}) })
}, },
...@@ -555,7 +772,7 @@ ...@@ -555,7 +772,7 @@
//日历点击删除 //日历点击删除
delInfo(item) { delInfo(item) {
this.$q.dialog({ this.$q.dialog({
title: "删除课程", title: "确定删除课程",
message: '', message: '',
cancel: { cancel: {
label: "取消", label: "取消",
...@@ -641,7 +858,8 @@ ...@@ -641,7 +858,8 @@
School_Id: this.setingObj.School_Id, School_Id: this.setingObj.School_Id,
TeacherId: this.comChecked.TeacherId, TeacherId: this.comChecked.TeacherId,
OrderGuestId: x.Id, OrderGuestId: x.Id,
CheckStatus: x.IsCheck CheckStatus: x.IsCheck,
StudyNum:x.StudyNum
} }
signMsg.push(obj); signMsg.push(obj);
}) })
...@@ -655,7 +873,6 @@ ...@@ -655,7 +873,6 @@
watch: { watch: {
setingObj: function (val, oldval) { setingObj: function (val, oldval) {
this.addMsg.ClassId = val.ClassId; this.addMsg.ClassId = val.ClassId;
this.initData();
} }
} }
} }
......
...@@ -79,15 +79,46 @@ ...@@ -79,15 +79,46 @@
<template> <template>
<div class="page-body"> <div class="page-body">
<div class="page-content recordForm"> <div class="page-content recordForm">
<div class="row wrap" style="display:flex;justify-content:flex-end"> <div class="row wrap" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;">
<div class="col-3">
<el-radio-group v-model="checkType" size="mini">
<el-radio-button :label="1">列表模式</el-radio-button>
<el-radio-button :label="2">时间轴模式</el-radio-button>
</el-radio-group>
</div>
<div class="col-3"> <div class="col-3">
<q-select filled stack-label option-value="TId" @input="changeRecord()" option-label="TeacherName" <q-select filled stack-label option-value="TId" @input="changeRecord()" option-label="TeacherName"
v-model="TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false" v-model="TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> class="col-6" emit-value map-options />
</div> </div>
</div> </div>
<div> <div>
<div class="col-10" style="margin:20px 0 60px 0;display:flex;" <template v-if="checkType==1">
<q-table :pagination="msg" no-data-label="暂无相关数据" flat
class="sticky-column-table" separator="none" :data="dataList.resultList" :columns="columns">
<template v-slot:body-cell-YearStr="props">
<q-td auto-width :props="props" style="width:25%">
{{props.row.YearStr}}-{{props.row.MonthStr}}-{{props.row.DayStr}}
</q-td>
</template>
<template v-slot:body-cell-CheckNum="props">
<q-td auto-width :props="props" style="width:25%">
<span style="color:green;">{{props.row.CheckNum}}</span>
</q-td>
</template>
<template v-slot:body-cell-NoCheckNum="props">
<q-td auto-width :props="props" style="width:25%">
<span style="color:red;">{{props.row.NoCheckNum}}</span>
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
</q-table>
</template>
<template v-else>
<div class="col-10" style="margin-bottom:20px;display:flex;"
v-if="dataList.resultList&&dataList.resultList.length>0"> v-if="dataList.resultList&&dataList.resultList.length>0">
<div class="col-4" id="timeleft"> <div class="col-4" id="timeleft">
<div v-for="item in dataList.resultList"> <div v-for="item in dataList.resultList">
...@@ -109,6 +140,10 @@ ...@@ -109,6 +140,10 @@
</div> </div>
</div> </div>
</div> </div>
<q-pagination class="full-width justify-end" style="margin-bottom:80px;padding-right:43px;" v-model="msg.PageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -135,13 +170,41 @@ ...@@ -135,13 +170,41 @@
msg: { msg: {
TeacherId: 0, TeacherId: 0,
PageIndex: 1, PageIndex: 1,
PageSize: 12, PageSize: 10,
rowsPerPage: 10,
School_Id: 0, School_Id: 0,
ClassId: 0 ClassId: 0
}, },
TeacherId:0, TeacherId:0,
dataList: {}, dataList: {},
TeacherList: [], //关联老师下拉 TeacherList: [], //关联老师下拉
pageCount:0,
columns: [{
name: 'TeacherName',
label: '教师',
field: 'TeacherName',
align: 'left'
},
{
name: 'YearStr',
label: '日期',
field: 'YearStr',
align: 'left',
},
{
name: 'CheckNum',
label: '签到数',
field: 'CheckNum',
align: 'left'
},
{
name: 'NoCheckNum',
label: '缺勤数',
field: 'NoCheckNum',
align: 'left'
}
],
checkType:1, //默认列表模式
} }
}, },
created() { created() {
...@@ -160,6 +223,7 @@ ...@@ -160,6 +223,7 @@
GetClassPlanLogPageList(this.msg).then(res => { GetClassPlanLogPageList(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
} }
}) })
}, },
...@@ -170,9 +234,14 @@ ...@@ -170,9 +234,14 @@
GetClassPlanLogPageList(this.msg).then(res => { GetClassPlanLogPageList(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
} }
}) })
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getRecord()
}, },
//获取教师下拉 //获取教师下拉
GetTeacherList() { GetTeacherList() {
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
{{name}} {{name}}
</q-toolbar-title> </q-toolbar-title>
<q-tabs v-model="tab" @input="changeNavs" inline-label <q-tabs v-model="tab" @input="changeNavs" inline-label
style="margin:0 auto;height:60px;flex:1;justify-content: left;font-weight:bold;" style="margin:0 auto;height:60px;flex:1;justify-content: left;font-weight:bold;" shrink stretch
shrink stretch v-if="userInfo" active-color="primary"> v-if="userInfo" active-color="primary">
<q-tab v-for="(x, i) in userInfo.MenuList" class="q-mr-md" :key="i" @click="setNavs(i)" :name="`navs_${i}`" <q-tab v-for="(x, i) in userInfo.MenuList" class="q-mr-md" :key="i" @click="setNavs(i)" :name="`navs_${i}`"
:label="x.MenuName" :icon="x.MenuIcon" /> :label="x.MenuName" :icon="x.MenuIcon" />
</q-tabs> </q-tabs>
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
} from 'vuex' } from 'vuex'
import userInfoBox from '../components/global/user-right-box' import userInfoBox from '../components/global/user-right-box'
import notify from '../components/global/notify' import notify from '../components/global/notify'
import {
sendSock
} from '../api/common/socket'
export default { export default {
name: 'MainLayout', name: 'MainLayout',
data() { data() {
...@@ -104,14 +107,14 @@ ...@@ -104,14 +107,14 @@
width: '6px', width: '6px',
opacity: 0.5 opacity: 0.5
}, },
persistent:false, persistent: false,
persistentNotify:false, persistentNotify: false,
isExpend: false, isExpend: false,
IsShowLeft: true, IsShowLeft: true,
userCenterMenuList: [], //用户中心菜单 userCenterMenuList: [], //用户中心菜单
} }
}, },
components:{ components: {
userInfoBox, userInfoBox,
notify notify
}, },
...@@ -167,16 +170,88 @@ ...@@ -167,16 +170,88 @@
if (this.userInfo && this.userInfo.MenuList) { if (this.userInfo && this.userInfo.MenuList) {
this.secondNavs = this.userInfo.MenuList.length > 0 ? this.userInfo.MenuList[i].SubList : [] this.secondNavs = this.userInfo.MenuList.length > 0 ? this.userInfo.MenuList[i].SubList : []
} }
this.getMsg();
}, },
methods: { methods: {
getMsg() {
var SendData = {
AppId: "JiaHeJiaoYu",
ClientId: "1",
};
//sendSock(SendData, this.getDataFunc)
},
getDataFunc(e) {
if (e.data) {
var newData = JSON.parse(e.data)
console.log("getDataFunc", newData)
this.showNotification(newData[0].Title, newData[0].Content, newData.CoverImg)
}
},
/**
* 通过Html调用显示系统通知
* @param title
* @param msg
* @param imgUrl
*/
showNotification(title, msg, imgUrl) {
console.log("title", title)
console.log("msg", msg)
console.log("imgUrl", imgUrl)
var Notification = window.Notification || window.mozNotification || window.webkitNotification;
// 判断浏览器是否支持桌面通知
if (Notification) {
Notification.requestPermission(function (result) {
//result 默认值'default'等同于拒绝 'denied' -用户选择了拒绝 'granted' -用户同意启用通知
if ("granted" != result) {
console.log('请授权浏览器能够进行通知!');
return false;
} else {
var tag = "sds" + Math.random();
var notify = new Notification(
title, {
dir: 'auto',
lang: 'zh-CN',
tag: tag, //实例化的notification的id
icon: imgUrl, //通知的缩略图,icon 支持ico、png、jpg、jpeg格式
title: title, //通知的标题
body: msg //通知的具体内容
}
);
// 定义通知窗口点击函数
notify.onclick = function () {
//如果通知消息被点击,通知窗口将被激活
window.focus();
};
// 定义通知错误事件
notify.onerror = function () {
// console.log("");
};
// 定义通知显示事件 可以设置多少秒之后关闭 也可以不设置关闭
notify.onshow = function () {
// 窗口显示3S后关闭
setTimeout(function () {
notify.close();
}, 3000);
};
// 定义通知关闭事件
notify.onclose = function () {
};
}
});
} else {
// 提示不支持系统通知
console.log('您的浏览器不支持系统通知,建议使用Chrome浏览');
}
},
changeLeft() { changeLeft() {
this.IsShowLeft = !this.IsShowLeft; this.IsShowLeft = !this.IsShowLeft;
}, },
showInfo(){ showInfo() {
this.persistent=true this.persistent = true
}, },
showNotify(){ showNotify() {
this.persistentNotify=true this.persistentNotify = true
}, },
changeNavs(val) { changeNavs(val) {
let i = val.split('_')[1] let i = val.split('_')[1]
...@@ -184,7 +259,7 @@ ...@@ -184,7 +259,7 @@
}, },
closeSaveForm() { closeSaveForm() {
this.persistent = false this.persistent = false
this.persistentNotify=false this.persistentNotify = false
}, },
setNavs(val) { setNavs(val) {
//防止页面数据丢失 //防止页面数据丢失
...@@ -202,6 +277,7 @@ ...@@ -202,6 +277,7 @@
<style> <style>
@import url('~assets/css/common.css'); @import url('~assets/css/common.css');
.full-width { .full-width {
height: 100%; height: 100%;
} }
...@@ -210,20 +286,23 @@ ...@@ -210,20 +286,23 @@
position: absolute; position: absolute;
color: #a1a4a9; color: #a1a4a9;
cursor: pointer; cursor: pointer;
right:75px; right: 75px;
bottom:7px; bottom: 7px;
z-index:999; z-index: 999;
} }
.is-show-menu-2 i{
font-size:30px; .is-show-menu-2 i {
font-size: 30px;
} }
.is_Show_menu_3{
.is_Show_menu_3 {
position: absolute; position: absolute;
left: 75px; left: 75px;
bottom:7px; bottom: 7px;
cursor: pointer; cursor: pointer;
z-index: 10; z-index: 10;
} }
.head-bg { .head-bg {
/*background-image: url('~assets/images/page/top.png'); /*background-image: url('~assets/images/page/top.png');
background-position: right; background-position: right;
...@@ -231,10 +310,12 @@ ...@@ -231,10 +310,12 @@
background-size: auto 100%;*/ background-size: auto 100%;*/
background-color: #FFF; background-color: #FFF;
} }
.head-bg .q-tab__label{
.head-bg .q-tab__label {
font-weight: bold !important; font-weight: bold !important;
font-size: 15px; font-size: 15px;
} }
.second-menu-bg { .second-menu-bg {
background-image: url('~assets/images/page/left.png'); background-image: url('~assets/images/page/left.png');
background-position: bottom; background-position: bottom;
...@@ -314,25 +395,29 @@ ...@@ -314,25 +395,29 @@
width: 60px; width: 60px;
} }
} }
.changeShowqidonghua { .changeShowqidonghua {
animation: shouqidonghua 0.5s linear; animation: shouqidonghua 0.5s linear;
width: 60px !important; width: 60px !important;
overflow-x: hidden; overflow-x: hidden;
} }
.wave_wrapper{
.wave_wrapper {
margin: 0px 20px 0px 0; margin: 0px 20px 0px 0;
width: 50px; width: 50px;
height: 50px; height: 50px;
position: relative; position: relative;
display:flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
} }
.wave_wrapper:hover{
.wave_wrapper:hover {
background-color: #f3f6f9; background-color: #f3f6f9;
} }
.wave_wrapper .dona { .wave_wrapper .dona {
position: absolute; position: absolute;
width: 50%; width: 50%;
...@@ -343,6 +428,7 @@ ...@@ -343,6 +428,7 @@
border-radius: 50%; border-radius: 50%;
z-index: 2; z-index: 2;
} }
.wave_wrapper span.wave_scale { .wave_wrapper span.wave_scale {
animation: wave_scale 2s both infinite; animation: wave_scale 2s both infinite;
} }
...@@ -353,11 +439,13 @@ ...@@ -353,11 +439,13 @@
-webkit-transform: scale(1, 1); -webkit-transform: scale(1, 1);
opacity: 1; opacity: 1;
} }
50% { 50% {
transform: translate3d(-41px, -41px, 0px) scale(10, 10); transform: translate3d(-41px, -41px, 0px) scale(10, 10);
-webkit-transform: scale(2.5, 2.5); -webkit-transform: scale(2.5, 2.5);
opacity: 0; opacity: 0;
} }
100% { 100% {
transform: translate3d(-41px, -41px, 0px) scale(1, 1); transform: translate3d(-41px, -41px, 0px) scale(1, 1);
-webkit-transform: scale(1, 1); -webkit-transform: scale(1, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment