Kaynağa Gözat

修改参数

lex-xin 3 yıl önce
ebeveyn
işleme
3dd1182ff5

+ 3 - 4
package-lock.json

@@ -7152,10 +7152,9 @@
       }
     },
     "lodash": {
-      "version": "4.17.15",
-      "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz",
-      "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=",
-      "dev": true
+      "version": "4.17.21",
+      "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz?cache=0&sync_timestamp=1613835817439&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.21.tgz",
+      "integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw="
     },
     "lodash.defaultsdeep": {
       "version": "4.6.1",

+ 1 - 0
package.json

@@ -18,6 +18,7 @@
     "es6-promise": "^4.2.8",
     "install": "^0.13.0",
     "js-storage": "^1.1.0",
+    "lodash": "^4.17.21",
     "moment": "^2.29.1",
     "qs": "^6.8.0",
     "vant": "^2.5.4",

+ 2 - 2
src/main.js

@@ -9,14 +9,14 @@ import { Button, Icon, Tag, Swipe, SwipeItem, Popup, Picker,
     Collapse, CollapseItem, Tab, Tabs, Row, Col, Cell, CellGroup,
     Circle, Field, DatetimePicker, Image, Loading,
     ActionSheet, RadioGroup, Radio, Checkbox, CheckboxGroup,
-    CountDown, Panel, Dialog, Sticky, Rate, Switch, ImagePreview} from 'vant'
+    CountDown, Panel, Dialog, Sticky, Rate, Switch, ImagePreview, NoticeBar} from 'vant'
 Vue.use(Button).use(Icon).use(Tag).use(Swipe).use(SwipeItem)
    .use(Popup).use(Picker).use(DropdownMenu).use(DropdownItem).use(Search)
    .use(PullRefresh).use(Toast).use(List).use(Collapse).use(CollapseItem)
    .use(Tab).use(Tabs).use(Row).use(Col).use(Cell).use(CellGroup)
    .use(Circle).use(Field).use(DatetimePicker).use(Image).use(Loading)
    .use(ActionSheet).use(RadioGroup).use(Radio).use(Checkbox).use(CheckboxGroup)
-   .use(CountDown).use(Panel).use(Dialog).use(Sticky).use(Rate).use(Switch).use(ImagePreview)
+   .use(CountDown).use(Panel).use(Dialog).use(Sticky).use(Rate).use(Switch).use(ImagePreview).use(NoticeBar)
 Vue.config.productionTip = false
 
 // import Vconsole from 'vconsole'

+ 19 - 8
src/views/audition/ArrangeWork.vue

@@ -12,14 +12,16 @@
         <van-field rows="8" v-model="content" type="textarea" placeholder="请输入(1-600字)" />
       </div>
     </div>
-    <van-cell class="endTime" title="作业提交截止时间" @click="onEndTime" readonly placeholder="请选择截止时间" >
+    <van-cell class="endTime" title="作业提交截止时间" @click="onEndTime" is-link readonly placeholder="请选择截止时间" >
       <template #default>
-        {{ dateSection.showStartDate }} <span class="arrowDown"></span>
+        {{ dateSection.showStartDate }}
+         <!-- <span class="arrowDown"></span> -->
       </template>
     </van-cell>
-    <van-cell class="endTime" title="作业曲目" @click="onEndTime" readonly placeholder="请选择作业曲目" >
+    <van-cell class="endTime" v-if="memberNum" title="作业曲目" @click="accompanimentStatus = true" readonly is-link placeholder="请选择作业曲目" >
       <template #default>
-        {{ dateSection.showStartDate }} <span class="arrowDown"></span>
+        {{ dateSection.musicScoreName }}
+         <!-- <span class="arrowDown"></span> -->
       </template>
     </van-cell>
     <div class="button-group">
@@ -39,8 +41,8 @@
       />
     </van-popup>
 
-    <van-popup position="bottom" v-model="accompanimentStatus" style="height: 100%; border-radius: 0; ">
-      <accompaniment-modal />
+    <van-popup position="bottom" v-model="accompanimentStatus"  :style="{ height: '100%' }" style=" border-radius: 0; overflow: inherit;">
+      <accompaniment-modal @onSelectMusic="onSelectMusic" />
     </van-popup>
   </div>
 </template>
