课程资讯等修复

fixAuth
yujialong 2 years ago
parent 7a8e99ce49
commit a0fb8bbcb1
  1. 14
      src/views/course/contentSettings.vue
  2. 2
      src/views/information/addArticle/index.vue
  3. 16
      src/views/information/columnManage/index.vue
  4. 23
      src/views/information/contentManage/contentList.vue
  5. 43
      src/views/information/contentManage/index.vue
  6. 62
      src/views/information/list/index.vue
  7. 3
      src/views/theoreticalCourse/add/index.vue
  8. 23
      src/views/theoreticalCourse/contentSettings/index.vue
  9. 6
      src/views/theoreticalCourse/list/courseManagement/index.vue
  10. 2
      src/views/theoreticalCourse/list/sortManagement/index.vue

@ -100,7 +100,8 @@
:http-request="handleRequest" :http-request="handleRequest"
name="file" name="file"
> >
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> <el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
<div slot="tip" class="el-upload__tip">视频请上传MP4格式大小不超过30Moffice文件大小不要超过10M</div>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> <el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item> </el-form-item>
@ -370,6 +371,10 @@ export default {
this.$message.error("请上传10M以内的文件"); this.$message.error("请上传10M以内的文件");
return false; return false;
} }
if (type == "视频" && (file.size / 1024 / 1024) > 30) {
util.errorMsg("请上传30M以内的视频");
return false;
}
this.uploading = true; this.uploading = true;
this.originalFileName = file.name; this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
@ -869,6 +874,13 @@ export default {
padding-right: 70px; padding-right: 70px;
margin-right: -70px; margin-right: -70px;
} }
.el-upload__tip {
position: absolute;
top: -4px;
right: 0;
width: 300px;
line-height: 1.4;
}
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform .5s;

@ -109,7 +109,7 @@ export default {
this.$router.back(); this.$router.back();
}, },
getData() { getData() {
this.$get(`${this.api.getArticle}/${this.id}`).then(({ article }) => { this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => {
this.form = article this.form = article
}).catch(err => {}) }).catch(err => {})
}, },

