课程资讯等修复

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"
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-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item>
@ -370,6 +371,10 @@ export default {
this.$message.error("请上传10M以内的文件");
return false;
}
if (type == "视频" && (file.size / 1024 / 1024) > 30) {
util.errorMsg("请上传30M以内的视频");
return false;
}
this.uploading = true;
this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
@ -869,6 +874,13 @@ export default {
padding-right: 70px;
margin-right: -70px;
}
.el-upload__tip {
position: absolute;
top: -4px;
right: 0;
width: 300px;
line-height: 1.4;
}
.el-image-viewer__wrapper {
transform: translateY(-10px);
transition: transform .5s;

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

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

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

@ -41,19 +41,15 @@ export default {
const storeId = this.$store.state.columnId
if (this.menuList.length) {
this.getId(this.menuList)
if (this.menuList[0].children && this.menuList[0].children.length) {
this.columnId = this.menuList[0].children[0].id;
} else {
this.columnId = this.menuList[0].id;
}
if (!storeId) {
this.$store.commit('setColumnId', this.columnId)
} else {
this.columnId = storeId
}
this.columnId = this.menuList[0].id
if (!storeId) {
this.$store.commit('setColumnId', this.columnId)
} else {
this.columnId = storeId
}
}
this.$nextTick(() => {
this.$refs.column.setCurrentKey(storeId)
this.$refs.column.setCurrentKey(this.columnId)
})
}).catch(err => {
});
@ -65,9 +61,26 @@ export default {
e.children.length && this.getId(e.children)
})
},
setColumnId(id) {
this.columnId = id
this.$store.commit('setColumnId', id)
},
handleSelect(key) {
this.columnId = key.id
this.$store.commit('setColumnId', key.id);
const { content } = this.$refs
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 {
flex: 1;
}
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
color: #fff;
background-color: #9278ff;
}
</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 == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul>
<columnManage class="flex-1" v-if="tabsName === 1" />
<ContentManage class="flex-1" ref="contentManage" v-if="tabsName === 2" />
<columnManage class="flex-1" ref="content1" v-if="tabsName == 1" />
<ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" />
</div>
</template>
@ -25,49 +25,36 @@ export default {
},
//
beforeRouteLeave(to, from, next) {
const { content } = this.$refs.contentManage.$refs
const { list, originSort } = content
//
if (JSON.stringify(list) !== JSON.stringify(originSort)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
next()
}).catch(() => {
next()
})
} else {
next()
}
this.routeLeave(next, true)
},
methods: {
switchTab(id) {
this.tabsName = id
this.$store.commit('setInfoTab', id)
},
handleClick(id) {
if (this.tabsName == 2) {
const { content } = this.$refs.contentManage.$refs
const { list, originSort } = content
//
if (JSON.stringify(list) !== JSON.stringify(originSort)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
this.switchTab(id)
}).catch(() => {
this.switchTab(id)
})
} else {
this.switchTab(id)
}
//
routeLeave(fn, param) {
const tab = this.tabsName
let content = this.$refs['content' + tab]
if (tab == 2) content = content.$refs.content
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
fn(param)
}).catch(() => {
fn(param)
})
} else {
this.switchTab(id)
fn(param)
}
},
// tab
handleClick(id) {
this.routeLeave(this.switchTab, id)
}
},
mounted() {
@ -85,6 +72,7 @@ export default {
}
.column-tab {
width: 120px;
border-right: solid 1px #e6e6e6;
li {
display: flex;
align-items: center;

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

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

@ -28,7 +28,7 @@
</li>
</ul>
<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>
</div>
</div>
@ -103,6 +103,10 @@ export default {
id: '',
name: '不限'
},
{
id: 0,
name: '本校内'
},
{
id: 1,
name: '全平台'

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

Loading…
Cancel
Save