@@ -56,19 +58,23 @@ export default {
   data() {
     let tempDate = new Date() // 默认显示T+3
     tempDate.setDate(tempDate.getDate() + 3)
+    let query = this.$route.query
     return {
       that: this,
+      memberNum: query.memberNum,
       headerStatus: true,
       dateSection: {
         status: false,
         minDate: new Date(),
         maxDate: new Date(2025, 10, 1),
         currentDate: tempDate,
-        showStartDate: dayjs(tempDate).format("YYYY年MM月DD日")
+        showStartDate: dayjs(tempDate).format("YYYY年MM月DD日"),
+        musicScoreId: null,
+        musicScoreName: null,
       },
       content: null, // 课程编号
       expiryDate: null, // 作业截止日期
-      accompanimentStatus: true, // 伴奏弹窗
+      accompanimentStatus: false, // 伴奏弹窗
     };
   },
   mounted() {
@@ -94,6 +100,11 @@ export default {
       }
       return val
     },
+    onSelectMusic(value) {
+      this.dateSection.musicScoreName = value.examSongName
+      this.dateSection.musicScoreId = value.musicScoreId
+      this.accompanimentStatus = false
+    },
     confirmStartTime() {
       this.dateSection.showStartDate = dayjs(this.dateSection.currentDate).format("YYYY年MM月DD日")
       this.dateSection.status = false

+ 8 - 0
src/views/audition/CourseEvaluation.vue

@@ -175,6 +175,7 @@ export default {
       isInside: false,
       isAssignHomework: 0, // 是否有布置作业,0 => 否 1 => 是
       enableAssignHomework: 0, // 是否要布置作业  0 否  1 是
+      memberStatus: 0, // 是否有学生或者乐团是会员
     };
   },
   created() {
@@ -255,6 +256,11 @@ export default {
       if (result.code == 200) {
         this.isAssignHomework = result.data.isAssignHomework;
         this.enableAssignHomework = result.data.enableAssignHomework;
+        const courseViewType = result.data.courseViewType || 0;
+        const memberNum = result.data.memberNum || 0;
+        if(courseViewType > 0 || memberNum > 0) {
+          this.memberNum = 1
+        }
       } else {
         this.$toast(result.msg);
       }
@@ -335,6 +341,7 @@ export default {
               path: "/arrangeWork",
               query: {
                 courseId: this.courseId,
+                memberNum: this.memberNum
               },
             });
           })
@@ -346,6 +353,7 @@ export default {
           path: "/arrangeWork",
           query: {
             courseId: this.courseId,
+            memberNum: this.memberNum
           },
         });
       }

+ 190 - 34
src/views/audition/modal/accompanimentModal.vue

@@ -1,49 +1,183 @@
 <template>
     <div class="accompanimentModal">
-        <van-dropdown-menu class="cateDropDown">
-            <van-dropdown-item v-model="value1" :options="option1" />
-            <van-dropdown-item v-model="value2" :options="option2" />
-        </van-dropdown-menu>
-        <van-search
-            v-model="search"
-            show-action
-            placeholder="请输入搜索关键词"
-            @search="onSearch"
+        <van-sticky>
+            <van-dropdown-menu class="cateDropDown">
+                <van-dropdown-item v-model="levelId" :options="levelOptions" @change="levelChange" />
+                <van-dropdown-item v-model="subjectId" :options="subjectOptions" @change="subjectChange" />
+            </van-dropdown-menu>
+            <van-search
+                v-model="search"
+                show-action
+                placeholder="请输入搜索关键词"
+                shape="round"
             >
-            <template #label>
-                <van-dropdown-menu class="headDropDown">
-                    <van-dropdown-item v-model="value1" :options="option1" />
-                </van-dropdown-menu>
-            </template>
-            <template #action>
-                <div @click="onSearch">搜索</div>
-            </template>
-        </van-search>
+                <template #label>
+                    <van-dropdown-menu class="headDropDown">
+                        <van-dropdown-item v-model="typeId" :options="typeOptions" @change="typeChange" />
+                    </van-dropdown-menu>
+                </template>
+                <template #action>
+                    <div @click="onSearch">搜索</div>
+                </template>
+            </van-search>
+        </van-sticky>
+
+        <van-list
+            v-model="loading"
+            v-if="show"
+            key="data"
+            :finished="finished"
+            finished-text="没有更多数据了"
+            @load="FetchList"
+        >
+            <van-cell-group>
+                <van-cell
+                    v-for="(item, index) in list"
+                    :key="index"
+                    class="input-cell"
+                    clickable
+                    @click="onSelect(item)"
+                    :center="true"
+                >
+                    <template slot="icon">
+                        <van-icon class="iconMusic" :name="MusicIcon" />
+                    </template>
+                    <template slot="title">
+                        <!-- {{ item.examSongName }} -->
+                        <van-notice-bar
+                            background="none"
+                            color="#444"
+                            :scrollable="false"
+                            :text="item.examSongName"
+                        />
+                    </template>
+                </van-cell>
+            </van-cell-group>
+        </van-list>
+        <m-empty class="empty" v-else key="data" />
     </div>
 </template>
 
 <script>
