diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index c48cc00..9b9c503 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -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/, '') } diff --git a/src/main/file.js b/src/main/file.js index 9cc20ea..d3eede2 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -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) diff --git a/src/main/index.js b/src/main/index.js index 653c83c..441bf06 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -243,4 +243,4 @@ function handleAll() { } } }) -} \ No newline at end of file +} diff --git a/src/renderer/src/api/classManage/index.js b/src/renderer/src/api/classManage/index.js index 14a8314..6db5913 100644 --- a/src/renderer/src/api/classManage/index.js +++ b/src/renderer/src/api/classManage/index.js @@ -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} + }) +} diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 00deb25..799bf33 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -35,6 +35,7 @@ 个人中心 + 课程预约 班级中心 退出登录 diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index 1a43c74..da709f0 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -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 } }) -} \ No newline at end of file +} diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index b4c3a54..eab5de5 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -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'), diff --git a/src/renderer/src/store/modules/tool.js b/src/renderer/src/store/modules/tool.js index c3fe9a7..9ec7d55 100644 --- a/src/renderer/src/store/modules/tool.js +++ b/src/renderer/src/store/modules/tool.js @@ -12,4 +12,4 @@ export const useToolState = defineStore('tool', { }), actions: { } -}) \ No newline at end of file +}) diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index 87ee641..c9c91f1 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -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) diff --git a/src/renderer/src/views/classManage/classReserv.vue b/src/renderer/src/views/classManage/classReserv.vue new file mode 100644 index 0000000..8983269 --- /dev/null +++ b/src/renderer/src/views/classManage/classReserv.vue @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + diff --git a/src/renderer/src/views/classManage/reserv-item.vue b/src/renderer/src/views/classManage/reserv-item.vue new file mode 100644 index 0000000..685d03a --- /dev/null +++ b/src/renderer/src/views/classManage/reserv-item.vue @@ -0,0 +1,133 @@ + + + + + + + + {{ item.className }} + {{ item.classType }} + {{ item.classSubject }} + + + {{ item.classDay }} {{ item.startTime }} ~ {{ item.classDay }} {{ item.endTime }} + {{ item.createUserName }}老师 + + + + {{ index === 0 ? tag.name : '、' + tag.name }} + + + + 上课 + 编辑 + + 删除 + + + + + diff --git a/src/renderer/src/views/prepare/container/reserv.vue b/src/renderer/src/views/prepare/container/reserv.vue index 4288303..ceb4dcd 100644 --- a/src/renderer/src/views/prepare/container/reserv.vue +++ b/src/renderer/src/views/prepare/container/reserv.vue @@ -77,20 +77,42 @@