Compare commits

..

No commits in common. "15b9f388108cf7c1e5fe57cf28692b7a8a696e7b" and "e43573bae2fa77520ce0ba2645d28bd929b232ee" have entirely different histories.

7 changed files with 32 additions and 32 deletions

View File

@ -55,28 +55,26 @@ export class PPTApi {
// 变量
static isUpdate = true // 是否更新数据
// 获取所有幻灯片列表 isUpdate为true不更新
static getSlideList(parentid: (Number | String),isUpdate?:Boolean): Promise<Boolean> {
// 获取所有幻灯片列表
static getSlideList(parentid: (Number | String)): Promise<Boolean> {
return new Promise(async (resolve, reject) => {
const params: object = { parentid, orderByColumn: 'fileidx', isAsc: 'asc', pageSize: 9999 }
const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params)
if (res.code === 200) {
if(!isUpdate){
const slides = (res.rows || []).map(o => {
if (!!o.datacontent) {
const json = JSON.parse(o.datacontent)
!!json && (json.id = o.id)
return json
}
// 如果没有数据,默认空白页
return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}}
})
// slidesStore.updateSlideIndex(0) // 下标0 为第一页
slidesStore.setSlides(slides) // 写入数据
}
if (res.code === 200) {
const slides = (res.rows || []).map(o => {
if (!!o.datacontent) {
const json = JSON.parse(o.datacontent)
!!json && (json.id = o.id)
return json
}
// 如果没有数据,默认空白页
return {id: o.id,elements:[],background:{type:"solid",color:"#fff"}}
})
// 活动列表处理
const workList = (res.rows || []).map(o => o.activityContent)
const workItem = res.rows ? [...res.rows] : []
const workItem = [...res.rows]
// slidesStore.updateSlideIndex(0) // 下标0 为第一页
slidesStore.setSlides(slides) // 写入数据
// 写入作业列表数据
slidesStore.setWorkList(workList)
// 获取所有的pptlist的数据
@ -113,6 +111,7 @@ export class PPTApi {
data.id = rid
slidesStore.updateSlide(data)
// msgUtils.msgSuccess('新增成功')
PPTApi.getSlideList(resource.id)
this.isUpdate = false // 新增后会触发监听,不再更新数据
resolve(true)
} else msgUtils.msgError('新增失败');resolve(false)
@ -135,9 +134,7 @@ export class PPTApi {
const isAdd = !/^\d+$/.test(currentSlide.id) // 是否新增
if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
const bool = await this.addSlide(currentSlide)
bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序
const resource = sessionStore.get('curr.resource')||{}
await PPTApi.getSlideList(resource.id)
bool && this.batchUpdateSlides(newData, true) // 批量更新-排序
} else { // 防抖-更新
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
const params = {

View File

@ -145,16 +145,21 @@ export const useSlidesStore = defineStore('slides', {
setWorkItem(list: Object[]) {
this.workItem = list
},
addWorkItem(data: any) {
const id = data?.id
if (!id) return
this.workItem.splice(this.slideIndex + 1, 0, data)
this.slideIndex += 1
},
addSlide(slide: Slide | Slide[]) {
const slides = Array.isArray(slide) ? slide : [slide]
for (const slide of slides) {
if (slide.sectionTag) delete slide.sectionTag
}
// const addIndex = this.slideIndex + 1
this.slides.splice(this.slideIndex, 0, ...slides)
// this.slideIndex = addIndex
},
updateSlide(props: Partial<Slide>, slideId?: string) {
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex
this.slides[slideIndex] = { ...this.slides[slideIndex], ...props }

View File

@ -302,9 +302,9 @@ const getData = async (data: WorkItem) => {
dialogVisible.value = false
}
const upDateData = async () => {
// await PPTApi.updateSlide(paramData.value)
loadingActive.value = true
await PPTApi.updateSlide(paramData.value)
// await updateEntpcoursefileNew(paramData.value)
await updateEntpcoursefileNew(paramData.value)
const resource = sessionStore.get('curr.resource')
await PPTApi.getSlideList(resource.id)
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })

View File

@ -5,7 +5,7 @@
<el-popover ref="popoverRef" placement="right" trigger="hover" popper-class="popoverStyle" :tabindex="999" >
<template #reference>
<div class="user-info">
<el-image class="user-img" :src="userStore.user.avatar ==='/img/avatar-default.jpg' ? defaultUserImg : dev_api + userStore.user.avatar" />
<el-image class="user-img" :src="dev_api + userStore.user.avatar" />
<span>{{ userStore.user.nickName }}</span>
</div>
</template>
@ -59,7 +59,6 @@ import { ElMessageBox, ElMessage } from 'element-plus'
import useUserStore from '@/store/modules/user'
import { sessionStore } from '@/utils/store'
import pkc from "../../../../../package.json"
import defaultUserImg from '@/assets/images/img-avatar.png'
const { ipcRenderer } = window.electron || {}

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>
<!--裁剪完的图片-->
@ -164,7 +164,7 @@ export default {
//
onMounted(() => {
if (props.filePath) {
dataFile.image.src = props.filePath;
dataFile.image.src = dev_api.value + props.filePath;
copper();
}
});

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
@ -23,7 +23,6 @@ import { uploadAvatar } from '@/api/system/user'
import useUserStore from '@/store/modules/user'
import { ElMessage } from 'element-plus'
import CropperImage from './cropperImage.vue'
import defaultUserImg from '@/assets/images/img-avatar.png'
const userStore = useUserStore()
@ -33,7 +32,7 @@ const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
//
const options = reactive({
img: userStore.user.avatar ==='/img/avatar-default.jpg' ? defaultUserImg : dev_api + userStore.user.avatar, //
img: userStore.user.avatar, //
autoCrop: true, //
autoCropWidth: 400, //
autoCropHeight: 400, //

View File

@ -8,7 +8,7 @@
</el-form-item>
<el-form-item label="所属学校" prop="identity">
<div style="display: flex;">
<div>{{ userStore.DeptInfo.register ? userStore.DeptInfo.register.schoolName : '' }}</div>
<div>{{ userStore.DeptInfo.register.schoolName }}</div>
<div>
<el-button type="primary" link>更改学校</el-button>
</div>