+import { find } from 'lodash'
+import { sysMusicScoreCategoriesTree, queryPageLimit, querySubjectIds } from './api'
+import MusicIcon from './icons/music.png'
 export default {
     data() {
         return {
-            value1: 0,
-            value2: 'a',
-            option1: [
-                { text: '全部商品', value: 0 },
-                { text: '新款商品', value: 1 },
-                { text: '活动商品', value: 2 },
+            MusicIcon,
+            levelId: 0,
+            subjectId: 0,
+            levelOptions: [
+                // { text: '全部等级', value: 0 },
             ],
-            option2: [
-                { text: '默认排序', value: 'a' },
-                { text: '好评排序', value: 'b' },
-                { text: '销量排序', value: 'c' },
+            subjectOptions: [
+                { text: '全部声部', value: 0 }
             ],
+            typeId: 0,
+            typeOptions: [],
             search: null,
+            loading: false,
+            finished: false,
+            show: true,
+            params: {
+                page: 1,
+                rows: 20,
+            },
+            list: []
         }
     },
+    async mounted() {
+        this.FetchLevel()
+    },
     methods: {
+        async FetchLevel() {
+            try {
+                const res = await sysMusicScoreCategoriesTree({ parentId: 1 })
+                // console.log(res)
+                this.levelOptions = [...res.data.map((item) => ({value: item.id, text: item.name, childs: item.sysMusicScoreCategoriesList}))]
+                if (this.levelOptions.length && !this.levelId) {
+                    // console.log(this.levelOptions)
+                    this.levelId = this.levelOptions[0].value
+                    const active = find(this.levelOptions, {value: this.levelId})
+                    if (active) {
+                        if (active.childs) {
+                            this.typeOptions = [{value: 0, text: '全部练习'}, ...active.childs.map((item) => ({value: item.id, text: item.name}))]
+                        } else {
+                            this.typeOptions = null
+                        }
+                    }
+                }
+            } catch(error) {
+                //
+            }
+        },
+        async FetchCats() {
+            try {
+                const res = await querySubjectIds()
+                this.subjectOptions = [...this.subjectOptions, ...res.data.filter((item) => !!item).map((item) => ({value: item.id, text: item.name}))]
+            } catch (error) {
+                //
+            }
+        },
+        async FetchList() {
+            if (this.subjectOptions.length === 1) {
+                await this.FetchCats()
+            }
+            try {
+                let params = this.params
+                const res = await queryPageLimit({
+                    ...params,
+                    clientType: 'SMART_PRACTICE',
+                    subjectId: this.subjectId === 0 ? undefined : this.subjectId,
+                    categoriesId: (this.levelId || this.typeId) === 0 ? undefined : this.typeId || this.levelId,
+                    search: this.search
+                })
+                this.loading = false;
+                const { data } = res
+                this.list = [...this.list, ...data.rows]
+                if(params.page >= Math.ceil(data.totalPage)) {
+                    this.finished = true
+                    // Toast('列表加载完成')
+                }
+                this.params.page = data.nextPage
+                if(this.list.length <= 0) {
+                    this.show = false
+                }
+            } catch {
+                //
+            }
+        },
+        levelChange(val) {
+            this.levelId = val
+            this.typeId = 0
+            const active = find(this.levelOptions, {value: val})
+            if (active) {
+                if (active.childs) {
+                    this.typeOptions = [{value: 0, text: '全部练习'}, ...active.childs.map((item) => ({value: item.id, text: item.name}))]
+                } else {
+                    this.typeOptions = null
+                }
+            }
+            this.onSearch()
+        },
+        subjectChange(val) {
+            this.subjectId = val
+            this.onSearch()
+        },
+        typeChange(val) {
+            this.typeId = val
+            this.onSearch()
+        },
         onSearch() {
-
+            this.params.page = 1
+            this.list = []
+            this.show = true
+            this.finished = false
+            this.FetchList()
+        },
+        onSelect(item) {
+            this.$emit('onSelectMusic', item)
         }
     }
 }
@@ -51,17 +185,39 @@ export default {
 
 <style lang="less" scoped>
 .accompanimentModal {
-    /deep/.van-cell {
-        font-size: 0.14rem;
-        padding: 0.05rem 0.08rem;
-        line-height: 0.24rem;
+    background-color: #f5f5f5;
+    min-height: 100vh;
+    /deep/.van-search {
+        .van-cell {
+            font-size: 0.14rem;
+            padding: 0.05rem 0.08rem;
+            line-height: 0.24rem;
+        }
     }
 
     .headDropDown {
         height: .36rem;
         background: transparent;
-        .van-dropdown-menu {
+        /deep/.van-dropdown-menu__title {
+            font-size: .14rem;
+        }
+    }
+    /deep/.van-field__control {
+        font-size: .14rem;
+    }
+    /deep/.van-dropdown-item .van-cell {
+        padding: 0.12rem 0.16rem;
+    }
+
+    .iconMusic {
+        /deep/.van-icon__image {
+            width: .38rem;
+            height: .38rem;
+            margin: auto;
+            vertical-align: middle;
+            // padding-right: .1rem;
         }
     }
+
 }
 </style>

+ 27 - 0
src/views/audition/modal/api.js

@@ -0,0 +1,27 @@
+const api = '/api-teacher'
+import request from '@/helpers/request'
+// 树状列表
+export const sysMusicScoreCategoriesTree = (data) => {
+  return request({
+      url: '/sysMusicScoreCategories/queryTree',
+      method: 'get',
+      params: data
+  })
+}
+
+export const queryPageLimit = (data) => {
+    return request({
+        url: '/sysMusicScoreAccompaniment/queryPageLimit',
+        method: 'get',
+        hideLoading: true,
+        params: data
+    })
+}
+
+export const querySubjectIds = (data) => {
+    return request({
+        url: '/sysMusicScoreAccompaniment/querySubjectIds',
+        method: 'get',
+        params: data
+    })
+}

BIN
src/views/audition/modal/icons/music.png