Compare commits

..

No commits in common. "776be8eaac63c9caf60e654a1062cf117cab2141" and "c7d2eba5bb7ec1354f6568bab9587a411aa22752" have entirely different histories.

6 changed files with 78 additions and 183 deletions

View File

@ -24,8 +24,8 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
'/dev-api': { '/dev-api': {
target: 'http://27.128.240.72:7865', // target: 'http://27.128.240.72:7865',
// target: 'http://192.168.2.52:7863', target: 'http://192.168.2.52:7863',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "1.0.7", "version": "1.0.6",
"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",

View File

@ -42,11 +42,6 @@ const updateInit = (win) => {
logger.error('检查更新失败') logger.error('检查更新失败')
}) })
// 监听下载进度
autoUpdater.on('download-progress', (progressObj) => {
win.webContents.send('update-app-progress', progressObj.percent);
});
// 跟新下载完毕 // 跟新下载完毕
autoUpdater.on('update-downloaded', () => { autoUpdater.on('update-downloaded', () => {
dialog dialog

View File

@ -7,47 +7,24 @@
<img class="welcome-img" :src="leftBg2" /> <img class="welcome-img" :src="leftBg2" />
</div> </div>
<div class="box-item login"> <div class="box-item login">
<WindowTools :is-has-max="false" /> <WindowTools :isHasMax="false" />
<div class="login-title">账号登录</div> <div class="login-title">账号登录</div>
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large"> <el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" /> <el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
</el-form-item> </el-form-item>
<el-form-item prop="password" style="margin-bottom: 15px"> <el-form-item prop="password" style="margin-bottom: 15px">
<el-input <el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" />
v-model="loginForm.password"
autocomplete="on"
type="password"
placeholder="请输入密码"
/>
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" class="flex mb-5">记住密码</el-checkbox> <el-checkbox class="flex mb-5" v-model="loginForm.rememberMe">记住密码</el-checkbox>
<el-form-item> <el-form-item>
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)" <el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)">登录</el-button>
>登录</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</div> </div>
<el-dialog
v-model="showDownLoading"
width="500"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
align-center
>
<el-progress
:text-inside="true"
:stroke-width="22"
:percentage="downloadProp"
:show-text="false"
status="success"
/>
</el-dialog>
<!--选择学科--> <!--选择学科-->
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" /> <SelectSubject v-model="isSubject" :loginData="loginForm" @onSuccess="successEditSubject"/>
</template> </template>
<script setup> <script setup>
import { onMounted, reactive, ref } from 'vue' import { onMounted, reactive, ref } from 'vue'
@ -59,8 +36,7 @@ import WindowTools from '@/components/window-tools/index.vue'
import SelectSubject from '@/components/select-subject/index.vue' import SelectSubject from '@/components/select-subject/index.vue'
const { session } = require('@electron/remote') const { session } = require('@electron/remote')
const downloadProp = ref(0)
const showDownLoading = ref(false)
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const formRef = ref() const formRef = ref()
const userStore = useUserStore() const userStore = useUserStore()
@ -79,11 +55,7 @@ const rules = reactive({
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }] password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }]
}) })
let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH;
ipcRenderer.on('update-app-progress', (e, prop) => {
downloadProp.value = prop
showDownLoading.value = prop !== 100
})
// //
const submitForm = async (formEl) => { const submitForm = async (formEl) => {
@ -111,9 +83,11 @@ const submitForm = async (formEl) => {
if (userStore.user.edustage || userStore.user.edusubject) { if (userStore.user.edustage || userStore.user.edusubject) {
ElMessage.success('登录成功') ElMessage.success('登录成功')
ipcRenderer && ipcRenderer.send('openMainWindow') ipcRenderer && ipcRenderer.send('openMainWindow')
} else { }
else {
isSubject.value = true isSubject.value = true
} }
} finally { } finally {
btnLoading.value = false btnLoading.value = false
} }
@ -144,7 +118,7 @@ const getCookieDetail = (name) => {
// cookie // cookie
const setCookie = (name, value) => { const setCookie = (name, value) => {
// 30 // 30
let Days = 30 let Days = 30;
let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60 let times = Math.round(Date.now() / 1000) + Days * 24 * 60 * 60
const cookie = { const cookie = {
url: curWinUrl, url: curWinUrl,
@ -155,6 +129,8 @@ const setCookie = (name, value) => {
return session.defaultSession.cookies.set(cookie) return session.defaultSession.cookies.set(cookie)
} }
onMounted(() => { onMounted(() => {
localStorage.clear() localStorage.clear()
getCookie() getCookie()

View File

@ -94,14 +94,13 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<!-- 判断是不是自己创建的课件--> <div class="item-popover-item">
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
<el-button text @click="editTalk(item, index)"> <el-button text @click="editTalk(item, index)">
<i class="iconfont icon-bianji"></i> <i class="iconfont icon-bianji"></i>
<span>重命名</span> <span>重命名</span>
</el-button> </el-button>
</div> </div>
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)"> <div class="item-popover-item">
<el-button text @click="deleteTalk(item)"> <el-button text @click="deleteTalk(item)">
<i class="iconfont icon-shanchu"></i> <i class="iconfont icon-shanchu"></i>
<span>删除</span> <span>删除</span>
@ -141,7 +140,6 @@ import { asyncLocalFile } from '@/utils/talkFile'
import { toTimeText } from '@/utils/date' import { toTimeText } from '@/utils/date'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file' import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
import useUserStore from '@/store/modules/user'
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
export default { export default {
@ -164,13 +162,11 @@ export default {
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null }, emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null },
data() { data() {
return { return {
listenList: [], listenList: []
userInfo:{}
} }
}, },
methods: { methods: {
editTalk(item) { editTalk(item) {
console.log(item,this.userInfo,'this.userInfo')
ElMessageBox.prompt('请输入新的名称', '重命名', { ElMessageBox.prompt('请输入新的名称', '重命名', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -257,9 +253,6 @@ export default {
deleteHomework(item){ deleteHomework(item){
this.$emit('on-delhomework', item) this.$emit('on-delhomework', item)
} }
},
mounted() {
this.userInfo = useUserStore().user
} }
} }
</script> </script>

View File

@ -4,13 +4,8 @@
<div class="page-right"> <div class="page-right">
<div class="header-top flex"> <div class="header-top flex">
<div class="textbook-img"> <div class="textbook-img">
<el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf" /> <el-image style="width: 80px; height: 110px" :src="curBookImg" @click="navtoPdf"/>
<el-progress <el-progress v-if="downloadNum>0 && downloadNum < 100" style="position:absolute;left: 0;z-index: 999;" type="circle" :percentage="downloadNum" />
v-if="downloadNum > 0 && downloadNum < 100"
style="position: absolute; left: 0; z-index: 999"
type="circle"
:percentage="downloadNum"
/>
</div> </div>
<div class="top-item"> <div class="top-item">
<el-button class="btn" @click="handleOutLink('standard')">课标研读</el-button> <el-button class="btn" @click="handleOutLink('standard')">课标研读</el-button>
@ -18,12 +13,7 @@
<el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button> <el-button class="btn" @click="handleOutLink('gk')">高考研读</el-button>
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button> <el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
</div> </div>
<el-button <el-button :type="!curClassReserv.id?'info' : 'primary'" :disabled="!curClassReserv.id" class="to-class-btn" @click="openLesson">
:type="!curClassReserv.id ? 'info' : 'primary'"
:disabled="!curClassReserv.id"
class="to-class-btn"
@click="openLesson"
>
<label><i class="iconfont icon-lingdang"></i>上课</label> <label><i class="iconfont icon-lingdang"></i>上课</label>
<label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label> <label>{{ curClassReserv.classDay }} {{ getWeekday1(curClassReserv.classDay) }}</label>
<label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label> <label>{{ curClassReserv.startTime }}-{{ curClassReserv.endTime }}</label>
@ -36,13 +26,7 @@
<el-popover placement="top-start" :width="250" trigger="hover"> <el-popover placement="top-start" :width="250" trigger="hover">
<template #default> <template #default>
<div> <div>
<el-button <el-button v-if="lastAsyncAllTime" type="success" size="small" :icon="Check" circle />
v-if="lastAsyncAllTime"
type="success"
size="small"
:icon="Check"
circle
/>
{{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }} {{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }}
</div> </div>
</template> </template>
@ -60,67 +44,26 @@
<el-button @click="handleOutLink('feedback')">作业反馈</el-button> <el-button @click="handleOutLink('feedback')">作业反馈</el-button>
<el-button @click="handleOutLink('homeWork')">布置作业</el-button> <el-button @click="handleOutLink('homeWork')">布置作业</el-button>
<el-button @click="isDialogOpen = true">上传资料</el-button> <el-button @click="isDialogOpen = true">上传资料</el-button>
<el-button type="primary" style="margin-left: 10px" @click="createFile" <el-button type="primary" style="margin-left: 10px" @click="createFile">新建课件</el-button>
>新建课件</el-button
>
</div> </div>
</div> </div>
<el-checkbox-group <el-checkbox-group v-model="checkFileList" class="prepare-body-main"
v-model="checkFileList" :style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }">
class="prepare-body-main" <file-list-item v-for="(item, index) in currentFileList" :key="index" :item="item" :index="index"
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }" @on-move="onMoveSingleFile" @on-delete="deleteTalk" @on-set="openSet" @on-delhomework="delhomework">
> <el-checkbox label="" :value="item" v-if="!item.uniquekey" />
<file-list-item
v-for="(item, index) in currentFileList"
:key="index"
:item="item"
:index="index"
@on-move="onMoveSingleFile"
@on-delete="deleteTalk"
@on-set="openSet"
@on-delhomework="delhomework"
>
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
</file-list-item>
<file-list-item
v-for="(item, index) in currentWorkList"
:key="index"
:item="item"
:index="index"
@on-move="onMoveSingleFile"
@on-delete="deleteTalk"
@on-set="openSet"
@on-delhomework="delhomework"
>
<el-checkbox v-if="!item.uniquekey" label="" :value="item" />
</file-list-item> </file-list-item>
</el-checkbox-group> </el-checkbox-group>
<file-oper-batch <file-oper-batch v-show="checkFileList.length > 0"
v-show="checkFileList.length > 0"
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length" :indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length"
:choose="checkFileList" :choose="checkFileList" :check-all="isCheckAll" @click-delete="clickDelete" @click-move="clickMove"
:check-all="isCheckAll" @cancel="checkFileList = []" @click-choose="clickChoose"></file-oper-batch>
@click-delete="clickDelete"
@click-move="clickMove"
@cancel="checkFileList = []"
@click-choose="clickChoose"
></file-oper-batch>
</div> </div>
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" /> <MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" /> <uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
<SetHomework <SetHomework v-model="setDialog" :entpcourseid="entpcourseid" :row="row" @on-close="closeHomework" />
v-model="setDialog"
:entpcourseid="entpcourseid"
:row="row"
@on-close="closeHomework"
/>
</div> </div>
<reserv <reserv ref="reservDialog" @add-success="initReserv" :current-node="currentNode" :book-id="uploadData.textbookId"></reserv>
ref="reservDialog"
:current-node="currentNode"
:book-id="uploadData.textbookId"
@add-success="initReserv"
></reserv>
</template> </template>
<script setup> <script setup>
import { Check } from '@element-plus/icons-vue' import { Check } from '@element-plus/icons-vue'
@ -175,7 +118,6 @@ export default {
fileList: [], fileList: [],
currentNode: {}, currentNode: {},
currentFileList: [], currentFileList: [],
currentWorkList: [],
curBookPath: '', curBookPath: '',
curClassReserv: {}, curClassReserv: {},
downloadNum: 0, downloadNum: 0,
@ -223,12 +165,9 @@ export default {
this.initReserv() this.initReserv()
}, },
mounted() { mounted() {
this.$watch( this.$watch(()=>toolStore.isToolWin,(newD, oldD)=>{
() => toolStore.isToolWin, setTimeout(this.initReserv, 500)
(newD, oldD) => { })
setTimeout(this.initReserv, 500)
}
)
}, },
// activated() { // activated() {
// if (this.uploadData.textbookId !== null) { // if (this.uploadData.textbookId !== null) {
@ -245,7 +184,7 @@ export default {
}) })
if (list.length > 0) { if (list.length > 0) {
this.curClassReserv = list[list.length - 1] this.curClassReserv = list[list.length - 1]
} else { }else {
this.curClassReserv = {} this.curClassReserv = {}
} }
}) })
@ -254,7 +193,7 @@ export default {
let fileName = this.curBookPath let fileName = this.curBookPath
if (!fileName) return if (!fileName) return
fileName = fileName.replace('.txt', '.pdf') fileName = fileName.replace('.txt', '.pdf')
return new Promise((resolve, reject) => { return new Promise((resolve, reject)=>{
const userDataPath = Remote.app.getPath('userData') const userDataPath = Remote.app.getPath('userData')
const appRootFilePath = userDataPath + '\\selfFile\\' const appRootFilePath = userDataPath + '\\selfFile\\'
let filePath = appRootFilePath + fileName let filePath = appRootFilePath + fileName
@ -417,10 +356,11 @@ export default {
this.uploadData.levelThirdId = cata[2] this.uploadData.levelThirdId = cata[2]
this.uploadData.textbookId = data.textBook.curBookId this.uploadData.textbookId = data.textBook.curBookId
const toolStore = useToolState() const toolStore = useToolState()
toolStore.curSubjectNode.data = data toolStore.curSubjectNode.data = data
toolStore.curSubjectNode.querySearch = this.uploadData toolStore.curSubjectNode.querySearch = this.uploadData
this.initHomeWork() this.initHomeWork()
await this.asyncAllFile() await this.asyncAllFile()
}, },
async initHomeWork() { async initHomeWork() {
if (this.timerId) { if (this.timerId) {
@ -431,10 +371,11 @@ export default {
let { rows } = await this.getChapterId() let { rows } = await this.getChapterId()
if (rows.length > 0) { if (rows.length > 0) {
this.entpcourseid = rows[0].id this.entpcourseid = rows[0].id
} else { }
await this.createEntpcourse() else{
let { rows } = await this.getChapterId() await this.createEntpcourse()
this.entpcourseid = rows[0].id let { rows } = await this.getChapterId()
this.entpcourseid = rows[0].id
} }
// //
@ -444,26 +385,26 @@ export default {
// entpcourse // entpcourse
createEntpcourse() { createEntpcourse() {
// web AIx // web AIx
var cform = {} var cform = {};
cform.entpid = this.userStore.deptId cform.entpid = this.userStore.deptId;
cform.level = 1 cform.level = 1;
cform.parentid = 0 cform.parentid = 0;
cform.dictid = 0 cform.dictid = 0;
cform.evalid = this.currentNode.id cform.evalid = this.currentNode.id;
cform.evalparentid = 0 cform.evalparentid = 0;
cform.edusubject = this.currentNode.edusubject cform.edusubject = this.currentNode.edusubject;
cform.edudegree = this.currentNode.edudegree cform.edudegree = this.currentNode.edudegree;
cform.edustage = this.currentNode.edustage cform.edustage = this.currentNode.edustage;
cform.coursetype = '课标学科' cform.coursetype = '课标学科';
cform.coursetitle = this.currentNode.itemtitle cform.coursetitle = this.currentNode.itemtitle;
cform.coursedesc = '' cform.coursedesc = '';
cform.status = '' cform.status = '';
cform.dflag = 0 cform.dflag = 0;
cform.edituserid = this.userStore.userId cform.edituserid = this.userStore.userId;
cform.createblankfile = 'yes' cform.createblankfile = 'yes';
return addEntpcourse(cform) return addEntpcourse(cform)
}, },
openReserv() { openReserv(){
this.$refs['reservDialog'].openDialog() this.$refs['reservDialog'].openDialog()
}, },
// //
@ -483,7 +424,7 @@ export default {
}, },
// ID ID // ID ID
getChapterId() { getChapterId() {
console.log(this.userStore, 'this.userStore') console.log(this.userStore,'this.userStore')
return listEntpcourse({ return listEntpcourse({
evalid: this.uploadData.levelSecondId, evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId, edituserid: this.userStore.userId,
@ -559,7 +500,7 @@ export default {
// //
let ary = uniqBy([...this.currentFileList, ...list], 'id') let ary = uniqBy([...this.currentFileList, ...list], 'id')
// //
this.currentWorkList = cloneDeep(ary) this.currentFileList = cloneDeep(ary)
}) })
}, },
getWeekday1(date) { getWeekday1(date) {
@ -575,16 +516,14 @@ export default {
// //
delhomework(item) { delhomework(item) {
this.isLoading = true this.isLoading = true
delClasswork(item.id) delClasswork(item.id).then(async res => {
.then(async (res) => { ElMessage.success('操作成功')
ElMessage.success('操作成功') this.isLoading = false
this.isLoading = false await this.asyncAllFile()
await this.asyncAllFile() this.getHomeWorkList()
this.getHomeWorkList() }).catch(() => {
}) this.isLoading = false
.catch(() => { })
this.isLoading = false
})
}, },
closeHomework() { closeHomework() {
this.setDialog = false this.setDialog = false
@ -603,15 +542,7 @@ export default {
const toolStore = useToolState() const toolStore = useToolState()
if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作') if (toolStore.isToolWin) return this.$message.error('您当前已开始上课,请勿重复操作')
startClass(this.curClassReserv.id) startClass(this.curClassReserv.id)
createWindow('tool-sphere', { createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + this.entpcourseid +'&label=' + this.currentNode.label+ "&reservId=" + this.curClassReserv.id })
url:
'/tool/sphere?entpcourseid=' +
this.entpcourseid +
'&label=' +
this.currentNode.label +
'&reservId=' +
this.curClassReserv.id
})
} }
} }
} }
@ -691,7 +622,7 @@ export default {
cursor: pointer; cursor: pointer;
} }
:deep(.el-progress-circle) { :deep(.el-progress-circle) {
width: 90px !important; width: 90px!important;
background-color: white; background-color: white;
} }
} }