Compare commits
No commits in common. "e002ef5f7de9cf008e26a704a5e71996f48a989d" and "1c89217fbf1cd989939fec4fe5b84e8d00fbad3a" have entirely different histories.
e002ef5f7d
...
1c89217fbf
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "aix-win",
|
||||
"version": "2.0.1",
|
||||
"version": "1.2.3",
|
||||
"description": "An Electron application with Vue",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
@ -49,7 +49,6 @@
|
|||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"spark-md5": "^3.0.2",
|
||||
"vue-qr": "^4.0.9",
|
||||
"vue-router": "^4.4.0",
|
||||
"xgplayer": "^3.0.19",
|
||||
"xlsx": "^0.18.5"
|
||||
|
|
|
@ -133,7 +133,7 @@ async function createLinkWin(data) {
|
|||
contextIsolation: true
|
||||
}
|
||||
})
|
||||
linkWin[data.key].type = 'link'+data.key // 唯一标识
|
||||
linkWin[data.key].type = 'link' // 唯一标识
|
||||
|
||||
let cookieDetails = { ...data.cookieData }
|
||||
await linkWin[data.key].webContents.session.cookies
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 48 KiB |
|
@ -1,89 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询classcourse列表
|
||||
export function listClasscourse(query) {
|
||||
return request({
|
||||
url: '/education/classcourse/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询classcourse详细
|
||||
export function getClasscourse(id) {
|
||||
return request({
|
||||
url: '/education/classcourse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增classcourse
|
||||
export function addClasscourse(data) {
|
||||
return request({
|
||||
url: '/education/classcourse',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增classcourse
|
||||
export function addClasscourseReturnId(data) {
|
||||
return request({
|
||||
url: '/education/classcourse/saveReturnId',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改classcourse
|
||||
export function updateClasscourse(data) {
|
||||
return request({
|
||||
url: '/education/classcourse',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除classcourse
|
||||
export function delClasscourse(id) {
|
||||
return request({
|
||||
url: '/education/classcourse/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 删除classcourse
|
||||
export function delClasscourseWithData(id) {
|
||||
return request({
|
||||
url: '/education/classcourse/removeData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// classcourse开始上课
|
||||
export function startCourseTeaching(id) {
|
||||
return request({
|
||||
url: '/education/classcourse/startCourseTeaching/'+id,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
// 老师学生发送新的消息
|
||||
export function sendCourseTeachingMsg(data) {
|
||||
return request({
|
||||
url: '/education/classcourse/sendCourseTeachingMsg',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 老师学生获取新的交互消息
|
||||
export function getCourseTeachingMsg(id) {
|
||||
return request({
|
||||
url: '/education/classcourse/getCourseTeachingMsg/'+id,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<i class="iconfont icon-xiangyou"></i>
|
||||
</div>
|
||||
<div class="book-list" v-loading="treeLoading">
|
||||
<el-tree ref="refTree" :data="treeData" accordion :props="defaultProps" node-key="id"
|
||||
<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 }">
|
||||
|
@ -30,7 +30,7 @@
|
|||
<el-scrollbar height="450px">
|
||||
<div class="textbook-item flex" v-for="item in subjectList" :class="curBookId == item.id ? 'active-item' : ''"
|
||||
:key="item.id" @click="changeBook(item)">
|
||||
<img v-if="item.avartar" :src="item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + item.avartar" class="textbook-img" alt="">
|
||||
<img v-if="item.avartar" :src="BaseUrl + item.avartar" class="textbook-img" alt="">
|
||||
<div v-else class="textbook-img">
|
||||
<i class="iconfont icon-jiaocaixuanze" style="font-size: 40px;"></i>
|
||||
</div>
|
||||
|
@ -42,7 +42,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, nextTick, toRaw, reactive, computed } from 'vue'
|
||||
import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
|
@ -64,12 +64,6 @@ const defaultProps = {
|
|||
class: 'textbook-tree'
|
||||
}
|
||||
|
||||
/*let coverImgUrl = computed((item)=>{
|
||||
if(!item.avartar){
|
||||
return ""
|
||||
}
|
||||
return item.avartar.indexOf('http') === 0 ? item.avartar : BaseUrl + item.avartar
|
||||
})*/
|
||||
const treeLoading = ref(false)
|
||||
//当前教材ID
|
||||
const curBookId = ref(-1)
|
||||
|
@ -115,13 +109,11 @@ const getSubjectContent = async () => {
|
|||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
}
|
||||
else{
|
||||
localStorage.removeItem('defaultExpandedKeys')
|
||||
localStorage.removeItem('currentNodeId')
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
}
|
||||
|
||||
|
||||
treeLoading.value = false
|
||||
|
||||
//获取教材版本
|
||||
|
@ -142,10 +134,6 @@ const changeBook = ({ id, itemtitle, avartar, fileurl }) => {
|
|||
curBookName.value = itemtitle
|
||||
curBookImg.value = BaseUrl + avartar
|
||||
curBookPath.value = fileurl
|
||||
|
||||
localStorage.removeItem('defaultExpandedKeys')
|
||||
localStorage.removeItem('currentNodeId')
|
||||
localStorage.setItem('curBook', JSON.stringify({id, itemtitle, avartar, fileurl}))
|
||||
getTreeData()
|
||||
setTimeout(() => {
|
||||
dialogVisible.value = false
|
||||
|
@ -156,6 +144,7 @@ const getTreeData = () => {
|
|||
//数据过滤
|
||||
let upData = transData(evaluationList.value)
|
||||
|
||||
|
||||
if(upData.length){
|
||||
treeData.value = [...upData]
|
||||
}
|
||||
|
@ -164,22 +153,10 @@ const getTreeData = () => {
|
|||
return
|
||||
}
|
||||
nextTick(() => {
|
||||
|
||||
let defaultCurNodeId = localStorage.getItem('currentNodeId')
|
||||
if(defaultCurNodeId){
|
||||
defaultCurNodeId = JSON.parse(defaultCurNodeId)
|
||||
const data = findNode(defaultCurNodeId)
|
||||
currentNode.data = findNode(defaultCurNodeId)
|
||||
currentNodeId.value = data.id
|
||||
currentNodeName.value = data.label
|
||||
}
|
||||
else{
|
||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
currentNode.data = getLastLevelData(treeData.value)[0]
|
||||
currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||
currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||
}
|
||||
|
||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
currentNode.data = getLastLevelData(treeData.value)[0]
|
||||
currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||
currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||
emitChangeBook()
|
||||
})
|
||||
|
||||
|
@ -206,9 +183,6 @@ const emitChangeBook = () => {
|
|||
},
|
||||
node: curNode
|
||||
}
|
||||
|
||||
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||
localStorage.setItem('currentNodeId', JSON.stringify(currentNodeId.value))
|
||||
emit('changeBook', data)
|
||||
}
|
||||
|
||||
|
@ -256,11 +230,6 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
const findNode = (id) =>{
|
||||
if(!id) return
|
||||
return evaluationList.value.find( item => item.id == id)
|
||||
}
|
||||
|
||||
const transData = (data) => {
|
||||
let ary = []
|
||||
data.forEach(item => {
|
||||
|
@ -312,21 +281,10 @@ const getSubject = async () => {
|
|||
|
||||
// 默认第一个
|
||||
if(!subjectList.value.length) return
|
||||
let curBook = localStorage.getItem('curBook')
|
||||
if(curBook){
|
||||
curBook = JSON.parse(curBook)
|
||||
curBookName.value = curBook.itemtitle
|
||||
curBookId.value = curBook.id
|
||||
curBookImg.value = BaseUrl + curBook.avartar
|
||||
curBookPath.value = curBook.fileurl
|
||||
}
|
||||
else{
|
||||
curBookName.value = subjectList.value[0].itemtitle
|
||||
curBookId.value = subjectList.value[0].id
|
||||
curBookImg.value = BaseUrl + subjectList.value[0].avartar
|
||||
curBookPath.value = subjectList.value[0].fileurl
|
||||
localStorage.setItem('curBookId', curBookId.value)
|
||||
}
|
||||
curBookName.value = subjectList.value[0].itemtitle
|
||||
curBookId.value = subjectList.value[0].id
|
||||
curBookImg.value = BaseUrl + subjectList.value[0].avartar
|
||||
curBookPath.value = subjectList.value[0].fileurl
|
||||
}
|
||||
|
||||
|
||||
|
@ -363,12 +321,7 @@ const handleNodeClick = (data, node) => {
|
|||
node: toRaw(nodeData)
|
||||
}
|
||||
currentNode.data = curData
|
||||
|
||||
localStorage.setItem('defaultExpandedKeys', nodeData.parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
|
||||
localStorage.setItem('currentNodeId', JSON.stringify(data.id))
|
||||
|
||||
emit('nodeClick', curData)
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
getSubjectContent()
|
||||
|
|
|
@ -64,8 +64,6 @@ const getVertion = (data) => {
|
|||
childs: []
|
||||
}
|
||||
})
|
||||
//判断是否存在该教材,有则展示第一项
|
||||
if(treeData.value.length === 0) return
|
||||
nextTick(() => {
|
||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
node.currentNode.data = treeData.value[0]
|
||||
|
|
|
@ -1,209 +0,0 @@
|
|||
<template>
|
||||
<!-- 表单-组件(自定义) -->
|
||||
<slot>
|
||||
<el-row v-bind="rows||{}">
|
||||
<!-- 其他内容-start -->
|
||||
<slot name="start"></slot>
|
||||
<el-form :model="form" ref="form" @submit.native.prevent
|
||||
v-bind="option||{}"
|
||||
:status-icon="option.isIcon" :inline-message="option.inlineMsg"
|
||||
:label-width="option.labelW" :label-position="option.labelP" :label-suffix="option.labelS">
|
||||
<!-- 内容区 -->
|
||||
<template v-for="(item, index) in itemFields">
|
||||
<slot :name="'cols_'+item.prop" :row="item" :index="index" :prop="item.prop">
|
||||
<el-col :span="colsFn(item,'span')" :offset="colsFn(item,'offset')" :push="colsFn(item,'push')" :pull="colsFn(item,'pull')"
|
||||
:xs="colsFn(item,'xs')" :sm="colsFn(item,'sm')" :md="colsFn(item,'md')" :lg="colsFn(item,'lg')" :xl="colsFn(item,'xl')"
|
||||
:tag="colsFn(item,'tag')" :key="index" :style="item.style">
|
||||
<!-- slot可自定义-元素 默认input -->
|
||||
<slot :name="item.prop" :row="item" :index="index" :prop="item.prop" :form="form">
|
||||
<el-form-item :label="item.label" :prop="item.prop" :label-width="item.labelW"
|
||||
:required="item.required" :rules="item.rules" :error="item.error"
|
||||
:show-message="item.showMsg" :inline-message="item.inlineMsg" :size="item.size">
|
||||
<!-- slot可自定义-item内部 单个 -->
|
||||
<slot :name="'item_'+item.prop" :row="item" :index="index" :value="form[item.prop]" :prop="item.prop" :form="form">
|
||||
<!-- slot可自定义-item内部 所有 -->
|
||||
<slot name="input" :row="item" :index="index" :value="form[item.prop]" :prop="item.prop" :form="form">
|
||||
<el-input v-model="form[item.prop]" v-bind="item.inputOpt||{}"
|
||||
@keyup.enter.native="handle(item, $event)" v-on="item.on||{}">
|
||||
<!-- slot自定义-输入框头部内容 单个 -->
|
||||
<template #prefix v-if="slotKeys.includes(`prefix_${item.prop}`)"><slot :name="'prefix_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框尾部内容 单个 -->
|
||||
<template #suffix v-if="slotKeys.includes(`suffix_${item.prop}`)"><slot :name="'suffix_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框前置内容 单个 -->
|
||||
<template #prepend v-if="slotKeys.includes(`prepend_${item.prop}`)"><slot :name="'prepend_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框后置内容 单个 -->
|
||||
<template #append v-if="slotKeys.includes(`append_${item.prop}`)"><slot :name="'append_'+item.prop"></slot></template>
|
||||
|
||||
<!-- slot自定义-输入框头部内容 所有 -->
|
||||
<template #prefix v-if="slotKeys.includes(`prefix`)"><slot :name="'prefix_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框尾部内容 所有 -->
|
||||
<template #suffix v-if="slotKeys.includes(`suffix`)"><slot :name="'suffix_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框前置内容 所有 -->
|
||||
<template #prepend v-if="slotKeys.includes(`prepend`)"><slot :name="'prepend_'+item.prop"></slot></template>
|
||||
<!-- slot自定义-输入框后置内容 所有 -->
|
||||
<template #append v-if="slotKeys.includes(`append`)"><slot :name="'append_'+item.prop"></slot></template>
|
||||
</el-input>
|
||||
</slot>
|
||||
</slot>
|
||||
<!-- slot自定义-标签文本的内容 单个 -->
|
||||
<template #label v-if="slotKeys.includes(`label_${item.prop}`)">
|
||||
<slot :name="'label_'+item.prop" :row="item" :index="index" :prop="item.prop"></slot>
|
||||
</template>
|
||||
<!-- slot自定义-标签文本的内容 所有 -->
|
||||
<template #label v-if="slotKeys.includes(`label`)">
|
||||
<slot name="label" :row="item" :index="index" :prop="item.prop"></slot>
|
||||
</template>
|
||||
|
||||
<!-- slot自定义-自定义表单校验信息的显示方式 单个 -->
|
||||
<template #error="{error}" v-if="slotKeys.includes(`error_${item.prop}`)">
|
||||
<slot :name="'error_'+item.prop" :row="item" :index="index" :prop="item.prop" :error="error"></slot>
|
||||
</template>
|
||||
<!-- slot自定义-自定义表单校验信息的显示方式 所有 -->
|
||||
<template #error="{error}" v-if="slotKeys.includes(`error`)">
|
||||
<slot name="error" :row="item" :index="index" :prop="item.prop" :error="error"></slot>
|
||||
</template>
|
||||
|
||||
</el-form-item>
|
||||
</slot>
|
||||
</el-col>
|
||||
</slot>
|
||||
</template>
|
||||
<!-- 其他内容 -->
|
||||
<slot name="add"></slot>
|
||||
<!-- 提交 -->
|
||||
<slot name="submit" :formRef="$refs.form">
|
||||
<div class="subBtn" v-if="btnDef" :style="btnStyle">
|
||||
<el-button type="primary" size="small" @click="confirm" :loading="btnLoad">{{btnText}}</el-button>
|
||||
</div>
|
||||
</slot>
|
||||
</el-form>
|
||||
<!-- 其他内容-end -->
|
||||
<slot name="end"></slot>
|
||||
</el-row>
|
||||
</slot>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'cForm',
|
||||
props: {
|
||||
form: { // 数据 form
|
||||
type: Object,
|
||||
default: _ => { return {} }
|
||||
},
|
||||
option: { // 配置
|
||||
type: Object,
|
||||
default: _ => {
|
||||
return { labelW: '80px' }
|
||||
}
|
||||
},
|
||||
itemOption: { // item配置
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
rows: { // 行 layout布局
|
||||
type: Object,
|
||||
default: _ => { return {} }
|
||||
},
|
||||
cols: { // 列 layout布局
|
||||
type: Object,
|
||||
default: _ => { return {} }
|
||||
},
|
||||
// onEnter: Function, // 默认回车
|
||||
onEnter: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
},
|
||||
btnText: { // 文本
|
||||
type: String,
|
||||
default: '确 定'
|
||||
},
|
||||
btnDef: Boolean, // 默认提交-按钮
|
||||
btnStyle: String, // 按钮样式css
|
||||
btnLoad: Boolean, // 加载load
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
slotKeys: [] // 外部自定义插槽
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
itemFields() {
|
||||
return this.itemOption
|
||||
.filter(o => o.show !== false)
|
||||
.map(o => {
|
||||
for (const key in o) {
|
||||
const inputOpt = {placeholder:'请输入'}
|
||||
if (key.startsWith('i')) {
|
||||
const newKey = key.substring(1)
|
||||
inputOpt[newKey] = o[key]
|
||||
delete o[key]
|
||||
}
|
||||
o.inputOpt = inputOpt
|
||||
return o
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.test = this
|
||||
this.slotKeys = Object.keys(this.$slots)
|
||||
},
|
||||
methods: {
|
||||
// 字段--cols属性
|
||||
colsFn(row, attr) {
|
||||
const cols = row.cols || this.cols
|
||||
return cols[attr]
|
||||
},
|
||||
// input -- 回车事件
|
||||
handle(row, e) {
|
||||
const onEnter = row.onEnter || this.onEnter
|
||||
if (row.prop) onEnter(row, e)
|
||||
},
|
||||
// 确定--提交
|
||||
confirm() {
|
||||
const formRefs = this.$refs.form
|
||||
this.$emit('confirm', formRefs)
|
||||
},
|
||||
// 重置
|
||||
resetFields() {
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
// 清除
|
||||
clearValidate(props) {
|
||||
this.$refs.form.clearValidate(props)
|
||||
},
|
||||
// 检验-字段
|
||||
validateField(props, callback) {
|
||||
this.$refs.form.validateField(props, callback)
|
||||
},
|
||||
// 整个表单验证
|
||||
validate(callback) {
|
||||
return this.$refs.form.validate(callback)
|
||||
}
|
||||
},
|
||||
// filters: {
|
||||
// // 是否清除input内容-按钮
|
||||
// clearable_f(val) {
|
||||
// return val == null ? true : val
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.subBtn{
|
||||
float: left;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.el-form {
|
||||
width: 100%;
|
||||
}
|
||||
.el-form--inline > .el-col {
|
||||
width: auto;
|
||||
display: inline-block;
|
||||
float: unset;
|
||||
}
|
||||
.el-form-item .el-input{
|
||||
vertical-align: bottom;
|
||||
}
|
||||
</style>
|
|
@ -1,64 +0,0 @@
|
|||
|
||||
/**
|
||||
* 使用-批量导入--方式
|
||||
*/
|
||||
|
||||
// 导入 import.meta.glob 用于获取所有符合要求的 .vue 文件
|
||||
const files = import.meta.glob('./!(index).vue', { eager: true });
|
||||
|
||||
export default {
|
||||
install(Vue, options) {
|
||||
Object.entries(files).forEach(([path, file]) => {
|
||||
const fileName = path.split('/').pop().replace(/\.\w+$/, '')
|
||||
// fileName == 'cDialog' && initDialog(Vue, file) // 弹窗--组件化
|
||||
Vue.component(fileName, file.default)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 弹窗--函数化
|
||||
function initDialog(Vue, dialog) {
|
||||
// 全局绑定
|
||||
Vue.prototype.$cDialog = (props) => {
|
||||
// props.dialog = Object.assign({ isOpen: true }, props.dialog) // 默认配置 propsData: option
|
||||
props.dialog.isOpen == null && (props.dialog.isOpen = true) // 默认打开
|
||||
props.isRemove == null && (props.isRemove = true) // 默认关闭后移除
|
||||
const Constructor = Vue.extend(dialog)
|
||||
const Instance = new Constructor({ propsData: props })
|
||||
props.slots && (Instance.$slots = props.slots) // 插槽内容
|
||||
props.scopedSlots && (Instance.$scopedSlots = props.scopedSlots) // 作用域插槽内容
|
||||
props.content && (Instance.$slots.default = props.content) // 插槽内容
|
||||
document.body.appendChild(Instance.$mount().$el)
|
||||
return Instance.showBox().then(v => {
|
||||
props.callback && props.callback(v)
|
||||
return Promise.resolve(v)
|
||||
}).catch(v => {
|
||||
props.callback && props.callback(v)
|
||||
// 移除弹窗
|
||||
props.isRemove && document.body.removeChild(Instance.$mount().$el)
|
||||
return Promise.reject(v)
|
||||
})
|
||||
}
|
||||
// 全局绑定2
|
||||
Vue.prototype.$cDialog2 = (props) => {
|
||||
// props.dialog = Object.assign({ isOpen: true }, props.dialog) // 默认配置 propsData: option
|
||||
props.dialog.isOpen == null && (props.dialog.isOpen = true) // 默认打开
|
||||
props.isRemove == null && (props.isRemove = true) // 默认关闭后移除
|
||||
const Constructor = Vue.extend(dialog)
|
||||
const Instance = new Constructor({ propsData: props })
|
||||
props.slots && (Instance.$slots = props.slots) // 插槽内容
|
||||
props.scopedSlots && (Instance.$scopedSlots = props.scopedSlots) // 作用域插槽内容
|
||||
props.content && (Instance.$slots.default = props.content) // 插槽内容
|
||||
document.body.appendChild(Instance.$mount().$el)
|
||||
Instance.showBox().then(v => {
|
||||
props.callback && props.callback(v)
|
||||
return Promise.resolve(v)
|
||||
}).catch(v => {
|
||||
props.callback && props.callback(v)
|
||||
// 移除弹窗
|
||||
props.isRemove && document.body.removeChild(Instance.$mount().$el)
|
||||
return Promise.reject(v)
|
||||
})
|
||||
return Instance
|
||||
}
|
||||
}
|
|
@ -115,8 +115,7 @@ const getSubjectContent = async () => {
|
|||
edustage,
|
||||
// entpcourseedituserid: userId,
|
||||
itemgroup: 'textbook',
|
||||
orderby: 'orderidx asc',
|
||||
pageSize: 10000
|
||||
pageSize: 500
|
||||
}
|
||||
let data;
|
||||
const { rows } = await listEvaluation(params)
|
||||
|
@ -143,7 +142,7 @@ const getSubject = async () => {
|
|||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000, orderby: 'orderidx asc', })
|
||||
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 500 })
|
||||
subjectList.value = rows
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
<div v-loading="setLoading">
|
||||
<el-form :model="form" label-width="80px" ref="ruleFormRef" :rules="rules">
|
||||
<el-form-item label="班级" prop="grade">
|
||||
<el-scrollbar max-height="150px" style="width: 100%">
|
||||
<el-scrollbar max-height="200px" style="width: 100%">
|
||||
<el-tree :props="defaultProps" :load="getLoad" node-key="id" highlight-current @check="handleCheckChange"
|
||||
lazy show-checkbox />
|
||||
</el-scrollbar>
|
||||
</el-form-item>
|
||||
<el-form-item label="选中学生" prop="student">
|
||||
<el-scrollbar max-height="130px">
|
||||
<el-scrollbar max-height="200px">
|
||||
<el-tag v-for="(tag, index) in studentList" :key="tag.studentid" closable type="primary"
|
||||
@close="delStudent(index)">
|
||||
{{ tag.name }}
|
||||
|
@ -53,7 +53,6 @@ import { ElMessage } from 'element-plus'
|
|||
import { listClassmain, listClassgroup } from '@/api/classManage/index'
|
||||
import { saveByClassWorkArray } from '@/api/teaching/classwork'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getCurrentTime } from '@/utils/date'
|
||||
import { uniqBy, groupBy } from 'lodash'
|
||||
|
||||
const model = defineModel({ type: Boolean, default: false })
|
||||
|
@ -234,7 +233,7 @@ const onSubmit = (formEl) => {
|
|||
timelength: form.timelength,
|
||||
weights: 1,
|
||||
deaddate: form.deaddate,
|
||||
workdate: getCurrentTime('YYYY-MM-DD'),
|
||||
workdate: getCurrentDate(),
|
||||
uniquekey: props.row.uniquekey,
|
||||
entpcourseworklist: '[' + props.row.entpcourseworklist + ']',
|
||||
needMsgNotifine: 'false',
|
||||
|
@ -243,8 +242,7 @@ const onSubmit = (formEl) => {
|
|||
msgcontent: '',
|
||||
teachername: userInfo.nickName,
|
||||
unixstamp: new Date().getTime(),
|
||||
worktype: props.row.worktype,
|
||||
status: '1'
|
||||
worktype: props.row.worktype
|
||||
}
|
||||
ary.push(obj)
|
||||
}
|
||||
|
@ -277,10 +275,24 @@ const cloneDialog = (formEl) => {
|
|||
formEl.resetFields()
|
||||
model.value = false
|
||||
}
|
||||
// 获取当前年月日
|
||||
const getCurrentDate = () => {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
let month = now.getMonth() + 1 // 月份是从0开始的,所以需要+1
|
||||
let day = now.getDate()
|
||||
if (month < 10) {
|
||||
month = '0' + month
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 默认当前
|
||||
form.deaddate = getCurrentTime('YYYY-MM-DD HH:mm')
|
||||
form.deaddate = getCurrentDate() + ' ' + '10:00:00'
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,201 +0,0 @@
|
|||
import { nextTick, toRaw } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { edustage, edusubject } = userStore.user
|
||||
|
||||
let evaluationList = []; // 教材版本list
|
||||
let subjectList = []; // 教材list
|
||||
//当前教材ID
|
||||
let curBookId = -1;
|
||||
|
||||
/**
|
||||
* 外部链接初始化获取 跳转web端的 unitId 专用,
|
||||
* 暂时: 初始化作业设计专用,后期可能会取消
|
||||
*/
|
||||
export const useGetClassWork = async () => {
|
||||
|
||||
const params = {
|
||||
edusubject,
|
||||
edustage,
|
||||
// entpcourseedituserid: userId,
|
||||
itemgroup: 'textbook',
|
||||
orderby: 'orderidx asc',
|
||||
pageSize: 10000
|
||||
}
|
||||
|
||||
if(localStorage.getItem('evaluationList')){
|
||||
evaluationList = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
}else{
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList = rows
|
||||
}
|
||||
|
||||
//获取教材版本
|
||||
await getSubject()
|
||||
//上册
|
||||
/**
|
||||
* 不区分上下册
|
||||
* 2024/08/20调整
|
||||
*/
|
||||
// volumeOne = data.filter(item => item.level == 1 && item.semester == '上册')
|
||||
// volumeTwo = data.filter(item => item.level == 1 && item.semester == '下册')
|
||||
getTreeData()
|
||||
}
|
||||
|
||||
//获取教材
|
||||
const getSubject = async () => {
|
||||
if(localStorage.getItem('subjectList')){
|
||||
subjectList = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}else{
|
||||
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', })
|
||||
|
||||
// subjectList = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
|
||||
subjectList = rows
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList))
|
||||
}
|
||||
|
||||
// 默认第一个
|
||||
if(!subjectList.length) return
|
||||
// curBookName = subjectList[0].itemtitle
|
||||
curBookId = subjectList[0].id
|
||||
// curBookImg = BaseUrl + subjectList[0].avartar
|
||||
// curBookPath = subjectList[0].fileurl
|
||||
}
|
||||
|
||||
|
||||
const getTreeData = () => {
|
||||
//数据过滤
|
||||
let upData = transData(evaluationList)
|
||||
|
||||
if(upData.length){
|
||||
// treeData = [...upData]
|
||||
}else{
|
||||
// treeData = []
|
||||
return
|
||||
}
|
||||
nextTick(() => {
|
||||
// defaultExpandedKeys = [treeData[0].id]
|
||||
// let currentNodeObj = {...getLastLevelData(upData)[0]}
|
||||
let currentNodeId = getLastLevelData(upData)[0].id
|
||||
let currentNodeName = getLastLevelData(upData)[0].label
|
||||
|
||||
let curNode = {
|
||||
id: currentNodeId,
|
||||
label: currentNodeName,
|
||||
// itemtitle: currentNodeObj.itemtitle,
|
||||
// edudegree: currentNodeObj.edudegree,
|
||||
// edustage: currentNodeObj.edustage,
|
||||
// edusubject: currentNodeObj.edusubject,
|
||||
}
|
||||
let parentNode = findParentByChildId(upData, currentNodeId)
|
||||
curNode.parentNode = toRaw(parentNode)
|
||||
|
||||
let levelFirstId = '';
|
||||
let levelSecondId = '';
|
||||
|
||||
if (curNode.parentNode) {
|
||||
levelFirstId = curNode.parentNode.id
|
||||
} else {
|
||||
levelFirstId = curNode.id
|
||||
levelSecondId = ''
|
||||
}
|
||||
// 头部 教材分析、作业设计:打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
|
||||
// const data = {
|
||||
// textBook: {
|
||||
// curBookId: curBookId,
|
||||
// curBookName: curBookName,
|
||||
// curBookImg: curBookImg,
|
||||
// curBookPath: curBookPath
|
||||
// },
|
||||
// node: curNode
|
||||
// }
|
||||
// emit('changeBook', data)
|
||||
})
|
||||
}
|
||||
|
||||
const getLastLevelData = (tree) => {
|
||||
let lastLevelData = [];
|
||||
// 递归函数遍历树形结构
|
||||
function traverseTree(nodes) {
|
||||
nodes.forEach((node) => {
|
||||
// 如果当前节点有子节点,继续遍历
|
||||
if (node.children && node.children.length > 0) {
|
||||
traverseTree(node.children);
|
||||
} else {
|
||||
// 如果没有子节点,说明是最后一层的节点
|
||||
lastLevelData.push(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 调用递归函数开始遍历
|
||||
traverseTree(tree);
|
||||
|
||||
// 返回最后一层的数据
|
||||
return lastLevelData;
|
||||
}
|
||||
|
||||
// 根据id 拿到父节点数据
|
||||
const findParentByChildId = (treeData, targetNodeId) => {
|
||||
// 递归查找函数
|
||||
// 遍历树中的每个节点
|
||||
for (let node of treeData) {
|
||||
// 检查当前节点的子节点是否包含目标子节点 ID
|
||||
if (node.children && node.children.some(child => child.id === targetNodeId)) {
|
||||
// 如果当前节点的某个子节点的 ID 匹配目标子节点 ID,则当前节点即为父节点
|
||||
return node;
|
||||
}
|
||||
// 如果当前节点没有匹配的子节点,则递归检查当前节点的子节点
|
||||
if (node.children) {
|
||||
let parentNode = findParentByChildId(node.children, targetNodeId);
|
||||
if (parentNode) {
|
||||
return parentNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果未找到匹配的父节点,则返回 null 或者适当的默认值
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
const transData = (data) => {
|
||||
let ary = []
|
||||
data.forEach(item => {
|
||||
let obj = {}
|
||||
// 根据当前教材ID 过滤出对应的单元、章节
|
||||
if (item.rootid == curBookId) {
|
||||
if(item.level == 1){
|
||||
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.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
|
||||
}
|
||||
|
|
@ -71,8 +71,7 @@ const getHomeWorkList = async () => {
|
|||
return await homeworklist({
|
||||
entpcourseid: chapterId,
|
||||
edituserid: userStore.user.userId,
|
||||
pageSize: 100,
|
||||
status: '10'
|
||||
pageSize: 100
|
||||
}).then((res) => {
|
||||
//以下代码 参照AIx web端 作业布置
|
||||
let list = []
|
||||
|
|
|
@ -200,8 +200,6 @@ const changeSubject = async (command) =>{
|
|||
await updateUserInfo(data)
|
||||
await userStore.login({username: phonenumber, password: plainpwd})
|
||||
await userStore.getInfo()
|
||||
localStorage.removeItem('subjectList')
|
||||
localStorage.removeItem('evaluationList')
|
||||
router.go()
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import { store } from '@/store'
|
|||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import log from 'electron-log/renderer' // 渲染进程日志-文件记录
|
||||
import customComponent from '@/components/common' // 自定义组件
|
||||
|
||||
if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件
|
||||
Object.assign(console, log.functions) // 渲染进程日志-控制台替换
|
||||
|
@ -38,6 +37,4 @@ app.config.globalProperties.$requestGetJYW = (url,config)=>{
|
|||
|
||||
app.use(router)
|
||||
.use(store)
|
||||
.use(ElementPlus, { locale: zhLocale })
|
||||
.use(customComponent) // 自定义组件
|
||||
.mount('#app')
|
||||
.use(ElementPlus, { locale: zhLocale }).mount('#app')
|
|
@ -173,7 +173,6 @@ export class ImChat {
|
|||
return this.timChat.TIMLogout().then(res => {
|
||||
this.setConsole('%cim-chat: logout', '登出成功')
|
||||
this.status.isLogin = false
|
||||
this.status.isConnect = false
|
||||
this.timChat.TIMUninit() // 反初始化
|
||||
return res
|
||||
}).catch(error => {
|
||||
|
|
|
@ -66,10 +66,9 @@ function stateSyncWatch(storeName, newState) {
|
|||
const keyArr = key.split('.') || []
|
||||
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
|
||||
const jsonStr = JSON.stringify(newValue) // 从新组装-json数据
|
||||
// 更新本地数据-session
|
||||
// console.log('state-change-update:', key, value)
|
||||
// // 更新本地数据-session
|
||||
sessionStore.set(key, value)
|
||||
// 通知主线程更新
|
||||
// // 通知主线程更新
|
||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||
// console.log('======',key, value, jsonStr )
|
||||
}
|
||||
|
|
|
@ -36,13 +36,13 @@ export const constantRoutes = [
|
|||
path: '/resource',
|
||||
component: () => import('@/views/resource/index.vue'),
|
||||
name: 'resource',
|
||||
meta: {title: '资源库'}
|
||||
meta: {title: '资源'}
|
||||
},
|
||||
{
|
||||
path: '/prepare',
|
||||
component: () => import('@/views/prepare/index.vue'),
|
||||
name: 'prepare',
|
||||
meta: {title: '教学实践'}
|
||||
meta: {title: '备课'}
|
||||
},
|
||||
{
|
||||
path: '/teach',
|
||||
|
@ -68,24 +68,12 @@ export const constantRoutes = [
|
|||
name: 'class',
|
||||
meta: {title: '班级中心'},
|
||||
},
|
||||
{
|
||||
path: '/classTaskAssign',
|
||||
component: () => import('@/views/classTaskAssign/index.vue'),
|
||||
name: 'classTaskAssign',
|
||||
meta: {title: '作业设计'},
|
||||
},
|
||||
{
|
||||
path: '/classTask',
|
||||
component: () => import('@/views/classTask/classTask.vue'),
|
||||
name: 'classCorrect',
|
||||
meta: {title: '作业批改'},
|
||||
},
|
||||
{
|
||||
path: '/newClassTask',
|
||||
component: () => import('@/views/classTask/newClassTask.vue'),
|
||||
name: 'newClassCorrect',
|
||||
meta: {title: '作业设计'},
|
||||
},
|
||||
{
|
||||
path: '/examReport',
|
||||
component: () => import('@/views/examReport/index.vue'),
|
||||
|
|
|
@ -1,312 +0,0 @@
|
|||
|
||||
/**
|
||||
* @description 公共工具类
|
||||
* @author zdg
|
||||
* @date 2024-4-26
|
||||
*/
|
||||
|
||||
// ============= 文件工具--相关 ===================
|
||||
/**
|
||||
* 获取上传文件
|
||||
*/
|
||||
export function getFiles() {
|
||||
const cb = resolve => {
|
||||
const fileDom = document.createElement('input')
|
||||
fileDom.type = 'file'
|
||||
fileDom.onchange = e => {
|
||||
resolve(e.target.files)
|
||||
return fileDom.remove()
|
||||
}
|
||||
fileDom.click()
|
||||
}
|
||||
return new Promise(cb)
|
||||
}
|
||||
|
||||
// ============= 数学公式--相关 ===================
|
||||
/**
|
||||
* @description 计算两点直线距离 (获取直径)
|
||||
* (欧几里得距离公式): [ \text{distance} = \sqrt{(x2 - x1)^2 + (y2 - y1)^2} ]
|
||||
* @param {*} x1
|
||||
* @param {*} y1
|
||||
* @param {*} x2
|
||||
* @param {*} y2
|
||||
*/
|
||||
export function getDistance(x1,y1,x2,y2) {
|
||||
return Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2))
|
||||
}
|
||||
// 获取半径
|
||||
export function getRadius(x1,y1,x2,y2) { return getDistance(x1,y1,x2,y2) / 2 }
|
||||
|
||||
/**
|
||||
* 计算某个值在总数中所占的百分比。
|
||||
*
|
||||
* 此函数用于根据给定的值和总数,计算该值占总数的百分比。它还支持指定百分比的小数位数。
|
||||
* 如果计算结果小于0,则返回0;如果大于100,则返回100,以确保百分比的合理范围。
|
||||
*
|
||||
* @param {number} v - 待计算的值。
|
||||
* @param {number} total - 总数。
|
||||
* @param {number} [step=2] - 百分比的小数位数,默认为2。
|
||||
* @returns {number} - 返回计算后的百分比,保证在0到100之间。
|
||||
*/
|
||||
export function getPercent(v, total, step=2) {
|
||||
!v && (v = 0)
|
||||
!total && (total = 1)
|
||||
// 计算百分比,保留指定的小数位,并转换为数字类型
|
||||
let res = (v / total * 100).toFixed(step)-0
|
||||
|
||||
// 确保百分比在0到100之间
|
||||
return res < 0 ? 0 : res > 100 ? 100 : res
|
||||
}
|
||||
|
||||
// ============= 格式化--相关 ===================
|
||||
|
||||
/**
|
||||
* @description 手机号隐藏中间几位
|
||||
* @param {*} phone 手机号
|
||||
* @param {*} start 前面保留几位 默认 3位
|
||||
* @param {*} end 后面保留几位 默认 3位
|
||||
* @param {*} rstr 替换字符 默认 ****
|
||||
* @returns
|
||||
*/
|
||||
export function phoneHideFormat(phone, start = 3, end = 4, rstr = '****') {
|
||||
// const reg = /^(\d{3})\d*(\d{4})$/
|
||||
if (!phone) return ''
|
||||
const reg = new RegExp(`(\\d\{${start}\})\\d*(\\d\{${end}\})`)
|
||||
return phone.replace(reg, `$1${rstr}$2`)
|
||||
}
|
||||
|
||||
// ============= 习题工具--相关 ===================
|
||||
/**
|
||||
* @description 将字符串转换为数组
|
||||
* @param {*} str
|
||||
* @returns
|
||||
*/
|
||||
export function quizStrToList(str = '') {
|
||||
if (!str) return []
|
||||
let resList = []
|
||||
if (isJson(str, true)) resList = JSON.parse(str) // 数组对象
|
||||
else if (str.includes('#&')) resList = str.split('#&') // 字符串数组 #&
|
||||
else if (str.includes(',')) resList = str.split(',') // 字符串数组 ,
|
||||
else resList = [str]
|
||||
return resList
|
||||
}
|
||||
|
||||
// ============= 常用工具--相关 ===================
|
||||
|
||||
export function isJson(str, isArray = false) {
|
||||
if(typeof str == 'string'){
|
||||
try {
|
||||
const res = JSON.parse(str)
|
||||
let isBool = typeof res == 'object' && res
|
||||
if(isBool && isArray) isBool = Array.isArray(res)
|
||||
return isBool
|
||||
} catch (error) {}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//获取临时唯一ID
|
||||
export const generateUniqueID = ()=> {
|
||||
const date = new Date();
|
||||
const timestamp = date.getTime().toString(36); // 使用36进制转换时间戳
|
||||
const random = Math.random().toString(36).substring(2, 9); // 获取随机数的一部分并转换为36进制
|
||||
return timestamp + random;
|
||||
}
|
||||
|
||||
// 清理参数中的undefined、null
|
||||
export const removePropertyOf = function(obj){
|
||||
Object.keys(obj).forEach(item=>{
|
||||
if(obj[item] === undefined || obj[item] === null) delete obj[item]
|
||||
})
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除children 为空 -- tree
|
||||
*/
|
||||
export function removeTree(list) {
|
||||
var this_ = this
|
||||
for (var i in list) {
|
||||
if (list[i].children.length == 0) {
|
||||
list[i].children = undefined
|
||||
} else {
|
||||
this_.removeTree(list[i].children)
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
// ============= 校验工具--相关 ===================
|
||||
|
||||
// url校验
|
||||
export const validateUrl = (url) => {
|
||||
const regex = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
|
||||
if (!regex.test(url.trim())) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// ============= 时间工具--相关 ===================
|
||||
|
||||
/**
|
||||
* @description 时间 秒 转化 时分秒
|
||||
* @param {*} seconds
|
||||
* @returns
|
||||
*/
|
||||
export function formatTime(seconds) {
|
||||
seconds = parseInt(seconds) // 转换整数
|
||||
const h = (Math.floor(seconds / 3600)+'').padStart(2,'0')
|
||||
const m = (Math.floor((seconds % 3600) / 60)+'').padStart(2,'0')
|
||||
const s = ((seconds % 60)+'').padStart(2,'0')
|
||||
return `${h}:${m}:${s}`
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 时间格式化
|
||||
* @param {*} time
|
||||
* @param {*} fmt
|
||||
* @returns
|
||||
*/
|
||||
export function formatDate(time, fmt = 'yyyy-MM-dd') {
|
||||
let date
|
||||
if (time) {
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
} else {
|
||||
date = new Date()
|
||||
}
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
}
|
||||
const o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds(),
|
||||
'a': date.getDay()
|
||||
}
|
||||
for (const k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
if (k === 'a') {
|
||||
const str = ['日', '一', '二', '三', '四', '五', '六'][o[k]]
|
||||
fmt = fmt.replace(RegExp.$1, str)
|
||||
continue
|
||||
}
|
||||
const str = o[k] + ''
|
||||
// fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str))
|
||||
fmt = fmt.replace(RegExp.$1, str.padStart(2, '0'))
|
||||
}
|
||||
}
|
||||
return fmt
|
||||
}
|
||||
/**
|
||||
* 快速获取日期
|
||||
* num: 1 今日 2 昨日 3 本周 4 上周 5 本月
|
||||
* bool: true 有时分秒 false | null 不要时分秒
|
||||
*/
|
||||
export function getDateStr(num, bool) {
|
||||
let now = new Date() // 当前日期
|
||||
let nowDayOfWeek = now.getDay() // 今天本周的第几天
|
||||
let nowDay = now.getDate() // 当前日
|
||||
let nowMonth = now.getMonth() // 当前月
|
||||
let nowYear = now.getYear() // 当前年
|
||||
nowYear += (nowYear < 2000) ? 1900 : 0 //
|
||||
let monthStartDate = new Date(nowYear, nowMonth, 1)
|
||||
let monthEndDate = new Date(nowYear, nowMonth + 1, 1)
|
||||
let days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)
|
||||
|
||||
let fmt = 'yyyy-MM-dd'
|
||||
let startTime = ''
|
||||
let endTime = ''
|
||||
|
||||
if (num == 1) { // 今日
|
||||
startTime = formatDate(now, fmt)
|
||||
endTime = startTime
|
||||
}
|
||||
if (num == 2) { // 昨日
|
||||
now.setDate(nowDay - 1)
|
||||
startTime = formatDate(now, fmt)
|
||||
endTime = startTime
|
||||
}
|
||||
if (num == 3) { // 本周
|
||||
startTime = formatDate(new Date(nowYear, nowMonth, nowDay - nowDayOfWeek), fmt)
|
||||
endTime = formatDate(new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek)), fmt)
|
||||
}
|
||||
if (num == 4) { // 上周
|
||||
startTime = formatDate(new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7), fmt)
|
||||
endTime = formatDate(new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1), fmt)
|
||||
}
|
||||
if (num == 5) { // 本月
|
||||
startTime = formatDate(new Date(nowYear, nowMonth, 1), fmt)
|
||||
endTime = formatDate(new Date(nowYear, nowMonth, days), fmt)
|
||||
}
|
||||
if (num == 6) { // 本年
|
||||
startTime = formatDate(new Date(nowYear, 0, 1), fmt)
|
||||
endTime = formatDate(new Date(nowYear, 11, 31), fmt)
|
||||
}
|
||||
if (bool) {
|
||||
startTime += ' 00:00:00'
|
||||
endTime += ' 23:59:59'
|
||||
}
|
||||
return [startTime, endTime]
|
||||
}
|
||||
/**
|
||||
* 获取 昨天 今天 明天 一周前 一月前 1-5
|
||||
*/
|
||||
export function getDateStr1(num, fmt = 'yyyy-MM-dd hh:mm:ss') {
|
||||
const now = new Date() // 当前日期
|
||||
const curr = Date.now() // 当前时间戳
|
||||
if (num == 1) return formatDate(new Date(curr-(24*60*60*1000)),fmt) // 昨天
|
||||
else if (num == 2) return formatDate(now,fmt) // 今天
|
||||
else if (num == 3) return formatDate(new Date(curr+(24*60*60*1000)),fmt) // 明天
|
||||
else if (num == 4) return formatDate(new Date(curr-(7*24*60*60*1000)),fmt) // 一周前
|
||||
else if (num == 5) return formatDate(new Date(curr-(30*24*60*60*1000)),fmt) // 一月前
|
||||
return ''
|
||||
}
|
||||
/**
|
||||
* 获取当前 0:0:0:0 时间
|
||||
* @param {*} [fmt] 格式 'yyyy-MM-dd hh:mm:ss'
|
||||
*/
|
||||
export function getDateNow(fmt) {
|
||||
const date = new Date()
|
||||
date.setHours(0, 0, 0, 0)
|
||||
if (fmt) return formatDate(date, fmt)
|
||||
return date
|
||||
}
|
||||
/** 默认加上-时分秒 */
|
||||
export function toTimeStr(arr = ['','']) {
|
||||
return [`${arr[0]} 00:00:00`, `${arr[1]} 23:59:59`]
|
||||
}
|
||||
|
||||
/**
|
||||
* 秒转时分
|
||||
*/
|
||||
export function timeToStr(time,str = '时分秒', isPad = false) {
|
||||
let s = parseInt(time)
|
||||
let h = 0, m = 0 // 初始化时|分
|
||||
if (s >= 60) {
|
||||
// 如果秒数大于60,将秒数转换成整数
|
||||
m = parseInt(s / 60) // 获取分钟,除以60取整数,得到整数分钟
|
||||
s = parseInt(s % 60) // 获取秒数,秒数取佘,得到整数秒数
|
||||
if (m >= 60) { // 如果分钟大于60,将分钟转换成小时
|
||||
h = parseInt(m / 60) // 获取小时,获取分钟除以60,得到整数小时
|
||||
m = parseInt(m % 60) // 获取小时后取佘的分,获取分钟除以60取佘的分
|
||||
}
|
||||
}
|
||||
const toStr = v => v.toString().padStart(2, '0') // 转换字符
|
||||
const arr = str.split('')
|
||||
if (isPad) return `${h?toStr(h)+arr[0]:''}${m?toStr(m)+arr[1]:''}${toStr(s)}${arr[2]||''}`
|
||||
return `${h?h+arr[0]:''}${m?m+arr[1]:''}${s?s+arr[2]||'':''}`
|
||||
}
|
|
@ -97,9 +97,6 @@ export const getCurrentTime = (format)=> {
|
|||
if(format == 'HH:mm'){
|
||||
return `${hours}:${minutes}`;
|
||||
}
|
||||
if(format == 'MMDD'){
|
||||
return `${month}${day}`;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import useUserStore from '@/store/modules/user'
|
||||
export const baseConfig = (token) => {
|
||||
const userStore = token ? {} : useUserStore()
|
||||
const baseConfig = () => {
|
||||
const userStore = useUserStore()
|
||||
return {
|
||||
// Electron 设置cookie
|
||||
url: import.meta.env.VITE_APP_BUILD_BASE_PATH,
|
||||
|
@ -8,7 +8,7 @@ export const baseConfig = (token) => {
|
|||
//cookie 名称 这里为 token
|
||||
name: 'Admin-Token',
|
||||
//cookie 值
|
||||
value: token ? '' : userStore.token,
|
||||
value: userStore.token,
|
||||
// 域名
|
||||
domain: import.meta.env.VITE_APP_DOMAIN
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ const Remote = isNode?require('@electron/remote'):{}
|
|||
const { ipcRenderer } = isNode?require('electron'):window.electron || {}
|
||||
const API = isNode?window.api:{} // preload-api
|
||||
import { useToolState } from '@/store/modules/tool' // 获取store状态
|
||||
// const Store = isNode?require('electron-store'):null // 持久化存储
|
||||
import store from './store'
|
||||
import { baseConfig } from './linkConfig' // 外部连接-配置
|
||||
// 常用变量
|
||||
const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':''
|
||||
const isDev = isNode?process.env.NODE_ENV !== 'production':''
|
||||
|
@ -297,23 +297,6 @@ const eventHandles = (type, win) => {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 外部跳转-web网页
|
||||
* @param {*} path
|
||||
* @param {*} params
|
||||
*/
|
||||
export const toLinkWeb = (path) => {
|
||||
const config = baseConfig()
|
||||
// console.log(config)
|
||||
const fullPath = config.url + path
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
key: `win-${Date.now()}`,
|
||||
fullPath: fullPath,
|
||||
cookieData: { ...config }
|
||||
})
|
||||
}
|
||||
|
||||
// const taskHandles = () => {
|
||||
// // 设置任务栏上下文菜单
|
||||
// const contextMenu = new Remote.Menu()
|
||||
|
|
|
@ -118,7 +118,6 @@ const getData = () => {
|
|||
getClassWorkList()
|
||||
// 3、班级学生作业 包含多个班级
|
||||
getStudentClassWorkData()
|
||||
loading.value = false
|
||||
}
|
||||
/**
|
||||
* 1、获取班级列表数据
|
||||
|
@ -141,7 +140,6 @@ const getClassWorkList = () => {
|
|||
edustage: userStore.edustage,// 学段
|
||||
edusubject: userStore.edusubject,//学科
|
||||
deaddate: tabActive.value === '进行中'? getTomorrow() : EndDate.value,// 进行中:明天,已结束:选择的日期
|
||||
status: '1', // 作业状态:1-已发布
|
||||
orderby: 'concat(deaddate,uniquekey) DESC',
|
||||
pageSize: 100
|
||||
}).then((response) => {
|
||||
|
@ -221,7 +219,7 @@ const getStudentClassWorkData = () => {
|
|||
}).then((res) => {
|
||||
for (var t = 0; t < classWorkList.value.length; t++) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (res.rows[i].classworkid == classWorkList.value[t].id && res.rows[i].finishtimelength != '0') {
|
||||
if (res.rows[i].classworkid == classWorkList.value[t].id && res.rows[i].resultcount > 0) {
|
||||
console.log('==================')
|
||||
// 有几个学生完成/正在完成学习任务
|
||||
// 至少resultcount不是0
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
<div class="teacher_content_con">
|
||||
<!-- 题目内容:习题训练 -->
|
||||
<div v-if="dialogProps.studentObj.worktype == '习题训练'">
|
||||
<div v-for="(quItem, qIndex) in dialogProps.quizlist" :key="quItem.id">
|
||||
<div v-for="(stuItem, sIndex) in dialogProps.studentQuizAllList" :key="stuItem.id">
|
||||
<div v-for="(stuItem, sIndex) in dialogProps.studentQuizAllList" :key="stuItem.id">
|
||||
<div v-for="quItem in dialogProps.quizlist" :key="quItem.id">
|
||||
<div v-if="stuItem.entpcourseworkid == quItem.id">
|
||||
<el-card style="max-width: 100%; margin-bottom: 10px">
|
||||
<!-- 题型 分值 -->
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span
|
||||
>{{ qIndex + 1 }}、{{ quItem.worktype }}
|
||||
>{{ sIndex + 1 }}、{{ quItem.worktype }}
|
||||
{{ stuItem.score ? stuItem.score : 0 }}分</span
|
||||
>
|
||||
</div>
|
||||
|
@ -79,34 +79,79 @@
|
|||
<template #footer>
|
||||
<el-row>
|
||||
<el-col :span="6" style="padding: 10px">
|
||||
<span>参考答案:
|
||||
<span
|
||||
>参考答案:
|
||||
<span v-if="quItem.workanswerFormat != ''">
|
||||
<sapn style="background-color: #0ed116; color: white; padding: 0 5px; border-radius: 5px;">{{ formatWorkAnswer(quItem) }}</sapn>
|
||||
<sapn
|
||||
style="
|
||||
background-color: #0ed116;
|
||||
color: white;
|
||||
padding: 0 5px;
|
||||
border-radius: 5px;
|
||||
"
|
||||
>{{ quItem.workanswerFormat.replace(/<[^>]+>/g, '') }}</sapn
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="6" style="padding: 10px">
|
||||
<!-- <span>学生答案:{{ stuItem.feedcontent }}</span> -->
|
||||
<span>学生答案:
|
||||
<span v-if="stuItem.feedcontent !=''" style="background-color: red; color: white; padding: 0 5px; border-radius: 5px;">
|
||||
{{ formatFeedContent(stuItem, quItem) }}
|
||||
<span
|
||||
>学生答案:
|
||||
<span v-if="quItem.workdesc == ''|| quItem.workdesc == '[]' ">
|
||||
<!-- quItem.workdesc 没值,说明是非选择题 -->
|
||||
<span
|
||||
v-if="stuItem.feedcontent != ''"
|
||||
style="
|
||||
background-color: red;
|
||||
color: white;
|
||||
padding: 0 5px;
|
||||
border-radius: 5px;
|
||||
"
|
||||
>
|
||||
{{ stuItem.feedcontent.replace('#', '、') }}
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<!-- 选择题类型:学生答题转换为 ABCD格式 -->
|
||||
<span
|
||||
v-if="stuItem.feedcontent != ''"
|
||||
style="
|
||||
background-color: red;
|
||||
color: white;
|
||||
padding: 0 5px;
|
||||
border-radius: 5px;
|
||||
"
|
||||
>
|
||||
{{
|
||||
JSON.parse(quItem.workdesc)
|
||||
.map((item, index) => {
|
||||
if (item == stuItem.feedcontent) {
|
||||
return String.fromCharCode(65 + Number(index))
|
||||
}
|
||||
})
|
||||
.filter(Boolean)[0]
|
||||
}}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col :span="6" style="padding: 10px">
|
||||
<div v-if="stuItem.imagefile && stuItem.imagefile.length > 0">
|
||||
<div v-for="(imageItem, index) in stuItem.imagefile" :key="index">
|
||||
<el-image
|
||||
style="width: 30px; height: 30px"
|
||||
:src="imageItem"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="stuItem.imagefile"
|
||||
:initial-index="4"
|
||||
fit="contain"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-for="(imageItem, index) in stuItem.imagefile"
|
||||
v-if="stuItem.imagefile && stuItem.imagefile.length > 0"
|
||||
:key="index"
|
||||
>
|
||||
<el-image
|
||||
style="width: 30px; height: 30px"
|
||||
:src="imageItem"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="stuItem.imagefile"
|
||||
:initial-index="4"
|
||||
fit="contain"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6" style="padding: 10px">
|
||||
|
@ -209,11 +254,6 @@
|
|||
|
||||
<!-- 学生答题展示 -->
|
||||
<div v-if="feedContentList.length > 0">
|
||||
<div v-if="dialogProps.studentObj.worktype == '常规作业' && stuItem.rightanswer != ''&& stuItem.rightanswer != null">
|
||||
<!-- 常规作业:学生有的会答复 -->
|
||||
<p style="padding: 10px 0;">学生答复内容</p>
|
||||
<div style="padding: 0 20px">{{stuItem.rightanswer}}</div>
|
||||
</div>
|
||||
<p>学生答题附件内容</p>
|
||||
<div class="image_list">
|
||||
<div v-if="imageList.length > 0">
|
||||
|
@ -250,9 +290,6 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 无附件内容 -->
|
||||
<div v-if="imageList.length == 0 && fileList.length == 0" style="padding: 0 20px">未提交附件内容</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
@ -462,7 +499,6 @@ import { ElMessageBox, ElMessage } from 'element-plus'
|
|||
import { updateClassworkeval, updateClassworkdata } from '@/api/classTask'
|
||||
import { getTimeDate } from '@/utils/date'
|
||||
import ReFilePreview from '@/components/refile-preview/index.vue'
|
||||
import { quizStrToList } from '@/utils/comm';
|
||||
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
@ -806,47 +842,6 @@ const acceptParams = (params) => {
|
|||
analysisScoreOpen.value = true
|
||||
}
|
||||
|
||||
const formatWorkAnswer = (quItem) => {
|
||||
let format = '';
|
||||
if (!Array.isArray(quItem.workanswerFormat)) {
|
||||
format = quItem.workanswerFormat.replace(/<[^>]+>/g, '')
|
||||
} else {
|
||||
format = quItem.workanswerFormat.map(item => item.replace(/<[^>]+>/g, '')).join('、');
|
||||
}
|
||||
return format;
|
||||
}
|
||||
// 根据题型处理学生答案
|
||||
const formatFeedContent = (stuItem, quItem) => {
|
||||
let format = '';
|
||||
|
||||
if (quItem.workdesc == '' || quItem.workdesc == '[]') {
|
||||
// 非单选题和多选题
|
||||
const arr = stuItem.feedcontent.split('#');
|
||||
return arr.map(item => {
|
||||
if (item == '') {
|
||||
item = '空';
|
||||
}
|
||||
return item;
|
||||
}).join('、');
|
||||
}else {
|
||||
const list = quizStrToList(quItem.workdesc);
|
||||
format = list.map((item,index) =>{
|
||||
if (quItem.worktype == '单选题') {
|
||||
const workdesc = item.replace(/<[^>]*>/g,'');
|
||||
const feedcontent = stuItem.feedcontent.replace(/<[^>]*>/g,'');
|
||||
if(workdesc == feedcontent){
|
||||
return (String.fromCharCode(65+Number(index)))
|
||||
}
|
||||
} else if (quItem.worktype == '多选题') {
|
||||
const arr = stuItem.feedcontent.split(',');
|
||||
return arr.map(item => String.fromCharCode(65+Number(item))).join('');
|
||||
}
|
||||
}).filter(Boolean)[0];
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
// 提交批改评分
|
||||
const onClassWorkFormScoreSave = () => {
|
||||
console.log(classWorkFormScore)
|
||||
|
|
|
@ -383,7 +383,7 @@ const getClassWorkStudentList = (rowId) => {
|
|||
// 默认获取已交的学生列表
|
||||
tableRadio.list =
|
||||
classWorkAnalysis.classworkdata &&
|
||||
classWorkAnalysis.classworkdata.filter((item) => item.finishtimelength != '0')
|
||||
classWorkAnalysis.classworkdata.filter((item) => item.resultcount > 0)
|
||||
tableRadio.value = '1'
|
||||
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length
|
||||
tableRadio.num1 = tableRadio.list.length
|
||||
|
@ -506,12 +506,12 @@ const tableRadioChange = (e) => {
|
|||
console.log(e,'??????')
|
||||
console.log("学生列表:", classWorkAnalysis.classworkdata)
|
||||
if(e=='1'){
|
||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength != '0')
|
||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.resultcount > 0)
|
||||
tableRadio.value = '1';
|
||||
tableRadio.num0 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
|
||||
tableRadio.num1 = tableRadio.list.length;
|
||||
}else if(e=='0'){
|
||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.finishtimelength == '0')
|
||||
tableRadio.list = classWorkAnalysis.classworkdata.filter(item => item.resultcount == 0)
|
||||
tableRadio.value = '0';
|
||||
tableRadio.num0 = tableRadio.list.length;
|
||||
tableRadio.num1 = classWorkAnalysis.classworkdata.length - tableRadio.list.length;
|
||||
|
|
|
@ -1,454 +0,0 @@
|
|||
<template>
|
||||
<div class="page-typeview flex">
|
||||
<el-form ref="classWorkForm" :model="classWorkForm" label-width="90" style="height: calc(100% - 55px);display: flex;flex-direction: column;">
|
||||
<!-- 标题 -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="作业类型:">
|
||||
<el-radio-group v-model="formType" @change="changeFormType">
|
||||
<template v-for="(item) in listWorkType" :key="item">
|
||||
<el-radio :value="item" >{{ item }}</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="作业资源:" class="el-form-work-list">
|
||||
<el-col :span="15" class="work-left">
|
||||
<div v-if="classWorkForm.worktype=='习题训练'" style="height: 100%; display: flex; flex-direction: column;">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="题型" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.worktype" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkTypeList" :key="index" :label="item.label" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="题源" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.workgroup" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkGroupList" :key="index" :label="item.Value" :value="item.Key" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="知识点" label-width="70">
|
||||
<el-cascader
|
||||
v-model="entpCourseWorkQueryParams.point"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:options="entpCourseWorkPointList"
|
||||
:props="knowledgePointProps"
|
||||
popper-class="my-popper"
|
||||
:show-all-levels="false"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" style="margin-top: 4px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="年份" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
|
||||
<el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-form-item label="关键词" label-width="70">
|
||||
<el-input
|
||||
v-model="entpCourseWorkQueryParams.keyWord"
|
||||
style="width: 70%" type="text"
|
||||
placeholder="请输入关键词"
|
||||
/>
|
||||
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> 查找</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="workResource.entpCourseWorkList" style="width: 100%;">
|
||||
<el-table-column type="index" width="60" />
|
||||
<el-table-column align="left" >
|
||||
<template #header>
|
||||
<div style="display: flex">
|
||||
<div style="align-items: center;">题目内容</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis" v-html="scope.row.titleFormat"></div>
|
||||
<div style="overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; margin-top: 6px;" v-html="scope.row.workdescFormat"></div>
|
||||
<el-col :span="24" style="display: flex">
|
||||
<div style="font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.entpname }} {{ scope.row.editusername }}</div>
|
||||
<div style="margin-left: 30px; font-size: 1em; color: silver; padding-top: 5px">{{ scope.row.worktag }}</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" width="100">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="handleClassWorkQuizAdd('entpcourseworklist', scope.row.id)">添加</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="height: 55px;">
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="entpCourseWorkTotal > 0"
|
||||
v-model:page="paginationParams.pageNum"
|
||||
v-model:limit="paginationParams.pageSize"
|
||||
:total="entpCourseWorkTotal"
|
||||
:style="{ position: 'relative', 'margin-top': '5px' }"
|
||||
@pagination="getPaginationList" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div v-if="classWorkForm.worktype!='习题训练'">
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-if="classWorkForm.worktype!='常规作业'">
|
||||
<template v-for="(item, index) in workResource.teachResourceList" :key="item">
|
||||
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
<div style="font-size: 1.2em; font-weight: bold;margin-right: 5px">{{ item.worktype }}</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="color: silver; display: flex;align-items: center;">
|
||||
<el-image :src="item.userheadimgurl" style="height: 30px; width: 30px; border-radius: 50%;"></el-image>
|
||||
<div style="line-height: 18px">
|
||||
<div style="margin-top: 5px; margin-left: 5px">{{ item.username }} 来自{{ item.parententpname }} {{ item.userentpname }}</div>
|
||||
<div style="margin-top: 5px; margin-left: 5px">{{ item.timestamp }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center; justify-content: space-around; margin-left: 15px; margin-right: 15px;">
|
||||
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
|
||||
<el-button @click="handleClassWorkAddOfResource(item)" icon="FolderAdd">添加到作业</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="classWorkForm.worktype =='常规作业'">
|
||||
<div class="upload-homework" v-loading="fileLoading">
|
||||
<FileUpload v-model="fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div v-if="classWorkForm.activeIndex==3">
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<el-form-item label="查找筛选条件">
|
||||
本节课、本单元,其他单元
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: right;">
|
||||
<el-button @click="handleQueryFromEntpCourseWork" icon="Search">更多</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-for="(item, index) in workResource.classWorkList" :key="item.id">
|
||||
<template v-if="item.classid > 0">
|
||||
<div style="margin-bottom: 30px; padding-left: 15px">
|
||||
<div style="font-size: 1.2em; font-weight: bold">{{ item.worktype }}</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div style="color: silver; display: flex">
|
||||
<el-image :src="item.edituserheadimgurl" style="height: 30px; width: 30px; border-radius: 50%;"></el-image>
|
||||
<div style="margin-top: 5px; margin-left: 10px">{{ item.editusername }} 来自{{ item.parententpname }} {{ item.entpname }}</div>
|
||||
</div>
|
||||
<div style="color: silver; margin-right: 15px; padding-top: 5px">{{item.workdate}}</div>
|
||||
</div>
|
||||
<div style="font-size: 1em; margin-top: 10px; margin-bottom: 10px; display: flex">
|
||||
<div style="max-width: 100%;word-wrap: break-word;">{{ item.workcontent }}</div>
|
||||
<div v-if="item.entpcourseworklistarray.length>0" style="margin-top: -5px; margin-left: 15px">
|
||||
<el-button v-if="item.expanded==false" style="margin-right: 4px" @click="handleClassWorkResNodeClick(index)">展开</el-button>
|
||||
<el-button v-if="item.expanded==true" @click="handleClassWorkResNodeClick(index)">缩回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="item.expanded == true">
|
||||
<template v-for="(qitem, qindex) in item.quizlist" :key="qitem.id">
|
||||
<el-row style="margin-bottom: 20px; border: 1px dotted; padding: 20px" >
|
||||
<el-col :span="22">
|
||||
<div v-html="qitem.titleFormat" style="overflow: hidden; text-overflow: ellipsis"></div>
|
||||
<div v-html="qitem.workdescFormat" style="overflow: hidden; text-overflow: ellipsis; margin-top: 6px;"></div>
|
||||
</el-col>
|
||||
<el-col :span="2"><el-button type="primary" @click="handleClassWorkQuizAdd('classworklist', qitem.id)"><el-icon><CirclePlus /></el-icon> 添加</el-button></el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</template>
|
||||
<div style="display: flex; justify-content: end; margin-left: 15px; margin-right: 15px">
|
||||
<el-button @click="handleClassWorkPackAdd(index)" icon="FolderAdd">添加到作业</el-button>
|
||||
</div>
|
||||
<el-divider />
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-col>
|
||||
<el-col :span="8" style="padding: 0 0 0 5px;height: 60vh; overflow: auto; line-height: 26px">
|
||||
<div v-if="classWorkForm.worktype=='习题训练'" :style="{ 'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||
<template v-for="(item,index) in classWorkForm.quizlist" :key="item.id">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<div v-html="item.titleFormat" style="padding: 15px 20px 5px 20px"></div>
|
||||
<div style="display: flex;">
|
||||
<el-form-item label="分值">
|
||||
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
|
||||
</el-form-item>
|
||||
<div style="margin-left: auto; padding: 0px 20px"><el-button size="small" type="danger" @click="handleClassWorkFormQuizRemove(index)">删除</el-button></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div v-if="classWorkForm.worktype!='习题训练'" :style="{'overflow': 'auto', 'border':'1px dotted blue','border-radius':'5px', 'background-color': '#f7f7f7'}">
|
||||
<div style="margin: 5px; background-color: white">
|
||||
<template v-for="(item,index) in chooseWorkLists" :key="item.id">
|
||||
<div v-if="item.worktype==classWorkForm.worktype">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
<div style="font-size: 1.2em; font-weight: bold;margin-right: 5px">{{ item.worktype }}</div>
|
||||
<div style="display: flex;align-items: center; justify-content: space-around; margin-left: 15px; margin-right: 15px;flex: 1;">
|
||||
<div style="color: silver; display: flex;align-items: center;flex: 1;">
|
||||
<el-form-item label="分值">
|
||||
<el-input-number v-model="item.score" :min="1" :max="100" size="small"></el-input-number >
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-button @click="prevRead(item)" icon="Search">预览</el-button>
|
||||
<el-button @click="deleteClassWorkAddOfResource(item)" type="danger" icon="Delete">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { getCurrentTime } from '@/utils/date'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
|
||||
const props = defineProps({
|
||||
bookobj: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
const isDialogOpen = ref(false)
|
||||
const toolStore = useToolState()
|
||||
const openDialog = () => {
|
||||
isDialogOpen.value = true
|
||||
}
|
||||
const formType = ref('习题训练')
|
||||
// ---------------------------------------------------
|
||||
const listWorkType = ref(['习题训练', '框架梳理', '课堂展示', '常规作业']); //作业类型
|
||||
|
||||
const entpCourseWorkTypeList = ref([
|
||||
{value: 0, label: "不限"},
|
||||
{value: 1, label: "单选题"},
|
||||
{value: 2, label: "填空题"},
|
||||
{value: 3, label: "多选题"},
|
||||
{value: 4, label: "判断题"},
|
||||
{value: 5, label: "主观题"},
|
||||
{value: 6, label: "复合题"},
|
||||
]); // 习题查询条件 - 题型
|
||||
|
||||
const entpCourseWorkGroupList = ref([{
|
||||
Key: -1,
|
||||
Value: '不限',
|
||||
}, {
|
||||
Key: 1,
|
||||
Value: '真题',
|
||||
}, {
|
||||
Key: 0,
|
||||
Value: '非真题',
|
||||
}]); // 习题查询条件 - 题源
|
||||
|
||||
const entpCourseWorkPointList = ref([
|
||||
{label: '不限', value: []},
|
||||
]); // 习题查询条件 - 知识点
|
||||
|
||||
const entpCourseWorkYearList =ref([
|
||||
{label: '不限', value: '-1'},
|
||||
{label: '2024', value: '2024'},
|
||||
{label: '2023', value: '2023'},
|
||||
{label: '2022', value: '2022'},
|
||||
{label: '2021', value: '2021'},
|
||||
{label: '2020', value: '2020'},
|
||||
]); // 习题查询条件 - 年份
|
||||
|
||||
|
||||
const paginationParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}); // 分页传参
|
||||
|
||||
// 习题查询参数条件
|
||||
const entpCourseWorkQueryParams = reactive({
|
||||
worktype: {
|
||||
label: '不限',
|
||||
value: 0,
|
||||
},
|
||||
workgroup: 0,
|
||||
yearStr: '-1',
|
||||
point: [],
|
||||
keyWord: '',
|
||||
});
|
||||
|
||||
const workResource = reactive({
|
||||
options: ['学习任务', '云题库'],
|
||||
worktype: '全部',
|
||||
activeIndex: "3",
|
||||
dialogOfTaskOpen: false,
|
||||
dislogOfAssignOpen: false,
|
||||
quiztype: '',
|
||||
queryForm: {},
|
||||
classWorkList: [], // 教学分析里产生的学习任务
|
||||
entpCourseWorkList: [],
|
||||
}); // 作业资源
|
||||
const classWorkForm = reactive({
|
||||
worktype: '习题训练', //作业类型
|
||||
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
||||
|
||||
})
|
||||
const entpCourseWorkList = ref([]); // 习题列表
|
||||
const entpCourseWorkTotal = ref(0); // 习题总数
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 作业类型切换
|
||||
*/
|
||||
const changeFormType = (val) => {
|
||||
console.log(val)
|
||||
classWorkForm.value.worktype = val;
|
||||
}
|
||||
|
||||
const queryForm = reactive({
|
||||
// 课程相关参数
|
||||
eid: props.bookobj.levelSecondId,
|
||||
sectionName: props.bookobj.coursetitle,
|
||||
edusubject: userStore.edusubject,
|
||||
edustage: userStore.edustage,
|
||||
//
|
||||
// 题类
|
||||
worktype: entpCourseWorkQueryParams.worktype.label,
|
||||
workTypeId: entpCourseWorkQueryParams.worktype.value,
|
||||
// 题源
|
||||
workgroup: entpCourseWorkQueryParams.workgroup,
|
||||
// 年份
|
||||
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
|
||||
// 知识点
|
||||
thirdId: entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
|
||||
// 关键字
|
||||
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
|
||||
|
||||
// 分页参数
|
||||
// pageNum: paginationParams.pageNum,
|
||||
// pageSize: paginationParams.pageSize,
|
||||
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 新查询试题
|
||||
* @return: {*}
|
||||
* @param {*} queryType
|
||||
* 0 - 标准查询
|
||||
* 1 - 按条件查询
|
||||
* 2 - 按关键词查询
|
||||
*/
|
||||
const handleQueryFromEntpCourseWork= (queryType) => {
|
||||
//queryForm.pageNum = this.paginationParams.pageNum;
|
||||
//queryForm.pageSize = this.paginationParams.pageSize;
|
||||
|
||||
// 初中政治特殊处理( warn: 需确认是否修改 )
|
||||
// if (this.courseObj.edusubject=='政治' && this.courseObj.edustage=='初中') {
|
||||
// // [初中+政治]需改为[初中+道德与法治]
|
||||
// queryForm.edusubject = '道德与法治';
|
||||
// }
|
||||
|
||||
|
||||
console.log(queryForm)
|
||||
listEntpcourseworkNew(queryForm).then(entpcourseworkres => {
|
||||
// if (queryType == 1 && this.entpCourseWorkQueryParams.worktype == '主观题') {
|
||||
// // 因菁优网题型因学科而不固定, 故非常规题重定义定为【主观题】
|
||||
// const allowedWorkTypes = ['单选题', '填空题', '多选题', '判断题', '复合题'];
|
||||
// workResource.entpCourseWorkList = entpcourseworkres.rows.filter(item => {
|
||||
// return !allowedWorkTypes.includes(item.worktype);
|
||||
// });
|
||||
// } else {
|
||||
// workResource.entpCourseWorkList = entpcourseworkres.rows;
|
||||
// }
|
||||
if(entpcourseworkres.data == null) {
|
||||
workResource.entpCourseWorkList = [];
|
||||
entpCourseWorkTotal.value = 0
|
||||
return;
|
||||
}
|
||||
entpCourseWorkList.value = entpcourseworkres.data;
|
||||
workResource.entpCourseWorkList.forEach(item=> {
|
||||
if (item.worktype == '选择题') {
|
||||
item.worktype = '单选题'
|
||||
}
|
||||
})
|
||||
// 同步数量
|
||||
entpCourseWorkTotal.value = 0;
|
||||
if (entpcourseworkres.data.length > 0) {
|
||||
entpCourseWorkTotal.value = entpcourseworkres.data.length;
|
||||
}
|
||||
|
||||
if()
|
||||
|
||||
//格式化试题信息
|
||||
processList(workResource.entpCourseWorkList);
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQueryFromEntpCourseWork(0);
|
||||
})
|
||||
|
||||
|
||||
// watch(() => sourceStore.query.fileSource,() => {
|
||||
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-typeview{
|
||||
padding-top: 10px;
|
||||
height: 100%;
|
||||
|
||||
.el-form-work-list{
|
||||
:deep(.el-form-item__content){
|
||||
align-items: normal;
|
||||
}
|
||||
|
||||
.work-left{
|
||||
height: 50vh;
|
||||
background-color: white;
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
border:1px dotted blue;
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -1,164 +0,0 @@
|
|||
<template>
|
||||
<div class="page-resource flex">
|
||||
<el-menu
|
||||
default-active="1"
|
||||
class="el-menu-vertical-demo"
|
||||
:collapse="isCollapse"
|
||||
>
|
||||
<!--左侧 教材 目录-->
|
||||
<div v-if="!isCollapse">
|
||||
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||
</div>
|
||||
</el-menu>
|
||||
|
||||
<div class="page-right" :style="{'margin-left': isCollapse ? '0' : '20px'}">
|
||||
<!-- 标题 -->
|
||||
<el-row style="align-items: center; margin-bottom: 0px">
|
||||
<el-col :span="12" style="padding-left: 20px; text-align: left;">
|
||||
<div class="unit-top-left" @click="isCollapse = !isCollapse">
|
||||
<i v-if="!isCollapse" class="iconfont icon-xiangzuo"></i>
|
||||
<span>作业范围</span>
|
||||
<i v-if="isCollapse" class="iconfont icon-xiangyou"></i>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="classtype-right">
|
||||
<el-form-item label="作业名称">
|
||||
<el-input v-model="classWorkForm.uniquekey" type="text" placeholder="请输入作业名称"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 作业类型:内容 -->
|
||||
<task-type-view :bookobj="courseObj" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, toRaw,watch, reactive } from 'vue'
|
||||
// import useResoureStore from './store'
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import Third from '@/components/choose-textbook/third.vue'
|
||||
// import ResoureSearch from './container/resoure-search.vue'
|
||||
// import ResoureList from './container/resoure-list.vue'
|
||||
// import ThirdList from './container/third-list.vue'
|
||||
import TaskTypeView from '@/views/classTask/container/newTask/taskTypeView.vue'
|
||||
import uploadDialog from '@/components/upload-dialog/index.vue'
|
||||
// import { createWindow } from '@/utils/tool'
|
||||
import { useToolState } from '@/store/modules/tool'
|
||||
import { getCurrentTime } from '@/utils/date'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
|
||||
// const sourceStore = useResoureStore()
|
||||
const isDialogOpen = ref(false)
|
||||
const toolStore = useToolState()
|
||||
const openDialog = () => {
|
||||
isDialogOpen.value = true
|
||||
}
|
||||
// ---------------------------------------------------
|
||||
const classWorkForm = reactive({
|
||||
// uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(this.taskList.length+1),
|
||||
uniquekey: userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1),
|
||||
|
||||
})
|
||||
const isCollapse = ref(false)
|
||||
|
||||
|
||||
const courseObj = reactive({
|
||||
// 课程相关参数: 教材id,单元id,章节id,课程名称
|
||||
textbookId: '',
|
||||
levelFirstId: '',
|
||||
levelSecondId: '',
|
||||
coursetitle:'',
|
||||
//
|
||||
})
|
||||
|
||||
// ---------------------------------------------------
|
||||
|
||||
|
||||
// 查询
|
||||
const getData = (data) => {
|
||||
const { textBook, node } = data
|
||||
let textbookId = textBook.curBookId
|
||||
let levelSecondId = node.id
|
||||
let levelFirstId
|
||||
if (node.parentNode) {
|
||||
levelFirstId = node.parentNode.id
|
||||
} else {
|
||||
levelFirstId = node.id
|
||||
levelSecondId = ''
|
||||
}
|
||||
|
||||
courseObj.textbookId = textbookId // 版本
|
||||
courseObj.levelFirstId = levelFirstId // 单元
|
||||
courseObj.levelSecondId = levelSecondId // 章节
|
||||
courseObj.coursetitle = node.itemtitle // (单元/章节) 名称
|
||||
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
// sourceStore.getCreate()
|
||||
})
|
||||
|
||||
const init = () => {
|
||||
classWorkForm.uniquekey = userStore.edusubject+'-' + getCurrentTime('MMDD')+'-'+(1);
|
||||
|
||||
}
|
||||
|
||||
// watch(() => sourceStore.query.fileSource,() => {
|
||||
// sourceStore.query.fileSource === '第三方'?isThird.value = true:isThird.value = false
|
||||
// })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-resource {
|
||||
padding-top: 10px;
|
||||
height: 100%;
|
||||
|
||||
.el-menu--collapse {
|
||||
width: 0px;
|
||||
min-height: 100%;
|
||||
}
|
||||
.el-menu-vertical-demo:not(.el-menu--collapse) {
|
||||
width: 300px;
|
||||
min-height: 100%;
|
||||
}
|
||||
.unit-top-left {
|
||||
cursor: pointer;
|
||||
|
||||
.icon-xiangzuo {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.classtype-right{
|
||||
padding: 5px;
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
.el-form-item--default{
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.page-right {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
margin-left: 20px;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
||||
}
|
||||
.icon-jiahao {
|
||||
font-size: 12px;
|
||||
margin-right: 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,242 +0,0 @@
|
|||
<template>
|
||||
<div v-loading="isLoading" class="page-resource flex">
|
||||
<!--左侧 教材 目录-->
|
||||
<ChooseTextbook @change-book="getData" @node-click="getData" />
|
||||
<!--右侧 作业设计/布置 列表 -->
|
||||
<div class="page-right">
|
||||
<div class="prepare-body-header">
|
||||
<el-button @click="handleOutLink('design')">作业设计</el-button>
|
||||
<el-button @click="handleOutLink('assign')">作业布置</el-button>
|
||||
<label style="font-size: 15px; margin-left: 20px">共{{ listClassWork.length }}个作业</label>
|
||||
<el-select
|
||||
v-model="queryParams.workType"
|
||||
placeholder="作业类型"
|
||||
size="small"
|
||||
@change="queryClassWorkByParams"
|
||||
style="width: 100px; margin-left: auto;"
|
||||
>
|
||||
<template v-for="(item, index) in listWorkType" :key="index">
|
||||
<el-option :label="item.label" :value="item" />
|
||||
</template>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="prepare-work-wrap">
|
||||
<FileListItem
|
||||
v-for="(item, index) in desingDataList"
|
||||
:key="index"
|
||||
:item="item"
|
||||
:index="index"
|
||||
@on-set="openSet"
|
||||
@on-delhomework="delhomework"
|
||||
>
|
||||
</FileListItem>
|
||||
</div>
|
||||
</div>
|
||||
<SetHomework v-model="setAssingDialog" :entpcourseid="entpcourseid" :row="curClassWork" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted, reactive, watch, nextTick, getCurrentInstance, computed} from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { homeworklist, delClasswork } from '@/api/teaching/classwork'
|
||||
import useResoureStore from '@/views/resource/store'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from "@/store/modules/classTask";
|
||||
import outLink from '@/utils/linkConfig'
|
||||
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
import FileListItem from '@/views/prepare/container/file-list-item.vue'
|
||||
import SetHomework from '@/components/set-homework/index.vue'
|
||||
|
||||
|
||||
const { ipcRenderer } = require('electron')
|
||||
const userStore = useUserStore().user
|
||||
const classTaskStore = useClassTaskStore()
|
||||
const {proxy} = getCurrentInstance();
|
||||
const sourceStore = useResoureStore();
|
||||
// 当前选中的章节或单元
|
||||
const curNode = ref({});
|
||||
const isLoading = ref(false);
|
||||
const listClassWork = ref([]);
|
||||
const listWorkType = ref(['不限', '习题训练', '框架梳理', '课堂展示', '常规作业']);
|
||||
const isOpenHomework = ref(false);
|
||||
const curClassWork = ref({});
|
||||
const setAssingDialog = ref(false);
|
||||
const entpcourseid = ref(0);
|
||||
|
||||
const queryParams = reactive({
|
||||
workType: '不限',
|
||||
total: 0,
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 更新作业任务
|
||||
* @return: {*}
|
||||
* @param {*} computed
|
||||
*/
|
||||
const desingDataList = computed(() => {
|
||||
return listClassWork.value;
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 选中单元章节后的回调, 获取单元章节信息
|
||||
* @return: {*}
|
||||
* @param {*} data
|
||||
*/
|
||||
const getData = async (data) => {
|
||||
if (curNode.value.id == data.node.id) {
|
||||
return;
|
||||
}
|
||||
// 1. 情况原作业集合并切换章节
|
||||
curNode.value = data.node;
|
||||
listClassWork.value = [];
|
||||
isLoading.value = true;
|
||||
console.log(curNode.value);
|
||||
|
||||
// 2. 作业设计模板
|
||||
await getClassWorkList();
|
||||
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 根据作业类型查询作业模板
|
||||
* @return: {*}
|
||||
*/
|
||||
const queryClassWorkByParams = async () => {
|
||||
// 1.先清空原作业集合
|
||||
listClassWork.value = [];
|
||||
isLoading.value = true;
|
||||
|
||||
// 2.根据[作业类型]查询
|
||||
const params = {
|
||||
worktype: queryParams.workType, // 此处多了[作业类型]参数
|
||||
}
|
||||
if (queryParams.workType == '不限') {
|
||||
delete params.worktype;
|
||||
}
|
||||
await getClassWorkList(params);
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 获取作业设计模板
|
||||
* @return: {*}
|
||||
*/
|
||||
const getClassWorkList = async(params) => {
|
||||
// 班级作业数据,包含多个班级 homeworklist
|
||||
let query = {
|
||||
evalid: curNode.value.id,
|
||||
edituserid: userStore.userId,
|
||||
edustage: userStore.edustage,
|
||||
edusubject: userStore.edusubject,
|
||||
status: '10',
|
||||
orderby: 'concat(worktype,uniquekey) DESC',
|
||||
pageSize: 100,
|
||||
}
|
||||
// 将形参更新至query
|
||||
if (params !== null && params !== undefined) {
|
||||
query = {...query, ...params};
|
||||
}
|
||||
const res = await homeworklist(query);
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
for (const item of res.rows) {
|
||||
item.fileShowName = item.uniquekey;
|
||||
}
|
||||
listClassWork.value = res.rows;
|
||||
//TODO: 这里没分页,貌似这个 total 不重要,后续看
|
||||
queryParams.total = res.total
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 作业设计/布置
|
||||
* @return: {*}
|
||||
* @param {*} key design-设计 assign-布置. 当key为设计时, url需再增加openDialog字段以便自动打开[设计新作业]
|
||||
*/
|
||||
const handleOutLink = (key) => {
|
||||
isOpenHomework.value = true;
|
||||
// key 对应的 linkConfig.js 外部链接配置
|
||||
let configObj = outLink()['homeWork']
|
||||
let fullPath = configObj.fullPath;
|
||||
|
||||
//打开作业url增加unitId 章节ID
|
||||
let unitId = curNode.value.id;
|
||||
fullPath += `&unitId=${unitId}`;
|
||||
|
||||
// 作业设计时, 再增加参数openDialog以自动打开教师端的[设计新作业]
|
||||
if (key == 'design') {
|
||||
fullPath += `&openDialog=newClassTask`;
|
||||
}
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
key,
|
||||
fullPath: fullPath,
|
||||
cookieData: { ...configObj.data }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const openSet = (item) => {
|
||||
// 打开布置作业窗口
|
||||
curClassWork.value = item;
|
||||
setAssingDialog.value = true;
|
||||
}
|
||||
|
||||
const delhomework = (item) => {
|
||||
isLoading.value = true
|
||||
delClasswork(item.id)
|
||||
.then(async(res) => {
|
||||
ElMessage.success('删除成功');
|
||||
isLoading.value = false;
|
||||
await getClassWorkList();
|
||||
})
|
||||
.catch(() => {
|
||||
isLoading.value = false;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-resource {
|
||||
padding-top: 10px;
|
||||
height: 100%;
|
||||
|
||||
//右侧栏
|
||||
.page-right {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
margin-left: 20px;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
|
||||
|
||||
.prepare-body-header {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.prepare-work-wrap{
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -45,8 +45,6 @@ import { useRouter } from 'vue-router'
|
|||
import workTrend from './container/work-trend.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import * as echarts from 'echarts'
|
||||
import { useGetClassWork } from '@/hooks/useGetClassWork'
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
@ -55,7 +53,7 @@ const chartDom = ref(null);
|
|||
let chartInstance = null
|
||||
|
||||
const menuList = [{
|
||||
name: '课程教学',
|
||||
name: '教学分析',
|
||||
span: 24,
|
||||
id: 1,
|
||||
list: [
|
||||
|
@ -81,13 +79,13 @@ const menuList = [{
|
|||
icon: 'icon-xueqingfenxi',
|
||||
disabled: true
|
||||
},
|
||||
// {
|
||||
// name: '教学设计',
|
||||
// icon: 'icon-jiaoxuesheji',
|
||||
// path: '/prepare'
|
||||
// },
|
||||
{
|
||||
name: '教学实践',
|
||||
name: '教学设计',
|
||||
icon: 'icon-jiaoxuesheji',
|
||||
path: '/prepare'
|
||||
},
|
||||
{
|
||||
name: '教学实施',
|
||||
icon: 'icon-jiaoxuefenxi',
|
||||
path: '/prepare'
|
||||
},
|
||||
|
@ -107,11 +105,7 @@ const menuList = [{
|
|||
name: '作业设计',
|
||||
icon: 'icon-jiaoxuefansi',
|
||||
isOuter: true,
|
||||
path: '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask'
|
||||
//path: '/newClassTask'
|
||||
//path: '/classTaskAssign'
|
||||
//isOuter: true,
|
||||
//path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||
path: '/teaching/classtaskassign?titleName=作业布置&&openDialog=newClassTask'
|
||||
},
|
||||
{
|
||||
name: '作业布置',
|
||||
|
@ -166,15 +160,6 @@ const clickMenu = ({isOuter, path, disabled}) =>{
|
|||
if(isOuter){
|
||||
let configObj = outLink().getBaseData()
|
||||
let fullPath = configObj.fullPath + path
|
||||
if(path == '/teaching/classtaskassign?titleName=作业布置&openDialog=newClassTask' || path == '/teaching/classtaskassign?titleName=作业布置'){
|
||||
// 头部 教材分析打开外部链接需要当前章节ID
|
||||
const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId'))
|
||||
|
||||
let unitId = levelSecondId ? levelSecondId : levelFirstId
|
||||
fullPath = fullPath + `&unitId=${unitId}`
|
||||
|
||||
console.log(fullPath)
|
||||
}
|
||||
fullPath = fullPath.replaceAll('//', '/')
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
|
@ -233,21 +218,8 @@ onMounted(async ()=>{
|
|||
]
|
||||
}
|
||||
chartInstance.setOption(option);
|
||||
// 初始化 获取教材下面的单元 + 章节
|
||||
getSubjectInit();
|
||||
|
||||
})
|
||||
|
||||
const getSubjectInit = async () => {
|
||||
//查看本地是否有缓存
|
||||
let unitId = localStorage.getItem('unitId')
|
||||
if(unitId){
|
||||
// 有缓存不用管
|
||||
} else{
|
||||
// 没有 就获取 获取教材下面的单元 + 章节
|
||||
useGetClassWork();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ onMounted(() => {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.page-resource {
|
||||
padding-top: 10px;
|
||||
padding-top: 20px;
|
||||
height: 100%;
|
||||
|
||||
//右侧栏
|
||||
|
|
|
@ -19,23 +19,23 @@
|
|||
ref="ruleFormRef"
|
||||
>
|
||||
<el-form-item label="姓名" prop="name" v-if="type==1 && activeIndex==1">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入姓名" />
|
||||
<el-input v-model="ruleForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idNumber" v-if="type==1 && activeIndex==1">
|
||||
<el-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
|
||||
<el-input v-model="ruleForm.idNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phoneNumber" v-if="activeIndex==1">
|
||||
<el-input v-model="ruleForm.phoneNumber" placeholder="请输入手机号" />
|
||||
<el-input v-model="ruleForm.phoneNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码" prop="Code" v-if="activeIndex==1">
|
||||
<el-input style="width:60%" v-model="ruleForm.Code" :disabled="true" placeholder="请输入验证码" />
|
||||
<el-button type="primary" style="margin-left:10px" @click="sendcaptchaImg">发送验证码</el-button>
|
||||
<el-input style="width:60%" v-model="ruleForm.Code" :disabled="true" />
|
||||
<el-button type="primary" style="margin-left:10px" @click="sendcaptchaImg">发送验证码</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="设置密码" prop="password" v-if="activeIndex==1">
|
||||
<el-input v-model="ruleForm.password" type="password" placeholder="6-30位,至少包含数字和字母,允许特殊符号" />
|
||||
<el-input v-model="ruleForm.password" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="confirmPassword" v-if="activeIndex==1">
|
||||
<el-input v-model="ruleForm.confirmPassword" type="password" placeholder="请确认密码" />
|
||||
<el-input v-model="ruleForm.confirmPassword" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属地区" prop="address" v-if="activeIndex==2">
|
||||
<el-cascader
|
||||
|
@ -54,7 +54,7 @@
|
|||
:data="gradeTree"
|
||||
multiple
|
||||
:render-after-expand="false"
|
||||
style="width: 100%;-webkit-app-region: no-drag;"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="学科" prop="discipline" v-if="activeIndex==2">
|
||||
|
@ -235,20 +235,6 @@ const OpenModel = v =>{
|
|||
}
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
var restValue={
|
||||
name: '',
|
||||
idNumber:'',
|
||||
phoneNumber: '',
|
||||
Code:'',
|
||||
password:'',
|
||||
confirmPassword:'',
|
||||
class:[],
|
||||
discipline:[],
|
||||
school:[],
|
||||
}
|
||||
Object.assign(ruleForm, restValue);
|
||||
schoolSubject.value=[]
|
||||
gradeTree.value=[]
|
||||
if (ruleFormRef.value) ruleFormRef.value.resetFields()
|
||||
removeToken();
|
||||
activeIndex.value=1
|
||||
|
@ -351,8 +337,6 @@ const submitForm = async (formEl) => {
|
|||
discipline:[],
|
||||
school:[],
|
||||
}
|
||||
schoolSubject.value=[]
|
||||
gradeTree.value=[]
|
||||
Object.assign(ruleForm, restValue);
|
||||
activeIndex.value=1
|
||||
dialogVisible.value=false
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</el-form-item>
|
||||
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
|
||||
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="RegisterModel(1)">注册账号</a>
|
||||
|
|
||||
<!-- | -->
|
||||
<a class="hover:text-sky-500" style="margin-left: 10px;" @click="RegisterModel(2)">忘记密码</a>
|
||||
</div>
|
||||
</el-form>
|
||||
|
|
|
@ -1,329 +0,0 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" width="75%" :close-on-click-modal="false"
|
||||
@close="handleClose">
|
||||
<template #header><b>准备开始上课</b></template>
|
||||
<div class="class-all">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<c-form v-bind="classForm">
|
||||
<template #item_classid="{prop, form}">
|
||||
<el-select v-model="form[prop]" placeholder="请选择班级">
|
||||
<el-option v-for="item in listData.classList" :value="item.id"
|
||||
:label="`${item.caption} (${item.classstudentcount}人)`" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #item_student>
|
||||
<el-scrollbar max-height="30em">
|
||||
<template v-for="(item, index) in listData.activeStudentList">
|
||||
<el-tag style="margin:0 7px 7px 0;cursor:default;">{{ item.name }}</el-tag>
|
||||
</template>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
</c-form>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<c-form v-bind="teacherForm">
|
||||
<!-- 上课 -->
|
||||
<template #item_classcourseid="{prop,form}">
|
||||
<el-radio-group v-model="form[prop]">
|
||||
<el-radio :value="0">开始新课</el-radio>
|
||||
<template v-for="(item,index) in listData.classcourseList">
|
||||
<template v-if="dt.isCreate&&!index">
|
||||
<el-radio :value="item.id">{{ item.opendate }} <span style="color: silver">({{ item.teachername }})</span></el-radio>
|
||||
</template>
|
||||
<template v-else-if="dt.isHistory&&(dt.isCreate&&index||!dt.isCreate)">
|
||||
<el-radio :value="item.id">{{ item.opendate }} <span style="color: silver">({{ item.teachername }})</span></el-radio>
|
||||
</template>
|
||||
</template>
|
||||
<el-button class="absolute top-1 right-0" size="small" type="primary" round
|
||||
:plain="!dt.isHistory" @click="getClasscourseList('toggle')">历史记录</el-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<!-- 老师扫码 -->
|
||||
<template #item_qrUrl="{value}">
|
||||
<div :title="value" v-if="!!value">
|
||||
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
||||
</div>
|
||||
<el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>
|
||||
</template>
|
||||
<!-- 手机登录 -->
|
||||
<template #item_mobile>
|
||||
<div>
|
||||
<div>开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
||||
<el-button type="warning" :loading="dt.loading" @click="createClasscourse">创建课堂</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 故障备用 -->
|
||||
<template #item_backup>
|
||||
<div>
|
||||
<div>如果手机扫码后进入课堂,但本页面没自动跳转,请点击下面按钮</div>
|
||||
<el-button type="primary" plain @click="classTeachingStart">开始上课</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</c-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- im-chat 聊天组件 -->
|
||||
<im-chat ref="imChatRef" v-if="visible" @change="chatChange" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 功能说明:课程开始
|
||||
import { onMounted, reactive, ref, watchEffect, watch, nextTick } from 'vue' // vue
|
||||
import { ElMessage, ElMessageBox } from 'element-plus' // ui框架: 消息提示
|
||||
import vueQr from 'vue-qr/src/packages/vue-qr.vue' // 插件: 二维码
|
||||
import imChat from '@/views/tool/components/imChat.vue' // im-chat-子组件
|
||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息头-相关定义(nuem)
|
||||
import * as commUtil from '@/utils/comm' // 工具类-通用
|
||||
import { toLinkWeb, getStaticUrl } from '@/utils/tool'
|
||||
|
||||
import * as Http_ClassManage from '@/api/classManage' // api接口
|
||||
import * as Http_Classcourse from '@/api/teaching/classcourse' // api接口
|
||||
import * as Http_Entpcoursefile from '@/api/education/entpcoursefile' // api接口
|
||||
import useUserStore from "@/store/modules/user" // 状态管理:user
|
||||
|
||||
const baseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
const userStore = useUserStore()
|
||||
const visible = ref(false) // 是否打开窗口
|
||||
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
||||
const imChatRef = ref(null) // im-chat ref
|
||||
const classForm = reactive({ // 班级(左侧):表单数据 表单配置
|
||||
form: {}, itemOption: [], option: {}
|
||||
})
|
||||
const teacherForm = reactive({ // 老师(右侧):表单数据 表单配置
|
||||
form: {}, itemOption: []
|
||||
})
|
||||
const listData = reactive({ // 列表数据
|
||||
classList: [], // 班级列表
|
||||
activeStudentList: [], // 学生列表-选择
|
||||
classcourseList: [], // 课程列表-历史记录
|
||||
})
|
||||
const dt = reactive({ // 其他数据
|
||||
isCreate: false, // 是否创建
|
||||
isHistory: false, // 是否显示-历史记录
|
||||
loading: false, // 加载-loading
|
||||
loadingDel: false, // 删除-loading
|
||||
atCourse: {}, // 当前课程
|
||||
})
|
||||
let chat = null // im-chat 对象
|
||||
|
||||
// 加载完,钩子
|
||||
onMounted(() => {
|
||||
initData() // 初始化-数据
|
||||
})
|
||||
/**
|
||||
* @description 暴露方法-打开对话框
|
||||
* @param row 课件对象
|
||||
*/
|
||||
const open = async (id) => {
|
||||
visible.value = true
|
||||
if (id) {
|
||||
// 重置数据
|
||||
reset()
|
||||
// 获取apt详情
|
||||
await getAptInfo(id)
|
||||
// 获取班级列表
|
||||
getClassList()
|
||||
// 初始化im-chat
|
||||
nextTick(async() => {
|
||||
chat = await imChatRef.value?.initImChat()
|
||||
})
|
||||
}
|
||||
}
|
||||
// 关闭弹窗
|
||||
const handleClose = async () => {
|
||||
reset() // 重置数据
|
||||
await chat?.logout()
|
||||
chat = null
|
||||
}
|
||||
// 初始化-数据
|
||||
const initData = () => {
|
||||
// 班级-表单配置
|
||||
classForm.option = { labelW: 40 }
|
||||
classForm.itemOption = [
|
||||
{ label: '班级', prop: 'classid' },
|
||||
{ label: '学生', prop: 'student' },
|
||||
]
|
||||
// 老师-表单提交
|
||||
teacherForm.form = { classcourseid: 0 }
|
||||
teacherForm.itemOption = [
|
||||
{ label: '上课', prop: 'classcourseid' },
|
||||
{ label: '老师扫码', prop: 'qrUrl', show: false },
|
||||
{ label: '手机登录', prop: 'mobile', show: false },
|
||||
{ label: '故障备用', prop: 'backup', show: false },
|
||||
]
|
||||
}
|
||||
// 重置数据
|
||||
const reset = () => {
|
||||
// 初始化-表单数据
|
||||
classForm.form = {}
|
||||
teacherForm.form = { classcourseid: 0 }
|
||||
dt.isCreate = false
|
||||
dt.isHistory = false
|
||||
dt.atCourse = {}
|
||||
}
|
||||
// 获取课件APT
|
||||
const getAptInfo = async (id) => {
|
||||
const res = await Http_Entpcoursefile.getEntpcoursefile(id)
|
||||
if (res.code == 200) {
|
||||
myClassActive.value = res.data
|
||||
}
|
||||
}
|
||||
// 获取当前账号-班级
|
||||
const getClassList = async () => {
|
||||
const res = await Http_ClassManage.listClassmain({
|
||||
classuserid: userStore.id, pageSize: 100, status: 'open'
|
||||
})
|
||||
if (res.code == 200) {
|
||||
listData.classList = (res.rows || []).map(o => {
|
||||
if(!!o.classstudentlist) { // 学生列表转为数组
|
||||
o.classstudentlist = JSON.parse('[' + o.classstudentlist + ']')
|
||||
}
|
||||
return o
|
||||
});
|
||||
// 默认选中第一项
|
||||
if (listData.classList.length > 0) {
|
||||
classForm.form.classid = listData.classList[0].id
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 获取开课列表 - 历史记录
|
||||
const getClasscourseList = async type => {
|
||||
if (type == 'toggle') { // 切换是否显示数据
|
||||
dt.isHistory = !dt.isHistory
|
||||
if (!dt.isHistory || listData.classcourseList.length) return // 不显示或者有数据时-不再请求
|
||||
}
|
||||
const {classid} = classForm.form
|
||||
const {entpcourseid} = myClassActive.value
|
||||
if (!classid || !entpcourseid) return
|
||||
const params = {classid, entpcourseid, entpcoursefileid: 0}
|
||||
const res = await Http_Classcourse.listClasscourse(params)
|
||||
if (res.code == 200) {
|
||||
// zdg: 排序id大的在前(最新的)
|
||||
const list = (res.rows || []).sort((a, b) => b.id - a.id)
|
||||
listData.classcourseList = list
|
||||
// 默认选中第一个
|
||||
if (type == 'update' && list.length) {
|
||||
dt.isCreate = true // 显示-新创建记录
|
||||
teacherForm.form.classcourseid = list[0].id
|
||||
}
|
||||
}
|
||||
}
|
||||
// 创建课程
|
||||
const createClasscourse = async () => {
|
||||
dt.loading = true
|
||||
const { classid } = classForm.form
|
||||
const { entpcourseid, evalid, id, coursetitle } = myClassActive.value // 课件对象
|
||||
const curDate = commUtil.getDateNow('yyyy-MM-dd')
|
||||
const params = {
|
||||
id: 0, coursetype: '', courseverid: 0, coursedesc: '', status: '',
|
||||
teacherid: userStore.id, entpcoursefileid: id, classid,
|
||||
entpcourseid, evalid, coursetitle,
|
||||
plandate: curDate, opendate: curDate
|
||||
}
|
||||
await Http_Classcourse.addClasscourseReturnId(params)
|
||||
dt.loading = false
|
||||
getClasscourseList('update') // 更新列表
|
||||
ElMessage.success('创建课程-成功')
|
||||
|
||||
}
|
||||
// 删除课程
|
||||
const removeClasscourse = async () => {
|
||||
const { classcourseid:id } = teacherForm.form
|
||||
const ind = listData.classcourseList.findIndex(o => o.id == id)
|
||||
if(ind < 0) return ElMessage.warning('删除课堂记录-失败')
|
||||
await ElMessageBox.confirm('请确认是否删除课堂记录?')
|
||||
dt.loadingDel = true
|
||||
const res = await Http_Classcourse.delClasscourse(id)
|
||||
dt.loadingDel = false
|
||||
if (res.code == 200) {
|
||||
const list = listData.classcourseList
|
||||
list.splice(ind, 1) // 删除-id的课堂记录
|
||||
// 重新赋值选中的课堂记录,默认是下一条记录
|
||||
if (list.length==0) teacherForm.classcourseid = 0
|
||||
else {
|
||||
const newInd = ind < list.length ? ind : ind-1
|
||||
teacherForm.form.classcourseid = list[newInd].id
|
||||
}
|
||||
ElMessage.success('删除成功')
|
||||
}
|
||||
}
|
||||
// 开始上课
|
||||
const classTeachingStart = async () => {
|
||||
const { classcourseid:id } = teacherForm.form
|
||||
if (id) { // 开始上课
|
||||
const url = `/teaching/classteaching?classcourseid=${id}&actor=classTeachingOnPublicScreen`
|
||||
toLinkWeb(url) // 跳转web-公屏
|
||||
visible.value = false // 关闭弹窗
|
||||
handleClose() // 关闭im-chat
|
||||
}
|
||||
}
|
||||
// 获取二维码地址
|
||||
const getQrUrl = () => {
|
||||
const { classcourseid:id } = teacherForm.form
|
||||
const { userName } = userStore.user
|
||||
if (!id||!userName) return
|
||||
const qrCodeUrl = `wxlogin?username=${userName}&nextaction=classteaching&id=${id}`
|
||||
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
||||
}
|
||||
|
||||
// ================== 监听 =======================
|
||||
// im-chat: 聊天事件 {type, data}
|
||||
const chatChange = (type, data, ...args) => {
|
||||
if (type == 'msg') { // im-chat 消息监听
|
||||
console.log('msg:===== ',data, args)
|
||||
// const msgId = (args||[])[0].message_msg_id
|
||||
const { msgKey:head, msgcontent:msg, senduserid:sendId, msgType } = data
|
||||
switch(head) {
|
||||
case MsgEnum.HEADS.MSG_classcourseopen:{ // 开课, 跳转公屏
|
||||
const { classcourseid:id } = teacherForm.form
|
||||
const { classcourseid: imId, status } = data
|
||||
if (imId == id && status == 'open') {
|
||||
classTeachingStart() // 开始跳转
|
||||
}
|
||||
break}
|
||||
default:
|
||||
console.log('未知消息:', data)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 监听-班级id
|
||||
watch(() => classForm.form.classid, (val)=> {
|
||||
// 获取选中课程
|
||||
dt.atCourse = listData.classList.find(o => o.id === val) || {}
|
||||
// 获取选中课程-学生列表
|
||||
listData.activeStudentList = dt.atCourse?.classstudentlist || []
|
||||
// 清空课程列表
|
||||
listData.classcourseList = []
|
||||
// 如果当前显示历史, 就从新获取
|
||||
if (dt.isHistory) getClasscourseList()
|
||||
})
|
||||
// 监听-课程id
|
||||
watch(() => teacherForm.form.classcourseid, (val) => {
|
||||
const bool = !!val
|
||||
// 获取选中课程-生成二维码地址
|
||||
bool && getQrUrl()
|
||||
// 监听课程id,是否显示功能
|
||||
teacherForm.itemOption.forEach(o => {
|
||||
// 有课程id,触发
|
||||
if (['qrUrl','backup'].includes(o.prop)) o.show = bool
|
||||
// 课程id为空,触发
|
||||
if (['mobile'].includes(o.prop)) o.show = !bool
|
||||
})
|
||||
})
|
||||
// 暴露方法
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.class-all{
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="file-oper-batch-wrap">
|
||||
<div style="line-height: 40px">
|
||||
<div style="margin: 0 20px; line-height: 40px">
|
||||
<el-checkbox
|
||||
v-model="isCheckAll"
|
||||
:indeterminate="indeterminate"
|
||||
|
@ -15,7 +15,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import { deleteSmarttalkBatch } from '@/api/file'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { exportFile } from '@/utils/talkFile'
|
||||
export default {
|
||||
name: 'FileOperBatch',
|
||||
|
|
|
@ -52,8 +52,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="prepare-body-main-item-btn">
|
||||
<el-button v-if="activeClassId==item.id" type="success" @click="clickStartClass(item)">上课中</el-button>
|
||||
<el-button v-else type="primary" @click="clickStartClass(item)">上课</el-button>
|
||||
<el-button type="primary" @click="clickStartClass(item)">上课</el-button>
|
||||
</div>
|
||||
<div class="prepare-body-main-item-tool">
|
||||
<el-popover
|
||||
|
@ -66,20 +65,18 @@
|
|||
<template #default>
|
||||
<div style="width: 100%">
|
||||
<div class="item-popover" @click="closePopver(index)">
|
||||
<template v-if="userInfo.userId === Number(item.createUserId)">
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="editTalk(item, index)">
|
||||
<i class="iconfont icon-bianji"></i>
|
||||
<span>标签</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="deleteTalk(item)" :disabled="activeClassId==item.id">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div v-if="userInfo.userId === Number(item.createUserId)" class="item-popover-item">
|
||||
<el-button text @click="editTalk(item, index)">
|
||||
<i class="iconfont icon-bianji"></i>
|
||||
<span>标签</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="userInfo.userId === Number(item.createUserId)" class="item-popover-item">
|
||||
<el-button text @click="deleteTalk(item)">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -101,7 +98,6 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
export default {
|
||||
|
@ -119,10 +115,6 @@ export default {
|
|||
default: function () {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
activeClassId: { // 当前上课id
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
emits: { 'on-start-class': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null },
|
||||
|
|
|
@ -172,23 +172,16 @@ const disabledHours = ()=>{
|
|||
}
|
||||
// 限制分-返回被禁选的
|
||||
const disabledMinute = (hour,role) => {
|
||||
if(form.time == null) return
|
||||
if(getCurrentTime('YYYY-MM-DD') == form.day){
|
||||
const arrs = []
|
||||
if(role == 'start'){
|
||||
let nowHour = new Date().getHours().toString().padStart(2, '0');
|
||||
if(nowHour < hour){
|
||||
return []
|
||||
}
|
||||
else{
|
||||
for (let i = 0; i < 60; i++) {
|
||||
if (new Date().getMinutes() <= i) continue;
|
||||
arrs.push(i)
|
||||
}
|
||||
return arrs;
|
||||
for (let i = 0; i < 60; i++) {
|
||||
if (new Date().getMinutes() <= i) continue;
|
||||
arrs.push(i)
|
||||
}
|
||||
return arrs;
|
||||
}
|
||||
if(role == 'end'){
|
||||
else{
|
||||
if(form.time[0]) return []
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
:key="index"
|
||||
:item="item"
|
||||
:index="index"
|
||||
:activeClassId="activeClass?.id"
|
||||
@on-delete="deleteTalk"
|
||||
@on-start-class="startClass"
|
||||
>
|
||||
|
@ -69,7 +68,7 @@
|
|||
<el-tab-pane label="素材" name="素材">
|
||||
<div class="prepare-body-header">
|
||||
<div>
|
||||
<label style="font-size: 15px">共{{ currentFileList.filter(ite=>ite.fileFlag!=='apt'&&ite.fileFlag!=='课件').length }}个文件</label>
|
||||
<label style="font-size: 15px">共{{ currentFileList.length }}个文件</label>
|
||||
<el-popover placement="top-start" :width="250" trigger="hover">
|
||||
<template #default>
|
||||
<div>
|
||||
|
@ -141,7 +140,7 @@
|
|||
</div>
|
||||
<file-oper-batch
|
||||
v-show="checkFileList.length > 0"
|
||||
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentSCFileList.length"
|
||||
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length"
|
||||
:choose="checkFileList"
|
||||
:check-all="isCheckAll"
|
||||
@click-delete="clickDelete"
|
||||
|
@ -160,8 +159,6 @@
|
|||
:book-id="uploadData.textbookId"
|
||||
@add-success="initReserv"
|
||||
></reserv>
|
||||
<!-- 上课配置 -->
|
||||
<class-start ref="calssRef"/>
|
||||
</template>
|
||||
<script setup>
|
||||
import { Check,Plus } from '@element-plus/icons-vue'
|
||||
|
@ -193,7 +190,6 @@ import { getClassInfo, getSelfReserv } from '@/api/classManage'
|
|||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile'
|
||||
import ClassReserv from '@/views/classManage/classReserv.vue'
|
||||
import classStart from './container/class-start.vue' // 预备上课
|
||||
const toolStore = useToolState()
|
||||
|
||||
const fs = require('fs')
|
||||
|
@ -210,8 +206,7 @@ export default {
|
|||
FileOperBatch,
|
||||
MoveFile,
|
||||
SetHomework,
|
||||
ClassReserv,
|
||||
classStart
|
||||
ClassReserv
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -247,15 +242,13 @@ export default {
|
|||
// 布置作业弹窗
|
||||
setDialog: false,
|
||||
row: '',
|
||||
isOpenHomework: false,
|
||||
// 当前上课课程
|
||||
activeClass: null,
|
||||
isOpenHomework: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isCheckAll() {
|
||||
return (
|
||||
this.checkFileList.length > 0 && this.checkFileList.length === this.currentSCFileList.length
|
||||
this.checkFileList.length > 0 && this.checkFileList.length === this.currentFileList.length
|
||||
)
|
||||
},
|
||||
currentKJFileList() {
|
||||
|
@ -275,9 +268,6 @@ export default {
|
|||
})
|
||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||
// this.initReserv()
|
||||
|
||||
// zdg: 获取缓存中的当前课程
|
||||
this.activeClass = sessionStore.get('activeClass') || null
|
||||
},
|
||||
mounted() {
|
||||
this.$watch(
|
||||
|
@ -304,20 +294,13 @@ export default {
|
|||
// },
|
||||
methods: {
|
||||
startClass(item) {
|
||||
// console.log(item, sessionStore)
|
||||
console.log(item)
|
||||
if(item.fileFlag === '课件') {
|
||||
// 关闭状态,打开上课相关功能(已打开,忽略)
|
||||
const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
|
||||
if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
|
||||
this.openReserv()
|
||||
}
|
||||
if(item.fileFlag === 'apt') {
|
||||
//TODO 打开apt - fileId: aptId
|
||||
this.$refs.calssRef.open(item.fileId)
|
||||
//TODO 打开apt
|
||||
}
|
||||
// 当前上课-store
|
||||
sessionStore.set('activeClass', item)
|
||||
this.activeClass = item
|
||||
},
|
||||
initReserv(id) {
|
||||
getClassInfo(id).then((res) => {
|
||||
|
|
|
@ -91,8 +91,6 @@ const subjectList = ref([])
|
|||
|
||||
// 获取基础的学科
|
||||
const getSubject = () => {
|
||||
//没有学科则不进行下面的步骤
|
||||
if(!userStore.user.subject) return
|
||||
listEvaluation({ itemkey: 'subject', pageSize: 500 }).then((res) => {
|
||||
const arr = userStore.user.subject.split(',')
|
||||
subjectList.value = res.rows.filter(item => arr.includes(String(item.id))).map(items => items)
|
||||
|
|
|
@ -8,7 +8,7 @@ import { ipcMsgSend, ipcHandle, ipcMain, ipcMsgInvoke } from '@/utils/tool' //
|
|||
const userStore = useUserStore()
|
||||
const emits = defineEmits(['change'])
|
||||
const props = defineProps({
|
||||
group: { type: Boolean, default: false }, // 是否创建群
|
||||
isGroup: { type: Boolean, default: false }, // 是否创建群
|
||||
})
|
||||
const imChatObj = reactive({imChat:null})
|
||||
onMounted(() => {
|
||||
|
@ -16,7 +16,7 @@ onMounted(() => {
|
|||
})
|
||||
// 初始化 im-chat
|
||||
const initImChat = async (timGroupId) => {
|
||||
// console.log('im-chat', userStore.user.timuserid, props)
|
||||
// console.log('im-chat', userStore.user.timuserid)
|
||||
try {
|
||||
const { timuserid, deptId, userId } = userStore.user
|
||||
// 获取腾讯云签名
|
||||
|
@ -26,6 +26,7 @@ const initImChat = async (timGroupId) => {
|
|||
// 群名称
|
||||
const groupName = `${deptId}-classteaching-${userId}`
|
||||
// 注册im-chat
|
||||
// await ipcMsgInvoke('im-chat:init', sdkAppId)
|
||||
imChatObj.imChat = new ImChat(sdkAppId, sign, timuserid)
|
||||
// 初始化 im-chat
|
||||
await imChatObj.imChat.init()
|
||||
|
@ -36,12 +37,11 @@ const initImChat = async (timGroupId) => {
|
|||
})
|
||||
// 登录 im-chat(为了不漏消息,需要在登录之前-监听)
|
||||
await imChatObj.imChat.login()
|
||||
// console.log('im-chat-login-success', userStore.user)
|
||||
// 创建群
|
||||
if (timGroupId) { // 已有群-设置群id
|
||||
if (!timGroupId||props.isGroup) { // 创建群
|
||||
await createGroup(groupName)
|
||||
} else { // 已有群-设置群id
|
||||
imChatObj.imChat.timGroupId = timGroupId
|
||||
} else {
|
||||
if (props.group) await createGroup(groupName) // 创建群
|
||||
}
|
||||
return imChatObj.imChat
|
||||
}
|
||||
|
|
|
@ -57,8 +57,6 @@ class Drag {
|
|||
document.removeEventListener('mouseup', this.up);
|
||||
document.addEventListener('touchmove', this.move);
|
||||
document.addEventListener('touchend', this.up);
|
||||
// 手动-触发事件 v-drag-start
|
||||
this.el.dispatchEvent(new CustomEvent('v-drag-end', {detail:{drag: this}}))
|
||||
}
|
||||
// 业务逻辑
|
||||
updatePosition(e) {
|
||||
|
@ -110,7 +108,6 @@ export default {
|
|||
// const { style } = binding.value
|
||||
const drag = new Drag(el, binding)
|
||||
const dragStart = (e) => {
|
||||
// console.log('start', e)
|
||||
drag.down(e)
|
||||
document.addEventListener('mousemove', drag.move);
|
||||
document.addEventListener('mouseup', drag.up);
|
||||
|
|
|
@ -10,14 +10,12 @@
|
|||
<upvote-vue ref="upvoteRef" type="2"></upvote-vue>
|
||||
|
||||
<!-- im-chat 聊天组件 -->
|
||||
<im-chat ref="imChatRef" @change="chatChange" group />
|
||||
<im-chat ref="imChatRef" @change="chatChange" />
|
||||
|
||||
<!-- 底部工具栏 -->
|
||||
<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}"
|
||||
@v-drag-start="dragtime = Date.now()"
|
||||
@v-drag-end="mouseChange(1)">
|
||||
@v-drag-start="dragtime = Date.now()">
|
||||
<div class="c-logo" @click="logoHandle" title="拖动 | 折叠 | 展开">
|
||||
<el-image :src="logo" draggable="false" />
|
||||
</div>
|
||||
|
@ -108,7 +106,7 @@ const getClassInfo = async () => {
|
|||
const tabChange = (val) => {
|
||||
const bool = !toolStore.isPdfWin && !toolStore.showBoardAll
|
||||
if(bool) toolStore.showBoardAll = true
|
||||
// console.log('tabChange:', val, bool)
|
||||
console.log('tabChange:', val, bool)
|
||||
toolStore.model = val // 存储当前tab
|
||||
}
|
||||
// logo 点击-事件 折叠|展开
|
||||
|
@ -145,12 +143,9 @@ const mouseChange = (bool) => {
|
|||
const isPdf = !resBool && toolStore.isPdfWin
|
||||
if (isPdf) resBool = true
|
||||
}
|
||||
console.log('mouseChange:', bool, resBool)
|
||||
// console.log('mouseChange:', bool, resBool)
|
||||
setIgnore(resBool)
|
||||
}
|
||||
const touchChange = (e) => {
|
||||
console.log(e)
|
||||
}
|
||||
// im-chat: 聊天事件 {type, data}
|
||||
const chatChange = (type, data, ...args) => {
|
||||
if (type == 'createGroup') { // 创建群-监听
|
||||
|
|
Loading…
Reference in New Issue