12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <template>
- <view>
- <template v-if="courseHandoutsData.handoutsId">
- <u-search
- v-if="isShowSearch"
- placeholder="搜索讲义名称"
- bg-color="#ffffff"
- margin="0 0 20rpx"
- v-model="fileName"
- @custom="search"
- @search="search"
- ></u-search>
- <view
- class="handouts-box"
- v-for="item in courseHandoutsData.fileList"
- :key="item.fileId"
- >
- <handouts-tree
- :canDownload="courseHandoutsData.canDownload"
- :isShowDownIcon="isShowDownIcon"
- :fileInfo="item"
- ></handouts-tree>
- </view>
- </template>
- <view v-else style="text-align: center">暂无讲义</view>
- </view>
- </template>
- <script>
- import handoutsTree from "@/components/course/handoutsTree.vue";
- export default {
- name: "HandoutsBox",
- props: {
- handoutsId: {
- type: Number,
- },
- isShowSearch: {
- type: Boolean,
- default: true,
- },
- isShowDownIcon: {
- type: Boolean,
- default: true,
- },
- },
- data() {
- return {
- fileName: "",
- courseHandoutsData: {},
- };
- },
- mounted() {
- this.courseHandouts();
- },
- methods: {
- search(val) {
- this.courseHandouts();
- },
- courseHandouts() {
- this.$api
- .courseHandouts({
- handoutsId: this.handoutsId,
- fileName: this.fileName,
- })
- .then((res) => {
- this.courseHandoutsData = res.data.data;
- });
- },
- },
- components: {
- handoutsTree,
- },
- };
- </script>
- <style lang="scss" scoped>
- .handouts-box {
- border-radius: 20rpx;
- background: #ffffff;
- margin-bottom: 20rpx;
- }
- </style>
|