Compare commits

...

26 Commits

Author SHA1 Message Date
朱浩 aec8e9a21f Merge remote-tracking branch 'origin/main' 2024-08-16 09:05:13 +08:00
朱浩 de909adccb 二期:修复图片加载失败无法点击的问题 2024-08-15 16:23:07 +08:00
yangws f7b00b1ccd Merge pull request 'fix:个人信息宽度调整;' (#141) from yangws into main
Reviewed-on: #141
2024-08-15 15:59:41 +08:00
yangws c94563fd43 fix:个人信息宽度调整; 2024-08-15 15:58:58 +08:00
lyc c1a34c61c9 Merge pull request 'lyc-dev' (#140) from lyc-dev into main 2024-08-15 15:16:07 +08:00
lyc a68b2a2805 Merge branch 'main' into lyc-dev 2024-08-15 15:15:40 +08:00
lyc 0d1a96b202 窗口minwidth 2024-08-15 15:15:22 +08:00
yangws 71fe8a0a8f Merge pull request 'fix:上传存图片路径之前取的缓存接口getUserProfile(),并且去掉前缀dev-api保证图片回显;' (#139) from yangws into main
Reviewed-on: #139
2024-08-15 15:11:43 +08:00
yangws b8f95eb20f fix:上传存图片路径之前取的缓存接口getUserProfile(),并且去掉前缀dev-api保证图片回显; 2024-08-15 15:10:42 +08:00
lyc 5328607ce1 Merge pull request '禁用双击最大化' (#138) from lyc-dev into main 2024-08-15 14:57:29 +08:00
lyc a17be49850 禁用双击最大化 2024-08-15 14:57:08 +08:00
yangws 2a4dac58ac Merge pull request 'fix:上传存图片路径之前取的缓存接口getUserProfile(),并且去掉前缀dev-api保证图片回显;' (#137) from yangws into main
Reviewed-on: #137
2024-08-15 14:11:32 +08:00
yangws 0fe264054c fix:上传存图片路径之前取的缓存接口getUserProfile(),并且去掉前缀dev-api保证图片回显; 2024-08-15 14:10:29 +08:00
lyc f632bab6b3 Merge pull request 'lyc-dev' (#136) from lyc-dev into main 2024-08-15 13:58:17 +08:00
lyc ae52510c7c Merge branch 'main' into lyc-dev 2024-08-15 13:57:36 +08:00
lyc 86d5f33119 登录 修改 2024-08-15 13:57:23 +08:00
lyc cf3129ed66 Merge pull request 'lyc-dev' (#135) from lyc-dev into main 2024-08-15 10:32:15 +08:00
lyc 97e035398c Merge branch 'main' into lyc-dev 2024-08-15 10:31:34 +08:00
lyc 6e8c96ce2e 布置作业默认日期修改 2024-08-15 10:31:11 +08:00
lyc decfb09eb4 Merge pull request 'lyc-dev' (#134) from lyc-dev into main
Reviewed-on: #134
2024-08-15 09:59:07 +08:00
lyc 2a84455f05 教材封面baseUrl 2024-08-15 09:55:37 +08:00
lyc ba9b381b69 Merge branch 'main' into lyc-dev 2024-08-14 17:27:34 +08:00
朱浩 6616ac640e Merge pull request 'zhuhao_dev' (#133) from zhuhao_dev into main
Reviewed-on: #133
2024-08-14 17:22:19 +08:00
lyc 4754ed641c 上课-作业 修改 2024-08-14 16:40:43 +08:00
lyc 94ae78bffc Merge branch 'main' into lyc-dev 2024-08-14 14:57:17 +08:00
lyc c72d103082 查询作业修改 2024-08-14 14:57:00 +08:00
15 changed files with 69 additions and 223 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aix-win",
"version": "1.1.0",
"version": "1.1.1",
"description": "An Electron application with Vue",
"main": "./out/main/index.js",
"author": "example.com",

View File

@ -61,10 +61,12 @@ function createLoginWindow() {
function createMainWindow() {
mainWindow = new BrowserWindow({
width: 1200,
minWidth: 1200,
height: 700,
show: false,
frame: false, // 无边框
autoHideMenuBar: true,
maximizable: false,
icon: join(__dirname, '../../resources/logo2.ico'),
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {

View File

@ -50,3 +50,9 @@ export function updateUserInfo(data) {
data: data
})
}
export function getUserInfo(userId) {
return request({
url: '/system/user/' + userId,
method: 'get'
})
}

View File

@ -46,7 +46,7 @@ import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
import useUserStore from '@/store/modules/user'
import { listEvaluation } from '@/api/subject'
const BaseUrl = 'https://prev.ysaix.com:7868/'
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
// emit
const emit = defineEmits(['nodeClick', 'changeBook'])
// store

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="500"
<el-dialog v-model="model" append-to-body :show-close="false" width="500"
top="25vh"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -34,12 +34,14 @@
<script setup>
import { ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
import { listEvaluation } from '@/api/subject'
import { updateUserInfo } from '@/api/system/user'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const { userId, userName } = userStore.user
const { ipcRenderer } = window.electron || {}
const props = defineProps({
loginData: {
@ -48,17 +50,11 @@ const props = defineProps({
return {}
}
},
modelValue: {
type: Boolean,
default: false
},
})
const model = defineModel();
const subjectLoading = ref(false)
// emit
const emit = defineEmits(['update:modelValue', 'onSuccess'])
// web AIx
const gradeList = ref([
{
label: '高中',
@ -85,7 +81,6 @@ gradeVal.value = gradeList.value[0].value
//
const subjectList = ref([])
const allSubject = ref([])
const dialogVisible = ref(false)
//
const changeGrade = ()=>{
@ -98,8 +93,8 @@ const changeGrade = ()=>{
//
subjectVal.value = subjectList.value[0].itemtitle
}
//
//
const getSubject = async ()=>{
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
//
@ -119,7 +114,6 @@ const editUserInfo = async () =>{
edustage: gradeVal.value,
edusubject: subjectVal.value
}
//
//
subjectLoading.value = true
@ -128,14 +122,15 @@ const editUserInfo = async () =>{
await updateUserInfo(data)
await userStore.login(props.loginData)
await userStore.getInfo()
ElMessage.success('登录成功')
model.value = false
ipcRenderer && ipcRenderer.send('openMainWindow')
} finally {
subjectLoading.value = false
}
emit('onSuccess')
}
watch(() => props.modelValue, (newVal) => {
dialogVisible.value = newVal
watch(() => model.value, (newVal) => {
if(newVal){
getSubject()
}

View File

@ -11,6 +11,7 @@ let chapterId = null
export const useGetHomework = async (node) => {
/**
* node
* 左侧选择章节的节点数据
*/
if (!node) return
curNode = node
@ -26,7 +27,10 @@ export const useGetHomework = async (node) => {
chapterId = rows[0].id
}
return await getHomeWorkList()
return new Promise(async (resolve) =>{
const res = await getHomeWorkList()
resolve({res,chapterId})
})
}

View File

@ -29,7 +29,7 @@
@command="handleCommand"
>
<div class="avatar-wrapper">
<img :src="userStore.user.avatar" class="user-avatar" style="float: left" />
<img :src="dev_api + userStore.user.avatar" class="user-avatar" style="float: left" />
<div style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
</div>
<template #dropdown>
@ -62,6 +62,7 @@ const { ipcRenderer } = window.electron || {}
const userStore = useUserStore()
const router = useRouter()
const currentRoute = ref('')
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const handleOutLink = (path, type) => {
if (!path) return

View File

@ -37,7 +37,7 @@ const useUserStore = defineStore('user', {
return new Promise((resolve, reject) => {
getInfo()
.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
this.user = user
const avatar = user.avatar == '' || user.avatar == null ? defAva : user.avatar

View File

@ -47,7 +47,7 @@
/>
</el-dialog>
<!--选择学科-->
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" />
<SelectSubject v-model="isSubject" :login-data="loginForm" />
</template>
<script setup>
import { onMounted, reactive, ref } from 'vue'
@ -121,12 +121,6 @@ const submitForm = async (formEl) => {
})
}
const successEditSubject = () => {
isSubject.value = false
ElMessage.success('登录成功')
ipcRenderer && ipcRenderer.send('openMainWindow')
}
const getCookie = async () => {
const username = (await getCookieDetail('username'))[0]
const password = (await getCookieDetail('password'))[0]

View File

@ -263,9 +263,15 @@ export default {
getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1; // 0+1
const day = now.getDate()
return `${year}-${month.length == 2 ? month : '0' + month}-${day.length == 2 ? day : '0' + day}`;
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}`;
},
validateGrade(rule, value, callback) {
if (this.studentList.length == 0) {

View File

@ -3,8 +3,8 @@
<ChooseTextbook @change-book="nodeClick" @node-click="nodeClick" />
<div class="page-right">
<div class="header-top flex">
<div class="textbook-img">
<el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf" />
<div class="textbook-img" @click="navtoPdf">
<el-image style="width: 80px; height: 110px" :src="curBookImg" />
<el-progress
v-if="downloadNum > 0 && downloadNum < 100"
style="position: absolute; left: 0; z-index: 999"
@ -139,7 +139,6 @@ import { useToolState } from '@/store/modules/tool'
import MoveFile from '@/components/move-file/index.vue'
import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
import { toTimeText } from '@/utils/date'
import { ElMessage } from 'element-plus'
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
@ -148,8 +147,9 @@ import SetHomework from './container/set-homework.vue'
import outLink from '@/utils/linkConfig'
import { createWindow } from '@/utils/tool'
import { cloneDeep } from 'lodash'
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
import { delClasswork } from '@/api/teaching/classwork'
import { getSelfReserv, startClass } from '@/api/classManage'
import { useGetHomework } from '@/hooks/useGetHomework'
const toolStore = useToolState()
const fs = require('fs')
const { ipcRenderer } = window.electron || {}
@ -429,44 +429,11 @@ export default {
this.initHomeWork()
await this.asyncAllFile()
},
//
async initHomeWork() {
if (this.uploadData.levelSecondId) {
// 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)
const { res, chapterId } = await useGetHomework(this.currentNode)
this.entpcourseid = chapterId
this.currentWorkList = cloneDeep(res)
},
openReserv() {
this.$refs['reservDialog'].openDialog()
@ -496,79 +463,6 @@ export default {
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>0PPT
// 2024-05-15jackyshen
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) {
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
const weekday = new Date(date).getDay()
@ -587,7 +481,7 @@ export default {
ElMessage.success('操作成功')
this.isLoading = false
await this.asyncAllFile()
this.getHomeWorkList()
this.initHomeWork()
})
.catch(() => {
this.isLoading = false

View File

@ -11,7 +11,7 @@
<!-- 裁剪+效果 -->
<div class="box">
<div class="box_1">
<img :src="filePath" ref="image" />
<img :src="dev_api + filePath" ref="image" />
</div>
<!--裁剪完的图片-->
@ -60,6 +60,7 @@ export default {
},
},
setup(props, context) {
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
//
const uploadImg = (e) => {
@ -163,7 +164,7 @@ export default {
//
onMounted(() => {
if (props.filePath) {
dataFile.image.src = props.filePath;
dataFile.image.src = dev_api.value + props.filePath;
copper();
}
});
@ -175,6 +176,7 @@ export default {
uploadImg,
upLoading,
cancle,
dev_api
};
},
};

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-row :gutter="20" style="display: flex;flex-wrap: nowrap;justify-content: start">
<el-col :xs="24" style="min-width: 260px;max-width: 260px">
<el-col :xs="24" style="min-width: 260px;max-width: 300px">
<el-card class="box-card">
<template v-slot:header>
<div class="clearfix">
@ -97,10 +97,10 @@ const state = reactive({
postGroup: {}
})
function getUser() {
async function getUser() {
getUserProfile().then((response) => {
response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
state.user = response.data
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
Object.assign(state.user,response.data)
state.roleGroup = response.roleGroup
state.postGroup = response.postGroup
})

View File

@ -1,6 +1,6 @@
<template>
<div class="user-info-head" @click="editCropper()">
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
<img :src="dev_api + options.img" title="点击上传头像" class="img-circle img-lg" />
<el-dialog
v-model="open"
append-to-body
@ -28,6 +28,7 @@ const userStore = useUserStore()
const open = ref(false)
const visible = ref(false)
const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
//
const options = reactive({
@ -56,7 +57,7 @@ function uploadImg(data) {
formData.append('avatarfile', data)
uploadAvatar(formData).then((response) => {
open.value = false
options.img = import.meta.env.VITE_APP_BASE_API + response.imgUrl
options.img = response.imgUrl
userStore.user.avatar = options.img
ElMessage({
message: '上传成功',
@ -68,7 +69,7 @@ function uploadImg(data) {
/** 关闭窗口 */
function closeDialog() {
// options.img = userStore.avatar
options.img = userStore.user.avatar
options.visible = false
}
const cancle = () => {

View File

@ -73,7 +73,6 @@
import { ref, onMounted, toRaw } from 'vue';
import { useRoute } from 'vue-router';
import useUserStore from '@/store/modules/user'
import { homeworklist } from '@/api/teaching/classwork'
import { getSmarttalkPage, getPrepareById } from '@/api/file'
import SetHomework from '@/views/prepare/container/set-homework.vue'
import FileImage from '@/components/file-image/index.vue'
@ -118,7 +117,7 @@ const closeHomework = () => {
const changeChapter = async (data)=>{
const res = await useGetHomework(data)
const { res } = await useGetHomework(data)
dataList.value = res
let cata = parseCataByNode(data)
@ -157,70 +156,12 @@ const getResource = () => {
}
//
const getHomework = () => {
const getHomework = async () => {
const data = toRaw(toolStore.curSubjectNode).data.node
loading.value = true
try {
homeworklist({
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>0PPT
// 2024-05-15jackyshen
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
})
const { res } = await useGetHomework(data)
dataList.value = res
} finally {
loading.value = false
}
@ -245,10 +186,10 @@ function leave(el, done) {
onMounted(() => {
entpcourseid.value = route.query.entpcourseid
lesson.value = route.query.label
getHomework()
setTimeout(()=>{
getHomework()
getResource()
},1000)
},200)
})
</script>