@ -21,7 +21,7 @@
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span> <span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
</div> </div>
</div> </div>
<el-tree :data="listData" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop"> <el-tree :data="list" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span> <span class="name">{{ data.name }}</span>
<span class="action" v-show="!sorting"> <span class="action" v-show="!sorting">
@ -66,8 +66,8 @@ export default {
first: "栏目管理" first: "栏目管理"
}, },
name: this.$store.state.name, name: this.$store.state.name,
originalList: [], originList: [],
listData: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -88,7 +88,7 @@ export default {
this.getData(); this.getData();
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (JSON.stringify(this.originalList) !== JSON.stringify(this.listData)) { if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
this.$confirm("确定返回?排序尚未保存。", "提示", { this.$confirm("确定返回?排序尚未保存。", "提示", {
type: "warning" type: "warning"
}) })
@ -106,8 +106,8 @@ export default {
this.$get(this.api.queryAllColumns, { this.$get(this.api.queryAllColumns, {
school: 0 school: 0
}).then(({ columnTree }) => { }).then(({ columnTree }) => {
this.listData = columnTree this.list = columnTree
this.originalList = JSON.parse(JSON.stringify(this.listData)); this.originList = JSON.parse(JSON.stringify(this.list));
this.total = columnTree.length this.total = columnTree.length
}).catch(res => { }).catch(res => {
}); });
@ -156,7 +156,7 @@ export default {
}, },
sortSubmit() { sortSubmit() {
this.level = 0 this.level = 0
let list = JSON.parse(JSON.stringify(this.listData)) let list = JSON.parse(JSON.stringify(this.list))
this.handleList(list) this.handleList(list)
this.$post(this.api.columnReorder, { this.$post(this.api.columnReorder, {
columnTree: list columnTree: list
@ -188,7 +188,7 @@ export default {
}, },
cancelSort() { cancelSort() {
this.sorting = false; this.sorting = false;
this.listData = JSON.parse(JSON.stringify(this.originalList)); this.list = JSON.parse(JSON.stringify(this.originList));
this.sortObj.destroy(); this.sortObj.destroy();
}, },
openSort() { openSort() {

@ -18,6 +18,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="title" label="标题" show-overflow-tooltip align="center"> <el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
</el-table-column> </el-table-column>
<el-table-column prop="title" label="栏目" show-overflow-tooltip align="center">
{{ columnName }}
</el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center"> <el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input> <el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
@ -70,12 +73,14 @@ export default {
tabs: { tabs: {
first: "栏目内容管理" first: "栏目内容管理"
}, },
columns: this.$parent.menuList,
columnName: '',
list: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
originSort: [] originList: []
}; };
}, },
props: { props: {
@ -83,11 +88,13 @@ export default {
}, },
watch: { watch: {
columnId() { columnId() {
this.getColumnName(this.$parent.menuList)
this.getData(); this.getData();
} }
}, },
mounted() { mounted() {
this.getData(); this.getColumnName(this.$parent.menuList)
this.getData();
}, },
methods: { methods: {
getData(id) { getData(id) {
@ -97,7 +104,7 @@ export default {
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => { this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => {
this.list = articleList; this.list = articleList;
this.totals = total; this.totals = total;
if (JSON.stringify(this.originSort) !== '{}') this.originSort = JSON.parse(JSON.stringify(articleList)) if (JSON.stringify(this.originList) !== '{}') this.originList = JSON.parse(JSON.stringify(articleList))
if (!this.list.length && this.totals) { if (!this.list.length && this.totals) {
this.pageNo--; this.pageNo--;
this.getData(); this.getData();
@ -113,6 +120,16 @@ export default {
this.$router.push(`list?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
//
getColumnName(data) {
data.map(e => {
if (e.id == this.columnId) {
this.columnName = e.name
} else {
this.getColumnName(e.children)
}
})
},
addArticle() { addArticle() {
this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`); this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`);
}, },

@ -41,19 +41,15 @@ export default {
const storeId = this.$store.state.columnId const storeId = this.$store.state.columnId
if (this.menuList.length) { if (this.menuList.length) {
this.getId(this.menuList) this.getId(this.menuList)
if (this.menuList[0].children && this.menuList[0].children.length) { this.columnId = this.menuList[0].id
this.columnId = this.menuList[0].children[0].id; if (!storeId) {
} else { this.$store.commit('setColumnId', this.columnId)
this.columnId = this.menuList[0].id; } else {
} this.columnId = storeId
if (!storeId) { }
this.$store.commit('setColumnId', this.columnId)
} else {
this.columnId = storeId
}
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.column.setCurrentKey(storeId) this.$refs.column.setCurrentKey(this.columnId)
}) })
}).catch(err => { }).catch(err => {
}); });
@ -65,9 +61,26 @@ export default {
e.children.length && this.getId(e.children) e.children.length && this.getId(e.children)
}) })
}, },
setColumnId(id) {
this.columnId = id
this.$store.commit('setColumnId', id)
},
handleSelect(key) { handleSelect(key) {
this.columnId = key.id const { content } = this.$refs
this.$store.commit('setColumnId', key.id); const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
this.setColumnId(key.id)
}).catch(() => {
this.setColumnId(key.id)
})
} else {
this.setColumnId(key.id)
}
} }
} }
}; };
@ -86,4 +99,8 @@ export default {
.right { .right {
flex: 1; flex: 1;
} }
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
color: #fff;
background-color: #9278ff;
}
</style> </style>

@ -5,8 +5,8 @@
<li :class="{active: tabsName == 1}" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li> <li :class="{active: tabsName == 1}" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li>
<li :class="{active: tabsName == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li> <li :class="{active: tabsName == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul> </ul>
<columnManage class="flex-1" v-if="tabsName === 1" /> <columnManage class="flex-1" ref="content1" v-if="tabsName == 1" />
<ContentManage class="flex-1" ref="contentManage" v-if="tabsName === 2" /> <ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" />
</div> </div>
</template> </template>
@ -25,49 +25,36 @@ export default {
}, },
// //
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
const { content } = this.$refs.contentManage.$refs this.routeLeave(next, true)
const { list, originSort } = content
//
if (JSON.stringify(list) !== JSON.stringify(originSort)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
next()
}).catch(() => {
next()
})
} else {
next()
}
}, },
methods: { methods: {
switchTab(id) { switchTab(id) {
this.tabsName = id this.tabsName = id
this.$store.commit('setInfoTab', id) this.$store.commit('setInfoTab', id)
}, },
handleClick(id) { //
if (this.tabsName == 2) { routeLeave(fn, param) {
const { content } = this.$refs.contentManage.$refs const tab = this.tabsName
const { list, originSort } = content let content = this.$refs['content' + tab]
if (tab == 2) content = content.$refs.content
// const { list, originList } = content
if (JSON.stringify(list) !== JSON.stringify(originSort)) { //
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', { if (JSON.stringify(list) !== JSON.stringify(originList)) {
type: 'warning' this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
}).then(() => { type: 'warning'
content.sortSubmit() }).then(() => {
this.switchTab(id) content.sortSubmit()
}).catch(() => { fn(param)
this.switchTab(id) }).catch(() => {
}) fn(param)
} else { })
this.switchTab(id)
}
} else { } else {
this.switchTab(id) fn(param)
} }
},
// tab
handleClick(id) {
this.routeLeave(this.switchTab, id)
} }
}, },
mounted() { mounted() {
@ -85,6 +72,7 @@ export default {
} }
.column-tab { .column-tab {
width: 120px; width: 120px;
border-right: solid 1px #e6e6e6;
li { li {
display: flex; display: flex;
align-items: center; align-items: center;

@ -55,6 +55,9 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="visibleRange" label="可见范围"> <el-form-item prop="visibleRange" label="可见范围">
<div>
<el-radio v-model="form.visibleRange" :label="0" disabled>仅本校</el-radio>
</div>
<div> <div>
<el-radio v-model="form.visibleRange" :label="1">全平台</el-radio> <el-radio v-model="form.visibleRange" :label="1">全平台</el-radio>
</div> </div>

@ -47,13 +47,15 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="资源名称"> <el-table-column prop="name" label="资源名称" min-width="200">
</el-table-column> </el-table-column>
<el-table-column prop="fileType" label="资源类型" align="center"> <el-table-column prop="fileType" label="资源类型" min-width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ transferType(scope.row.fileType) }} {{ transferType(scope.row.fileType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="fileType" label="格式" min-width="120" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="!sorting"> <template v-if="!sorting">
@ -100,7 +102,8 @@
:http-request="handleRequest" :http-request="handleRequest"
name="file" name="file"
> >
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button> <el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
<div slot="tip" class="el-upload__tip">视频请上传MP4格式大小不超过30Moffice文件大小不要超过10M</div>
</el-upload> </el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress> <el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item> </el-form-item>
@ -368,6 +371,10 @@ export default {
util.errorMsg("请上传10M以内的文件"); util.errorMsg("请上传10M以内的文件");
return false; return false;
} }
if (type == "视频" && (file.size / 1024 / 1024) > 30) {
util.errorMsg("请上传30M以内的视频");
return false;
}
this.uploading = true; this.uploading = true;
this.originalFileName = file.name; this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
@ -838,6 +845,13 @@ export default {
padding-right: 70px; padding-right: 70px;
margin-right: -70px; margin-right: -70px;
} }
.el-upload__tip {
position: absolute;
top: -4px;
right: 0;
width: 300px;
line-height: 1.4;
}
.sort-icon { .sort-icon {
font-size: 24px; font-size: 24px;
cursor: pointer; cursor: pointer;
@ -847,9 +861,6 @@ export default {
cursor: not-allowed cursor: not-allowed
} }
} }
/deep/.el-upload-list__item-status-label {
// display: inline-block;
}
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform .5s;

@ -28,7 +28,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button v-auth="'课程管理:新增'" type="primary" round @click="addCourse">新增</el-button> <!-- <el-button v-auth="'课程管理:新增'" type="primary" round @click="addCourse">新增</el-button> -->
<el-button v-auth="'课程管理:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> <el-button v-auth="'课程管理:批量删除'" type="primary" round @click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
@ -103,6 +103,10 @@ export default {
id: '', id: '',
name: '不限' name: '不限'
}, },
{
id: 0,
name: '本校内'
},
{ {
id: 1, id: 1,
name: '全平台' name: '全平台'

@ -67,7 +67,7 @@ export default {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.nameChange(); this.nameChange();
}, 500); }, 100);
} }
}, },
mounted() { mounted() {

Loading…
Cancel
Save