Compare commits
12 Commits
e5845a6714
...
c29a3d7a77
Author | SHA1 | Date |
---|---|---|
朱浩 | c29a3d7a77 | |
朱浩 | b8325d336b | |
朱浩 | c2876ff983 | |
zhengdegang | 6035803db1 | |
zdg | f9de8514ed | |
zdg | cc8ea2b043 | |
lyc | 9e0e2a41f2 | |
lyc | 3fcd0cdb21 | |
lyc | 815b2b15cb | |
lyc | eb17167feb | |
朱浩 | ae500c94ce | |
lyc | 258a99bc36 |
|
@ -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,7 +250,9 @@ 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() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,14 @@ export function addSmartClassReserv(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//修改课程预约
|
||||||
|
export function updateSmartClassReserv(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smarttalk/classReserv/updateSmartClassReserv',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
//查询课程预约
|
//查询课程预约
|
||||||
export function getSelfReserv() {
|
export function getSelfReserv() {
|
||||||
return request({
|
return request({
|
||||||
|
@ -145,4 +153,23 @@ export function getSelfReserv() {
|
||||||
method: 'get'
|
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}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 2794390 */
|
font-family: "iconfont"; /* Project id 2794390 */
|
||||||
src: url('iconfont.woff2?t=1723099371232') format('woff2'),
|
src: url('iconfont.woff2?t=1723186593107') format('woff2'),
|
||||||
url('iconfont.woff?t=1723099371232') format('woff'),
|
url('iconfont.woff?t=1723186593107') format('woff'),
|
||||||
url('iconfont.ttf?t=1723099371232') format('truetype'),
|
url('iconfont.ttf?t=1723186593107') format('truetype'),
|
||||||
url('iconfont.svg?t=1723099371232#iconfont') format('svg');
|
url('iconfont.svg?t=1723186593107#iconfont') format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
@ -14,6 +14,10 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-xiangzuo:before {
|
||||||
|
content: "\e64d";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-kechengziyuan1:before {
|
.icon-kechengziyuan1:before {
|
||||||
content: "\e647";
|
content: "\e647";
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,13 @@
|
||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "6176588",
|
||||||
|
"name": "向左",
|
||||||
|
"font_class": "xiangzuo",
|
||||||
|
"unicode": "e64d",
|
||||||
|
"unicode_decimal": 58957
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "3053509",
|
"icon_id": "3053509",
|
||||||
"name": "课程资源",
|
"name": "课程资源",
|
||||||
|
@ -630,7 +637,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "22779610",
|
"icon_id": "22779610",
|
||||||
"name": "数译_教学管理",
|
"name": "教学管理",
|
||||||
"font_class": "shuyi_jiaoxueguanli",
|
"font_class": "shuyi_jiaoxueguanli",
|
||||||
"unicode": "e678",
|
"unicode": "e678",
|
||||||
"unicode_decimal": 59000
|
"unicode_decimal": 59000
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
/>
|
/>
|
||||||
<missing-glyph />
|
<missing-glyph />
|
||||||
|
|
||||||
|
<glyph glyph-name="xiangzuo" unicode="" d="M774.89 725L399.08 380.75l375.81-344.21a39.28 39.28 0 0 0 13.11-29c0-36.51-48.19-54.79-76.38-29L335.8 322.8c-34.94 32-34.94 83.9 0 115.9l375.82 344.22c28.19 25.81 76.38 7.53 76.38-29A39.3 39.3 0 0 0 774.89 725z" horiz-adv-x="1024" />
|
||||||
|
|
||||||
<glyph glyph-name="kechengziyuan1" unicode="" d="M530.299631 315.712191a54.537462 54.537462 0 0 0-34.299976 12.187492L19.862486 563.299519l-3.749997 3.749997a55.187462 55.187462 0 0 0 0 77.949946l3.749997 3.749998L495.687155 883.836796A54.537462 54.537462 0 0 0 530.299631 895.999288a54.562462 54.562462 0 0 0 34.299976-12.162492l476.137169-235.424836 3.749997-3.749998a55.199962 55.199962 0 0 0 0-77.949945l-3.749997-3.749998-476.137169-235.399836a54.562462 54.562462 0 0 0-34.299976-11.849992z m-455.874683 289.999798l455.874683-225.449843 455.874683 225.437343-455.874683 225.749843z m0 0M530.299631 94.012346a54.574962 54.574962 0 0 0-34.299976 12.162491L24.537483 339.149675a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-234.849836 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.174978 31.174978 0 0 0 27.749981-55.812461L564.599607 105.862337a54.562462 54.562462 0 0 0-34.299976-11.849991z m0 0M530.299631-128a54.862462 54.862462 0 0 0-34.299976 12.149992L24.537483 116.46233a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-233.862337 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.724978 31.724978 0 1 0 27.749981-57.06246L564.599607-115.850008a55.199962 55.199962 0 0 0-34.299976-12.149992z m0 0" horiz-adv-x="1060" />
|
<glyph glyph-name="kechengziyuan1" unicode="" d="M530.299631 315.712191a54.537462 54.537462 0 0 0-34.299976 12.187492L19.862486 563.299519l-3.749997 3.749997a55.187462 55.187462 0 0 0 0 77.949946l3.749997 3.749998L495.687155 883.836796A54.537462 54.537462 0 0 0 530.299631 895.999288a54.562462 54.562462 0 0 0 34.299976-12.162492l476.137169-235.424836 3.749997-3.749998a55.199962 55.199962 0 0 0 0-77.949945l-3.749997-3.749998-476.137169-235.399836a54.562462 54.562462 0 0 0-34.299976-11.849992z m-455.874683 289.999798l455.874683-225.449843 455.874683 225.437343-455.874683 225.749843z m0 0M530.299631 94.012346a54.574962 54.574962 0 0 0-34.299976 12.162491L24.537483 339.149675a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-234.849836 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.174978 31.174978 0 0 0 27.749981-55.812461L564.599607 105.862337a54.562462 54.562462 0 0 0-34.299976-11.849991z m0 0M530.299631-128a54.862462 54.862462 0 0 0-34.299976 12.149992L24.537483 116.46233a31.174978 31.174978 0 1 0 27.749981 55.812461l474.899669-233.862337 3.112498-1.874999 3.124998 1.874999 474.887169 235.112336a31.724978 31.724978 0 1 0 27.749981-57.06246L564.599607-115.850008a55.199962 55.199962 0 0 0-34.299976-12.149992z m0 0" horiz-adv-x="1060" />
|
||||||
|
|
||||||
<glyph glyph-name="tubiaozhizuomobanyihuifu-" unicode="" d="M695.48 353.85m-15 0a15 15 0 1 1 30 0 15 15 0 1 1-30 0ZM586.39 17.63A28.63 28.63 0 0 0 557.76-11H122.39V424.37A28.63 28.63 0 0 0 151 453h156.39v79H152A108.63 108.63 0 0 1 43.39 423.37V-91h514.37a108.63 108.63 0 0 1 108.63 108.63V174h-80zM359.39 749v-523h523a100 100 0 0 1 100 100V849h-523a100 100 0 0 1-100-100z m523-443h-443V749a20 20 0 0 0 20 20h443v-443a20 20 0 0 0-20-20zM751.9 339h102a15.5 15.5 0 0 1 15.5 15.5V581.9a5.25 5.25 0 0 1-1.54 3.75c-13 12.72-28.46 3.75-28.46-8.84v-202.64a5.17 5.17 0 0 0-5.17-5.17H746.8a5.25 5.25 0 0 1-3.75-1.54c-12.71-12.95-3.74-28.46 8.85-28.46z" horiz-adv-x="1024" />
|
<glyph glyph-name="tubiaozhizuomobanyihuifu-" unicode="" d="M695.48 353.85m-15 0a15 15 0 1 1 30 0 15 15 0 1 1-30 0ZM586.39 17.63A28.63 28.63 0 0 0 557.76-11H122.39V424.37A28.63 28.63 0 0 0 151 453h156.39v79H152A108.63 108.63 0 0 1 43.39 423.37V-91h514.37a108.63 108.63 0 0 1 108.63 108.63V174h-80zM359.39 749v-523h523a100 100 0 0 1 100 100V849h-523a100 100 0 0 1-100-100z m523-443h-443V749a20 20 0 0 0 20 20h443v-443a20 20 0 0 0-20-20zM751.9 339h102a15.5 15.5 0 0 1 15.5 15.5V581.9a5.25 5.25 0 0 1-1.54 3.75c-13 12.72-28.46 3.75-28.46-8.84v-202.64a5.17 5.17 0 0 0-5.17-5.17H746.8a5.25 5.25 0 0 1-3.75-1.54c-12.71-12.95-3.74-28.46 8.85-28.46z" horiz-adv-x="1024" />
|
||||||
|
|
Before Width: | Height: | Size: 262 KiB After Width: | Height: | Size: 262 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,52 +1,81 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container class="class-reserv-wrap">
|
<el-container class="class-reserv-wrap">
|
||||||
<div class="class-reserv-tabs">
|
<div class="class-reserv-tabs">
|
||||||
<el-segmented block v-model="tabActive" :options="tabOptions" size="large" />
|
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-body">
|
<div class="class-reserv-body">
|
||||||
<reserv-item v-for="(item, index) in activeDataList" :key="index" :item="item" v-show="tabActive === '进行中'"></reserv-item>
|
<reserv-item
|
||||||
<reserv-item v-for="(item, index) in doneDataList" :key="index" :item="item" v-show="tabActive === '已结束'"></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>
|
</div>
|
||||||
|
<reserv ref="reservDialog"></reserv>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed, watch } from 'vue'
|
||||||
import { getSelfReserv } from '@/api/classManage'
|
import { getSelfReserv } from '@/api/classManage'
|
||||||
import ReservItem from '@/views/classManage/reserv-item.vue'
|
import ReservItem from '@/views/classManage/reserv-item.vue'
|
||||||
|
import Reserv from '@/views/prepare/container/reserv.vue'
|
||||||
const tabOptions = ref(['进行中','已结束'])
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
const reservDialog = ref(null)
|
||||||
|
const tabOptions = ref(['进行中', '已结束'])
|
||||||
const tabActive = ref('进行中')
|
const tabActive = ref('进行中')
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
|
|
||||||
const activeDataList = computed(() => {
|
const activeDataList = computed(() => {
|
||||||
return dataList.value.filter(item => {
|
return dataList.value.filter((item) => {
|
||||||
return item.status !== "已结束"
|
return item.status !== '已结束'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
const deleteReserv = (item) => {
|
||||||
|
dataList.value = dataList.value.filter((is) => {
|
||||||
|
return is.id !== item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
const doneDataList = computed(() => {
|
const doneDataList = computed(() => {
|
||||||
return dataList.value.filter(item => {
|
return dataList.value.filter((item) => {
|
||||||
return item.status === "已结束"
|
return item.status === '已结束'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
const toolStore = useToolState()
|
||||||
|
watch(
|
||||||
|
() => toolStore.isToolWin,
|
||||||
|
(newD, oldD) => {
|
||||||
|
getSelfReserv().then((res) => {
|
||||||
|
dataList.value = [...res.data]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSelfReserv().then(res => {
|
getSelfReserv().then((res) => {
|
||||||
dataList.value = res.data
|
dataList.value = res.data
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.class-reserv-wrap{
|
.class-reserv-wrap {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 15px 30px;
|
padding: 15px 30px;
|
||||||
.class-reserv-tabs{
|
.class-reserv-tabs {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.class-reserv-body{
|
.class-reserv-body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
|
@ -1,31 +1,44 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="class-reserv-item">
|
<div class="class-reserv-item">
|
||||||
<div class="class-reserv-item-img">
|
<div class="class-reserv-item-img">
|
||||||
<img :src="basePath + item.bookImg" alt="封面"/>
|
<img :src="basePath + item.bookImg" alt="封面" />
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-item-body">
|
<div class="class-reserv-item-body">
|
||||||
<div class="class-reserv-item-title1">
|
<div class="class-reserv-item-title1">
|
||||||
<label>{{item.className}}</label>
|
<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.classType }}</el-tag>
|
||||||
<el-tag style="margin-left: 5px;" type="primary"> {{ item.classSubject }}</el-tag>
|
<el-tag style="margin-left: 5px" type="primary"> {{ item.classSubject }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-item-title2">
|
<div class="class-reserv-item-title2">
|
||||||
{{item.classDay}} {{item.startTime}} ~ {{item.classDay}} {{item.endTime}} {{item.createUserName}}老师
|
{{ item.classDay }} {{ item.startTime }} ~ {{ item.classDay }} {{ item.endTime }}
|
||||||
|
{{ item.createUserName }}老师
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-item-title3">
|
<div class="class-reserv-item-title3">
|
||||||
<span style="margin-left: 5px;" v-for="(tag, index) in item.classItemList" :key="index"> {{ index===0? tag.name:'、'+tag.name }}</span>
|
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
|
||||||
|
{{ index === 0 ? tag.name : '、' + tag.name }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="class-reserv-item-tool">
|
<div class="class-reserv-item-tool">
|
||||||
<el-button type="primary">上课</el-button>
|
<el-button v-if="item.status !== '已结束'" type="primary" @click="startClassR(item)"
|
||||||
<el-button>编辑</el-button>
|
>上课</el-button
|
||||||
<el-button type="info">下课</el-button>
|
>
|
||||||
<el-button type="danger">删除</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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
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({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -33,37 +46,85 @@ const props = defineProps({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
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>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.class-reserv-item{
|
.class-reserv-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
.class-reserv-item-img{
|
.class-reserv-item-img {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
img{
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.class-reserv-item-body{
|
.class-reserv-item-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
.class-reserv-item-title1{
|
.class-reserv-item-title1 {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
label{
|
label {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.class-reserv-item-tool{
|
.class-reserv-item-tool {
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -77,21 +77,25 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineExpose, onMounted, reactive, computed } from 'vue'
|
import { ref, defineExpose, onMounted, reactive, computed, watch } from 'vue'
|
||||||
import { addSmartClassReserv, listClassmain } from '@/api/classManage'
|
import { addSmartClassReserv, updateSmartClassReserv, listClassmain } from '@/api/classManage'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
const emit = defineEmits(['addSuccess'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
subject: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
bookId: {
|
bookId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: ''
|
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({
|
||||||
|
@ -102,6 +106,13 @@ const form = reactive({
|
||||||
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' }],
|
||||||
|
@ -132,17 +143,29 @@ 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 = () => {
|
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
|
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]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -152,13 +175,17 @@ const submitForm = async () => {
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid) => {
|
await formEl.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addClassReserv(form)
|
if (nowType.value === 'update') {
|
||||||
|
updateClassReserv(form)
|
||||||
|
} else {
|
||||||
|
addClassReserv(form)
|
||||||
|
}
|
||||||
centerDialogVisible.value = false
|
centerDialogVisible.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const addClassReserv = (formData) => {
|
const updateClassReserv = (formData) => {
|
||||||
let ids = formData.resource.join(",")
|
let ids = formData.resource.join(',')
|
||||||
let param = {
|
let param = {
|
||||||
className: formData.name,
|
className: formData.name,
|
||||||
classType: formData.type,
|
classType: formData.type,
|
||||||
|
@ -167,16 +194,46 @@ const addClassReserv = (formData) => {
|
||||||
endTime: formData.time[1],
|
endTime: formData.time[1],
|
||||||
classList: ids,
|
classList: ids,
|
||||||
classRoom: formData.classRoom,
|
classRoom: formData.classRoom,
|
||||||
classSubject: props.subject,
|
id: updateForm.value.id
|
||||||
ex1: props.bookId
|
}
|
||||||
}
|
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) => {
|
addSmartClassReserv(param).then((res) => {
|
||||||
if (res.data === true) {
|
if (res.data === true) {
|
||||||
closeDialog();
|
closeDialog()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '预约成功!'
|
message: '预约成功!'
|
||||||
})
|
})
|
||||||
|
emit('addSuccess')
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
<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" @click="navtoPdf">
|
<div class="textbook-img">
|
||||||
<el-image style="width: 80px; height: 110px" :src="curBookImg" />
|
<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>
|
||||||
<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>
|
||||||
|
@ -12,9 +13,11 @@
|
||||||
<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="primary" class="to-class-btn" @click="openLesson">
|
<el-button :type="!curClassReserv.id?'info' : 'primary'" :disabled="!curClassReserv.id" class="to-class-btn" @click="openLesson">
|
||||||
<i class="iconfont icon-lingdang"></i>上课</el-button
|
<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 class="top-zoom-style"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="prepare-body-header">
|
<div class="prepare-body-header">
|
||||||
|
@ -23,13 +26,7 @@
|
||||||
<el-popover placement="top-start" :width="250" trigger="hover">
|
<el-popover placement="top-start" :width="250" trigger="hover">
|
||||||
<template #default>
|
<template #default>
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button v-if="lastAsyncAllTime" type="success" size="small" :icon="Check" circle />
|
||||||
v-if="lastAsyncAllTime"
|
|
||||||
type="success"
|
|
||||||
size="small"
|
|
||||||
:icon="Check"
|
|
||||||
circle
|
|
||||||
/>
|
|
||||||
{{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }}
|
{{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -47,62 +44,26 @@
|
||||||
<el-button @click="handleOutLink('feedback')">作业反馈</el-button>
|
<el-button @click="handleOutLink('feedback')">作业反馈</el-button>
|
||||||
<el-button @click="handleOutLink('homeWork')">布置作业</el-button>
|
<el-button @click="handleOutLink('homeWork')">布置作业</el-button>
|
||||||
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
||||||
<el-button type="primary" style="margin-left: 10px" @click="createFile"
|
<el-button type="primary" style="margin-left: 10px" @click="createFile">新建课件</el-button>
|
||||||
>新建课件</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-checkbox-group
|
<el-checkbox-group v-model="checkFileList" class="prepare-body-main"
|
||||||
v-model="checkFileList"
|
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }">
|
||||||
class="prepare-body-main"
|
<file-list-item v-for="(item, index) in currentFileList" :key="index" :item="item" :index="index"
|
||||||
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }"
|
@on-move="onMoveSingleFile" @on-delete="deleteTalk" @on-set="openSet" @on-delhomework="delhomework">
|
||||||
>
|
<el-checkbox label="" :value="item" v-if="!item.uniquekey" />
|
||||||
<file-list-item
|
|
||||||
v-for="(item, index) in currentFileList"
|
|
||||||
:key="index"
|
|
||||||
:item="item"
|
|
||||||
:index="index"
|
|
||||||
@on-move="onMoveSingleFile"
|
|
||||||
@on-delete="deleteTalk"
|
|
||||||
@on-set="openSet"
|
|
||||||
@on-delhomework="delhomework"
|
|
||||||
>
|
|
||||||
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
|
|
||||||
</file-list-item>
|
|
||||||
<file-list-item
|
|
||||||
v-for="(item, index) in currentWorkList"
|
|
||||||
:key="'work_' + index"
|
|
||||||
:item="item"
|
|
||||||
:index="index"
|
|
||||||
@on-move="onMoveSingleFile"
|
|
||||||
@on-delete="deleteTalk"
|
|
||||||
@on-set="openSet"
|
|
||||||
@on-delhomework="delhomework"
|
|
||||||
>
|
|
||||||
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
|
|
||||||
</file-list-item>
|
</file-list-item>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
<file-oper-batch
|
<file-oper-batch v-show="checkFileList.length > 0"
|
||||||
v-show="checkFileList.length > 0"
|
|
||||||
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length"
|
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length"
|
||||||
:choose="checkFileList"
|
:choose="checkFileList" :check-all="isCheckAll" @click-delete="clickDelete" @click-move="clickMove"
|
||||||
:check-all="isCheckAll"
|
@cancel="checkFileList = []" @click-choose="clickChoose"></file-oper-batch>
|
||||||
@click-delete="clickDelete"
|
|
||||||
@click-move="clickMove"
|
|
||||||
@cancel="checkFileList = []"
|
|
||||||
@click-choose="clickChoose"
|
|
||||||
></file-oper-batch>
|
|
||||||
</div>
|
</div>
|
||||||
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
|
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
|
||||||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||||
<SetHomework
|
<SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" @on-close="closeHomework" />
|
||||||
v-model="setDialog"
|
|
||||||
:entpcourseid="entpcourseid"
|
|
||||||
:row="row"
|
|
||||||
@on-close="closeHomework"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<reserv :subject="currentNode.edusubject" :book-id="uploadData.textbookId" ref="reservDialog"></reserv>
|
<reserv ref="reservDialog" @add-success="initReserv" :current-node="currentNode" :book-id="uploadData.textbookId"></reserv>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Check } from '@element-plus/icons-vue'
|
import { Check } from '@element-plus/icons-vue'
|
||||||
|
@ -129,6 +90,8 @@ 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 toolStore = useToolState()
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
|
||||||
|
@ -155,8 +118,9 @@ export default {
|
||||||
fileList: [],
|
fileList: [],
|
||||||
currentNode: {},
|
currentNode: {},
|
||||||
currentFileList: [],
|
currentFileList: [],
|
||||||
currentWorkList: [],
|
|
||||||
curBookPath: '',
|
curBookPath: '',
|
||||||
|
curClassReserv: {},
|
||||||
|
downloadNum: 0,
|
||||||
lastAsyncAllTime: '',
|
lastAsyncAllTime: '',
|
||||||
uploadData: {
|
uploadData: {
|
||||||
textbookId: null,
|
textbookId: null,
|
||||||
|
@ -198,20 +162,38 @@ 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
|
||||||
fileName = fileName.replace('.txt', '.pdf')
|
fileName = fileName.replace('.txt', '.pdf')
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject)=>{
|
||||||
const userDataPath = Remote.app.getPath('userData')
|
const userDataPath = Remote.app.getPath('userData')
|
||||||
const appRootFilePath = userDataPath + '\\selfFile\\'
|
const appRootFilePath = userDataPath + '\\selfFile\\'
|
||||||
let filePath = appRootFilePath + fileName
|
let filePath = appRootFilePath + fileName
|
||||||
|
@ -223,9 +205,11 @@ 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(fileName)
|
resolve(appRootFilePath + fileName)
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
|
@ -234,11 +218,14 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
resolve(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)
|
||||||
|
@ -370,9 +357,9 @@ export default {
|
||||||
this.uploadData.textbookId = data.textBook.curBookId
|
this.uploadData.textbookId = data.textBook.curBookId
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
|
|
||||||
},
|
},
|
||||||
async initHomeWork() {
|
async initHomeWork() {
|
||||||
this.currentWorkList = []
|
|
||||||
if (this.timerId) {
|
if (this.timerId) {
|
||||||
clearInterval(this.timerId)
|
clearInterval(this.timerId)
|
||||||
}
|
}
|
||||||
|
@ -381,10 +368,11 @@ export default {
|
||||||
let { rows } = await this.getChapterId()
|
let { rows } = await this.getChapterId()
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
this.entpcourseid = rows[0].id
|
this.entpcourseid = rows[0].id
|
||||||
} else {
|
}
|
||||||
await this.createEntpcourse()
|
else{
|
||||||
let { rows } = await this.getChapterId()
|
await this.createEntpcourse()
|
||||||
this.entpcourseid = rows[0].id
|
let { rows } = await this.getChapterId()
|
||||||
|
this.entpcourseid = rows[0].id
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询作业
|
// 查询作业
|
||||||
|
@ -393,27 +381,28 @@ export default {
|
||||||
},
|
},
|
||||||
// 创建新的entpcourse
|
// 创建新的entpcourse
|
||||||
createEntpcourse() {
|
createEntpcourse() {
|
||||||
var cform = {}
|
// 参照 web AIx 传入参数
|
||||||
cform.entpid = this.userStore.deptId
|
var cform = {};
|
||||||
cform.level = 1
|
cform.entpid = this.userStore.deptId;
|
||||||
cform.parentid = 0
|
cform.level = 1;
|
||||||
cform.dictid = 0
|
cform.parentid = 0;
|
||||||
cform.evalid = this.currentNode.id
|
cform.dictid = 0;
|
||||||
cform.evalparentid = 0
|
cform.evalid = this.currentNode.id;
|
||||||
cform.edusubject = this.currentNode.edusubject
|
cform.evalparentid = 0;
|
||||||
cform.edudegree = this.currentNode.edudegree
|
cform.edusubject = this.currentNode.edusubject;
|
||||||
cform.edustage = this.currentNode.edustage
|
cform.edudegree = this.currentNode.edudegree;
|
||||||
cform.coursetype = '课标学科'
|
cform.edustage = this.currentNode.edustage;
|
||||||
cform.coursetitle = this.currentNode.itemtitle
|
cform.coursetype = '课标学科';
|
||||||
cform.coursedesc = ''
|
cform.coursetitle = this.currentNode.itemtitle;
|
||||||
cform.status = ''
|
cform.coursedesc = '';
|
||||||
cform.dflag = 0
|
cform.status = '';
|
||||||
cform.edituserid = this.userStore.userId
|
cform.dflag = 0;
|
||||||
cform.createblankfile = 'yes'
|
cform.edituserid = this.userStore.userId;
|
||||||
|
cform.createblankfile = 'yes';
|
||||||
return addEntpcourse(cform)
|
return addEntpcourse(cform)
|
||||||
},
|
},
|
||||||
openReserv() {
|
openReserv(){
|
||||||
this.$refs['reservDialog'].openDialog()
|
// this.$refs['reservDialog'].openDialog()
|
||||||
},
|
},
|
||||||
// 打开外部链接
|
// 打开外部链接
|
||||||
handleOutLink(key) {
|
handleOutLink(key) {
|
||||||
|
@ -505,11 +494,16 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 去重
|
// 去重
|
||||||
let ary = uniqBy([...list], 'id')
|
let ary = uniqBy([...this.currentFileList, ...list], 'id')
|
||||||
// 深度克隆
|
// 深度克隆
|
||||||
this.currentWorkList = 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
|
||||||
|
@ -518,16 +512,14 @@ export default {
|
||||||
// 删除作业
|
// 删除作业
|
||||||
delhomework(item) {
|
delhomework(item) {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
delClasswork(item.id)
|
delClasswork(item.id).then(async res => {
|
||||||
.then(async (res) => {
|
ElMessage.success('操作成功')
|
||||||
ElMessage.success('操作成功')
|
this.isLoading = false
|
||||||
this.isLoading = false
|
await this.asyncAllFile()
|
||||||
await this.asyncAllFile()
|
this.getHomeWorkList()
|
||||||
this.getHomeWorkList()
|
}).catch(() => {
|
||||||
})
|
this.isLoading = false
|
||||||
.catch(() => {
|
})
|
||||||
this.isLoading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
closeHomework() {
|
closeHomework() {
|
||||||
this.setDialog = false
|
this.setDialog = false
|
||||||
|
@ -535,16 +527,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', { url: '/classBegins/index?textbookId='+this.uploadData.textbookId+'&path='+ path })
|
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('您当前已开始上课,请勿重复操作')
|
||||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid })
|
startClass(this.curClassReserv.id)
|
||||||
|
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label+ "&reservId=" + this.curClassReserv.id })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -619,9 +613,14 @@ 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 {
|
||||||
|
@ -658,7 +657,13 @@ 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,67 +1,126 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="homework-content">
|
<div class="page-homework">
|
||||||
<div class="homework-top">
|
|
||||||
<h3 class="title">沁园春-长沙</h3>
|
<transition name="slide" @before-enter="beforeEnter" @enter="enter" @leave="leave">
|
||||||
<div class="grade">{{ usertore.edusubject}}</div>
|
<div v-if="showLeft" class="homework homework-content">
|
||||||
</div>
|
<div class="homework-top flex">
|
||||||
<div class="homework-list" v-loading="loading">
|
<div>
|
||||||
<el-scrollbar height="360px">
|
<h3 class="title">{{ lesson }}</h3>
|
||||||
<ul>
|
<div class="grade">{{ usertore.edusubject }}</div>
|
||||||
<li class="item flex" v-for="item in dataList" :key="item.id">
|
</div>
|
||||||
<div class="item-left flex">
|
<!-- <i class="iconfont icon-xiangyou"></i> -->
|
||||||
<svg class="icon homework-icon" aria-hidden="true">
|
</div>
|
||||||
<use xlink:href="#icon-zuoye2"></use>
|
<div class="homework-list" v-loading="loading">
|
||||||
</svg>
|
<el-scrollbar height="360px">
|
||||||
<div class="item-info flex">
|
<ul>
|
||||||
<span class="item-name">{{ item.uniquekey }}</span>
|
<!--资源-->
|
||||||
<div class="item-student">
|
<li class="item flex" v-for="item in resourceList" :key="item.id">
|
||||||
<span class="item-option">作业</span>
|
<div class="item-left flex">
|
||||||
<span>{{ item.worktype }}</span>
|
<FileImage :size="50" :file-name="item.fileShowName" />
|
||||||
|
<div class="item-info flex">
|
||||||
|
<span class="item-name">{{ item.fileShowName }}</span>
|
||||||
|
<div class="item-student">
|
||||||
|
<span class="item-option">{{ item.fileFlag }}</span>
|
||||||
|
<span>{{ item.fileSuffix }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</li>
|
||||||
</div>
|
<!--作业-->
|
||||||
<el-button color="#349d44" @click="sendHomework(item)">推送</el-button>
|
<li class="item flex" v-for="item in dataList" :key="item.id">
|
||||||
</li>
|
<div class="item-left flex">
|
||||||
</ul>
|
<svg class="icon homework-icon" aria-hidden="true">
|
||||||
</el-scrollbar>
|
<use xlink:href="#icon-zuoye2"></use>
|
||||||
</div>
|
</svg>
|
||||||
<SetHomework v-model="setDialog" :title="'推送作业'" :entpcourseid="entpcourseid" :row="curRow" @on-close="closeHomework" />
|
<div class="item-info flex">
|
||||||
|
<span class="item-name">{{ item.uniquekey }}</span>
|
||||||
|
<div class="item-student">
|
||||||
|
<span class="item-option">作业</span>
|
||||||
|
<span>{{ item.worktype }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button color="#349d44" @click="sendHomework(item)">推送</el-button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
<SetHomework v-model="setDialog" :title="'推送作业'" :entpcourseid="entpcourseid" :row="curRow"
|
||||||
|
@on-close="closeHomework" />
|
||||||
|
</div>
|
||||||
|
<div class="homework" @click="showLeft = !showLeft" v-else>
|
||||||
|
<div class="unit-top flex">
|
||||||
|
<div class="unit-top-left">
|
||||||
|
<i class="iconfont icon-xiangzuo"></i>
|
||||||
|
<span>返回</span>
|
||||||
|
</div>
|
||||||
|
<span class="unit-top-center">选择目录</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<!-- <Lesson/> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, toRaw } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
|
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||||
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
import { ipcMsgSend } from '@/utils/tool'
|
import { ipcMsgSend } from '@/utils/tool'
|
||||||
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
import { asyncLocalFile } from '@/utils/talkFile'
|
||||||
|
import Lesson from './lesson.vue';
|
||||||
|
|
||||||
|
const { ipcRenderer } = window.electron || {}
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const usertore = useUserStore().user
|
const usertore = useUserStore().user
|
||||||
|
const toolStore = useToolState()
|
||||||
const entpcourseid = ref('')
|
const entpcourseid = ref('')
|
||||||
|
const lesson = ref('')
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const showLeft = ref(true)
|
||||||
//作业数据
|
//作业数据
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const setDialog = ref(false)
|
const setDialog = ref(false)
|
||||||
|
// 资源数据
|
||||||
|
const resourceList = ref([])
|
||||||
|
|
||||||
//
|
//
|
||||||
const curRow = ref('')
|
const curRow = ref('')
|
||||||
|
|
||||||
|
|
||||||
const sendHomework = (row)=>{
|
const sendHomework = (row) => {
|
||||||
curRow.value = row
|
curRow.value = row
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
ipcMsgSend('tool-sphere:set:ignore', false)
|
ipcMsgSend('tool-sphere:set:ignore', false)
|
||||||
},200)
|
}, 200)
|
||||||
setDialog.value = true
|
setDialog.value = true
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
const closeHomework = ()=>{
|
const closeHomework = () => {
|
||||||
ipcMsgSend('tool-sphere:set:ignore', true)
|
ipcMsgSend('tool-sphere:set:ignore', true)
|
||||||
setDialog.value = false
|
setDialog.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取资源数据
|
||||||
|
const getResource = () => {
|
||||||
|
let data = toRaw(toolStore.curSubjectNode)
|
||||||
|
data.orderByColumn = 'uploadTime'
|
||||||
|
data.isAsc = 'desc'
|
||||||
|
data.pageSize = 500
|
||||||
|
getSmarttalkPage(data).then(res => {
|
||||||
|
resourceList.value = res.rows
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取作业数据
|
||||||
const getHomework = () => {
|
const getHomework = () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
@ -70,7 +129,6 @@ const getHomework = () => {
|
||||||
edituserid: usertore.userId,
|
edituserid: usertore.userId,
|
||||||
pageSize: 100
|
pageSize: 100
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res.rows)
|
|
||||||
//以下代码 参照AIx web端 作业布置
|
//以下代码 参照AIx web端 作业布置
|
||||||
let list = []
|
let list = []
|
||||||
for (var i = 0; i < res.rows.length; i++) {
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
@ -131,21 +189,58 @@ const getHomework = () => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function beforeEnter(el) {
|
||||||
|
el.style.transform = 'translateX(100%)';
|
||||||
|
}
|
||||||
|
|
||||||
|
function enter(el, done) {
|
||||||
|
el.offsetHeight; // trigger reflow
|
||||||
|
el.style.transition = 'transform 0.5s ease';
|
||||||
|
el.style.transform = 'translateX(0)';
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
|
function leave(el, done) {
|
||||||
|
el.style.transition = 'transform 0.5s ease';
|
||||||
|
el.style.transform = 'translateX(-100%)';
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
|
lesson.value = route.query.label
|
||||||
getHomework()
|
getHomework()
|
||||||
|
setTimeout(() => {
|
||||||
|
getResource()
|
||||||
|
}, 5000)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.page-homework {
|
||||||
|
position: relative;
|
||||||
|
height: 435px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homework {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.homework-content {
|
.homework-content {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
.homework-top {
|
.homework-top {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.icon-xiangyou {
|
||||||
|
font-size: 26px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -191,8 +286,37 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.slide-enter-active,
|
||||||
|
.slide-leave-active {
|
||||||
|
transition: transform 0.5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-enter,
|
||||||
|
.slide-leave-to
|
||||||
|
|
||||||
|
/* .slide-leave-active in <2.1.8 */
|
||||||
|
{
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.unit-top {
|
||||||
|
color: #fff;
|
||||||
|
padding: 10px 0;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.unit-top-left {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.icon-xiangzuo {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.unit-top-center{
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -0,0 +1,129 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||||
|
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||||
|
@node-click="handleNodeClick">
|
||||||
|
<template #default="{ node }">
|
||||||
|
<span :title="node.label" class="tree-label">{{ node.label }}</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, nextTick, markRaw, toRaw } from 'vue'
|
||||||
|
import { useToolState } from '@/store/modules/tool'
|
||||||
|
|
||||||
|
|
||||||
|
const toolStore = useToolState()
|
||||||
|
const treeData = ref([])
|
||||||
|
const defaultProps = {
|
||||||
|
children: 'children',
|
||||||
|
label: 'label',
|
||||||
|
class: 'textbook-tree'
|
||||||
|
}
|
||||||
|
// 当前选中的节点ID
|
||||||
|
const currentNodeId = ref(0)
|
||||||
|
// 当前选中的节点名称
|
||||||
|
const currentNodeName = ref('')
|
||||||
|
// 默认展开的节点
|
||||||
|
const defaultExpandedKeys = ref([])
|
||||||
|
// tree
|
||||||
|
const refTree = ref(null)
|
||||||
|
// 教材ID
|
||||||
|
const curBookId = ref('')
|
||||||
|
//
|
||||||
|
const evaluationList = ref([])
|
||||||
|
|
||||||
|
const getTreeData = () => {
|
||||||
|
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||||
|
|
||||||
|
//上册
|
||||||
|
let volumeOne = evaluationList.value.filter(item => item.level == 1 && item.semester == '上册')
|
||||||
|
//下册
|
||||||
|
let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册')
|
||||||
|
//数据过滤
|
||||||
|
console.log(volumeOne,1)
|
||||||
|
console.log(volumeTwo,2)
|
||||||
|
let upData = transData(volumeOne)
|
||||||
|
let downData = transData(volumeTwo)
|
||||||
|
console.log(upData)
|
||||||
|
console.log(downData)
|
||||||
|
if(upData.length && downData.length){
|
||||||
|
treeData.value = [...upData,...downData]
|
||||||
|
}
|
||||||
|
else if(upData.length || downData.length){
|
||||||
|
treeData.value = upData.length ? upData : downData
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
treeData.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
let defaultKey
|
||||||
|
if(toolStore.curSubjectNode.levelSecondId){
|
||||||
|
defaultKey = toolStore.curSubjectNode.levelSecondId
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
defaultKey = toolStore.curSubjectNode.levelFirstId
|
||||||
|
}
|
||||||
|
defaultExpandedKeys.value = defaultKey
|
||||||
|
// currentNode.data = getLastLevelData(treeData.value)[0]
|
||||||
|
// currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||||
|
// currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleNodeClick = ()=>{}
|
||||||
|
|
||||||
|
const transData = (data) => {
|
||||||
|
let ary = []
|
||||||
|
data.forEach(item => {
|
||||||
|
let obj = {}
|
||||||
|
console.log(item.rootid, '==========>',curBookId.value)
|
||||||
|
if (item.rootid == curBookId.value) {
|
||||||
|
obj.label = item.itemtitle
|
||||||
|
obj.id = item.id
|
||||||
|
obj.itemtitle = item.itemtitle
|
||||||
|
obj.edudegree = item.edudegree
|
||||||
|
obj.edustage = item.edustage
|
||||||
|
obj.edusubject = item.edusubject
|
||||||
|
let ary2 = []
|
||||||
|
evaluationList.value.forEach(el => {
|
||||||
|
let obj2 = {}
|
||||||
|
if (item.id == el.parentid) {
|
||||||
|
obj2 = {
|
||||||
|
label: el.itemtitle,
|
||||||
|
id: el.id,
|
||||||
|
itemtitle : el.itemtitle,
|
||||||
|
edudegree : el.edudegree,
|
||||||
|
edustage : el.edustage,
|
||||||
|
edusubject : el.edusubject,
|
||||||
|
}
|
||||||
|
ary2.push(obj2)
|
||||||
|
}
|
||||||
|
obj.children = ary2
|
||||||
|
})
|
||||||
|
ary.push(obj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return ary
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
// console.log(toolStore.curSubjectNode,111)
|
||||||
|
|
||||||
|
// let data = toRaw(toolStore.curSubjectNode)
|
||||||
|
// console.log(data,222)
|
||||||
|
|
||||||
|
|
||||||
|
// curBookId.value = toolStore.curSubjectNode.textbookId
|
||||||
|
// getTreeData()
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
|
@ -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">
|
<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}"
|
||||||
|
@ -30,13 +35,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 功能说明:electron 悬浮球
|
// 功能说明:electron 悬浮球
|
||||||
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
import { onMounted, ref, reactive, watchEffect } from 'vue'
|
||||||
import logo from '@root/resources/icon.png' // logo
|
import { useRoute } from 'vue-router';
|
||||||
import boardVue from './components/board.vue' // 画板-子组件
|
import { endClass } from '@/api/classManage'
|
||||||
import sideVue from './components/side.vue' // 画板-子组件
|
import logo from '@root/resources/icon.png' // logo
|
||||||
import vDrag from './directive/drag' // 自定义指令-拖拽
|
import boardVue from './components/board.vue' // 画板-子组件
|
||||||
import vIgnore from './directive/ignore' // 自定义指令-穿透
|
import sideVue from './components/side.vue' // 画板-子组件
|
||||||
import { useToolState } from '@/store/modules/tool'
|
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' // 相关工具
|
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) // 开始拖拽
|
||||||
|
@ -111,6 +120,7 @@ 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
|
||||||
}
|
}
|
||||||
|
@ -118,7 +128,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
|
||||||
})
|
})
|
||||||
|
@ -170,4 +180,4 @@ watchEffect(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue