Compare commits
No commits in common. "74275ac327d2b3d15a037cc88a61c90386da1bc7" and "3fcd0cdb2196867e88be936e9cbf59e6baa764d1" have entirely different histories.
74275ac327
...
3fcd0cdb21
|
@ -24,8 +24,8 @@ export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/dev-api': {
|
'/dev-api': {
|
||||||
// target: 'http://27.128.240.72:7865',
|
target: 'http://27.128.240.72:7865',
|
||||||
target: 'http://192.168.2.52:7863',
|
// target: 'http://192.168.2.52:7863',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,9 +250,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
onDownloadStarted: async ({ id, item, webContents }) => {
|
onDownloadStarted: async ({ id, item, webContents }) => {
|
||||||
// Do something with the download id
|
// 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 }) => {
|
onDownloadCompleted: async ({ id, item }) => {
|
||||||
console.log('完成')
|
console.log('完成')
|
||||||
e.reply('download-file-default' + fileName, true)
|
e.reply('download-file-default' + fileName, true)
|
||||||
|
|
|
@ -243,4 +243,4 @@ function handleAll() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -130,46 +130,3 @@ export function addStudentmainByNameArray(data) {
|
||||||
data: 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,7 +35,6 @@
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="changePage('/profile')">个人中心</el-dropdown-item>
|
<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 @click="changePage('/class')">班级中心</el-dropdown-item>
|
||||||
<el-dropdown-item divided command="logout">
|
<el-dropdown-item divided command="logout">
|
||||||
<span>退出登录</span>
|
<span>退出登录</span>
|
||||||
|
|
|
@ -20,7 +20,7 @@ export function shareStorePlugin({store}) {
|
||||||
function stateSync(store) {
|
function stateSync(store) {
|
||||||
const storeName = store.$id
|
const storeName = store.$id
|
||||||
const jsonStr = JSON.stringify(store.$state)
|
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)
|
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ function stateChange(store) {
|
||||||
// 更新状态
|
// 更新状态
|
||||||
store.$patch(stateJson)
|
store.$patch(stateJson)
|
||||||
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
// 您可以通过将其 $state 属性设置为新对象来替换 Store 的整个状态
|
||||||
// store.$state = stateJson
|
// store.$state = stateJson
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -45,12 +45,6 @@ export const constantRoutes = [
|
||||||
name: 'profile',
|
name: 'profile',
|
||||||
meta: {title: '个人中心'}
|
meta: {title: '个人中心'}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/classReserv',
|
|
||||||
component: () => import('@/views/classManage/classReserv.vue'),
|
|
||||||
name: 'classReserv',
|
|
||||||
meta: {title: '课程预约'}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/class',
|
path: '/class',
|
||||||
component: () => import('@/views/classManage/index.vue'),
|
component: () => import('@/views/classManage/index.vue'),
|
||||||
|
|
|
@ -12,4 +12,4 @@ export const useToolState = defineStore('tool', {
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
}
|
}
|
||||||
})
|
})
|
|
@ -19,7 +19,7 @@ const isDev = isNode?process.env.NODE_ENV !== 'production':''
|
||||||
export const ipcMain = Remote?.ipcMain || {}
|
export const ipcMain = Remote?.ipcMain || {}
|
||||||
/**
|
/**
|
||||||
* 获取静态资源,开发和生产环境
|
* 获取静态资源,开发和生产环境
|
||||||
* @param {*} url
|
* @param {*} url
|
||||||
* @param {*} type 类型 app 应用内 user (用户目录 selfFile 自定义文件路径)
|
* @param {*} type 类型 app 应用内 user (用户目录 selfFile 自定义文件路径)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
@ -67,9 +67,9 @@ export function ipcMsgInvoke(key, ...args) {
|
||||||
/**
|
/**
|
||||||
* @description 封装ipcRenderer事件监听
|
* @description 封装ipcRenderer事件监听
|
||||||
* @param {*} fn on once handle invoke
|
* @param {*} fn on once handle invoke
|
||||||
* @param {*} key
|
* @param {*} key
|
||||||
* @param {Function} cb 回调函数
|
* @param {Function} cb 回调函数
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function ipcHandle(fn,key, cb) {
|
export function ipcHandle(fn,key, cb) {
|
||||||
return ipcRenderer[fn](key, cb)
|
return ipcRenderer[fn](key, cb)
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
<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>
|
|
|
@ -1,133 +0,0 @@
|
||||||
<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,42 +77,20 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineExpose, onMounted, reactive, computed, watch } from 'vue'
|
import { ref, defineExpose, onMounted, reactive, computed } from 'vue'
|
||||||
import { addSmartClassReserv, updateSmartClassReserv, listClassmain } from '@/api/classManage'
|
import { listClassmain } from '@/api/classManage'
|
||||||
import useUserStore from '@/store/modules/user'
|
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 ruleFormDialog = ref(null)
|
||||||
const nowType = ref('add')
|
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const centerDialogVisible = ref(false)
|
const centerDialogVisible = ref(false)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
name: '',
|
name: '',
|
||||||
type: '常规课',
|
type: '常规课',
|
||||||
day: '',
|
day: '',
|
||||||
time: [],
|
time: '',
|
||||||
resource: [],
|
resource: [],
|
||||||
classRoom: ''
|
classRoom: ''
|
||||||
})
|
})
|
||||||
const updateForm = ref({})
|
|
||||||
watch(
|
|
||||||
() => props.currentNode,
|
|
||||||
(newValue, oldValue) => {
|
|
||||||
form.name = newValue.label
|
|
||||||
}
|
|
||||||
)
|
|
||||||
const ruleForm = reactive({
|
const ruleForm = reactive({
|
||||||
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }],
|
||||||
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
day: [{ required: true, message: '请选择上课日期', trigger: 'change' }],
|
||||||
|
@ -143,29 +121,17 @@ const locationOptions = [
|
||||||
const locationMessage = computed(() => {
|
const locationMessage = computed(() => {
|
||||||
return locationOptions.find((item) => item.value === form.type).message
|
return locationOptions.find((item) => item.value === form.type).message
|
||||||
})
|
})
|
||||||
const openDialog = (data) => {
|
const openDialog = () => {
|
||||||
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
|
centerDialogVisible.value = true
|
||||||
}
|
}
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
ruleFormDialog.value.resetFields()
|
ruleFormDialog.value.resetFields()
|
||||||
centerDialogVisible.value = false
|
centerDialogVisible.value = false
|
||||||
form.name = props.currentNode.label
|
|
||||||
}
|
}
|
||||||
const classList = ref([])
|
const classList = ref([])
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
listClassmain({ classuserid: userStore.userId, pageSize: 100, status: 'open' }).then(
|
||||||
(response) => {
|
(response) => {
|
||||||
console.log(response)
|
|
||||||
classList.value = [...response.rows]
|
classList.value = [...response.rows]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -175,73 +141,10 @@ const submitForm = async () => {
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid) => {
|
await formEl.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (nowType.value === 'update') {
|
|
||||||
updateClassReserv(form)
|
|
||||||
} else {
|
|
||||||
addClassReserv(form)
|
|
||||||
}
|
|
||||||
centerDialogVisible.value = false
|
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({
|
defineExpose({
|
||||||
openDialog,
|
openDialog,
|
||||||
closeDialog
|
closeDialog
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||||
<div class="page-right">
|
<div class="page-right">
|
||||||
<div class="header-top flex">
|
<div class="header-top flex">
|
||||||
<div class="textbook-img">
|
<div class="textbook-img" @click="navtoPdf">
|
||||||
<el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf"/>
|
<el-image style="width: 80px; height: 110px" :src="curBookImg" />
|
||||||
<el-progress v-if="downloadNum>0 && downloadNum < 100" style="position:absolute;left: 0;z-index: 999;" type="circle" :percentage="downloadNum" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="top-item">
|
<div class="top-item">
|
||||||
<el-button class="btn" @click="handleOutLink('standard')">课标研读</el-button>
|
<el-button class="btn" @click="handleOutLink('standard')">课标研读</el-button>
|
||||||
|
@ -13,11 +12,9 @@
|
||||||
<el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button>
|
<el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button>
|
||||||
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
|
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button :type="!curClassReserv.id?'info' : 'primary'" :disabled="!curClassReserv.id" class="to-class-btn" @click="openLesson">
|
<el-button type="primary" class="to-class-btn" @click="openLesson">
|
||||||
<label><i class="iconfont icon-lingdang"></i>上课</label>
|
<i class="iconfont icon-lingdang"></i>上课</el-button
|
||||||
<label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label>
|
>
|
||||||
<label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label>
|
|
||||||
</el-button>
|
|
||||||
<div class="top-zoom-style"></div>
|
<div class="top-zoom-style"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="prepare-body-header">
|
<div class="prepare-body-header">
|
||||||
|
@ -63,7 +60,7 @@
|
||||||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||||
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" @on-close="closeHomework" />
|
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" @on-close="closeHomework" />
|
||||||
</div>
|
</div>
|
||||||
<reserv ref="reservDialog" @add-success="initReserv" :current-node="currentNode" :book-id="uploadData.textbookId"></reserv>
|
<reserv ref="reservDialog"></reserv>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Check } from '@element-plus/icons-vue'
|
import { Check } from '@element-plus/icons-vue'
|
||||||
|
@ -90,9 +87,7 @@ import outLink from '@/utils/linkConfig'
|
||||||
import { createWindow } from '@/utils/tool'
|
import { createWindow } from '@/utils/tool'
|
||||||
import { uniqBy, cloneDeep } from 'lodash'
|
import { uniqBy, cloneDeep } from 'lodash'
|
||||||
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
|
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
|
||||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
const fs = require('fs');
|
||||||
const toolStore = useToolState()
|
|
||||||
const fs = require('fs')
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -119,8 +114,6 @@ export default {
|
||||||
currentNode: {},
|
currentNode: {},
|
||||||
currentFileList: [],
|
currentFileList: [],
|
||||||
curBookPath: '',
|
curBookPath: '',
|
||||||
curClassReserv: {},
|
|
||||||
downloadNum: 0,
|
|
||||||
lastAsyncAllTime: '',
|
lastAsyncAllTime: '',
|
||||||
uploadData: {
|
uploadData: {
|
||||||
textbookId: null,
|
textbookId: null,
|
||||||
|
@ -162,33 +155,15 @@ export default {
|
||||||
this.callback(param)
|
this.callback(param)
|
||||||
})
|
})
|
||||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||||
this.initReserv()
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$watch(()=>toolStore.isToolWin,(newD, oldD)=>{
|
|
||||||
setTimeout(this.initReserv, 500)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
mounted() { },
|
||||||
activated() {
|
activated() {
|
||||||
if (this.uploadData.textbookId !== null) {
|
if (this.uploadData.textbookId !== null) {
|
||||||
this.asyncAllFile()
|
this.asyncAllFile()
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
this.initReserv()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
getBookPathFromServer() {
|
||||||
let fileName = this.curBookPath
|
let fileName = this.curBookPath
|
||||||
if (!fileName) return
|
if (!fileName) return
|
||||||
|
@ -205,27 +180,22 @@ export default {
|
||||||
url: filePath,
|
url: filePath,
|
||||||
fileName: fileName
|
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) => {
|
ipcRenderer.once('download-file-default' + fileName, (e, isSuccess) => {
|
||||||
if (isSuccess === true) {
|
if (isSuccess === true) {
|
||||||
resolve(appRootFilePath + fileName)
|
resolve(appRootFilePath + fileName)
|
||||||
} else {
|
}else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: `下载教材失败!`
|
message: `下载教材失败!`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
}else {
|
||||||
resolve(appRootFilePath + fileName)
|
resolve(appRootFilePath + fileName)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
progDownFile(e, num) {
|
|
||||||
this.downloadNum = num
|
|
||||||
},
|
|
||||||
createFile() {
|
createFile() {
|
||||||
creatPPT(this.currentNode.label + '.pptx', this.uploadData).then((res) => {
|
creatPPT(this.currentNode.label + '.pptx', this.uploadData).then((res) => {
|
||||||
this.currentFileList.unshift(res.resData)
|
this.currentFileList.unshift(res.resData)
|
||||||
|
@ -499,11 +469,6 @@ export default {
|
||||||
this.currentFileList = cloneDeep(ary)
|
this.currentFileList = cloneDeep(ary)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getWeekday1(date) {
|
|
||||||
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
|
||||||
const weekday = new Date(date).getDay()
|
|
||||||
return weekdays[weekday]
|
|
||||||
},
|
|
||||||
// 打开布置作业窗口
|
// 打开布置作业窗口
|
||||||
openSet(row) {
|
openSet(row) {
|
||||||
this.row = row
|
this.row = row
|
||||||
|
@ -527,18 +492,18 @@ export default {
|
||||||
|
|
||||||
// 打开PDF-课件
|
// 打开PDF-课件
|
||||||
async navtoPdf() {
|
async navtoPdf() {
|
||||||
|
const toolStore = useToolState()
|
||||||
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
if (toolStore.isPdfWin) return this.$message.error('您当前已打开课本,请勿重复操作')
|
||||||
let path = await this.getBookPathFromServer()
|
let path = await this.getBookPathFromServer()
|
||||||
createWindow('open-PDF', {
|
path=path.replace(/^.*[\\\/]/, '');
|
||||||
url: '/classBegins/index?textbookId=' + this.uploadData.textbookId + '&path=' + path
|
// console.log(this.uploadData.textbookId)
|
||||||
})
|
createWindow('open-PDF', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
||||||
},
|
},
|
||||||
// 上课-工具类悬浮
|
// 上课-工具类悬浮
|
||||||
openLesson() {
|
openLesson() {
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作')
|
if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作')
|
||||||
startClass(this.curClassReserv.id)
|
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label })
|
||||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label+ "&reservId=" + this.curClassReserv.id })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -613,14 +578,9 @@ export default {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
position: relative;
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
:deep(.el-progress-circle) {
|
|
||||||
width: 90px!important;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-item {
|
.top-item {
|
||||||
|
@ -657,13 +617,7 @@ export default {
|
||||||
margin-left: 25px;
|
margin-left: 25px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
& label:hover {
|
|
||||||
cursor: pointer !important;
|
|
||||||
}
|
|
||||||
& > :deep(span) {
|
|
||||||
flex-direction: column !important;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.icon-lingdang {
|
.icon-lingdang {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
<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,13 +2,8 @@
|
||||||
<div class="warp-all">
|
<div class="warp-all">
|
||||||
<!-- 画板 -->
|
<!-- 画板 -->
|
||||||
<board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue>
|
<board-vue v-model="tabActive" v-show="isShow" ref="boardVueRef"></board-vue>
|
||||||
|
|
||||||
<!-- 侧边工具栏 -->
|
<!-- 侧边工具栏 -->
|
||||||
<side-vue v-ignore @ignore-mounted="sideMouse" @change="sideChange"></side-vue>
|
<side-vue v-ignore @ignore-mounted="sideMouse" @change="sideChange"></side-vue>
|
||||||
|
|
||||||
<!-- 点赞组件 -->
|
|
||||||
<upvote-vue></upvote-vue>
|
|
||||||
|
|
||||||
<!-- 底部工具栏 :style="dataPos.style"-->
|
<!-- 底部工具栏 :style="dataPos.style"-->
|
||||||
<div class="tool-bottom-all" @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
<div class="tool-bottom-all" @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
||||||
<div v-drag="{handle:'.tool-bottom-all', dragtime}"
|
<div v-drag="{handle:'.tool-bottom-all', dragtime}"
|
||||||
|
@ -35,17 +30,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 功能说明:electron 悬浮球
|
// 功能说明:electron 悬浮球
|
||||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
||||||
import { useRoute } from 'vue-router';
|
import logo from '@root/resources/icon.png' // logo
|
||||||
import { endClass } from '@/api/classManage'
|
import boardVue from './components/board.vue' // 画板-子组件
|
||||||
import logo from '@root/resources/icon.png' // logo
|
import sideVue from './components/side.vue' // 画板-子组件
|
||||||
import boardVue from './components/board.vue' // 画板-子组件
|
import vDrag from './directive/drag' // 自定义指令-拖拽
|
||||||
import sideVue from './components/side.vue' // 画板-子组件
|
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
||||||
import upvoteVue from './components/upvote.vue' // 点赞-子组件
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
|
||||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
|
||||||
import { useToolState } from '@/store/modules/tool' // 数据状态-缓存
|
|
||||||
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' // 相关工具
|
||||||
const route = useRoute();
|
|
||||||
const tabActive = ref('select') // 工具栏当前选中项
|
const tabActive = ref('select') // 工具栏当前选中项
|
||||||
const isFold = ref(false) // 折叠工具栏
|
const isFold = ref(false) // 折叠工具栏
|
||||||
const isDrag = ref(false) // 开始拖拽
|
const isDrag = ref(false) // 开始拖拽
|
||||||
|
@ -120,7 +111,6 @@ const sideChange = o => {
|
||||||
break
|
break
|
||||||
case 'over': // 下课
|
case 'over': // 下课
|
||||||
toolStore.isToolWin = false
|
toolStore.isToolWin = false
|
||||||
endClass(route.query.reservId)
|
|
||||||
ipcMsgSend('tool-sphere:close')
|
ipcMsgSend('tool-sphere:close')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -128,7 +118,7 @@ const sideChange = o => {
|
||||||
|
|
||||||
// === 监听器 ===
|
// === 监听器 ===
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// 不同的时候, 更新值: 是否显示-画板
|
// 不同的时候, 更新值: 是否显示-画板
|
||||||
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
const show = !toolStore.isPdfWin && toolStore.showBoardAll
|
||||||
if (show != isShow.value) isShow.value = show
|
if (show != isShow.value) isShow.value = show
|
||||||
})
|
})
|
||||||
|
@ -180,4 +170,4 @@ watchEffect(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue