Compare commits
13 Commits
3fcd0cdb21
...
74275ac327
Author | SHA1 | Date |
---|---|---|
朱浩 | 74275ac327 | |
朱浩 | c29a3d7a77 | |
朱浩 | b8325d336b | |
朱浩 | c2876ff983 | |
zhengdegang | 6035803db1 | |
zdg | f9de8514ed | |
zdg | cc8ea2b043 | |
lyc | 9e0e2a41f2 | |
朱浩 | ae500c94ce | |
朱浩 | e5845a6714 | |
朱浩 | 1c1ec2be71 | |
朱浩 | 572bdb5fec | |
朱浩 | 7974aeabe4 |
|
@ -24,8 +24,8 @@ export default defineConfig({
|
|||
server: {
|
||||
proxy: {
|
||||
'/dev-api': {
|
||||
target: 'http://27.128.240.72:7865',
|
||||
// target: 'http://192.168.2.52:7863',
|
||||
// target: 'http://27.128.240.72:7865',
|
||||
target: 'http://192.168.2.52:7863',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
}
|
||||
|
|
|
@ -250,7 +250,9 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
|||
onDownloadStarted: async ({ id, item, webContents }) => {
|
||||
// Do something with the download id
|
||||
},
|
||||
onDownloadProgress: async ({ id, item, percentCompleted }) => {},
|
||||
onDownloadProgress: async ({ id, item, percentCompleted }) => {
|
||||
e.reply('download-file-default-prog' + fileName, percentCompleted)
|
||||
},
|
||||
onDownloadCompleted: async ({ id, item }) => {
|
||||
console.log('完成')
|
||||
e.reply('download-file-default' + fileName, true)
|
||||
|
|
|
@ -243,4 +243,4 @@ function handleAll() {
|
|||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,3 +130,46 @@ export function addStudentmainByNameArray(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
//新增课程预约
|
||||
export function addSmartClassReserv(data) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/addSmartClassReserv',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//修改课程预约
|
||||
export function updateSmartClassReserv(data) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/updateSmartClassReserv',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//查询课程预约
|
||||
export function getSelfReserv() {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/getSelfReserv',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function deleteSmartReserv(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function startClass(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/startClass',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
export function endClass(id) {
|
||||
return request({
|
||||
url: '/smarttalk/classReserv/endClass',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
||||
<el-dropdown-item @click="changePage('/classReserv')">课程预约</el-dropdown-item>
|
||||
<el-dropdown-item @click="changePage('/class')">班级中心</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout">
|
||||
<span>退出登录</span>
|
||||
|
|
|
@ -20,7 +20,7 @@ export function shareStorePlugin({store}) {
|
|||
function stateSync(store) {
|
||||
const storeName = store.$id
|
||||
const jsonStr = JSON.stringify(store.$state)
|
||||
// console.log('state-change', jsonStr, storeName)
|
||||
console.log('state-change', jsonStr, storeName)
|
||||
// 通知主线程更新
|
||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ function stateChange(store) {
|
|||
// 更新状态
|
||||
store.$patch(stateJson)
|
||||
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
||||
// store.$state = stateJson
|
||||
// store.$state = stateJson
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,12 @@ export const constantRoutes = [
|
|||
name: 'profile',
|
||||
meta: {title: '个人中心'}
|
||||
},
|
||||
{
|
||||
path: '/classReserv',
|
||||
component: () => import('@/views/classManage/classReserv.vue'),
|
||||
name: 'classReserv',
|
||||
meta: {title: '课程预约'}
|
||||
},
|
||||
{
|
||||
path: '/class',
|
||||
component: () => import('@/views/classManage/index.vue'),
|
||||
|
|
|
@ -12,4 +12,4 @@ export const useToolState = defineStore('tool', {
|
|||
}),
|
||||
actions: {
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@ const isDev = isNode?process.env.NODE_ENV !== 'production':''
|
|||
export const ipcMain = Remote?.ipcMain || {}
|
||||
/**
|
||||
* 获取静态资源,开发和生产环境
|
||||
* @param {*} url
|
||||
* @param {*} url
|
||||
* @param {*} type 类型 app 应用内 user (用户目录 selfFile 自定义文件路径)
|
||||
* @returns
|
||||
*/
|
||||
|
@ -67,9 +67,9 @@ export function ipcMsgInvoke(key, ...args) {
|
|||
/**
|
||||
* @description 封装ipcRenderer事件监听
|
||||
* @param {*} fn on once handle invoke
|
||||
* @param {*} key
|
||||
* @param {*} key
|
||||
* @param {Function} cb 回调函数
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function ipcHandle(fn,key, cb) {
|
||||
return ipcRenderer[fn](key, cb)
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<el-container class="class-reserv-wrap">
|
||||
<div class="class-reserv-tabs">
|
||||
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
||||
</div>
|
||||
<div class="class-reserv-body">
|
||||
<reserv-item
|
||||
v-for="(item, index) in activeDataList"
|
||||
v-show="tabActive === '进行中'"
|
||||
:key="index"
|
||||
:item="item"
|
||||
@open-edit="reservDialog.openDialog(item)"
|
||||
@delete-reserv="deleteReserv(item)"
|
||||
></reserv-item>
|
||||
<reserv-item
|
||||
v-for="(item, index) in doneDataList"
|
||||
v-show="tabActive === '已结束'"
|
||||
:key="index"
|
||||
:item="item"
|
||||
></reserv-item>
|
||||
</div>
|
||||
<reserv ref="reservDialog"></reserv>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed, watch } from 'vue'
|
||||
import { getSelfReserv } from '@/api/classManage'
|
||||
import ReservItem from '@/views/classManage/reserv-item.vue'
|
||||
import Reserv from '@/views/prepare/container/reserv.vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
const reservDialog = ref(null)
|
||||
const tabOptions = ref(['进行中', '已结束'])
|
||||
const tabActive = ref('进行中')
|
||||
const dataList = ref([])
|
||||
|
||||
const activeDataList = computed(() => {
|
||||
return dataList.value.filter((item) => {
|
||||
return item.status !== '已结束'
|
||||
})
|
||||
})
|
||||
const deleteReserv = (item) => {
|
||||
dataList.value = dataList.value.filter((is) => {
|
||||
return is.id !== item.id
|
||||
})
|
||||
}
|
||||
const doneDataList = computed(() => {
|
||||
return dataList.value.filter((item) => {
|
||||
return item.status === '已结束'
|
||||
})
|
||||
})
|
||||
const toolStore = useToolState()
|
||||
watch(
|
||||
() => toolStore.isToolWin,
|
||||
(newD, oldD) => {
|
||||
getSelfReserv().then((res) => {
|
||||
dataList.value = [...res.data]
|
||||
})
|
||||
}
|
||||
)
|
||||
onMounted(() => {
|
||||
getSelfReserv().then((res) => {
|
||||
dataList.value = res.data
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.class-reserv-wrap {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 15px 30px;
|
||||
.class-reserv-tabs {
|
||||
width: 30%;
|
||||
text-align: left;
|
||||
}
|
||||
.class-reserv-body {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,133 @@
|
|||
<template>
|
||||
<div class="class-reserv-item">
|
||||
<div class="class-reserv-item-img">
|
||||
<img :src="basePath + item.bookImg" alt="封面" />
|
||||
</div>
|
||||
<div class="class-reserv-item-body">
|
||||
<div class="class-reserv-item-title1">
|
||||
<label>{{ item.className }}</label>
|
||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classType }}</el-tag>
|
||||
<el-tag style="margin-left: 5px" type="primary"> {{ item.classSubject }}</el-tag>
|
||||
</div>
|
||||
<div class="class-reserv-item-title2">
|
||||
{{ item.classDay }} {{ item.startTime }} ~ {{ item.classDay }} {{ item.endTime }}
|
||||
{{ item.createUserName }}老师
|
||||
</div>
|
||||
<div class="class-reserv-item-title3">
|
||||
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
|
||||
{{ index === 0 ? tag.name : '、' + tag.name }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="class-reserv-item-tool">
|
||||
<el-button v-if="item.status !== '已结束'" type="primary" @click="startClassR(item)"
|
||||
>上课</el-button
|
||||
>
|
||||
<el-button v-if="item.status === '未开始'" @click="openEdit">编辑</el-button>
|
||||
<!-- <el-button v-if="item.status === '上课中'" type="info" @click="endClassR(item)"
|
||||
>下课</el-button
|
||||
>-->
|
||||
<el-button type="danger" @click="deleteReserv">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
import { deleteSmartReserv, startClass, endClass } from '@/api/classManage'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { listEntpcourse } from '@/api/teaching/classwork'
|
||||
const emit = defineEmits(['openEdit', 'deleteReserv'])
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
const openEdit = () => {
|
||||
emit('openEdit', props.item)
|
||||
}
|
||||
const deleteReserv = () => {
|
||||
deleteSmartReserv([props.item.id]).then((res) => {
|
||||
if (res.data === true) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('deleteReserv', props.item)
|
||||
}
|
||||
})
|
||||
}
|
||||
const startClassR = (item) => {
|
||||
startClass(item.id).then((res) => {
|
||||
if (res.data === true) {
|
||||
item.status = '上课中'
|
||||
openLesson()
|
||||
}
|
||||
})
|
||||
}
|
||||
const toolStore = useToolState()
|
||||
// 上课-工具类悬浮
|
||||
const openLesson = () => {
|
||||
if (toolStore.isToolWin) return ElMessage.error('您当前已开始上课,请勿重复操作')
|
||||
startClass(props.item.id)
|
||||
listEntpcourse({
|
||||
evalid: props.item.ex2,
|
||||
edituserid: useUserStore().user.userId,
|
||||
pageSize: 500
|
||||
}).then(res=>{
|
||||
if (res.rows[0].id) {
|
||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res.rows[0].id + "&reservId=" + props.item.id })
|
||||
}
|
||||
})
|
||||
}
|
||||
const endClassR = (item) => {
|
||||
endClass(item.id).then((res) => {
|
||||
if (res.data === true) {
|
||||
ElMessage({
|
||||
message: '下课成功',
|
||||
type: 'success'
|
||||
})
|
||||
item.status = '已结束'
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.class-reserv-item {
|
||||
display: flex;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
.class-reserv-item-img {
|
||||
width: 80px;
|
||||
padding-left: 20px;
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.class-reserv-item-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: left;
|
||||
padding-left: 30px;
|
||||
font-size: 14px;
|
||||
.class-reserv-item-title1 {
|
||||
flex: 1;
|
||||
label {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.class-reserv-item-tool {
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -77,20 +77,42 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, defineExpose, onMounted, reactive, computed } from 'vue'
|
||||
import { listClassmain } from '@/api/classManage'
|
||||
import { ref, defineExpose, onMounted, reactive, computed, watch } from 'vue'
|
||||
import { addSmartClassReserv, updateSmartClassReserv, listClassmain } from '@/api/classManage'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const emit = defineEmits(['addSuccess'])
|
||||
const props = defineProps({
|
||||
bookId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
currentNode: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
})
|
||||
const ruleFormDialog = ref(null)
|
||||
const nowType = ref('add')
|
||||
const userStore = useUserStore().user
|
||||
const centerDialogVisible = ref(false)
|
||||
const form = reactive({
|
||||
name: '',
|
||||
type: '常规课',
|
||||
day: '',
|
||||
time: '',
|
||||
time: [],
|
||||
resource: [],
|
||||
classRoom: ''
|
||||
})
|
||||
const updateForm = ref({})
|
||||
watch(
|
||||
() => props.currentNode,
|
||||
(newValue, oldValue) => {
|
||||
form.name = newValue.label
|
||||
}
|
||||
)
|
||||
const ruleForm = reactive({
|
||||
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
||||
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
||||
|
@ -121,17 +143,29 @@ const locationOptions = [
|
|||
const locationMessage = computed(() => {
|
||||
return locationOptions.find((item) => item.value === form.type).message
|
||||
})
|
||||
const openDialog = () => {
|
||||
const openDialog = (data) => {
|
||||
if (data) {
|
||||
updateForm.value = data
|
||||
nowType.value = 'update'
|
||||
form.name = data.className
|
||||
form.type = data.classType
|
||||
form.day = data.classDay
|
||||
form.time = [data.startTime, data.endTime]
|
||||
form.resource = data.classList.split(',').map((item) => parseInt(item))
|
||||
form.classRoom = data.classRoom
|
||||
}
|
||||
centerDialogVisible.value = true
|
||||
}
|
||||
const closeDialog = () => {
|
||||
ruleFormDialog.value.resetFields()
|
||||
centerDialogVisible.value = false
|
||||
form.name = props.currentNode.label
|
||||
}
|
||||
const classList = ref([])
|
||||
onMounted(() => {
|
||||
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
||||
(response) => {
|
||||
console.log(response)
|
||||
classList.value = [...response.rows]
|
||||
}
|
||||
)
|
||||
|
@ -141,10 +175,73 @@ const submitForm = async () => {
|
|||
if (!formEl) return
|
||||
await formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
if (nowType.value === 'update') {
|
||||
updateClassReserv(form)
|
||||
} else {
|
||||
addClassReserv(form)
|
||||
}
|
||||
centerDialogVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
const updateClassReserv = (formData) => {
|
||||
let ids = formData.resource.join(',')
|
||||
let param = {
|
||||
className: formData.name,
|
||||
classType: formData.type,
|
||||
classDay: formData.day,
|
||||
startTime: formData.time[0],
|
||||
endTime: formData.time[1],
|
||||
classList: ids,
|
||||
classRoom: formData.classRoom,
|
||||
id: updateForm.value.id
|
||||
}
|
||||
updateSmartClassReserv(param).then((res) => {
|
||||
if (res.data === true) {
|
||||
closeDialog()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '修改预约成功!'
|
||||
})
|
||||
Object.assign(updateForm.value, param)
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const addClassReserv = (formData) => {
|
||||
let ids = formData.resource.join(',')
|
||||
let param = {
|
||||
className: formData.name,
|
||||
classType: formData.type,
|
||||
classDay: formData.day,
|
||||
startTime: formData.time[0],
|
||||
endTime: formData.time[1],
|
||||
classList: ids,
|
||||
classRoom: formData.classRoom,
|
||||
classSubject: props.currentNode.edusubject,
|
||||
ex1: props.bookId,
|
||||
ex2: props.currentNode.id
|
||||
}
|
||||
addSmartClassReserv(param).then((res) => {
|
||||
if (res.data === true) {
|
||||
closeDialog()
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '预约成功!'
|
||||
})
|
||||
emit('addSuccess')
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
openDialog,
|
||||
closeDialog
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||
<div class="page-right">
|
||||
<div class="header-top flex">
|
||||
<div class="textbook-img" @click="navtoPdf">
|
||||
<el-image style="width: 80px; height: 110px" :src="curBookImg" />
|
||||
<div class="textbook-img">
|
||||
<el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf"/>
|
||||
<el-progress v-if="downloadNum>0 && downloadNum < 100" style="position:absolute;left: 0;z-index: 999;" type="circle" :percentage="downloadNum" />
|
||||
</div>
|
||||
<div class="top-item">
|
||||
<el-button class="btn" @click="handleOutLink('standard')">课标研读</el-button>
|
||||
|
@ -12,9 +13,11 @@
|
|||
<el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button>
|
||||
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
|
||||
</div>
|
||||
<el-button type="primary" class="to-class-btn" @click="openLesson">
|
||||
<i class="iconfont icon-lingdang"></i>上课</el-button
|
||||
>
|
||||
<el-button :type="!curClassReserv.id?'info' : 'primary'" :disabled="!curClassReserv.id" class="to-class-btn" @click="openLesson">
|
||||
<label><i class="iconfont icon-lingdang"></i>上课</label>
|
||||
<label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label>
|
||||
<label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label>
|
||||
</el-button>
|
||||
<div class="top-zoom-style"></div>
|
||||
</div>
|
||||
<div class="prepare-body-header">
|
||||
|
@ -60,7 +63,7 @@
|
|||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" @on-close="closeHomework" />
|
||||
</div>
|
||||
<reserv ref="reservDialog"></reserv>
|
||||
<reserv ref="reservDialog" @add-success="initReserv" :current-node="currentNode" :book-id="uploadData.textbookId"></reserv>
|
||||
</template>
|
||||
<script setup>
|
||||
import { Check } from '@element-plus/icons-vue'
|
||||
|
@ -87,7 +90,9 @@ import outLink from '@/utils/linkConfig'
|
|||
import { createWindow } from '@/utils/tool'
|
||||
import { uniqBy, cloneDeep } from 'lodash'
|
||||
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
|
||||
const fs = require('fs');
|
||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
||||
const toolStore = useToolState()
|
||||
const fs = require('fs')
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
||||
export default {
|
||||
|
@ -114,6 +119,8 @@ export default {
|
|||
currentNode: {},
|
||||
currentFileList: [],
|
||||
curBookPath: '',
|
||||
curClassReserv: {},
|
||||
downloadNum: 0,
|
||||
lastAsyncAllTime: '',
|
||||
uploadData: {
|
||||
textbookId: null,
|
||||
|
@ -155,15 +162,33 @@ export default {
|
|||
this.callback(param)
|
||||
})
|
||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||
this.initReserv()
|
||||
},
|
||||
mounted() {
|
||||
this.$watch(()=>toolStore.isToolWin,(newD, oldD)=>{
|
||||
setTimeout(this.initReserv, 500)
|
||||
})
|
||||
},
|
||||
mounted() { },
|
||||
activated() {
|
||||
if (this.uploadData.textbookId !== null) {
|
||||
this.asyncAllFile()
|
||||
this.initHomeWork()
|
||||
this.initReserv()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initReserv() {
|
||||
getSelfReserv().then((res) => {
|
||||
let list = res.data.filter((item) => {
|
||||
return item.status !== '已结束'
|
||||
})
|
||||
if (list.length > 0) {
|
||||
this.curClassReserv = list[list.length - 1]
|
||||
}else {
|
||||
this.curClassReserv = {}
|
||||
}
|
||||
})
|
||||
},
|
||||
getBookPathFromServer() {
|
||||
let fileName = this.curBookPath
|
||||
if (!fileName) return
|
||||
|
@ -180,22 +205,27 @@ export default {
|
|||
url: filePath,
|
||||
fileName: fileName
|
||||
})
|
||||
ipcRenderer.removeListener('download-file-default-prog' + fileName, this.progDownFile)
|
||||
ipcRenderer.on('download-file-default-prog' + fileName, this.progDownFile)
|
||||
ipcRenderer.once('download-file-default' + fileName, (e, isSuccess) => {
|
||||
if (isSuccess === true) {
|
||||
resolve(appRootFilePath + fileName)
|
||||
}else {
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: `下载教材失败!`
|
||||
})
|
||||
}
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
resolve(appRootFilePath + fileName)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
progDownFile(e, num) {
|
||||
this.downloadNum = num
|
||||
},
|
||||
createFile() {
|
||||
creatPPT(this.currentNode.label + '.pptx', this.uploadData).then((res) => {
|
||||
this.currentFileList.unshift(res.resData)
|
||||
|
@ -469,6 +499,11 @@ export default {
|
|||
this.currentFileList = cloneDeep(ary)
|
||||
})
|
||||
},
|
||||
getWeekday1(date) {
|
||||
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||
const weekday = new Date(date).getDay()
|
||||
return weekdays[weekday]
|
||||
},
|
||||
// 打开布置作业窗口
|
||||
openSet(row) {
|
||||
this.row = row
|
||||
|
@ -492,18 +527,18 @@ export default {
|
|||
|
||||
// 打开PDF-课件
|
||||
async navtoPdf() {
|
||||
const toolStore = useToolState()
|
||||
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
||||
let path = await this.getBookPathFromServer()
|
||||
path=path.replace(/^.*[\\\/]/, '');
|
||||
// console.log(this.uploadData.textbookId)
|
||||
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
||||
createWindow('open-PDF', {
|
||||
url: '/classBegins/index?textbookId=' + this.uploadData.textbookId + '&path=' + path
|
||||
})
|
||||
},
|
||||
// 上课-工具类悬浮
|
||||
openLesson() {
|
||||
const toolStore = useToolState()
|
||||
if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作')
|
||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label })
|
||||
startClass(this.curClassReserv.id)
|
||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label+ "&reservId=" + this.curClassReserv.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -578,9 +613,14 @@ export default {
|
|||
overflow: hidden;
|
||||
margin-right: 20px;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
:deep(.el-progress-circle) {
|
||||
width: 90px!important;
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.top-item {
|
||||
|
@ -617,7 +657,13 @@ export default {
|
|||
margin-left: 25px;
|
||||
font-size: 18px;
|
||||
z-index: 1;
|
||||
|
||||
& label:hover {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
& > :deep(span) {
|
||||
flex-direction: column !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
.icon-lingdang {
|
||||
margin-right: 5px;
|
||||
color: #ffffff;
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<button v-if="props.test" @click="trigger">测试</button>
|
||||
<div ref="warpRef" class="c-warp">
|
||||
<template v-for="i in sum">
|
||||
<slot><el-icon><Star /></el-icon></slot>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
// 功能说明:动画-点赞
|
||||
import { nextTick, ref } from 'vue'
|
||||
import {Star} from '@element-plus/icons-vue'
|
||||
const warpRef = ref(null)
|
||||
const props = defineProps({ test: Boolean })
|
||||
const sum = ref(0)
|
||||
// === 方法 ===
|
||||
const trigger = () => {
|
||||
sum.value++
|
||||
nextTick(() => {
|
||||
const el = warpRef.value.lastElementChild // 获取最后一个新加的元素
|
||||
animInit(el)
|
||||
})
|
||||
}
|
||||
// 初始化动画
|
||||
const animInit = (el) => {
|
||||
const { height, width } = el.getBoundingClientRect()
|
||||
const sumH = warpRef.value.clientHeight
|
||||
const sumW = warpRef.value.clientWidth
|
||||
const maxH = sumH - height // 最大高度
|
||||
const maxw = sumW - width // 最大宽度
|
||||
let bottom = 0 // 底部距离
|
||||
let opacity = 0 // 透明度
|
||||
let scale = 0 // 缩放
|
||||
let transform = '' // 旋转 缩放 偏移等操作
|
||||
let right = getRandom(5, maxw, false, true) // 随机-右距离
|
||||
let isPlus = getRandomBool()?'':'-' // 随机-方向
|
||||
let rotate = getRandom(0, 60, false, true) // 随机-旋转
|
||||
let scaleMax = getRandom(0, 1, true, true)+1 // 随机-缩放倍数
|
||||
setStatic(el,'position','absolute') // 设置-定位
|
||||
setStatic(el, 'right', right, 'px') // 设置-右距离
|
||||
const amFn = () => { // opacity: 0.5;
|
||||
// 到顶了- 移除元素
|
||||
if (bottom > maxH) {el.remove();return}
|
||||
// 透明度: 进入-慢慢出现
|
||||
if (bottom < 101 && opacity < 1) opacity = toNumber(opacity + 0.01)
|
||||
else if (bottom > maxH - 100 && opacity > 0) opacity = toNumber(opacity - 0.01)
|
||||
// 缩放:进入-慢慢放大
|
||||
if (bottom < (scaleMax/0.1) && scale < scaleMax) scale = toNumber(scale + 0.1)
|
||||
// 缩放:退出-慢慢缩小
|
||||
else if (bottom > maxH - (scaleMax/0.1) && scale > 0) scale = toNumber(scale - 0.1)
|
||||
bottom++
|
||||
// console.log('zdg: ', scale)
|
||||
// 设置样式
|
||||
transform = `rotate(${isPlus}${rotate}deg) scale(${scale})`
|
||||
setStatic(el, 'bottom', bottom, 'px')
|
||||
setStatic(el, 'opacity', opacity)
|
||||
setStatic(el, 'transform', transform)
|
||||
requestAnimationFrame(amFn)
|
||||
}
|
||||
amFn() // 初次执行
|
||||
}
|
||||
// 设置-静态样式
|
||||
const setStatic = (el, type, val, end) => el.style[type] = val + (end || '')
|
||||
// 随机数 isFloat:是否小数 isMax:是否包含最大值
|
||||
const getRandom = (min, max, isFloat, isMax, pos=2) => {
|
||||
const maxVal = isMax ? max - min + 1 : max - min
|
||||
const getVal = () => Math.random() * maxVal + min
|
||||
return isFloat ? toNumber(getVal(), pos) : toNumber(getVal(), 0)
|
||||
}
|
||||
// 随机布尔值
|
||||
const getRandomBool = () => Math.random() > 0.5
|
||||
// 转换数字-(小数精度丢失)
|
||||
const toNumber = (v, pos = 2) => Number(v.toFixed(pos))
|
||||
// 暴露方法
|
||||
defineExpose({ trigger })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.c-warp {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 30%;
|
||||
height: 50%;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
|
@ -2,8 +2,13 @@
|
|||
<div class="warp-all">
|
||||
<!-- 画板 -->
|
||||
<board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue>
|
||||
|
||||
<!-- 侧边工具栏 -->
|
||||
<side-vue v-ignore @ignore-mounted="sideMouse" @change="sideChange"></side-vue>
|
||||
|
||||
<!-- 点赞组件 -->
|
||||
<upvote-vue></upvote-vue>
|
||||
|
||||
<!-- 底部工具栏 :style="dataPos.style"-->
|
||||
<div class="tool-bottom-all" @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
||||
<div v-drag="{handle:'.tool-bottom-all', dragtime}"
|
||||
|
@ -30,13 +35,17 @@
|
|||
<script setup>
|
||||
// 功能说明:electron 悬浮球
|
||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
||||
import logo from '@root/resources/icon.png' // logo
|
||||
import boardVue from './components/board.vue' // 画板-子组件
|
||||
import sideVue from './components/side.vue' // 画板-子组件
|
||||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { useRoute } from 'vue-router';
|
||||
import { endClass } from '@/api/classManage'
|
||||
import logo from '@root/resources/icon.png' // logo
|
||||
import boardVue from './components/board.vue' // 画板-子组件
|
||||
import sideVue from './components/side.vue' // 画板-子组件
|
||||
import upvoteVue from './components/upvote.vue' // 点赞-子组件
|
||||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
||||
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
||||
const route = useRoute();
|
||||
const tabActive = ref('select') // 工具栏当前选中项
|
||||
const isFold = ref(false) // 折叠工具栏
|
||||
const isDrag = ref(false) // 开始拖拽
|
||||
|
@ -111,6 +120,7 @@ const sideChange = o => {
|
|||
break
|
||||
case 'over': // 下课
|
||||
toolStore.isToolWin = false
|
||||
endClass(route.query.reservId)
|
||||
ipcMsgSend('tool-sphere:close')
|
||||
break
|
||||
}
|
||||
|
@ -118,7 +128,7 @@ const sideChange = o => {
|
|||
|
||||
// === 监听器 ===
|
||||
watchEffect(() => {
|
||||
// 不同的时候, 更新值: 是否显示-画板
|
||||
// 不同的时候, 更新值: 是否显示-画板
|
||||
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
||||
if (show != isShow.value) isShow.value = show
|
||||
})
|
||||
|
@ -170,4 +180,4 @@ watchEffect(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue