Compare commits
No commits in common. "aec8e9a21f29d100a26e48a94659565c77c97ec3" and "f3619817f9fc3e6230746bc97092b13651538536" have entirely different histories.
aec8e9a21f
...
f3619817f9
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win",
|
||||||
"version": "1.1.1",
|
"version": "1.1.0",
|
||||||
"description": "An Electron application with Vue",
|
"description": "An Electron application with Vue",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "example.com",
|
"author": "example.com",
|
||||||
|
|
|
@ -61,12 +61,10 @@ function createLoginWindow() {
|
||||||
function createMainWindow() {
|
function createMainWindow() {
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1200,
|
width: 1200,
|
||||||
minWidth: 1200,
|
|
||||||
height: 700,
|
height: 700,
|
||||||
show: false,
|
show: false,
|
||||||
frame: false, // 无边框
|
frame: false, // 无边框
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
maximizable: false,
|
|
||||||
icon: join(__dirname, '../../resources/logo2.ico'),
|
icon: join(__dirname, '../../resources/logo2.ico'),
|
||||||
...(process.platform === 'linux' ? { icon } : {}),
|
...(process.platform === 'linux' ? { icon } : {}),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
|
|
@ -50,9 +50,3 @@ export function updateUserInfo(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getUserInfo(userId) {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/' + userId,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
|
|
||||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
const BaseUrl = 'https://prev.ysaix.com:7868/'
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['nodeClick', 'changeBook'])
|
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||||
// store
|
// store
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="model" append-to-body :show-close="false" width="500"
|
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="500"
|
||||||
top="25vh"
|
top="25vh"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
|
@ -34,14 +34,12 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { listEvaluation } from '@/api/subject'
|
import { listEvaluation } from '@/api/subject'
|
||||||
import { updateUserInfo } from '@/api/system/user'
|
import { updateUserInfo } from '@/api/system/user'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userId, userName } = userStore.user
|
const { userId, userName } = userStore.user
|
||||||
const { ipcRenderer } = window.electron || {}
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
loginData: {
|
loginData: {
|
||||||
|
@ -50,11 +48,17 @@ const props = defineProps({
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const model = defineModel();
|
|
||||||
const subjectLoading = ref(false)
|
const subjectLoading = ref(false)
|
||||||
// 默认学段 前端写死 参照web AIx
|
|
||||||
|
// 定义要发送的emit事件
|
||||||
|
const emit = defineEmits(['update:modelValue', 'onSuccess'])
|
||||||
|
|
||||||
const gradeList = ref([
|
const gradeList = ref([
|
||||||
{
|
{
|
||||||
label: '高中',
|
label: '高中',
|
||||||
|
@ -81,6 +85,7 @@ gradeVal.value = gradeList.value[0].value
|
||||||
//学科列表数据
|
//学科列表数据
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
const allSubject = ref([])
|
const allSubject = ref([])
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
|
||||||
//切换年级
|
//切换年级
|
||||||
const changeGrade = ()=>{
|
const changeGrade = ()=>{
|
||||||
|
@ -93,8 +98,8 @@ const changeGrade = ()=>{
|
||||||
// 默认选中第一个学科
|
// 默认选中第一个学科
|
||||||
subjectVal.value = subjectList.value[0].itemtitle
|
subjectVal.value = subjectList.value[0].itemtitle
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取学科数据
|
// 获取学科数据
|
||||||
|
|
||||||
const getSubject = async ()=>{
|
const getSubject = async ()=>{
|
||||||
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
||||||
// 所有学科
|
// 所有学科
|
||||||
|
@ -114,6 +119,7 @@ const editUserInfo = async () =>{
|
||||||
edustage: gradeVal.value,
|
edustage: gradeVal.value,
|
||||||
edusubject: subjectVal.value
|
edusubject: subjectVal.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改之后需要重新登录 查询用户信息,否则不登录 查询的用户信息是未修改之前的
|
// 修改之后需要重新登录 查询用户信息,否则不登录 查询的用户信息是未修改之前的
|
||||||
// 接口如此,我也不知道为啥要这样
|
// 接口如此,我也不知道为啥要这样
|
||||||
subjectLoading.value = true
|
subjectLoading.value = true
|
||||||
|
@ -122,15 +128,14 @@ const editUserInfo = async () =>{
|
||||||
await updateUserInfo(data)
|
await updateUserInfo(data)
|
||||||
await userStore.login(props.loginData)
|
await userStore.login(props.loginData)
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
ElMessage.success('登录成功')
|
|
||||||
model.value = false
|
|
||||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
|
||||||
} finally {
|
} finally {
|
||||||
subjectLoading.value = false
|
subjectLoading.value = false
|
||||||
}
|
}
|
||||||
|
emit('onSuccess')
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => model.value, (newVal) => {
|
watch(() => props.modelValue, (newVal) => {
|
||||||
|
dialogVisible.value = newVal
|
||||||
if(newVal){
|
if(newVal){
|
||||||
getSubject()
|
getSubject()
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ let chapterId = null
|
||||||
export const useGetHomework = async (node) => {
|
export const useGetHomework = async (node) => {
|
||||||
/**
|
/**
|
||||||
* node
|
* node
|
||||||
* 左侧选择章节的节点数据
|
|
||||||
*/
|
*/
|
||||||
if (!node) return
|
if (!node) return
|
||||||
curNode = node
|
curNode = node
|
||||||
|
@ -27,10 +26,7 @@ export const useGetHomework = async (node) => {
|
||||||
chapterId = rows[0].id
|
chapterId = rows[0].id
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(async (resolve) =>{
|
return await getHomeWorkList()
|
||||||
const res = await getHomeWorkList()
|
|
||||||
resolve({res,chapterId})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
@command="handleCommand"
|
@command="handleCommand"
|
||||||
>
|
>
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="dev_api + userStore.user.avatar" class="user-avatar" style="float: left" />
|
<img :src="userStore.user.avatar" class="user-avatar" style="float: left" />
|
||||||
<div style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
|
<div style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
@ -62,7 +62,6 @@ const { ipcRenderer } = window.electron || {}
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const currentRoute = ref('')
|
const currentRoute = ref('')
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
|
||||||
|
|
||||||
const handleOutLink = (path, type) => {
|
const handleOutLink = (path, type) => {
|
||||||
if (!path) return
|
if (!path) return
|
||||||
|
|
|
@ -37,7 +37,7 @@ const useUserStore = defineStore('user', {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo()
|
getInfo()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
|
res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
|
||||||
const user = res.user
|
const user = res.user
|
||||||
this.user = user
|
this.user = user
|
||||||
const avatar = user.avatar == '' || user.avatar == null ? defAva : user.avatar
|
const avatar = user.avatar == '' || user.avatar == null ? defAva : user.avatar
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
/>
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!--选择学科-->
|
<!--选择学科-->
|
||||||
<SelectSubject v-model="isSubject" :login-data="loginForm" />
|
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" />
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
|
@ -121,6 +121,12 @@ const submitForm = async (formEl) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const successEditSubject = () => {
|
||||||
|
isSubject.value = false
|
||||||
|
ElMessage.success('登录成功')
|
||||||
|
ipcRenderer && ipcRenderer.send('openMainWindow')
|
||||||
|
}
|
||||||
|
|
||||||
const getCookie = async () => {
|
const getCookie = async () => {
|
||||||
const username = (await getCookieDetail('username'))[0]
|
const username = (await getCookieDetail('username'))[0]
|
||||||
const password = (await getCookieDetail('password'))[0]
|
const password = (await getCookieDetail('password'))[0]
|
||||||
|
|
|
@ -263,15 +263,9 @@ export default {
|
||||||
getCurrentDate() {
|
getCurrentDate() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
let month = now.getMonth() + 1; // 月份是从0开始的,所以需要+1
|
const month = now.getMonth() + 1; // 月份是从0开始的,所以需要+1
|
||||||
let day = now.getDate()
|
const day = now.getDate()
|
||||||
if(month < 10){
|
return `${year}-${month.length == 2 ? month : '0' + month}-${day.length == 2 ? day : '0' + day}`;
|
||||||
month = '0' + month
|
|
||||||
}
|
|
||||||
if(day < 10){
|
|
||||||
day = '0' + day
|
|
||||||
}
|
|
||||||
return `${year}-${month}-${day}`;
|
|
||||||
},
|
},
|
||||||
validateGrade(rule, value, callback) {
|
validateGrade(rule, value, callback) {
|
||||||
if (this.studentList.length == 0) {
|
if (this.studentList.length == 0) {
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
|
||||||
<div class="page-right">
|
<div class="page-right">
|
||||||
<div class="header-top flex">
|
<div class="header-top flex">
|
||||||
<div class="textbook-img" @click="navtoPdf">
|
<div class="textbook-img">
|
||||||
<el-image style="width: 80px; height: 110px" :src="curBookImg" />
|
<el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf" />
|
||||||
<el-progress
|
<el-progress
|
||||||
v-if="downloadNum > 0 && downloadNum < 100"
|
v-if="downloadNum > 0 && downloadNum < 100"
|
||||||
style="position: absolute; left: 0; z-index: 999"
|
style="position: absolute; left: 0; z-index: 999"
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
@on-delete="deleteTalk"
|
@on-delete="deleteTalk"
|
||||||
@on-set="openSet"
|
@on-set="openSet"
|
||||||
@on-delhomework="delhomework"
|
@on-delhomework="delhomework"
|
||||||
|
|
||||||
>
|
>
|
||||||
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
|
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
|
||||||
</file-list-item>
|
</file-list-item>
|
||||||
|
@ -139,6 +139,7 @@ import { useToolState } from '@/store/modules/tool'
|
||||||
import MoveFile from '@/components/move-file/index.vue'
|
import MoveFile from '@/components/move-file/index.vue'
|
||||||
import FileListItem from '@/views/prepare/container/file-list-item.vue'
|
import FileListItem from '@/views/prepare/container/file-list-item.vue'
|
||||||
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
|
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
|
||||||
|
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
|
||||||
import { toTimeText } from '@/utils/date'
|
import { toTimeText } from '@/utils/date'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||||
|
@ -147,9 +148,8 @@ import SetHomework from './container/set-homework.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
import { createWindow } from '@/utils/tool'
|
import { createWindow } from '@/utils/tool'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { delClasswork } from '@/api/teaching/classwork'
|
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
|
||||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
import { getSelfReserv, startClass } from '@/api/classManage'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
@ -429,11 +429,44 @@ export default {
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
},
|
},
|
||||||
// 获取作业
|
|
||||||
async initHomeWork() {
|
async initHomeWork() {
|
||||||
const { res, chapterId } = await useGetHomework(this.currentNode)
|
|
||||||
this.entpcourseid = chapterId
|
if (this.uploadData.levelSecondId) {
|
||||||
this.currentWorkList = cloneDeep(res)
|
// 获取作业列表所需ID 可能存在没有
|
||||||
|
let { rows } = await this.getChapterId()
|
||||||
|
if (rows.length > 0) {
|
||||||
|
this.entpcourseid = rows[0].id
|
||||||
|
} else {
|
||||||
|
await this.createEntpcourse()
|
||||||
|
let { rows } = await this.getChapterId()
|
||||||
|
this.entpcourseid = rows[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询作业
|
||||||
|
this.getHomeWorkList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 创建新的entpcourse
|
||||||
|
createEntpcourse() {
|
||||||
|
// 参照 web AIx 传入参数
|
||||||
|
var cform = {}
|
||||||
|
cform.entpid = this.userStore.deptId
|
||||||
|
cform.level = 1
|
||||||
|
cform.parentid = 0
|
||||||
|
cform.dictid = 0
|
||||||
|
cform.evalid = this.currentNode.id
|
||||||
|
cform.evalparentid = 0
|
||||||
|
cform.edusubject = this.currentNode.edusubject
|
||||||
|
cform.edudegree = this.currentNode.edudegree
|
||||||
|
cform.edustage = this.currentNode.edustage
|
||||||
|
cform.coursetype = '课标学科'
|
||||||
|
cform.coursetitle = this.currentNode.itemtitle
|
||||||
|
cform.coursedesc = ''
|
||||||
|
cform.status = ''
|
||||||
|
cform.dflag = 0
|
||||||
|
cform.edituserid = this.userStore.userId
|
||||||
|
cform.createblankfile = 'yes'
|
||||||
|
return addEntpcourse(cform)
|
||||||
},
|
},
|
||||||
openReserv() {
|
openReserv() {
|
||||||
this.$refs['reservDialog'].openDialog()
|
this.$refs['reservDialog'].openDialog()
|
||||||
|
@ -463,6 +496,79 @@ export default {
|
||||||
cookieData: { ...configObj.data }
|
cookieData: { ...configObj.data }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 根据教材章节单元ID 查询作业列表所需ID
|
||||||
|
getChapterId() {
|
||||||
|
return listEntpcourse({
|
||||||
|
evalid: this.uploadData.levelSecondId,
|
||||||
|
edituserid: this.userStore.userId,
|
||||||
|
pageSize: 500
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询作业列表
|
||||||
|
getHomeWorkList() {
|
||||||
|
homeworklist({
|
||||||
|
entpcourseid: this.entpcourseid,
|
||||||
|
edituserid: this.userStore.userId,
|
||||||
|
pageSize: 100
|
||||||
|
}).then((res) => {
|
||||||
|
//以下代码 参照AIx web端 作业布置
|
||||||
|
let list = []
|
||||||
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
res.rows[i].taskconfig = []
|
||||||
|
|
||||||
|
// 找child
|
||||||
|
for (var j = 0; j < res.rows.length; j++) {
|
||||||
|
if (res.rows[j].parentid == res.rows[i].id) {
|
||||||
|
var ss = []
|
||||||
|
if (res.rows[j].classworkdatastudentids != null) {
|
||||||
|
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||||
|
}
|
||||||
|
var js = {
|
||||||
|
id: res.rows[j].id,
|
||||||
|
classid: res.rows[j].classid,
|
||||||
|
classcaption: res.rows[j].classcaption,
|
||||||
|
parentid: 0,
|
||||||
|
worktype: '',
|
||||||
|
workkey: res.rows[j].workkey,
|
||||||
|
worktag: '',
|
||||||
|
entpcourseid: 0,
|
||||||
|
evalid: 0,
|
||||||
|
edusubject: '',
|
||||||
|
edudegree: '',
|
||||||
|
workdate: '',
|
||||||
|
title: '',
|
||||||
|
workcodes: '',
|
||||||
|
studentlist: ss,
|
||||||
|
deaddate: res.rows[j].deaddate,
|
||||||
|
timelength: res.rows[j].timelength,
|
||||||
|
weights: res.rows[j].weights,
|
||||||
|
feedtype: res.rows[j].feedtype
|
||||||
|
}
|
||||||
|
res.rows[i].taskconfig.push(js)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||||
|
|
||||||
|
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||||
|
// 2024-05-15,酉阳,jackyshen
|
||||||
|
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||||
|
list.push(res.rows[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
if (res.rows[i].entpcourseworklist != '') {
|
||||||
|
res.rows[i].entpcourseworklistarray = JSON.parse(
|
||||||
|
'[' + res.rows[i].entpcourseworklist + ']'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
res.rows[i].entpcourseworklistarray = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 深度克隆
|
||||||
|
this.currentWorkList = cloneDeep(list)
|
||||||
|
})
|
||||||
|
},
|
||||||
getWeekday1(date) {
|
getWeekday1(date) {
|
||||||
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||||
const weekday = new Date(date).getDay()
|
const weekday = new Date(date).getDay()
|
||||||
|
@ -481,7 +587,7 @@ export default {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
this.initHomeWork()
|
this.getHomeWorkList()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<!-- 裁剪+效果 -->
|
<!-- 裁剪+效果 -->
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box_1">
|
<div class="box_1">
|
||||||
<img :src="dev_api + filePath" ref="image" />
|
<img :src="filePath" ref="image" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--裁剪完的图片-->
|
<!--裁剪完的图片-->
|
||||||
|
@ -60,7 +60,6 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
|
||||||
|
|
||||||
// 原生上传的文件
|
// 原生上传的文件
|
||||||
const uploadImg = (e) => {
|
const uploadImg = (e) => {
|
||||||
|
@ -164,7 +163,7 @@ export default {
|
||||||
// 页面刷新自动执行
|
// 页面刷新自动执行
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.filePath) {
|
if (props.filePath) {
|
||||||
dataFile.image.src = dev_api.value + props.filePath;
|
dataFile.image.src = props.filePath;
|
||||||
copper();
|
copper();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -176,7 +175,6 @@ export default {
|
||||||
uploadImg,
|
uploadImg,
|
||||||
upLoading,
|
upLoading,
|
||||||
cancle,
|
cancle,
|
||||||
dev_api
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="20" style="display: flex;flex-wrap: nowrap;justify-content: start">
|
<el-row :gutter="20" style="display: flex;flex-wrap: nowrap;justify-content: start">
|
||||||
<el-col :xs="24" style="min-width: 260px;max-width: 300px">
|
<el-col :xs="24" style="min-width: 260px;max-width: 260px">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
|
@ -97,10 +97,10 @@ const state = reactive({
|
||||||
postGroup: {}
|
postGroup: {}
|
||||||
})
|
})
|
||||||
|
|
||||||
async function getUser() {
|
function getUser() {
|
||||||
getUserProfile().then((response) => {
|
getUserProfile().then((response) => {
|
||||||
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
||||||
Object.assign(state.user,response.data)
|
state.user = response.data
|
||||||
state.roleGroup = response.roleGroup
|
state.roleGroup = response.roleGroup
|
||||||
state.postGroup = response.postGroup
|
state.postGroup = response.postGroup
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="user-info-head" @click="editCropper()">
|
<div class="user-info-head" @click="editCropper()">
|
||||||
<img :src="dev_api + options.img" title="点击上传头像" class="img-circle img-lg" />
|
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="open"
|
v-model="open"
|
||||||
append-to-body
|
append-to-body
|
||||||
|
@ -28,7 +28,6 @@ const userStore = useUserStore()
|
||||||
|
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
|
|
||||||
|
|
||||||
//图片裁剪数据
|
//图片裁剪数据
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
|
@ -57,7 +56,7 @@ function uploadImg(data) {
|
||||||
formData.append('avatarfile', data)
|
formData.append('avatarfile', data)
|
||||||
uploadAvatar(formData).then((response) => {
|
uploadAvatar(formData).then((response) => {
|
||||||
open.value = false
|
open.value = false
|
||||||
options.img = response.imgUrl
|
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl
|
||||||
userStore.user.avatar = options.img
|
userStore.user.avatar = options.img
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '上传成功',
|
message: '上传成功',
|
||||||
|
@ -69,7 +68,7 @@ function uploadImg(data) {
|
||||||
|
|
||||||
/** 关闭窗口 */
|
/** 关闭窗口 */
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
options.img = userStore.user.avatar
|
// options.img = userStore.avatar
|
||||||
options.visible = false
|
options.visible = false
|
||||||
}
|
}
|
||||||
const cancle = () => {
|
const cancle = () => {
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
import { ref, onMounted, toRaw } from 'vue';
|
import { ref, onMounted, toRaw } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||||
import FileImage from '@/components/file-image/index.vue'
|
import FileImage from '@/components/file-image/index.vue'
|
||||||
|
@ -117,7 +118,7 @@ const closeHomework = () => {
|
||||||
|
|
||||||
|
|
||||||
const changeChapter = async (data)=>{
|
const changeChapter = async (data)=>{
|
||||||
const { res } = await useGetHomework(data)
|
const res = await useGetHomework(data)
|
||||||
dataList.value = res
|
dataList.value = res
|
||||||
let cata = parseCataByNode(data)
|
let cata = parseCataByNode(data)
|
||||||
|
|
||||||
|
@ -144,7 +145,7 @@ const openFileLink = (item) =>{
|
||||||
// 获取资源数据
|
// 获取资源数据
|
||||||
const getResource = () => {
|
const getResource = () => {
|
||||||
let querySearch = toRaw(toolStore.curSubjectNode).querySearch
|
let querySearch = toRaw(toolStore.curSubjectNode).querySearch
|
||||||
|
|
||||||
querySearch.orderByColumn = 'uploadTime'
|
querySearch.orderByColumn = 'uploadTime'
|
||||||
querySearch.isAsc = 'desc'
|
querySearch.isAsc = 'desc'
|
||||||
querySearch.pageSize = 500
|
querySearch.pageSize = 500
|
||||||
|
@ -155,13 +156,71 @@ const getResource = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取作业数据
|
// 获取作业数据
|
||||||
const getHomework = async () => {
|
const getHomework = () => {
|
||||||
const data = toRaw(toolStore.curSubjectNode).data.node
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const { res } = await useGetHomework(data)
|
homeworklist({
|
||||||
dataList.value = res
|
entpcourseid: entpcourseid.value,
|
||||||
|
edituserid: usertore.userId,
|
||||||
|
pageSize: 100
|
||||||
|
}).then(res => {
|
||||||
|
//以下代码 参照AIx web端 作业布置
|
||||||
|
let list = []
|
||||||
|
for (var i = 0; i < res.rows.length; i++) {
|
||||||
|
res.rows[i].taskconfig = []
|
||||||
|
|
||||||
|
// 找child
|
||||||
|
for (var j = 0; j < res.rows.length; j++) {
|
||||||
|
if (res.rows[j].parentid == res.rows[i].id) {
|
||||||
|
var ss = []
|
||||||
|
if (res.rows[j].classworkdatastudentids != null) {
|
||||||
|
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||||
|
}
|
||||||
|
var js = {
|
||||||
|
id: res.rows[j].id,
|
||||||
|
classid: res.rows[j].classid,
|
||||||
|
classcaption: res.rows[j].classcaption,
|
||||||
|
parentid: 0,
|
||||||
|
worktype: '',
|
||||||
|
workkey: res.rows[j].workkey,
|
||||||
|
worktag: '',
|
||||||
|
entpcourseid: 0,
|
||||||
|
evalid: 0,
|
||||||
|
edusubject: '',
|
||||||
|
edudegree: '',
|
||||||
|
workdate: '',
|
||||||
|
title: '',
|
||||||
|
workcodes: '',
|
||||||
|
studentlist: ss,
|
||||||
|
deaddate: res.rows[j].deaddate,
|
||||||
|
timelength: res.rows[j].timelength,
|
||||||
|
weights: res.rows[j].weights,
|
||||||
|
feedtype: res.rows[j].feedtype
|
||||||
|
}
|
||||||
|
res.rows[i].taskconfig.push(js)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||||
|
|
||||||
|
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||||
|
// 2024-05-15,酉阳,jackyshen
|
||||||
|
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||||
|
list.push(res.rows[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
if (res.rows[i].entpcourseworklist != '') {
|
||||||
|
res.rows[i].entpcourseworklistarray = JSON.parse(
|
||||||
|
'[' + res.rows[i].entpcourseworklist + ']'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
res.rows[i].entpcourseworklistarray = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dataList.value = list
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
@ -186,10 +245,10 @@ function leave(el, done) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
entpcourseid.value = route.query.entpcourseid
|
entpcourseid.value = route.query.entpcourseid
|
||||||
lesson.value = route.query.label
|
lesson.value = route.query.label
|
||||||
|
getHomework()
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
getHomework()
|
|
||||||
getResource()
|
getResource()
|
||||||
},200)
|
},1000)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue