lex-xin %!s(int64=3) %!d(string=hai) anos
pai
achega
c398511200

+ 2 - 2
src/utils/validate.js

@@ -29,11 +29,11 @@ export function vaildStudentUrl() {
   if (/online/.test(url)) { //线上
     returnUrl = 'https://mstuonline.dayaedu.com'
   } else if (/dev/.test(url)) { // dev 环境
-    returnUrl = 'https://mstudev.dayaedu.com'
+    returnUrl = 'http://mstudev.dayaedu.com'
   } else if (/test/.test(url)) { // dev 环境
     returnUrl = 'http://mstutest.dayaedu.com'
   } else { // 默认dev环境
-    returnUrl = 'https://mstutest.dayaedu.com'
+    returnUrl = 'http://mstudev.dayaedu.com'
   }
   return returnUrl
 }

+ 2 - 2
src/views/accompaniment/api.js

@@ -57,12 +57,12 @@ export const Del = id => {
   })
 }
 
-export const queryTree = () => {
+export const queryTree = (data) => {
   return request({
     url: '/api-web/sysMusicScoreCategories/queryTree',
     method: 'get',
     data: {},
-    params: {},
+    params: data,
     requestType: 'form'
   })
 }

+ 24 - 66
src/views/teachManager/index.vue

@@ -26,8 +26,6 @@
             class="multiple"
             v-model.trim="searchForm.organId"
             filterable
-            multiple
-            collapse-tags
             clearable
             placeholder="请选择分部"
           >
@@ -56,7 +54,7 @@
       </save-form>
       <div class="btnList">
         <auth auths="sysMusicScoreCategories/save">
-          <el-button type="primary" @click="addTeachClass">新增教材</el-button>
+          <el-button type="primary" @click="operationTeachClass('create')">新增教材</el-button>
         </auth>
       </div>
       <div class="tableWrap">
@@ -64,25 +62,30 @@
           style="width: 100%"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
-          :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+          row-key="id"
+          :tree-props="{children: 'sysMusicScoreCategoriesList', hasChildren: 'hasChildren'}"
         >
-          <el-table-column
+          <!-- <el-table-column
             align="center"
             prop="id"
             label="教材编号"
-          ></el-table-column>
+          ></el-table-column> -->
           <el-table-column
-            align="center"
+            align="left"
             prop="name"
             label="教材名称"
-          ></el-table-column>
-          <el-table-column align="center" prop="organNames" label="可见分部">
+          >
+            <template slot-scope="scope">
+              {{ scope.row.name }}({{ scope.row.id }})
+            </template>
+          </el-table-column>
+          <!-- <el-table-column align="center" prop="organNames" label="可见分部">
             <template slot-scope="scope">
               <div>
                 <overflow-text :text="scope.row.organNames"></overflow-text>
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
             align="center"
             prop="musicScoreNum"
@@ -120,7 +123,7 @@
                 <auth auths="sysMusicScoreCategories/update">
                   <el-button
                     type="text"
-                    @click="resetTeach(scope.row)"
+                    @click="operationTeachClass('create', scope.row)"
                     v-if="!scope.row.enable"
                     >添加</el-button
                   >
@@ -128,7 +131,7 @@
                 <auth auths="sysMusicScoreCategories/update">
                   <el-button
                     type="text"
-                    @click="resetTeach(scope.row)"
+                    @click="operationTeachClass('update', scope.row)"
                     v-if="!scope.row.enable"
                     >修改</el-button
                   >
@@ -171,7 +174,7 @@
     </div>
 
     <el-dialog
-      title="新增教材"
+      :title="type == 'create' ? '新增教材' : '修改教材'"
       :visible.sync="teachClassVisible"
       width="600px"
       v-if="teachClassVisible"
@@ -180,43 +183,17 @@
         @close="teachClassVisible = false"
         @getList="getList"
         ref="teachClass"
+        :type="type"
         v-if="teachClassVisible"
         :activeRow="activeRow"
       />
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="teachClassVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submitAddClass">确 定</el-button>
-      </span>
     </el-dialog>
 
-
-    <el-dialog
-      title="新增教材"
-      :visible.sync="teachVisible"
-      width="600px"
-      v-if="teachVisible"
-    >
-      <addTeach
-        @close="teachVisible = false"
-        @getList="getList"
-        ref="addTeach"
-        v-if="teachVisible"
-        :activeRow="activeRow"
-      />
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="teachVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submitAdd">确 定</el-button>
-      </span>
-    </el-dialog>
   </div>
 </template>
 
 <script>
-import axios from "axios";
-import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
-import load from "@/utils/loading";
-import addTeach from "./modals/addTeach";
 import teachClass from "./modals/addRoot";
 import { queryTree } from '../accompaniment/api'
 import {
@@ -225,24 +202,21 @@ import {
   removeSysMusicScore,
 } from "./api";
 export default {
-  components: { pagination, addTeach, teachClass },
+  components: { pagination, teachClass },
   data() {
     return {
       searchForm: {
         search: null,
         enable: null,
+        organId: null,
       },
-
       tableList: [],
       organList: [],
-      teachVisible: false,
       activeRow: null,
+      type: 'create',
       teachClassVisible: false,
-      activeClassRow: null,
     };
   },
-  //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     // 获取分部
@@ -265,40 +239,24 @@ export default {
       try {
         const res = await queryTree({
           // organId:organId.join(','),
-         ...rest,
-          page: this.rules.page,
-          rows: this.rules.limit,
+         ...rest
         });
         console.log(res)
         this.tableList = res.data;
       } catch (e) {}
     },
     search() {
-      this.rules.page = 1;
       this.getList();
     },
     onReSet() {
       this.$refs.searchForm.resetFields();
       this.search();
     },
-    addTeachClass() {
-      this.activeRow = null;
+    operationTeachClass(type, row) {
+      this.type = type
+      this.activeRow = row || null;
       this.teachClassVisible = true;
     },
-    submitAddClass() {
-      this.$refs.teachClass.addSubmit();
-    },
-    addTeach() {
-      this.activeRow = null;
-      this.teachVisible = true;
-    },
-    submitAdd() {
-      this.$refs.addTeach.addSubmit();
-    },
-    resetTeach(row) {
-      this.activeRow = row;
-      this.teachVisible = true;
-    },
     async stopTeach(row) {
       let str = "";
       if (row.enable) {

+ 48 - 20
src/views/teachManager/modals/addRoot.vue

@@ -18,7 +18,7 @@
           },
         ]"
       >
-        <el-input v-model="form.name" style="width: 100%"></el-input>
+        <el-input v-model="form.name" placeholder="请输入教材名称" style="width: 100%"></el-input>
       </el-form-item>
       <el-form-item
         label="适用分部"
@@ -78,17 +78,21 @@
         label-width="120px"
       >
         <upload
-          class="uploadImg"
+          :class="[imageWidthM == 350 ? 'uploadImg' : 'uploadSmallImg']"
           v-model="form.coverImg"
-          :imageWidthM="350"
-          :imageHeightM="140"
+          :imageWidthM="imageWidthM"
+          :imageHeightM="imageHeightM"
           ref="uploadImg"
         ></upload>
         <p style="color: red">
-          请上传350*140像素,大小2M以内,格式为jpg、png、gif图片
+          请上传{{ imageWidthM }}*{{ imageHeightM }}像素,大小2M以内,格式为jpg、png、gif图片
         </p>
       </el-form-item>
     </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="$listeners.close()">取 消</el-button>
+      <el-button type="primary" @click="addSubmit">确 定</el-button>
+    </span>
   </div>
 </template>
 <script>
@@ -99,19 +103,21 @@ import {
   resetsysMusicScore,
 } from "../api";
 export default {
-  props: ["activeRow"],
+  props: ["type", "activeRow"],
   components: {
     Upload,
   },
   data() {
     return {
+      imageWidthM: 350,
+      imageHeightM: 140,
       form: {
         organId: [],
         name: null,
         coverImg: "",
         soundResource: null,
         sysMusicScoreCategoriesList: [],
-        delCategoriesIds: [],
+        // delCategoriesIds: [],
       },
       index: 0,
       treeProps: {
@@ -122,18 +128,29 @@ export default {
   },
   async mounted() {
     await this.$store.dispatch("setBranchs");
+    console.log(this.activeRow)
     if (this.activeRow?.id) {
-      try {
-        const res = await getSysMusicScoreDetail({ id: this.activeRow.id });
-        this.form.name = res.data.name;
-        this.form.organId = res.data.organId.split(",").map((item) => {
-          return Number(item);
-        });
-        this.form.coverImg = res.data.coverImg;
-        this.form.soundResource = res.data.soundResource;
-        this.form.sysMusicScoreCategoriesList =
+      // 判断是否是根元素处理
+      // if(this.activeRow?.parentId != 0) {
+        this.imageWidthM = 210
+        this.imageHeightM = 268
+      // }
+      console.log(this.type)
+      if(this.type == 'create') { // 添加一级分类或子级
+
+      } else if(this.type == 'update') { // 修改分类
+        try {
+          const res = await getSysMusicScoreDetail({ id: this.activeRow.id });
+          this.form.name = res.data.name;
+          this.form.organId = res.data.organId.split(",").map((item) => {
+            return Number(item);
+          });
+          this.form.coverImg = res.data.coverImg;
+          this.form.soundResource = res.data.soundResource;
+          this.form.sysMusicScoreCategoriesList =
           this.recursionDate(res.data.sysMusicScoreCategoriesList) || [];
-      } catch (e) {}
+        } catch (e) {}
+      }
     }
   },
   methods: {
@@ -166,14 +183,15 @@ export default {
     addSubmit() {
       this.$refs.form.validate(async (flag) => {
         if (flag) {
-          let { organId, delCategoriesIds, ...rest } = this.form;
+          let { organId, ...rest } = this.form;
+          let parentId = this.activeRow?.id || 0
           let obj = {
             ...rest,
+            parentId,
             organId: organId.join(","),
-            delCategoriesIds: delCategoriesIds.join(","),
           };
           try {
-            if (this.activeRow?.id) {
+            if (this.type == 'update') {
               obj.id = this.activeRow.id;
               await resetsysMusicScore(obj);
               this.$message.success("修改成功");
@@ -199,6 +217,10 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.dialog-footer {
+  display: block;
+  text-align: right;
+}
 .alert {
   margin-bottom: 20px;
 }
@@ -227,4 +249,10 @@ export default {
     height: 140px;
   }
 }
+.uploadSmallImg {
+  /deep/.avatar {
+    width: 105px;
+    height: 134px;
+  }
+}
 </style>

+ 5 - 2
src/views/teamBuild/signupList.vue

@@ -1528,9 +1528,12 @@ export default {
       // 生成报名二维码
       let id = this.id;
       this.codeStatus = true;
+      let tenantConfig = sessionStorage.getItem('tenantConfig')
+      tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {}
+      const tenantId = tenantConfig.tenantId || 0
       if (type == "payment") {
         this.codeTitle = "学员报名链接";
-        this.qrCodeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id;
+        this.qrCodeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id + '&tenantId=' + tenantId;
       } else if (type == "detail") {
         let teamName = this.$route.query.name;
         this.codeTitle = "报名缴费详情";
@@ -1543,7 +1546,7 @@ export default {
       } else if (type == "rePayment") {
         this.codeTitle = "学生报名链接(无乐器)";
         this.qrCodeUrl =
-          vaildStudentUrl() + "/#/login?musicGroupId=" + id + "&instrument=1";
+          vaildStudentUrl() + "/#/login?musicGroupId=" + id + '&tenantId=' + tenantId + "&instrument=1";
       }
     },
     onCreateQRCode2() {