123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- import { defineStore } from 'pinia';
- import { store } from '@/store';
- export const usePrepareStore = defineStore('prepare-lessons-store', {
- state: () => ({
- subjectId: null as any, // 基础声部
- baseCourseware: {} as any, // 基础教学课件
- selectKey: '', // 选的哪一节课
- lessonCoursewareId: '', // 哪个教材分类
- subjectList: [] as any, // 教材带的声部列表
- lessonCoursewareDetailId: '', // 哪个教材详情
- treeList: [] as any[], // 左边教学课件列表
- coursewareList: [] as any[], // 课件信息
- trainList: [] as any[], // 训练信息
- tabType: 'courseware', // 备课 - 课件 | 训练 类型切换 'courseware' | 'train'
- selectMusicStatus: false, // 乐谱状态
- selectResourceStatus: false, // 资源状态
- isAddResource: false, // 是否添加资源
- isEditResource: false, // 是否编辑资源
- iseditTrain: false, // 是否编辑训练,
- isAddTrain: false, // 是否添加训练,
- classGroupId: null as any // 班级编号
- }),
- getters: {
- /** 获取资源状态 */
- getSubjectId(): [string, number] {
- return this.subjectId;
- },
- /** 获取基础教学课件 */
- getBaseCourseware(): any {
- return this.baseCourseware;
- },
- /** 获取选择课的编号 */
- getSelectKey(): string {
- return this.selectKey;
- },
- /** 获取教材编号 */
- getLessonCoursewareId(): string {
- return this.lessonCoursewareId;
- },
- /** 获取分类编号 */
- getLessonCoursewareDetailId(): string {
- return this.lessonCoursewareDetailId;
- },
- /** 获取树形控件 */
- getTreeList(): any[] {
- return this.treeList;
- },
- /** 获取课件列表 */
- getCoursewareList(): any[] {
- return this.coursewareList;
- },
- /** 获取训练列表 */
- getTrainList(): any[] {
- return this.trainList;
- },
- /** 获取课件类型 */
- getTabType(): string {
- return this.tabType;
- },
- /** 获取乐谱状态 */
- getSelectMusicStatus(): boolean {
- return this.selectMusicStatus;
- },
- /** 获取资源状态 */
- getSelectResourceStatus(): boolean {
- return this.selectResourceStatus;
- },
- /** 获取是否添加资源 */
- getIsAddResource(): boolean {
- return this.isAddResource;
- },
- /** 获取是否修改资源 */
- getIsEditResource(): boolean {
- return this.isEditResource;
- },
- /** 获取是否修改训练 */
- getIsEditTrain(): boolean {
- return this.iseditTrain;
- },
- /** 获取是否添加训练 */
- getIsAddTrain(): boolean {
- return this.isAddTrain;
- },
- /** 获取声部列表 */
- getSubjectList(): any {
- return this.subjectList;
- },
- /** 获取班级编号 */
- getClassGroupId(): string | number {
- return this.classGroupId;
- }
- },
- actions: {
- /** 设置基础声部 */
- setSubjectId(subjectId: string | number) {
- this.subjectId = subjectId;
- },
- /** 设置基础教学课件 */
- setBaseCourseware(baseCourseware: any) {
- this.baseCourseware = baseCourseware;
- },
- /** 设置课的编号 */
- setSelectKey(key: string) {
- this.selectKey = key;
- },
- /** 设置教材的编号 */
- setLessonCoursewareId(id: string) {
- this.lessonCoursewareId = id;
- },
- /** 设置分类的编号 */
- setLessonCoursewareDetailId(id: string) {
- this.lessonCoursewareDetailId = id;
- },
- /** 设置课的编号 */
- setTreeList(list: any[]) {
- this.treeList = list;
- },
- /** 设置课件列表 */
- setCoursewareList(list: any[]) {
- this.coursewareList = list;
- },
- /** 设置训练列表 */
- setTrainList(list: any[]) {
- this.trainList = list;
- },
- /** 设置tab类型 */
- setTabType(type: string) {
- this.tabType = type;
- },
- /** 设置乐谱状态 */
- setSelectMusicStatus(status: boolean) {
- this.selectMusicStatus = status;
- },
- /** 设置资源状态 */
- setSelectResourceStatus(status: boolean) {
- this.selectResourceStatus = status;
- },
- /** 设置资源状态 */
- setIsAddResource(status: boolean) {
- this.isAddResource = status;
- },
- /** 设置训练状态 */
- setIsAddTrain(status: boolean) {
- this.isAddTrain = status;
- },
- /** 设置资源状态 */
- setIsEditResource(status: boolean) {
- this.isEditResource = status;
- },
- /** 设置训练状态 */
- setIsEditTrain(status: boolean) {
- this.iseditTrain = status;
- },
- /** 设置声部列表 */
- setSubjectList(subjects: any): any {
- this.subjectList = subjects;
- },
- /** 设置班级编号 */
- setClassGroupId(id: string | number): any {
- this.classGroupId = id;
- }
- }
- });
- // Need to be used outside the setup
- export function usePrepareLessonsStoreWidthOut() {
- return usePrepareStore(store);
- }
|